MK3S_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 6d 57 jmp 0xaeda ; 0xaeda <__dtors_end> 4: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 8: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> c: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 10: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 14: 0d 94 0d bc jmp 0x3781a ; 0x3781a <__vector_5> 18: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 1c: 0c 94 e1 75 jmp 0xebc2 ; 0xebc2 <__vector_7> 20: 0c 94 fe 75 jmp 0xebfc ; 0xebfc <__vector_8> 24: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 28: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 2c: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 30: 0c 94 39 68 jmp 0xd072 ; 0xd072 <__vector_12> 34: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 38: 0d 94 e6 48 jmp 0x291cc ; 0x291cc <__vector_14> 3c: 0d 94 72 42 jmp 0x284e4 ; 0x284e4 <__vector_15> 40: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 44: 0d 94 9b 59 jmp 0x2b336 ; 0x2b336 <__vector_17> 48: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 4c: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 50: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 54: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 58: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 5c: 0c 94 e8 74 jmp 0xe9d0 ; 0xe9d0 <__vector_23> 60: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 64: 0d 94 af d6 jmp 0x3ad5e ; 0x3ad5e <__vector_25> 68: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 6c: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 70: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 74: 0c 94 f3 8e jmp 0x11de6 ; 0x11de6 <__vector_29> 78: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 7c: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 80: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 84: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 88: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 8c: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 90: 0d 94 6b d6 jmp 0x3acd6 ; 0x3acd6 <__vector_36> 94: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 98: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> 9c: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> a0: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> a4: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> a8: 0d 94 08 38 jmp 0x27010 ; 0x27010 <__vector_42> ac: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> b0: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> b4: 0d 94 ea 37 jmp 0x26fd4 ; 0x26fd4 <__vector_45> b8: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> bc: 0d 94 30 4e jmp 0x29c60 ; 0x29c60 <__vector_47> c0: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> c4: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> c8: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> cc: 0d 94 aa 37 jmp 0x26f54 ; 0x26f54 <__vector_51> d0: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> d4: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> d8: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> dc: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__bad_interrupt> e0: 0c 94 9e 57 jmp 0xaf3c ; 0xaf3c <__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 20 53 44 20 63 61 72 64 00 ..No SD card. 00003bf4 : 3bf4: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00003c04 : 3c04: ff ff 43 6c 65 61 72 20 54 4d 20 65 72 72 6f 72 ..Clear TM error ... 00003c15 : 3c15: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 00003c24 : 3c24: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 00003c32 : 3c32: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00003c3e : 3c3e: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00003c4e : 3c4e: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00003c58 : 3c58: ff ff 54 75 6e 65 00 ..Tune. 00003c5f : 3c5f: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 00003c6f : 3c6f: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00003c79 : 3c79: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00003c87 : 3c87: ff ff 42 72 69 67 68 74 6e 65 73 73 00 ..Brightness. 00003c94 : 3c94: ff ff 41 73 73 69 73 74 00 ..Assist. 00003c9d : 3c9d: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00003ca6 : 3ca6: ff ff 4f 6e 63 65 00 ..Once. 00003cad : 3cad: ff ff 53 6f 75 6e 64 00 ..Sound. 00003cb5 : 3cb5: ff ff 4c 6f 75 64 00 ..Loud. 00003cbc : 3cbc: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 00003cca : 3cca: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 3cda: 74 00 t. 00003cdc : 3cdc: ff ff 46 6c 6f 77 00 ..Flow. 00003ce3 : 3ce3: ff ff 53 70 65 65 64 00 ..Speed. 00003ceb : 3ceb: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 00003cfb : 3cfb: ff ff 4e 2f 41 00 ..N/A. 00003d01 : 3d01: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00003d0f : 3d0f: ff ff 4d 65 73 68 00 ..Mesh. 00003d16 : 3d16: ff ff 54 69 6d 65 6f 75 74 00 ..Timeout. 00003d20 : 3d20: ff ff 4d 6f 64 65 00 ..Mode. 00003d27 : 3d27: ff ff 41 75 74 6f 00 ..Auto. 00003d2e : 3d2e: ff ff 44 69 6d 00 ..Dim. 00003d34 : 3d34: ff ff 42 72 69 67 68 74 00 ..Bright. 00003d3d : 3d3d: ff ff 4c 65 76 65 6c 20 44 69 6d 6d 65 64 00 ..Level Dimmed. 00003d4c : 3d4c: ff ff 4c 65 76 65 6c 20 42 72 69 67 68 74 00 ..Level Bright. 00003d5b : 3d5b: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00003d66 : 3d66: ff ff 59 65 73 00 ..Yes. 00003d6c : 3d6c: ff ff 4e 6f 00 ..No. 00003d71 : 3d71: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 00003d7e : 3d7e: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 00003d8e : 3d8e: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 3d9e: 65 2e 00 e.. 00003da1 : 3da1: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 00003dac : 3dac: ff ff 4d 61 69 6e 00 ..Main. 00003db3 : 3db3: ff ff 49 6e 73 65 72 74 20 74 68 65 20 66 69 6c ..Insert the fil 3dc3: 61 6d 65 6e 74 20 28 64 6f 20 6e 6f 74 20 6c 6f ament (do not lo 3dd3: 61 64 20 69 74 29 20 69 6e 74 6f 20 74 68 65 20 ad it) into the 3de3: 65 78 74 72 75 64 65 72 20 61 6e 64 20 74 68 65 extruder and the 3df3: 6e 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 n press the knob 3e03: 2e 00 .. 00003e05 : 3e05: ff ff 53 65 6e 73 6f 72 20 76 65 72 69 66 69 65 ..Sensor verifie 3e15: 64 2c 20 72 65 6d 6f 76 65 20 74 68 65 20 66 69 d, remove the fi 3e25: 6c 61 6d 65 6e 74 20 6e 6f 77 2e 00 lament now.. 00003e31 : 3e31: ff ff 56 65 72 69 66 69 63 61 74 69 6f 6e 20 66 ..Verification f 3e41: 61 69 6c 65 64 2c 20 72 65 6d 6f 76 65 20 74 68 ailed, remove th 3e51: 65 20 66 69 6c 61 6d 65 6e 74 20 61 6e 64 20 74 e filament and t 3e61: 72 79 20 61 67 61 69 6e 2e 00 ry again.. 00003e6b : 3e6b: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 74 ..Please check t 3e7b: 68 65 20 49 52 20 73 65 6e 73 6f 72 20 63 6f 6e he IR sensor con 3e8b: 6e 65 63 74 69 6f 6e 2c 20 75 6e 6c 6f 61 64 20 nection, unload 3e9b: 66 69 6c 61 6d 65 6e 74 20 69 66 20 70 72 65 73 filament if pres 3eab: 65 6e 74 2e 00 ent.. 00003eb0 : 3eb0: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 3ec0: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 3ed0: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 3ee0: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 00003eed : 3eed: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 3efd: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 3f0d: 6c 69 6e 67 00 ling. 00003f12 : 3f12: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3f22: 74 3a 00 t:. 00003f25 : 3f25: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00003f33 : 3f33: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00003f44 : 3f44: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00003f51 : 3f51: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 00003f5f : 3f5f: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 3f6f: 6d 65 00 me. 00003f72 : 3f72: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00003f80 : 3f80: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 3f90: 72 73 00 rs. 00003f93 : 3f93: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 3fa3: 64 00 d. 00003fa5 : 3fa5: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00003fb4 : 3fb4: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 3fc4: 73 00 s. 00003fc6 : 3fc6: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 3fd6: 73 00 s. 00003fd8 : 3fd8: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 3fe8: 73 00 s. 00003fea : 3fea: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 3ffa: 6f 70 73 00 ops. 00003ffe : 3ffe: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 0000400d : 400d: ff ff 42 61 63 6b 00 ..Back. 00004014 : 4014: ff ff 53 74 72 69 63 74 00 ..Strict. 0000401d : 401d: ff ff 57 61 72 6e 00 ..Warn. 00004024 : 4024: ff ff 4e 6f 6e 65 00 ..None. 0000402b : 402b: ff ff 48 6f 74 65 6e 64 20 61 74 20 32 38 30 43 ..Hotend at 280C 403b: 21 20 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ! Nozzle changed 404b: 20 61 6e 64 20 74 69 67 68 74 65 6e 65 64 20 74 and tightened t 405b: 6f 20 73 70 65 63 73 3f 00 o specs?. 00004064 : 4064: ff ff 46 6f 72 20 61 20 4e 6f 7a 7a 6c 65 20 63 ..For a Nozzle c 4074: 68 61 6e 67 65 20 70 6c 65 61 73 65 20 72 65 61 hange please rea 4084: 64 0a 70 72 75 73 61 2e 69 6f 2f 6e 6f 7a 7a 6c d.prusa.io/nozzl 4094: 65 2d 6d 6b 33 73 00 e-mk3s. 0000409b : 409b: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 40ab: 68 65 64 00 hed. 000040af : 40af: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 000040ba : 40ba: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 000040c9 : 40c9: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 000040d9 : 40d9: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 40e9: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 40f9: 68 65 20 47 2d 63 6f 64 65 2e 00 he G-code.. 00004104 : 4104: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4114: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4124: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4134: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4144: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 00 e in settings.. 00004153 : 4153: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4163: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 00 lament loaded.. 00004172 : 4172: ff ff 4d 4b 33 53 20 66 69 72 6d 77 61 72 65 20 ..MK3S firmware 4182: 64 65 74 65 63 74 65 64 20 6f 6e 20 4d 4b 33 20 detected on MK3 4192: 70 72 69 6e 74 65 72 00 printer. 0000419a : 419a: ff ff 42 6c 61 63 6b 6f 75 74 20 6f 63 63 75 72 ..Blackout occur 41aa: 72 65 64 2e 20 52 65 63 6f 76 65 72 20 70 72 69 red. Recover pri 41ba: 6e 74 3f 00 nt?. 000041be : 41be: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 41ce: 6e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 20 79 not calibrated y 41de: 65 74 2e 00 et.. 000041e2 : 41e2: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 41f2: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 4202: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 4212: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 4222: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 4232: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 4242: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4252: 6e 20 66 6c 6f 77 2e 00 n flow.. 0000425a : 425a: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 426a: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 427a: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 428a: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 429a: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 42aa: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 42ba: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 000042ca : 42ca: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 42da: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 42ea: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 42fa: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 430a: 2e 00 .. 0000430c : 430c: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 431c: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 432c: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 433c: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 00004348 : 4348: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 4358: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 4368: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 4378: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004383 : 4383: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4393: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 000043a4 : 43a4: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 43b4: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 43c4: 67 65 64 2e 00 ged.. 000043c9 : 43c9: ff ff 53 68 65 65 74 00 ..Sheet. 000043d1 : 43d1: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 000043e0 : 43e0: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 000043eb : 43eb: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000043f6 : 43f6: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 4406: 64 00 d. 00004408 : 4408: ff ff 25 73 20 6c 65 76 65 6c 20 65 78 70 65 63 ..%s level expec 4418: 74 65 64 00 ted. 0000441c : 441c: ff ff 46 61 6c 73 65 20 74 72 69 67 67 65 72 69 ..False triggeri 442c: 6e 67 00 ng. 0000442f : 442f: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 443f: 72 00 r. 00004441 : 4441: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 0000444b : 444b: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 445b: 73 00 s. 0000445d : 445d: ff ff 41 78 69 73 00 ..Axis. 00004464 : 4464: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00004472 : 4472: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00004481 : 4481: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 4491: 6e 3f 00 n?. 00004494 : 4494: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 44a4: 6e 3f 00 n?. 000044a7 : 44a7: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 44b7: 74 00 t. 000044b9 : 44b9: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 000044c3 : 44c3: ff ff 4d 6f 74 6f 72 00 ..Motor. 000044cb : 44cb: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 000044d6 : 44d6: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 000044e5 : 44e5: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 000044f2 : 44f2: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 00004502 : 4502: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 4512: 74 6f 72 00 tor. 00004516 : 4516: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 00004526 : 4526: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 4536: 21 00 !. 00004538 : 4538: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4548: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 4558: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 4568: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 4578: 79 2e 00 y.. 0000457b : 457b: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 458b: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 459b: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 45ab: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 45bb: 6a 6f 62 21 00 job!. 000045c0 : 45c0: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45d0: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 45e0: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 45f0: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 4600: 73 21 00 s!. 00004603 : 4603: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4613: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 4623: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 4633: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 4643: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 0000464f : 464f: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 465f: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 466f: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 467f: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 468f: 68 61 62 6c 65 2e 00 hable.. 00004696 : 4696: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 46a6: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 46b6: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 46c6: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 46d6: 68 61 62 6c 65 2e 00 hable.. 000046dd : 46dd: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 46ed: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 46fd: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 470d: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 471d: 2e 00 .. 0000471f : 471f: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 472f: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 473f: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 474f: 75 61 6c 2e 00 ual.. 00004754 : 4754: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4764: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 4774: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 4784: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00004793 : 4793: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 47a3: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 47b3: 61 74 62 65 64 2e 00 atbed.. 000047ba : 47ba: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 47ca: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 47da: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 47ea: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 47fa: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 480a: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 481a: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 482a: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 483a: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 484a: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 00004859 : 4859: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 4869: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 4879: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 4889: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 4899: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 48a9: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 48b9: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 48c9: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 48d9: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 48e9: 69 61 74 65 6c 79 2e 00 iately.. 000048f1 : 48f1: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 4901: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 4911: 74 00 t. 00004913 : 4913: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 4923: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 4933: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 4943: 74 00 t. 00004945 : 4945: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 4955: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 4965: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 4975: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00004981 : 4981: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 0000498d : 498d: ff ff 54 48 45 52 4d 41 4c 20 41 4e 4f 4d 41 4c ..THERMAL ANOMAL 499d: 59 00 Y. 0000499f : 499f: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 000049b0 : 49b0: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 000049c0 : 49c0: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 49d0: 6e 65 00 ne. 000049d3 : 49d3: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 000049e3 : 49e3: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 000049ee : 49ee: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 000049fc : 49fc: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00004a0c : 4a0c: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 00004a16 : 4a16: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 00004a22 : 4a22: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00004a33 : 4a33: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4a43: 73 00 s. 00004a45 : 4a45: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4a55: 65 73 00 es. 00004a58 : 4a58: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004a69 : 4a69: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 4a79: 6c 75 72 65 73 00 lures. 00004a7f : 4a7f: ff ff 50 6f 77 65 72 20 66 61 69 6c 75 72 65 73 ..Power failures ... 00004a90 : 4a90: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004a9f : 4a9f: ff ff 43 72 61 73 68 00 ..Crash. 00004aa7 : 4aa7: ff ff 54 6f 74 61 6c 00 ..Total. 00004aaf : 4aaf: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00004abc : 4abc: ff ff 41 6d 62 69 65 6e 74 00 ..Ambient. 00004ac6 : 4ac6: ff ff 56 6f 6c 74 61 67 65 73 00 ..Voltages. 00004ad1 : 4ad1: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004ae0 : 4ae0: ff ff 42 65 6c 74 20 73 74 61 74 75 73 00 ..Belt status. 00004aee : 4aee: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004afc : 4afc: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004b0c : 4b0c: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4b1c: 6c 73 00 ls. 00004b1f : 4b1f: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4b2f: 72 3a 00 r:. 00004b32 : 4b32: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004b3c : 4b3c: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004b4c : 4b4c: ff ff 44 61 74 65 3a 00 ..Date:. 00004b54 : 4b54: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4b64: 6d 65 6e 74 00 ment. 00004b69 : 4b69: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4b79: 6e 74 00 nt. 00004b7c : 4b7c: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004b8d : 4b8d: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4b9d: 63 75 74 00 cut. 00004ba1 : 4ba1: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4bb1: 65 6a 65 63 74 00 eject. 00004bb7 : 4bb7: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4bc7: 75 6e 6c 6f 61 64 00 unload. 00004bce : 4bce: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4bde: 6c 6f 61 64 00 load. 00004be3 : 4be3: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00004bee : 4bee: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 4bfe: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 4c0e: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00004c19 : 4c19: ff ff 45 6a 65 63 74 00 ..Eject. 00004c21 : 4c21: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 4c31: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 4c41: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 4c51: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 4c61: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 00004c6e : 4c6e: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 00004c7f : 4c7f: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 4c8f: 6d 65 00 me. 00004c92 : 4c92: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00004ca2 : 4ca2: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 00004caf : 4caf: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 4cbf: 7a 7a 6c 65 21 00 zzle!. 00004cc5 : 4cc5: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00004cce : 4cce: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 4cde: 6d 20 6d 69 6e 00 m min. 00004ce4 : 4ce4: ff ff 4c 65 66 74 00 ..Left. 00004ceb : 4ceb: ff ff 52 69 67 68 74 00 ..Right. 00004cf3 : 4cf3: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00004d03 : 4d03: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00004d11 : 4d11: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00004d1f : 4d1f: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 4d2f: 66 73 65 74 00 fset. 00004d34 : 4d34: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00004d42 : 4d42: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00004d53 : 4d53: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00004d64 : 4d64: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00004d75 : 4d75: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00004d86 : 4d86: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 4d96: 65 3a 00 e:. 00004d99 : 4d99: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4da9: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00004db4 : 4db4: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4dc4: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 4dd4: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 4de4: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 4df4: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 4e04: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00004e10 : 4e10: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00004e1b : 4e1b: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00004e24 : 4e24: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00004e2d : 4e2d: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00004e36 : 4e36: ff ff 43 72 61 73 68 20 64 65 74 65 63 74 69 6f ..Crash detectio 4e46: 6e 20 63 61 6e 0a 62 65 20 74 75 72 6e 65 64 20 n can.be turned 4e56: 6f 6e 20 6f 6e 6c 79 20 69 6e 0a 4e 6f 72 6d 61 on only in.Norma 4e66: 6c 20 6d 6f 64 65 00 l mode. 00004e6d : 4e6d: ff ff 57 41 52 4e 49 4e 47 3a 0a 43 72 61 73 68 ..WARNING:.Crash 4e7d: 20 64 65 74 65 63 74 69 6f 6e 0a 64 69 73 61 62 detection.disab 4e8d: 6c 65 64 20 69 6e 0a 53 74 65 61 6c 74 68 20 6d led in.Stealth m 4e9d: 6f 64 65 00 ode. 00004ea1 : 4ea1: ff ff 4d 6f 64 65 20 63 68 61 6e 67 65 20 69 6e ..Mode change in 4eb1: 20 70 72 6f 67 72 65 73 73 2e 2e 2e 00 progress.... 00004ebe : 4ebe: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 4ece: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004ed8 : 4ed8: ff ff 43 6f 6d 6d 75 6e 69 74 79 20 6d 61 64 65 ..Community made ... 00004ee9 : 4ee9: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 4ef9: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 4f09: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 4f19: 65 74 00 et. 00004f1c : 4f1c: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 4f2c: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00004f3a : 4f3a: ff ff 43 61 6e 63 65 6c 00 ..Cancel. 00004f43 : 4f43: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 4f53: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 4f63: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 4f73: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 4f83: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 4f93: 6e 6e 69 6e 67 2e 00 nning.. 00004f9a : 4f9a: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 4faa: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 4fba: 2e 00 .. 00004fbc : 4fbc: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4fcc: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4fdc: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 4fec: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 4ffc: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00005008 : 5008: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 5018: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 5028: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 5038: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 5048: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 5058: 6c 6f 61 64 20 69 74 2e 00 load it.. 00005061 : 5061: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 5071: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 5081: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 5091: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 50a1: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 50b1: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 50c1: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 50d1: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 50e1: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 50f1: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 00005101 : 5101: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 5111: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 5121: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 5131: 2e 00 .. 00005133 : 5133: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 5143: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 5153: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 5163: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 5173: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 5183: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 0000518c : 518c: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 519c: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 51ac: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 51bc: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 51cc: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 000051db : 51db: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 51eb: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 51fb: 20 69 74 20 6e 6f 77 3f 00 it now?. 00005204 : 5204: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 5214: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 5224: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 0000522e : 522e: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 523e: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 0000524b : 524b: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 525b: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 526b: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 527b: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 528b: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 529b: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 52ab: 2e 00 .. 000052ad : 52ad: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 52bd: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 000052cc : 52cc: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 52dc: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 52ec: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 52fc: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 0000530b : 530b: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 531b: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 532b: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 533b: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 534b: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 535b: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 536b: 65 65 74 73 2e 00 eets.. 00005371 : 5371: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 5381: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 5391: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 000053a1 : 53a1: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 53b1: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 53c1: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 53d1: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 53e1: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 53f1: 64 3f 00 d?. 000053f4 : 53f4: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 5404: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 5414: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 5424: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 00005435 : 5435: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 5445: 61 64 65 64 3f 00 aded?. 0000544b : 544b: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 545b: 63 61 6c 2e 20 74 61 6b 65 73 20 61 70 70 72 6f cal. takes appro 546b: 78 2e 20 31 32 20 6d 69 6e 73 2e 20 53 65 65 0a x. 12 mins. See. 547b: 70 72 75 73 61 2e 69 6f 2f 74 6d 2d 63 61 6c 00 prusa.io/tm-cal. 0000548b : 548b: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 549b: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 54ab: 50 4c 41 2e 00 PLA.. 000054b0 : 54b0: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 54c0: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 000054d0 : 54d0: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 54e0: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 54f0: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 000054fe : 54fe: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 550e: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 551e: 20 66 69 72 73 74 2e 00 first.. 00005526 : 5526: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 5536: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 5546: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 5556: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 00005564 : 5564: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 5574: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 5584: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 5594: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 55a4: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 000055ad : 55ad: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 55bd: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 55cd: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 55dd: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 55ed: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 55fd: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 560d: 65 73 73 3f 00 ess?. 00005612 : 5612: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 5622: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 5632: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 5642: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 5652: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 5662: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 5672: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 5682: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 5692: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 56a2: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 56b2: 69 6e 74 2e 00 int.. 000056b7 : 56b7: ff ff 45 2d 63 6f 72 72 65 63 74 00 ..E-correct. 000056c3 : 56c3: ff ff 5a 2d 63 6f 72 72 65 63 74 00 ..Z-correct. 000056cf : 56cf: ff ff 59 2d 63 6f 72 72 65 63 74 00 ..Y-correct. 000056db : 56db: ff ff 58 2d 63 6f 72 72 65 63 74 00 ..X-correct. 000056e7 : 56e7: ff ff 50 61 75 73 65 00 ..Pause. 000056ef : 56ef: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 000056fb : 56fb: ff ff 43 6f 6e 74 2e 00 ..Cont.. 00005703 : 5703: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 00005711 : 5711: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 0000571d : 571d: ff ff 4d 4d 55 20 4d 6f 64 65 00 ..MMU Mode. 00005728 : 5728: ff ff 43 75 74 74 65 72 00 ..Cutter. 00005731 : 5731: ff ff 53 74 65 61 6c 74 68 00 ..Stealth. 0000573b : 573b: ff ff 43 72 61 73 68 20 64 65 74 2e 00 ..Crash det.. 00005748 : 5748: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 00005754 : 5754: ff ff 42 65 64 00 ..Bed. 0000575a : 575a: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 00005767 : 5767: ff ff 4d 6f 64 65 6c 00 ..Model. 0000576f : 576f: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 00005778 : 5778: ff ff 43 68 65 63 6b 73 00 ..Checks. 00005781 : 5781: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00005791 : 5791: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 0000579d : 579d: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 000057a8 : 57a8: ff ff 53 6f 72 74 00 ..Sort. 000057af : 57af: ff ff 54 69 6d 65 00 ..Time. 000057b6 : 57b6: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 000057bf : 57bf: ff ff 53 44 20 63 61 72 64 00 ..SD card. 000057c9 : 57c9: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 57d9: 65 00 e. 000057db : 57db: ff ff 52 50 69 20 70 6f 72 74 00 ..RPi port. 000057e6 : 57e6: ff ff 4c 69 6e 2e 20 63 6f 72 72 65 63 74 69 6f ..Lin. correctio 57f6: 6e 00 n. 000057f8 : 57f8: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 00005803 : 5803: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 00005812 : 5812: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 5822: 72 73 00 rs. 00005825 : 5825: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 00005831 : 5831: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 0000583f : 583f: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 584f: 6e 73 6f 72 00 nsor. 00005854 : 5854: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 5864: 72 00 r. 00005866 : 5866: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 0000586f : 586f: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 587f: 49 4e 44 41 00 INDA. 00005884 : 5884: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 5894: 65 6e 74 00 ent. 00005898 : 5898: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 58a8: 6f 72 00 or. 000058ab : 58ab: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 58bb: 63 74 6f 72 00 ctor. 000058c0 : 58c0: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 000058d1 : 58d1: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 58e1: 6e 74 00 nt. 000058e4 : 58e4: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 58f4: 65 00 e. 000058f6 : 58f6: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 5906: 20 73 6c 6f 74 00 slot. 0000590c : 590c: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 591c: 6d 65 6e 74 00 ment. 00005921 : 5921: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 00005932 : 5932: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5942: 65 6e 74 00 ent. 00005946 : 5946: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 00005955 : 5955: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 5965: 73 65 72 00 ser. 00005969 : 5969: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 5979: 6d 65 6e 74 73 00 ments. 0000597f : 597f: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 00005990 : 5990: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 59a0: 7a 6c 65 00 zle. 000059a4 : 59a4: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 59b4: 72 75 64 65 72 00 ruder. 000059ba : 59ba: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 59ca: 44 41 00 DA. 000059cd : 59cd: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 59dd: 75 6c 6c 65 79 00 ulley. 000059e3 : 59e3: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 59f3: 49 4e 44 41 00 INDA. 000059f8 : 59f8: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 5a08: 6c 65 72 00 ler. 00005a0c : 5a0c: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 00005a1d : 5a1d: ff ff 4f 4b 00 ..OK. 00005a22 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.546>: 5a22: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005a32 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.545>: 5a32: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5a42: 45 00 E. 00005a44 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.544>: 5a44: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5a54: 45 44 00 ED. 00005a57 <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.543>: 5a57: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5a67: 59 00 Y. 00005a69 <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.542>: 5a69: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 5a79: 4f 52 00 OR. 00005a7c <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.541>: 5a7c: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 5a8c: 4e 45 45 44 45 44 00 NEEDED. 00005a93 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.540>: 5a93: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005aa0 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.539>: 5aa0: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 00005aaf <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.538>: 5aaf: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 5abf: 4f 41 44 45 44 00 OADED. 00005ac5 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.537>: 5ac5: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5ad5: 45 52 52 4f 52 00 ERROR. 00005adb <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.536>: 5adb: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 5aeb: 44 49 4e 47 00 DING. 00005af0 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.535>: 5af0: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005b00 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.534>: 5b00: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5b10: 41 49 4c 45 44 00 AILED. 00005b16 <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.533>: 5b16: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5b26: 52 54 45 44 00 RTED. 00005b2b <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.532>: 5b2b: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 5b3b: 47 45 20 45 52 52 00 GE ERR. 00005b42 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.531>: 5b42: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5b52: 45 54 00 ET. 00005b55 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.530>: 5b55: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5b65: 4f 52 00 OR. 00005b68 <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.529>: 5b68: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 5b78: 52 52 4f 52 00 RROR. 00005b7d <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.528>: 5b7d: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 5b8d: 4f 20 48 4f 54 00 O HOT. 00005b93 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.527>: 5b93: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 5ba3: 4f 56 45 00 OVE. 00005ba7 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.526>: 5ba7: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 5bb7: 4f 4d 45 00 OME. 00005bbb <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.525>: 5bbb: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5bcb: 54 20 4d 4f 56 45 00 T MOVE. 00005bd2 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.524>: 5bd2: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5be2: 54 20 48 4f 4d 45 00 T HOME. 00005be9 <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.523>: 5be9: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5bf9: 46 41 49 4c 45 44 00 FAILED. 00005c00 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.522>: 5c00: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005c10 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.521>: 5c10: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5c20: 52 4c 59 00 RLY. 00005c24 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.520>: 5c24: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5c34: 4d 4f 56 45 00 MOVE. 00005c39 <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.519>: 5c39: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5c49: 54 55 43 4b 00 TUCK. 00005c4e <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.518>: 5c4e: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5c5e: 54 52 49 47 47 2e 00 TRIGG.. 00005c65 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.517>: 5c65: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5c75: 54 55 43 4b 00 TUCK. 00005c7a <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.516>: 5c7a: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 5c8a: 49 47 47 45 52 00 IGGER. 00005c90 : 5c90: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005c9f : 5c9f: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005cb0 : 5cb0: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5cc0: 6e 74 00 nt. 00005cc3 : 5cc3: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5cd3: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5ce3: 72 65 2e 2e 2e 00 re.... 00005ce9 : 5ce9: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005cf9 : 5cf9: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5d09: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5d19: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5d29: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5d39: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5d49: 30 2e 00 0.. 00005d4c : 5d4c: ff ff 75 6e 6b 6e 6f 77 6e 20 73 74 61 74 65 00 ..unknown state. 00005d5c : 5d5c: ff ff 20 30 2e 34 20 6f 72 20 6e 65 77 65 72 00 .. 0.4 or newer. 00005d6c : 5d6c: ff ff 20 30 2e 33 20 6f 72 20 6f 6c 64 65 72 00 .. 0.3 or older. 00005d7c : 5d7c: ff ff 4f 66 66 00 ..Off. 00005d82 : 5d82: ff ff 4f 6e 00 ..On. 00005d87 : 5d87: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5d97: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005da4 : 5da4: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5db4: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5dc4: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5dd4: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5de4: 2e 00 .. 00005de6 : 5de6: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5df6: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5e06: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5e16: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005e1f : 5e1f: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5e2f: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5e3f: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5e4f: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5e5f: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5e6f: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005e7d : 5e7d: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5e8d: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5e9d: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5ead: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5ebd: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005ec7 : 5ec7: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5ed7: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5ee7: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5ef7: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5f07: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005f11 : 5f11: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5f21: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5f31: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5f41: 4d 4d 55 2e 00 MMU.. 00005f46 : 5f46: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5f56: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5f66: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5f76: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 5f86: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 5f96: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 5fa6: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 5fb6: 29 2e 00 ).. 00005fb9 : 5fb9: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5fc9: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5fd9: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5fe9: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5ff9: 69 74 20 66 69 72 73 74 2e 00 it first.. 00006003 : 6003: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 6013: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 6023: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 6033: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 00006044 : 6044: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 6054: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 6064: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 6074: 63 74 6f 72 73 2e 00 ctors.. 0000607b : 607b: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 608b: 6e 6c 69 6e 65 2e 00 nline.. 00006092 : 6092: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 60a2: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 60b2: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 60c2: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 60d2: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 000060de : 60de: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 60ee: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 000060fe : 60fe: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 610e: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 611e: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 612e: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 613e: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 0000614d : 614d: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 615d: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 616d: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 617d: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 618d: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 619d: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 61ad: 6e 65 65 64 65 64 2e 00 needed.. 000061b5 : 61b5: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 61c5: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 61d5: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 61e5: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 61f5: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 6205: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 6215: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 6225: 6f 70 65 72 6c 79 2e 00 operly.. 0000622d : 622d: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 623d: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 624d: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 625d: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 626d: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 627d: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 628d: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 629d: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 62ad: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 62bd: 2e 00 .. 000062bf : 62bf: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 62cf: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 62df: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 62ef: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 62ff: 20 77 69 72 69 6e 67 2e 00 wiring.. 00006308 : 6308: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6318: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 6328: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 6338: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 6348: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 6358: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 6368: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 00006375 : 6375: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6385: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 6395: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 63a5: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 63b5: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 63c5: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 63d5: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 63e5: 61 63 68 65 64 20 69 74 2e 00 ached it.. 000063ef : 63ef: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 63ff: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 640f: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 641f: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 642f: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 643f: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 644f: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 645f: 6f 72 6b 73 2e 00 orks.. 00006465 : 6465: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 6475: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 6485: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 6495: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 64a5: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 64b5: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 000064c6 : 64c6: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 000064d0 : 64d0: ff ff 53 74 6f 70 00 ..Stop. 000064d7 : 64d7: ff ff 4c 6f 61 64 00 ..Load. 000064de : 64de: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 000064e7 : 64e7: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 000064f2 : 64f2: ff ff 52 65 74 72 79 00 ..Retry. 000064fa : 64fa: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 650a: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 651a: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 652a: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 653a: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 654a: 74 2e 00 t.. 0000654d : 654d: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 0000655b : 655b: ff ff 44 6f 6e 65 00 ..Done. 00006562 : 6562: ff ff 52 65 63 6f 76 65 72 69 6e 67 20 70 72 69 ..Recovering pri 6572: 6e 74 00 nt. 00006575 <__loc_pri_end>: 6575: 65 6e ori r22, 0xE5 ; 229 6577: 71 75 andi r23, 0x51 ; 81 6579: 65 69 ori r22, 0x95 ; 149 657b: 6e 67 ori r22, 0x7E ; 126 657d: 20 22 and r2, r16 ... 00006580 : 6580: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 6590: 6c 65 00 le. 00006593 : 6593: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 65a3: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 65b3: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000065bd : 65bd: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 65cd: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 65dd: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000065e7 : 65e7: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 65f7: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 00006606 : 6606: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 6616: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 6626: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 6636: 3a 20 00 : . 00006639 : 6639: 25 6c 75 20 62 79 74 65 73 20 77 72 69 74 74 65 %lu bytes writte 6649: 6e 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 n to %S at addre 6659: 73 73 20 30 78 25 30 34 6c 78 0a 00 ss 0x%04lx.. 00006665 : 6665: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 6675: 20 25 53 0a 00 %S.. 0000667a <__c.2367>: 667a: 3f 3f 00 ??. 0000667d <__c.2365>: 667d: 52 6f 6d 61 6e 61 00 Romana. 00006684 <__c.2362>: 6684: 48 72 76 61 74 73 6b 69 00 Hrvatski. 0000668d <__c.2359>: 668d: 4d 61 67 79 61 72 00 Magyar. 00006694 <__c.2356>: 6694: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 0000669f <__c.2353>: 669f: 4e 6f 72 73 6b 00 Norsk. 000066a5 <__c.2350>: 66a5: 53 76 65 6e 73 6b 61 00 Svenska. 000066ad <__c.2347>: 66ad: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 000066b8 <__c.2344>: 66b8: 50 6f 6c 73 6b 69 00 Polski. 000066bf <__c.2341>: 66bf: 49 74 61 6c 69 61 6e 6f 00 Italiano. 000066c8 <__c.2338>: 66c8: 46 72 61 6e 63 61 69 73 00 Francais. 000066d1 <__c.2335>: 66d1: 45 73 70 61 6e 6f 6c 00 Espanol. 000066d9 <__c.2332>: 66d9: 44 65 75 74 73 63 68 00 Deutsch. 000066e1 <__c.2329>: 66e1: 43 65 73 74 69 6e 61 00 Cestina. 000066e9 <__c.2326>: 66e9: 45 6e 67 6c 69 73 68 00 English. 000066f1 : 66f1: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 000066fc : 66fc: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 670c: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 671c: 31 40 3a 25 75 0a 00 1@:%u.. 00006723 : 6723: 52 65 73 65 6e 64 00 Resend. 0000672a : 672a: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 00006736 : 6736: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 6746: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 00006750 : 6750: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 6760: 64 65 74 65 63 74 65 64 21 00 detected!. 0000676a : 676a: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 677a: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 678a: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 679a: 72 65 64 2e 00 red.. 0000679f : 679f: 64 75 6d 70 20 63 6c 65 61 72 65 64 0a 00 dump cleared.. 000067ad : 67ad: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 67bd: 65 0a 00 e.. 000067c0 : 67c0: 44 32 31 20 2d 20 72 65 61 64 20 63 72 61 73 68 D21 - read crash 67d0: 20 64 75 6d 70 0a 00 dump.. 000067d7 : 67d7: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 67e7: 65 0a 00 e.. 000067ea : 67ea: 64 75 6d 70 20 63 6f 6d 70 6c 65 74 65 64 20 69 dump completed i 67fa: 6e 20 25 6c 75 6d 73 0a 00 n %lums.. 00006803 : 6803: 58 46 4c 41 53 48 00 XFLASH. 0000680a : 680a: 45 45 50 52 4f 4d 00 EEPROM. 00006811 : 6811: 53 52 41 4d 00 SRAM. 00006816 : 6816: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 6826: 6f 70 0a 00 op.. 0000682a : 682a: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 683a: 20 30 00 0. 0000683d : 683d: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 0000684e : 684e: 74 6d 63 32 31 33 30 5f 70 72 69 6e 74 5f 63 75 tmc2130_print_cu 685e: 72 72 65 6e 74 73 28 29 0a 09 48 09 52 0a 58 09 rrents()..H.R.X. 686e: 25 64 09 25 64 0a 59 09 25 64 09 25 64 0a 5a 09 %d.%d.Y.%d.%d.Z. 687e: 25 64 09 25 64 0a 45 09 25 64 09 25 64 0a 00 %d.%d.E.%d.%d.. 0000688d : 688d: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 689d: 20 00 . 0000689f : 689f: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 68af: 20 22 00 ". 000068b2 <_ZZ16process_commandsvE3__c__65_>: 68b2: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 68c2: 72 75 64 65 72 20 00 ruder . 000068c9 : 68c9: 7a 5f 6d 61 78 3a 20 00 z_max: . 000068d1 : 68d1: 7a 5f 6d 69 6e 3a 20 00 z_min: . 000068d9 <_ZZ16process_commandsvE3__c__64_>: 68d9: 79 5f 6d 61 78 3a 20 00 y_max: . 000068e1 <_ZZ16process_commandsvE3__c__63_>: 68e1: 79 5f 6d 69 6e 3a 20 00 y_min: . 000068e9 <_ZZ16process_commandsvE3__c__62_>: 68e9: 78 5f 6d 61 78 3a 20 00 x_max: . 000068f1 : 68f1: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 000068fb : 68fb: 6f 70 65 6e 00 open. 00006900 <_ZZ16process_commandsvE3__c__61_>: 6900: 78 5f 6d 69 6e 3a 20 00 x_min: . 00006908 <_ZZ16process_commandsvE3__c__60_>: 6908: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 6918: 70 20 73 74 61 74 75 73 00 p status. 00006921 : 6921: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 6931: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 0000693e : 693e: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 694e: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 0000695b : 695b: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 61 75 //action:uvlo_au 696b: 74 6f 5f 72 65 63 6f 76 65 72 79 5f 72 65 61 64 to_recovery_read 697b: 79 00 y. 0000697d <_ZZ16process_commandsvE3__c__46_>: 697d: 25 53 3a 25 6c 75 20 63 6d 0a 25 53 3a 25 6c 75 %S:%lu cm.%S:%lu 698d: 20 6d 69 6e 0a 00 min.. 00006993 <_ZZ16process_commandsvE3__c__45_>: 6993: 53 49 4c 45 4e 54 00 SILENT. 0000699a <_ZZ16process_commandsvE3__c__44_>: 699a: 4e 4f 52 4d 41 4c 00 NORMAL. 000069a1 <_ZZ16process_commandsvE3__c__43_>: 69a1: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 69b1: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 69c1: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 69d1: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 69e1: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 69f1: 64 0a 00 d.. 000069f4 <_ZZ16process_commandsvE3__c__42_>: 69f4: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 6a04: 0a 00 .. 00006a06 <_ZZ16process_commandsvE3__c__38_>: 6a06: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 00006a14 <_ZZ16process_commandsvE3__c__37_>: 6a14: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 00006a24 : 6a24: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 6a34: 20 25 73 0a 00 %s.. 00006a39 <_ZZ16process_commandsvE3__c__35_>: 6a39: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 6a49: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 6a59: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006a65 <_ZZ16process_commandsvE3__c__34_>: 6a65: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 00006a72 <_ZZ16process_commandsvE3__c__33_>: 6a72: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 6a82: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 6a92: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6aa2: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 00006aae <_ZZ16process_commandsvE3__c__32_>: 6aae: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 00006abb <_ZZ16process_commandsvE3__c__31_>: 6abb: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 6acb: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006ad4 <_ZZ16process_commandsvE3__c__28_>: 6ad4: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006add <_ZZ16process_commandsvE3__c__27_>: 6add: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6aed: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 00006af9 <_ZZ16process_commandsvE3__c__26_>: 6af9: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006b02 <_ZZ16process_commandsvE3__c__10_>: 6b02: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6b12: 64 20 52 50 4d 0a 00 d RPM.. 00006b19 : 6b19: 47 39 30 00 G90. 00006b1d : 6b1d: 4d 31 30 37 00 M107. 00006b22 : 6b22: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 63 61 Thermal Model ca 6b32: 6c 2e 00 l.. 00006b35 : 6b35: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6b45: 52 4f 52 00 ROR. 00006b49 : 6b49: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6b59: 52 52 4f 52 00 RROR. 00006b5e : 6b5e: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006b6f : 6b6f: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006b7f : 6b7f: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006b8e : 6b8e: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6b9e: 64 79 00 dy. 00006ba1 : 6ba1: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006bb1 : 6bb1: 4d 38 34 00 M84. 00006bb5 : 6bb5: 41 78 69 73 20 6c 65 6e 67 74 68 20 64 69 66 66 Axis length diff 6bc5: 65 72 65 6e 63 65 3a 25 2e 33 66 0a 00 erence:%.3f.. 00006bd2 : 6bd2: 4d 65 61 73 75 72 65 64 20 61 78 69 73 20 6c 65 Measured axis le 6be2: 6e 67 74 68 3a 25 2e 33 66 0a 00 ngth:%.3f.. 00006bed : 6bed: 4f 4b 00 OK. 00006bf0 : 6bf0: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6c00: 65 64 00 ed. 00006c03 <_ZZN10CardReader7releaseEvE3__c.lto_priv.554>: 6c03: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006c14 : 6c14: 46 61 6b 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 Fake serial numb 6c24: 65 72 00 er. 00006c27 : 6c27: 45 2d 63 6f 6f 6c 20 6d 6f 64 65 00 E-cool mode. 00006c33 : 6c33: 41 4c 54 46 41 4e 20 64 65 74 2e 00 ALTFAN det.. 00006c3f : 6c3f: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006c4e : 6c4e: 47 39 31 00 G91. 00006c52 : 6c52: 4d 37 30 32 00 M702. 00006c57 : 6c57: 4d 38 33 00 M83. 00006c5b : 6c5b: 47 32 38 20 57 00 G28 W. 00006c61 : 6c61: 4d 35 30 30 00 M500. 00006c66 : 6c66: 45 78 74 65 72 6e 61 6c 20 53 50 49 20 66 6c 61 External SPI fla 6c76: 73 68 0a 58 46 4c 41 53 48 20 69 73 20 6e 6f 74 sh.XFLASH is not 6c86: 20 72 65 73 2d 0a 70 6f 6e 64 69 6e 67 2e 20 4c res-.ponding. L 6c96: 61 6e 67 75 61 67 65 0a 73 77 69 74 63 68 20 75 anguage.switch u 6ca6: 6e 61 76 61 69 6c 61 62 6c 65 2e 00 navailable.. 00006cb2 : 6cb2: 58 46 4c 41 53 48 20 6e 6f 74 20 72 65 73 70 6f XFLASH not respo 6cc2: 6e 64 69 6e 67 2e 00 nding.. 00006cc9 : 6cc9: 46 57 20 63 72 61 73 68 20 64 65 74 65 63 74 65 FW crash detecte 6cd9: 64 21 20 59 6f 75 20 63 61 6e 20 63 6f 6e 74 69 d! You can conti 6ce9: 6e 75 65 20 70 72 69 6e 74 69 6e 67 2e 20 44 65 nue printing. De 6cf9: 62 75 67 20 64 61 74 61 20 61 76 61 69 6c 61 62 bug data availab 6d09: 6c 65 20 66 6f 72 20 61 6e 61 6c 79 73 69 73 2e le for analysis. 6d19: 20 43 6f 6e 74 61 63 74 20 73 75 70 70 6f 72 74 Contact support 6d29: 20 74 6f 20 73 75 62 6d 69 74 20 64 65 74 61 69 to submit detai 6d39: 6c 73 2e 00 ls.. 00006d3d : 6d3d: 2f 2f 61 63 74 69 6f 6e 3a 64 75 6d 70 5f 61 76 //action:dump_av 6d4d: 61 69 6c 61 62 6c 65 00 ailable. 00006d55 <_ZZ5setupE3__c__14_>: 6d55: 43 72 61 73 68 44 65 74 65 63 74 20 44 49 53 41 CrashDetect DISA 6d65: 42 4c 45 44 00 BLED. 00006d6a <_ZZ5setupE3__c__13_>: 6d6a: 43 72 61 73 68 44 65 74 65 63 74 20 45 4e 41 42 CrashDetect ENAB 6d7a: 4c 45 44 21 00 LED!. 00006d7f <_ZZ5setupE3__c__10_>: 6d7f: 48 6f 74 65 6e 64 20 66 61 6e 20 74 79 70 65 3a Hotend fan type: 6d8f: 20 00 . 00006d91 : 6d91: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6da1: 79 74 65 73 3a 20 00 ytes: . 00006da8 : 6da8: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006db7 : 6db7: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006dc3 : 6dc3: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006dd3 : 6dd3: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006de3 : 6de3: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006df3 : 6df3: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006e04 : 6e04: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006e14 : 6e14: 50 6f 77 65 72 55 70 00 PowerUp. 00006e1c : 6e1c: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6e2c: 20 66 69 6c 65 00 file. 00006e32 : 6e32: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6e42: 2e 00 .. 00006e44 : 6e44: 6f 6b 00 ok. 00006e47 : 6e47: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006e50 : 6e50: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 6e60: 25 66 20 25 66 0a 00 %f %f.. 00006e67 : 6e67: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6e77: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6e87: 69 6c 65 64 2e 0a 00 iled... 00006e8e : 6e8e: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6e9e: 65 73 73 2e 0a 00 ess... 00006ea4 : 6ea4: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6eb4: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006ec5 : 6ec5: 31 2f 34 00 1/4. 00006ec9 : 6ec9: 31 2f 34 00 1/4. 00006ecd : 6ecd: 31 2f 39 00 1/9. 00006ed1 : 6ed1: 54 4d 43 20 44 52 49 56 45 52 20 4f 56 45 52 54 TMC DRIVER OVERT 6ee1: 45 4d 50 00 EMP. 00006ee5 : 6ee5: 48 6f 6c 64 20 63 75 72 72 65 6e 74 20 74 72 75 Hold current tru 6ef5: 6e 63 61 74 65 64 20 74 6f 20 52 75 6e 20 63 75 ncated to Run cu 6f05: 72 72 65 6e 74 00 rrent. 00006f0b : 6f0b: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006f15 : 6f15: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006f1e : 6f1e: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006f27 : 6f27: 86 25 33 64 25 25 00 .%3d%%. 00006f2e : 6f2e: 2d 2d 2d 25 25 00 ---%%. 00006f34 : 6f34: 25 33 64 25 25 00 %3d%%. 00006f3a : 6f3a: 20 53 44 00 SD. 00006f3e : 6f3e: 20 20 20 00 . 00006f42 : 6f42: 20 48 4f 00 HO. 00006f46 : 6f46: 87 2d 2d 3a 2d 2d 20 20 00 .--:-- . 00006f4f : 6f4f: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006f5a : 6f5a: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006f69 : 6f69: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006f79 : 6f79: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006f88 <_ZZL16lcd_support_menuvE3__c__17_>: 6f88: 44 75 6d 70 20 6d 65 6d 6f 72 79 00 Dump memory. 00006f94 : 6f94: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006fa5 : 6fa5: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6fb5: 6d 00 m. 00006fb7 : 6fb7: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006fc3 : 6fc3: 4d 37 30 31 00 M701. 00006fc8 : 6fc8: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6fd8: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6fe8: 32 64 6d 00 2dm. 00006fec : 6fec: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6ffc: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 700c: 32 64 73 00 2ds. 00007010 : 7010: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00007018 : 7018: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00007026 : 7026: 25 33 2e 32 66 81 00 %3.2f.. 0000702d : 702d: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 703d: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 704d: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 0000705a : 705a: 20 20 30 00 0. 0000705e : 705e: 20 20 31 00 1. 00007062 : 7062: 46 49 4e 44 41 00 FINDA. 00007068 : 7068: 50 49 4e 44 41 00 PINDA. 0000706e : 706e: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 707e: 3a 20 25 64 0a 00 : %d.. 00007084 : 7084: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 0000708e : 708e: 46 69 72 6d 77 61 72 65 00 Firmware. 00007097 : 7097: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 000070a4 : 70a4: 46 6c 61 73 68 41 69 72 00 FlashAir. 000070ad : 70ad: 50 72 75 73 61 20 69 33 20 4d 4b 33 53 20 4f 4b Prusa i3 MK3S OK 70bd: 2e 00 .. 000070bf : 70bf: 4d 36 30 30 00 M600. 000070c4 : 70c4: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 000070cf : 70cf: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 000070df : 70df: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 70ef: 65 64 00 ed. 000070f2 : 70f2: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 000070ff : 70ff: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 710f: 65 3a 20 00 e: . 00007113 : 7113: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 7123: 64 69 72 3a 20 00 dir: . 00007129 : 7129: 4d 32 34 00 M24. 0000712d : 712d: 4d 32 33 20 25 73 00 M23 %s. 00007134 : 7134: 31 2f 39 00 1/9. 00007138 : 7138: 88 00 .. 0000713a : 713a: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 714a: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00007158 : 7158: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 7168: 70 72 65 76 65 6e 74 65 64 00 prevented. 00007172 : 7172: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 0000717f : 717f: 50 4f 57 45 52 20 50 41 4e 49 43 20 44 45 54 45 POWER PANIC DETE 718f: 43 54 45 44 00 CTED. 00007194 : 7194: 55 56 4c 4f 20 2d 20 65 6e 64 20 25 64 0a 00 UVLO - end %d.. 000071a3 : 71a3: 55 56 4c 4f 5f 54 49 4e 59 20 2d 20 65 6e 64 20 UVLO_TINY - end 71b3: 25 64 0a 00 %d.. 000071b7 : 71b7: 77 6f 72 6c 64 20 63 6f 6f 72 64 69 6e 61 74 65 world coordinate 71c7: 73 3a 20 28 25 2e 33 66 2c 20 25 2e 33 66 2c 20 s: (%.3f, %.3f, 71d7: 25 2e 33 66 29 0a 00 %.3f).. 000071de : 71de: 4d 32 32 30 20 53 25 64 00 M220 S%d. 000071e7 : 71e7: 44 6f 6e 65 20 72 65 61 64 69 6e 67 20 45 45 50 Done reading EEP 71f7: 52 4f 4d 0a 00 ROM.. 000071fc : 71fc: 54 65 6d 70 65 72 61 74 75 72 65 20 52 65 73 74 Temperature Rest 720c: 6f 72 65 64 0a 00 ored.. 00007212 : 7212: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00007222 <__noloc_end>: 7222: 08 4a sbci r16, 0xA8 ; 168 7224: d7 3b cpi r29, 0xB7 ; 183 7226: 3b ce rjmp .-906 ; 0x6e9e 7228: 01 6e ori r16, 0xE1 ; 225 722a: 84 bc out 0x24, r8 ; 36 722c: bf fd .word 0xfdbf ; ???? 722e: c1 2f mov r28, r17 7230: 3d 6c ori r19, 0xCD ; 205 7232: 74 31 cpi r23, 0x14 ; 20 7234: 9a bd out 0x2a, r25 ; 42 7236: 56 83 std Z+6, r21 ; 0x06 7238: 3d da rcall .-2950 ; 0x66b4 <__c.2347+0x7> 723a: 3d 00 .word 0x003d ; ???? 723c: c7 7f andi r28, 0xF7 ; 247 723e: 11 be out 0x31, r1 ; 49 7240: d9 e4 ldi r29, 0x49 ; 73 7242: bb 4c sbci r27, 0xCB ; 203 7244: 3e 91 ld r19, -X 7246: 6b aa std Y+51, r6 ; 0x33 7248: aa be out 0x3a, r10 ; 58 724a: 00 00 nop 724c: 00 80 ld r0, Z 724e: 3f 05 cpc r19, r15 7250: a8 4c sbci r26, 0xC8 ; 200 7252: cd b2 in r12, 0x1d ; 29 7254: d4 4e sbci r29, 0xE4 ; 228 7256: b9 38 cpi r27, 0x89 ; 137 7258: 36 a9 ldd r19, Z+54 ; 0x36 725a: 02 0c add r0, r2 725c: 50 b9 out 0x00, r21 ; 0 725e: 91 86 std Z+9, r9 ; 0x09 7260: 88 08 sbc r8, r8 7262: 3c a6 std Y+44, r3 ; 0x2c 7264: aa aa std Y+50, r10 ; 0x32 7266: 2a be out 0x3a, r2 ; 58 7268: 00 00 nop 726a: 00 80 ld r0, Z 726c: 3f 07 cpc r19, r31 726e: 63 42 sbci r22, 0x23 ; 35 7270: 36 b7 in r19, 0x36 ; 54 7272: 9b d8 rcall .-3786 ; 0x63aa 7274: a7 1a sub r10, r23 7276: 39 68 ori r19, 0x89 ; 137 7278: 56 18 sub r5, r6 727a: ae ba out 0x1e, r10 ; 30 727c: ab 55 subi r26, 0x5B ; 91 727e: 8c 1d adc r24, r12 7280: 3c b7 in r19, 0x3c ; 60 7282: cc 57 subi r28, 0x7C ; 124 7284: 63 bd out 0x23, r22 ; 35 7286: 6d ed ldi r22, 0xDD ; 221 7288: fd 75 andi r31, 0x5D ; 93 728a: 3e f6 brtc .-114 ; 0x721a 728c: 17 72 andi r17, 0x27 ; 39 728e: 31 bf out 0x31, r19 ; 49 7290: 00 00 nop 7292: 00 80 ld r0, Z 7294: 3f 08 sbc r3, r15 7296: 00 00 nop 7298: 00 be out 0x30, r0 ; 48 729a: 92 24 eor r9, r2 729c: 49 12 cpse r4, r25 729e: 3e ab std Y+54, r19 ; 0x36 72a0: aa aa std Y+50, r10 ; 0x32 72a2: 2a be out 0x3a, r2 ; 58 72a4: cd cc rjmp .-1638 ; 0x6c40 72a6: cc 4c sbci r28, 0xCC ; 204 72a8: 3e 00 .word 0x003e ; ???? 72aa: 00 00 nop 72ac: 80 be out 0x30, r8 ; 48 72ae: ab aa std Y+51, r10 ; 0x33 72b0: aa aa std Y+50, r10 ; 0x32 72b2: 3e 00 .word 0x003e ; ???? 72b4: 00 00 nop 72b6: 00 bf out 0x30, r16 ; 48 72b8: 00 00 nop 72ba: 00 80 ld r0, Z 72bc: 3f 00 .word 0x003f ; ???? 72be: 00 00 nop 72c0: 00 00 nop 72c2: 08 41 sbci r16, 0x18 ; 24 72c4: 78 d3 rcall .+1776 ; 0x79b6 72c6: bb 43 sbci r27, 0x3B ; 59 72c8: 87 d1 rcall .+782 ; 0x75d8 <__trampolines_start+0x2e8> 72ca: 13 3d cpi r17, 0xD3 ; 211 72cc: 19 0e add r1, r25 72ce: 3c c3 rjmp .+1656 ; 0x7948 72d0: bd 42 sbci r27, 0x2D ; 45 72d2: 82 ad ldd r24, Z+58 ; 0x3a 72d4: 2b 3e cpi r18, 0xEB ; 235 72d6: 68 ec ldi r22, 0xC8 ; 200 72d8: 82 76 andi r24, 0x62 ; 98 72da: be d9 rcall .-3204 ; 0x6658 72dc: 8f e1 ldi r24, 0x1F ; 31 72de: a9 3e cpi r26, 0xE9 ; 233 72e0: 4c 80 ldd r4, Y+4 ; 0x04 72e2: ef ff .word 0xffef ; ???? 72e4: be 01 movw r22, r28 72e6: c4 ff sbrs r28, 4 72e8: 7f 3f cpi r23, 0xFF ; 255 72ea: 00 00 nop 72ec: 00 00 nop ... 000072f0 <__trampolines_start>: 72f0: 0c 94 c0 cf jmp 0x19f80 ; 0x19f80 72f4: 0c 94 f7 cf jmp 0x19fee ; 0x19fee 72f8: 0d 94 47 6a jmp 0x2d48e ; 0x2d48e 72fc: 0d 94 01 66 jmp 0x2cc02 ; 0x2cc02 7300: 0c 94 cd cf jmp 0x19f9a ; 0x19f9a 7304: 0d 94 ed 25 jmp 0x24bda ; 0x24bda 7308: 0d 94 cf 99 jmp 0x3339e ; 0x3339e 730c: 0c 94 0b d9 jmp 0x1b216 ; 0x1b216 7310: 0d 94 df 11 jmp 0x223be ; 0x223be 7314: 0d 94 2e 29 jmp 0x2525c ; 0x2525c 7318: 0d 94 c5 55 jmp 0x2ab8a ; 0x2ab8a 731c: 0d 94 83 66 jmp 0x2cd06 ; 0x2cd06 7320: 0d 94 c5 07 jmp 0x20f8a ; 0x20f8a 7324: 0d 94 fa 14 jmp 0x229f4 ; 0x229f4 7328: 0d 94 20 07 jmp 0x20e40 ; 0x20e40 732c: 0d 94 b5 d1 jmp 0x3a36a ; 0x3a36a 7330: 0c 94 90 d2 jmp 0x1a520 ; 0x1a520 7334: 0c 94 9b d0 jmp 0x1a136 ; 0x1a136 7338: 0c 94 3e d4 jmp 0x1a87c ; 0x1a87c () [clone .lto_priv.446]> 733c: 0d 94 c2 22 jmp 0x24584 ; 0x24584 7340: 0d 94 e4 24 jmp 0x249c8 ; 0x249c8 7344: 0d 94 c6 3e jmp 0x27d8c ; 0x27d8c 7348: 0d 94 95 07 jmp 0x20f2a ; 0x20f2a 734c: 0d 94 9b 41 jmp 0x28336 ; 0x28336 7350: 0c 94 34 d8 jmp 0x1b068 ; 0x1b068 7354: 0d 94 96 69 jmp 0x2d32c ; 0x2d32c 7358: 0d 94 f9 69 jmp 0x2d3f2 ; 0x2d3f2 735c: 0c 94 ce d6 jmp 0x1ad9c ; 0x1ad9c 7360: 0c 94 63 e0 jmp 0x1c0c6 ; 0x1c0c6 7364: 0d 94 98 07 jmp 0x20f30 ; 0x20f30 7368: 0d 94 33 67 jmp 0x2ce66 ; 0x2ce66 736c: 0c 94 71 d2 jmp 0x1a4e2 ; 0x1a4e2 7370: 0d 94 64 23 jmp 0x246c8 ; 0x246c8 7374: 0c 94 36 e0 jmp 0x1c06c ; 0x1c06c 7378: 0d 94 d8 24 jmp 0x249b0 ; 0x249b0 737c: 0d 94 37 6a jmp 0x2d46e ; 0x2d46e 7380: 0d 94 ce 9f jmp 0x33f9c ; 0x33f9c 7384: 0d 94 2e 23 jmp 0x2465c ; 0x2465c 7388: 0d 94 74 37 jmp 0x26ee8 ; 0x26ee8 738c: 0c 94 95 d0 jmp 0x1a12a ; 0x1a12a 7390: 0d 94 45 2f jmp 0x25e8a ; 0x25e8a 7394: 0d 94 e5 54 jmp 0x2a9ca ; 0x2a9ca 7398: 0c 94 2a d4 jmp 0x1a854 ; 0x1a854 () [clone .lto_priv.450]> 739c: 0d 94 07 6a jmp 0x2d40e ; 0x2d40e 73a0: 0c 94 80 d7 jmp 0x1af00 ; 0x1af00 73a4: 0c 94 0d d3 jmp 0x1a61a ; 0x1a61a 73a8: 0d 94 34 27 jmp 0x24e68 ; 0x24e68 73ac: 0d 94 4f 6a jmp 0x2d49e ; 0x2d49e 73b0: 0d 94 5e 27 jmp 0x24ebc ; 0x24ebc 73b4: 0d 94 b6 07 jmp 0x20f6c ; 0x20f6c 73b8: 0d 94 58 2c jmp 0x258b0 ; 0x258b0 73bc: 0c 94 f4 df jmp 0x1bfe8 ; 0x1bfe8 73c0: 0d 94 39 2d jmp 0x25a72 ; 0x25a72 73c4: 0d 94 f2 0e jmp 0x21de4 ; 0x21de4 73c8: 0c 94 e5 df jmp 0x1bfca ; 0x1bfca 73cc: 0d 94 9b 07 jmp 0x20f36 ; 0x20f36 73d0: 0d 94 6c 27 jmp 0x24ed8 ; 0x24ed8 73d4: 0c 94 c5 d8 jmp 0x1b18a ; 0x1b18a 73d8: 0d 94 54 67 jmp 0x2cea8 ; 0x2cea8 73dc: 0d 94 e6 14 jmp 0x229cc ; 0x229cc 73e0: 0d 94 da 25 jmp 0x24bb4 ; 0x24bb4 73e4: 0d 94 df 41 jmp 0x283be ; 0x283be 73e8: 0d 94 b0 24 jmp 0x24960 ; 0x24960 73ec: 0d 94 d1 9f jmp 0x33fa2 ; 0x33fa2 73f0: 0c 94 77 e0 jmp 0x1c0ee ; 0x1c0ee 73f4: 0d 94 d3 66 jmp 0x2cda6 ; 0x2cda6 73f8: 0d 94 a3 29 jmp 0x25346 ; 0x25346 73fc: 0d 94 77 66 jmp 0x2ccee ; 0x2ccee 7400: 0c 94 d1 cf jmp 0x19fa2 ; 0x19fa2 7404: 0d 94 44 07 jmp 0x20e88 ; 0x20e88 7408: 0c 94 3a 75 jmp 0xea74 ; 0xea74 <__vector_23+0xa4> 740c: 0d 94 13 69 jmp 0x2d226 ; 0x2d226 7410: 0d 94 ce 2e jmp 0x25d9c ; 0x25d9c 7414: 0d 94 98 2f jmp 0x25f30 ; 0x25f30 7418: 0c 94 f2 cf jmp 0x19fe4 ; 0x19fe4 741c: 0c 94 25 d4 jmp 0x1a84a ; 0x1a84a () [clone .lto_priv.451]> 7420: 0d 94 08 67 jmp 0x2ce10 ; 0x2ce10 7424: 0d 94 91 33 jmp 0x26722 ; 0x26722 7428: 0d 94 ef 2c jmp 0x259de ; 0x259de 742c: 0c 94 ff 77 jmp 0xeffe ; 0xeffe 7430: 0d 94 c4 27 jmp 0x24f88 ; 0x24f88 7434: 0d 94 7b 28 jmp 0x250f6 ; 0x250f6 7438: 0c 94 df cf jmp 0x19fbe ; 0x19fbe 743c: 0d 94 65 27 jmp 0x24eca ; 0x24eca 7440: 0c 94 1b d4 jmp 0x1a836 ; 0x1a836 () [clone .lto_priv.453]> 7444: 0d 94 2c 07 jmp 0x20e58 ; 0x20e58 7448: 0c 94 b9 71 jmp 0xe372 ; 0xe372 744c: 0d 94 57 99 jmp 0x332ae ; 0x332ae 7450: 0d 94 53 69 jmp 0x2d2a6 ; 0x2d2a6 7454: 0d 94 7d 23 jmp 0x246fa ; 0x246fa 7458: 0d 94 0f 6a jmp 0x2d41e ; 0x2d41e 745c: 0d 94 88 25 jmp 0x24b10 ; 0x24b10 7460: 0c 94 b9 d9 jmp 0x1b372 ; 0x1b372 7464: 0c 94 04 d3 jmp 0x1a608 ; 0x1a608 7468: 0d 94 1f 6a jmp 0x2d43e ; 0x2d43e 746c: 0c 94 42 d4 jmp 0x1a884 ; 0x1a884 7470: 0d 94 57 59 jmp 0x2b2ae ; 0x2b2ae 7474: 0c 94 34 d4 jmp 0x1a868 ; 0x1a868 () [clone .lto_priv.448]> 7478: 0d 94 46 15 jmp 0x22a8c ; 0x22a8c 747c: 0c 94 4f e0 jmp 0x1c09e ; 0x1c09e 7480: 0c 94 2c e0 jmp 0x1c058 ; 0x1c058 7484: 0c 94 08 e0 jmp 0x1c010 ; 0x1c010 7488: 0c 94 76 d7 jmp 0x1aeec ; 0x1aeec 748c: 0d 94 05 75 jmp 0x2ea0a ; 0x2ea0a 7490: 0d 94 9c 25 jmp 0x24b38 ; 0x24b38 7494: 0d 94 a4 0b jmp 0x21748 ; 0x21748 7498: 0c 94 a2 d9 jmp 0x1b344 ; 0x1b344 749c: 0d 94 fc 69 jmp 0x2d3f8 ; 0x2d3f8 74a0: 0d 94 e3 9f jmp 0x33fc6 ; 0x33fc6 74a4: 0d 94 0d 06 jmp 0x20c1a ; 0x20c1a 74a8: 0c 94 2f d4 jmp 0x1a85e ; 0x1a85e () [clone .lto_priv.449]> 74ac: 0c 94 9a d9 jmp 0x1b334 ; 0x1b334 74b0: 0d 94 aa 07 jmp 0x20f54 ; 0x20f54 74b4: 0c 94 39 d4 jmp 0x1a872 ; 0x1a872 () [clone .lto_priv.447]> 74b8: 0d 94 c4 24 jmp 0x24988 ; 0x24988 74bc: 0c 94 fc d8 jmp 0x1b1f8 ; 0x1b1f8 74c0: 0c 94 e9 cf jmp 0x19fd2 ; 0x19fd2 74c4: 0d 94 1a 24 jmp 0x24834 ; 0x24834 74c8: 0d 94 ae cf jmp 0x39f5c ; 0x39f5c <_menu_edit_P()> 74cc: 0d 94 da 0f jmp 0x21fb4 ; 0x21fb4 74d0: 0d 94 2f 6a jmp 0x2d45e ; 0x2d45e 74d4: 0d 94 50 69 jmp 0x2d2a0 ; 0x2d2a0 74d8: 0d 94 21 27 jmp 0x24e42 ; 0x24e42 74dc: 0d 94 68 23 jmp 0x246d0 ; 0x246d0 74e0: 0d 94 0a 28 jmp 0x25014 ; 0x25014 74e4: 0c 94 90 d0 jmp 0x1a120 ; 0x1a120 74e8: 0d 94 ed 66 jmp 0x2cdda ; 0x2cdda 74ec: 0d 94 1a 27 jmp 0x24e34 ; 0x24e34 74f0: 0c 94 8f cf jmp 0x19f1e ; 0x19f1e 74f4: 0c 94 ff d8 jmp 0x1b1fe ; 0x1b1fe 74f8: 0c 94 e5 cf jmp 0x19fca ; 0x19fca 74fc: 0d 94 c2 69 jmp 0x2d384 ; 0x2d384 7500: 0d 94 73 27 jmp 0x24ee6 ; 0x24ee6 7504: 0c 94 02 d9 jmp 0x1b204 ; 0x1b204 7508: 0d 94 b2 99 jmp 0x33364 ; 0x33364 750c: 0d 94 2b 69 jmp 0x2d256 ; 0x2d256 7510: 0d 94 6c 24 jmp 0x248d8 ; 0x248d8 7514: 0c 94 22 e0 jmp 0x1c044 ; 0x1c044 7518: 0d 94 b8 25 jmp 0x24b70 ; 0x24b70 751c: 0d 94 eb 3b jmp 0x277d6 ; 0x277d6 7520: 0c 94 f3 cf jmp 0x19fe6 ; 0x19fe6 7524: 0d 94 04 67 jmp 0x2ce08 ; 0x2ce08 7528: 0c 94 fb d4 jmp 0x1a9f6 ; 0x1a9f6 752c: 0c 94 db d4 jmp 0x1a9b6 ; 0x1a9b6 7530: 0d 94 ce 24 jmp 0x2499c ; 0x2499c 7534: 0c 94 d7 cf jmp 0x19fae ; 0x19fae 7538: 0c 94 10 e0 jmp 0x1c020 ; 0x1c020 753c: 0c 94 ff cf jmp 0x19ffe ; 0x19ffe 7540: 0d 94 48 10 jmp 0x22090 ; 0x22090 7544: 0d 94 d5 99 jmp 0x333aa ; 0x333aa 7548: 0d 94 cf 26 jmp 0x24d9e ; 0x24d9e 754c: 0d 94 ee 0e jmp 0x21ddc ; 0x21ddc 7550: 0d 94 00 23 jmp 0x24600 ; 0x24600 7554: 0d 94 16 67 jmp 0x2ce2c ; 0x2ce2c 7558: 0c 94 3b 65 jmp 0xca76 ; 0xca76 <_GLOBAL__sub_D_card> 755c: 0d 94 44 10 jmp 0x22088 ; 0x22088 7560: 0d 94 fa 6e jmp 0x2ddf4 ; 0x2ddf4 7564: 0d 94 f6 69 jmp 0x2d3ec ; 0x2d3ec 7568: 0d 94 16 2b jmp 0x2562c ; 0x2562c 756c: 0d 94 7a 27 jmp 0x24ef4 ; 0x24ef4 7570: 0d 94 58 06 jmp 0x20cb0 ; 0x20cb0 7574: 0c 94 4a d3 jmp 0x1a694 ; 0x1a694 7578: 0d 94 d9 1c jmp 0x239b2 ; 0x239b2 757c: 0d 94 3a 16 jmp 0x22c74 ; 0x22c74 7580: 0c 94 ae d9 jmp 0x1b35c ; 0x1b35c 7584: 0c 94 f3 e6 jmp 0x1cde6 ; 0x1cde6 7588: 0c 94 bc cf jmp 0x19f78 ; 0x19f78 758c: 0c 94 7c 75 jmp 0xeaf8 ; 0xeaf8 <__vector_23+0x128> 7590: 0d 94 1f 67 jmp 0x2ce3e ; 0x2ce3e 7594: 0d 94 3f 41 jmp 0x2827e ; 0x2827e 7598: 0d 94 89 07 jmp 0x20f12 ; 0x20f12 759c: 0c 94 21 75 jmp 0xea42 ; 0xea42 <__vector_23+0x72> 75a0: 0c 94 18 e0 jmp 0x1c030 ; 0x1c030 75a4: 0d 94 f0 1c jmp 0x239e0 ; 0x239e0 75a8: 0d 94 fa 10 jmp 0x221f4 ; 0x221f4 75ac: 0c 94 c4 cf jmp 0x19f88 ; 0x19f88 75b0: 0d 94 9e 07 jmp 0x20f3c ; 0x20f3c 75b4: 0d 94 95 3d jmp 0x27b2a ; 0x27b2a 75b8: 0c 94 2c 75 jmp 0xea58 ; 0xea58 <__vector_23+0x88> 75bc: 0d 94 59 2a jmp 0x254b2 ; 0x254b2 75c0: 0d 94 cd 28 jmp 0x2519a ; 0x2519a 75c4: 0d 94 c7 36 jmp 0x26d8e ; 0x26d8e 75c8: 0d 94 8d 66 jmp 0x2cd1a ; 0x2cd1a 75cc: 0d 94 d7 2e jmp 0x25dae ; 0x25dae 75d0: 0d 94 34 68 jmp 0x2d068 ; 0x2d068 75d4: 0d 94 67 3f jmp 0x27ece ; 0x27ece 75d8: 0c 94 24 d8 jmp 0x1b048 ; 0x1b048 75dc: 0c 94 c8 d9 jmp 0x1b390 ; 0x1b390 75e0: 0c 94 07 75 jmp 0xea0e ; 0xea0e <__vector_23+0x3e> 75e4: 0d 94 fd 26 jmp 0x24dfa ; 0x24dfa 75e8: 0d 94 4c 1e jmp 0x23c98 ; 0x23c98 75ec: 0d 94 e0 2e jmp 0x25dc0 ; 0x25dc0 75f0: 0d 94 d5 9f jmp 0x33faa ; 0x33faa 75f4: 0d 94 d2 99 jmp 0x333a4 ; 0x333a4 75f8: 0d 94 92 25 jmp 0x24b24 ; 0x24b24 75fc: 0c 94 fb cf jmp 0x19ff6 ; 0x19ff6 7600: 0c 94 c7 cf jmp 0x19f8e ; 0x19f8e 7604: 0d 94 c8 69 jmp 0x2d390 ; 0x2d390 7608: 0d 94 b2 9f jmp 0x33f64 ; 0x33f64 760c: 0d 94 a7 3c jmp 0x2794e ; 0x2794e 7610: 0c 94 08 d9 jmp 0x1b210 ; 0x1b210 7614: 0d 94 da 0a jmp 0x215b4 ; 0x215b4 7618: 0d 94 b9 07 jmp 0x20f72 ; 0x20f72 761c: 0d 94 fe 66 jmp 0x2cdfc ; 0x2cdfc 7620: 0c 94 fe df jmp 0x1bffc ; 0x1bffc 7624: 0c 94 ed cf jmp 0x19fda ; 0x19fda 7628: 0d 94 5d 69 jmp 0x2d2ba ; 0x2d2ba 762c: 0c 94 20 d4 jmp 0x1a840 ; 0x1a840 () [clone .lto_priv.452]> 7630: 0c 94 14 d9 jmp 0x1b228 ; 0x1b228 7634: 0d 94 e7 2c jmp 0x259ce ; 0x259ce 7638: 0c 94 92 d9 jmp 0x1b324 ; 0x1b324 763c: 0d 94 0a 2a jmp 0x25414 ; 0x25414 7640: 0d 94 1d 24 jmp 0x2483a ; 0x2483a 7644: 0c 94 d1 e4 jmp 0x1c9a2 ; 0x1c9a2 7648: 0c 94 59 75 jmp 0xeab2 ; 0xeab2 <__vector_23+0xe2> 764c: 0d 94 de 9f jmp 0x33fbc ; 0x33fbc 7650: 0c 94 ea df jmp 0x1bfd4 ; 0x1bfd4 7654: 0d 94 ce 41 jmp 0x2839c ; 0x2839c 7658: 0c 94 b8 cf jmp 0x19f70 ; 0x19f70 765c: 0d 94 c3 26 jmp 0x24d86 ; 0x24d86 7660: 0d 94 51 66 jmp 0x2cca2 ; 0x2cca2 7664: 0d 94 db 1c jmp 0x239b6 ; 0x239b6 7668: 0d 94 c3 25 jmp 0x24b86 ; 0x24b86 766c: 0d 94 6c 9f jmp 0x33ed8 ; 0x33ed8 7670: 0d 94 20 30 jmp 0x26040 ; 0x26040 7674: 0d 94 de 67 jmp 0x2cfbc ; 0x2cfbc 7678: 0c 94 e7 78 jmp 0xf1ce ; 0xf1ce 767c: 0d 94 2a 0d jmp 0x21a54 ; 0x21a54 7680: 0d 94 b2 26 jmp 0x24d64 ; 0x24d64 7684: 0d 94 70 99 jmp 0x332e0 ; 0x332e0 7688: 0c 94 8a d9 jmp 0x1b314 ; 0x1b314 768c: 0d 94 17 6a jmp 0x2d42e ; 0x2d42e 7690: 0d 94 83 0f jmp 0x21f06 ; 0x21f06 7694: 0c 94 7d d2 jmp 0x1a4fa ; 0x1a4fa 7698: 0d 94 0e 6f jmp 0x2de1c ; 0x2de1c 769c: 0d 94 5a 69 jmp 0x2d2b4 ; 0x2d2b4 76a0: 0d 94 ba 24 jmp 0x24974 ; 0x24974 76a4: 0c 94 50 75 jmp 0xeaa0 ; 0xeaa0 <__vector_23+0xd0> 76a8: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 76ac: 0d 94 c5 69 jmp 0x2d38a ; 0x2d38a 76b0: 0d 94 f4 2c jmp 0x259e8 ; 0x259e8 76b4: 0d 94 c7 66 jmp 0x2cd8e ; 0x2cd8e 76b8: 0d 94 3c 45 jmp 0x28a78 ; 0x28a78 76bc: 0d 94 27 6a jmp 0x2d44e ; 0x2d44e 76c0: 0d 94 64 1e jmp 0x23cc8 ; 0x23cc8 76c4: 0c 94 b2 cf jmp 0x19f64 ; 0x19f64 76c8: 0c 94 6d e0 jmp 0x1c0da ; 0x1c0da 76cc: 0c 94 ab d2 jmp 0x1a556 ; 0x1a556 76d0: 0c 94 8e 75 jmp 0xeb1c ; 0xeb1c <__vector_23+0x14c> 76d4: 0d 94 a6 26 jmp 0x24d4c ; 0x24d4c 76d8: 0c 94 ab d7 jmp 0x1af56 ; 0x1af56 76dc: 0d 94 52 41 jmp 0x282a4 ; 0x282a4 76e0: 0d 94 69 6f jmp 0x2ded2 ; 0x2ded2 76e4: 0d 94 a6 25 jmp 0x24b4c ; 0x24b4c 76e8: 0c 94 59 e0 jmp 0x1c0b2 ; 0x1c0b2 76ec: 0d 94 7a 1d jmp 0x23af4 ; 0x23af4 76f0: 0d 94 81 0e jmp 0x21d02 ; 0x21d02 76f4: 0d 94 fb 41 jmp 0x283f6 ; 0x283f6 76f8: 0d 94 30 0d jmp 0x21a60 ; 0x21a60 76fc: 0c 94 9f d2 jmp 0x1a53e ; 0x1a53e 7700: 0c 94 dd df jmp 0x1bfba ; 0x1bfba 7704: 0c 94 db cf jmp 0x19fb6 ; 0x19fb6 7708: 0c 94 f9 5c jmp 0xb9f2 ; 0xb9f2 770c: 0c 94 45 e0 jmp 0x1c08a ; 0x1c08a 7710: 0d 94 07 27 jmp 0x24e0e ; 0x24e0e 7714: 0c 94 05 d9 jmp 0x1b20a ; 0x1b20a 7718: 0d 94 3f 6a jmp 0x2d47e ; 0x2d47e 771c: 0d 94 ff 69 jmp 0x2d3fe ; 0x2d3fe 7720: 0d 94 e9 31 jmp 0x263d2 ; 0x263d2 7724: 0c 94 b6 d2 jmp 0x1a56c ; 0x1a56c 00007728 <__trampolines_end>: 7728: 6e 61 ori r22, 0x1E ; 30 772a: 6e 00 .word 0x006e ; ???? 0000772c <__c.2228>: 772c: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 773c: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 774c: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 775c: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 776c: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 777c: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 778c: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 779c: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 77ac: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 77bc: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 77cc: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 77dc: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 77ec: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 77fc: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 780c: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 781c: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 0000782a : 782a: 22 00 ". 0000782c : ... 0000782d : 782d: 20 45 53 50 00 ESP. 00007832 : 7832: 20 4e 53 50 00 NSP. 00007837 : 7837: 20 4f 46 46 00 OFF. 0000783c : 783c: 20 4f 4e 00 ON. 00007840 : 7840: 50 56 30 31 00 PV01. 00007845 : 7845: 20 5b 4d 50 5d 20 00 [MP] . 0000784c : 784c: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 785c: 74 65 73 00 tes. 00007860 : 7860: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 0000786b : 786b: 4d 33 31 30 00 M310. 00007870 : 7870: 4d 31 31 32 00 M112. 00007875 : 7875: 4d 31 31 30 00 M110. 0000787a : 787a: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 00007889 : 7889: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 00007899 : 7899: 54 4d 3a 20 73 74 6f 72 65 64 20 63 61 6c 69 62 TM: stored calib 78a9: 72 61 74 69 6f 6e 20 69 6e 76 61 6c 69 64 2c 20 ration invalid, 78b9: 72 65 73 65 74 74 69 6e 67 00 resetting. 000078c3 : 78c3: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 78d3: 72 65 74 72 69 65 76 65 64 00 retrieved. 000078dd : 78dd: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 78ed: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 78fd: 64 00 d. 000078ff : 78ff: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 790f: 00 00 8c 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 791f: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 792f: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 793f: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 794f: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 795f: 00 00 00 00 cd cc cc 3e 3d 0a 81 41 ff 08 43 3e .......>=..A..C> 796f: b0 99 ab 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ...C.B.B.Z4?Lb.E 797f: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 798f: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 c8 42 ......A....?...B 799f: 00 00 c8 42 00 00 40 41 00 00 f0 42 c0 03 00 00 ...B..@A...B.... 79af: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 20 ............... 79bf: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 000079d0 : 79d0: 43 75 73 74 6f 6d 00 Custom. 000079d7 : 79d7: 4e 79 6c 6f 6e 50 41 00 NylonPA. 000079df : 79df: 53 61 74 69 6e 20 20 00 Satin . 000079e7 : 79e7: 54 65 78 74 75 72 00 Textur. 000079ee : 79ee: 53 6d 6f 6f 74 68 00 Smooth. 000079f5 : 79f5: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 7a05: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 7a15: 78 70 65 63 74 65 64 00 xpected. 00007a1d : 7a1d: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 7a2d: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 7a3d: 70 65 63 74 65 64 00 pected. 00007a44 : 7a44: 31 2e 30 00 1.0. 00007a48 : 7a48: 31 2e 35 00 1.5. 00007a4c : 7a4c: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 00007a54 : 7a54: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 7a64: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 00007a71 : 7a71: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 7a81: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 00007a8a <_PRI_LANG_SIGNATURE>: 7a8a: ff ff ff ff .... 00007a8e : 7a8e: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7a9e: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7aae: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7abe: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7ace: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7ade: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7aee: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7afe: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7b0e: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7b1e: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 7b2e: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7b3e: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7b4e: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7b5e: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7b6e: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7b7e: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7b8e: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7b9e: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7bae: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7bbe: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7bce: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7bde: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7bee: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7bfe: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7c0e: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7c4a: 00 40 14 54 .@.T 00007c4e : 7c4e: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7c5e: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007c66 : 7c66: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7c76: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007c7e : 7c7e: 4e 41 4e NAN 00007c81 : 7c81: 49 4e 46 INF 00007c84 : 7c84: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7c94: 20 69 6e 70 75 74 00 input. 00007c9b : 7c9b: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7cab: 20 75 73 65 72 00 user. 00007cb1 : 7cb1: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007cc2 : 7cc2: 00 00 7f 43 00 80 54 43 00 00 52 43 ...C..TC..RC 00007cce : 7cce: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007cda : 7cda: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007ce6 : 7ce6: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00007cf2 : 7cf2: 25 33 64 20 73 74 65 70 3d 25 32 64 20 6d 73 63 %3d step=%2d msc 7d02: 6e 74 3d 25 34 64 0a 00 nt=%4d.. 00007d0a : 7d0a: 00 00 7f 43 00 80 58 43 9a d9 51 43 ...C..XC..QC 00007d16 : 7d16: ff ff ff ... 00007d19 : 7d19: 20 41 3a 00 A:. 00007d1d : 7d1d: 20 50 3a 00 P:. 00007d21 : 7d21: 20 42 40 3a 00 B@:. 00007d26 : 7d26: 20 40 3a 00 @:. 00007d2a : 7d2a: 20 2f 00 /. 00007d2d : 7d2d: 20 54 30 3a 00 T0:. 00007d32 : 7d32: 20 2f 00 /. 00007d35 : 7d35: 20 42 3a 00 B:. 00007d39 : 7d39: 20 2f 00 /. 00007d3c : 7d3c: 54 3a 00 T:. 00007d3f : 7d3f: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7d4f: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7d5f: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007d70 : 7d70: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7d80: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7d90: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 7da0: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007da9 : 7da9: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7db9: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7dc9: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007dd8 : 7dd8: 20 20 00 . 00007ddb : 7ddb: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007dec : 7dec: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7dfc: 20 35 2e 30 66 00 5.0f. 00007e02 : 7e02: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007e0f : 7e0f: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7e1f: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007e2d : 7e2d: 20 45 3a 00 E:. 00007e31 : 7e31: 20 5a 3a 00 Z:. 00007e35 : 7e35: 20 59 3a 00 Y:. 00007e39 : 7e39: 20 45 3a 00 E:. 00007e3d : 7e3d: 20 5a 3a 00 Z:. 00007e41 : 7e41: 20 59 3a 00 Y:. 00007e45 : 7e45: 58 3a 00 X:. 00007e48 : 7e48: 20 2d 3e 20 00 -> . 00007e4d : 7e4d: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007e59 : 7e59: 2c 20 00 , . 00007e5c : 7e5c: 66 73 65 6e 73 6f 72 20 76 30 2e 34 20 69 6e 20 fsensor v0.4 in 7e6c: 66 61 75 6c 74 20 72 61 6e 67 65 20 34 2e 36 2d fault range 4.6- 7e7c: 35 56 20 2d 20 75 6e 63 6f 6e 6e 65 63 74 65 64 5V - unconnected ... 00007e8d : 7e8d: 66 73 65 6e 73 6f 72 20 69 6e 20 66 6f 72 62 69 fsensor in forbi 7e9d: 64 64 65 6e 20 72 61 6e 67 65 20 31 2e 35 2d 33 dden range 1.5-3 7ead: 56 20 2d 20 63 68 65 63 6b 20 73 65 6e 73 6f 72 V - check sensor ... 00007ebe : 7ebe: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7ece: 6f 77 6e 00 own. 00007ed2 : 7ed2: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007eda : 7eda: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7eea: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007ef9 : 7ef9: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7f09: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7f19: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7f29: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007f36 : 7f36: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7f46: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7f56: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007f5f : 7f5f: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007f67 : 7f67: 54 3a 00 T:. 00007f6a : 7f6a: 47 31 20 5a 25 2d 2e 33 66 20 46 25 2d 2e 33 66 G1 Z%-.3f F%-.3f ... 00007f7b : 7f7b: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 00007f8b : 7f8b: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 7f9b: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00007fa5 : 7fa5: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00007fb0 : 7fb0: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 7fc0: 20 72 61 6e 67 65 21 00 range!. 00007fc8 <_sPrinterName>: 7fc8: 4d 4b 33 53 00 MK3S. 00007fcd <_sPrinterMmuName>: 7fcd: 4d 4b 33 53 4d 4d 55 33 00 MK3SMMU3. 00007fd6 <_nPrinterMmuType>: 7fd6: 5e 76 ^v 00007fd8 <_nPrinterType>: 7fd8: 2e 01 .. 00007fda : 7fda: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007fe2 : 7fe2: 25 33 64 00 %3d. 00007fe6 : 7fe6: 20 0a 20 0a 20 0a 20 00 . . . . 00007fee : 7fee: 25 53 53 74 61 74 69 73 74 69 63 73 3a 0a 25 53 %SStatistics:.%S 7ffe: 20 20 4d 37 38 20 53 25 6c 75 20 54 25 6c 75 0a M78 S%lu T%lu. ... 0000800f : 800f: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 801f: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 802f: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 803f: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 804f: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 805f: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 806f: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 807f: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 808f: 0a 00 .. 00008091 : 8091: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 80a1: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 000080b0 : 80b0: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 80c0: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 80d0: 25 2e 32 66 0a 00 %.2f.. 000080d6 : 80d6: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 80e6: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 80f6: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 8106: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 8116: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 8126: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 8136: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 8146: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 8156: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 8166: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 8176: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 8186: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 8196: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 81a6: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 81b6: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 81c6: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 000081d7 : 81d7: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 81e7: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 81f7: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 8207: 2e 32 66 0a 00 .2f.. 0000820c : 820c: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 821c: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 822c: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 00008239 : 8239: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 8249: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 8259: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 8269: 66 0a 25 53 55 53 74 65 70 20 72 65 73 6f 6c 75 f.%SUStep resolu 8279: 74 69 6f 6e 3a 20 0a 25 53 20 4d 33 35 30 20 58 tion: .%S M350 X 8289: 25 64 20 59 25 64 20 5a 25 64 20 45 25 64 0a 25 %d Y%d Z%d E%d.% 8299: 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 72 61 74 SMaximum feedrat 82a9: 65 73 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f es - normal (mm/ 82b9: 73 29 3a 0a 25 53 20 20 4d 32 30 33 20 58 25 2e s):.%S M203 X%. 82c9: 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 2f Y%.2f Z%.2f E 82d9: 25 2e 32 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 %.2f.%SMaximum f 82e9: 65 65 64 72 61 74 65 73 20 2d 20 73 74 65 61 6c eedrates - steal 82f9: 74 68 20 28 6d 6d 2f 73 29 3a 0a 25 53 20 20 4d th (mm/s):.%S M 8309: 32 30 33 20 58 25 2e 32 66 20 59 25 2e 32 66 20 203 X%.2f Y%.2f 8319: 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 4d 61 Z%.2f E%.2f.%SMa 8329: 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 61 74 69 ximum accelerati 8339: 6f 6e 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f on - normal (mm/ 8349: 73 32 29 3a 0a 25 53 20 20 4d 32 30 31 20 58 25 s2):.%S M201 X% 8359: 6c 75 20 59 25 6c 75 20 5a 25 6c 75 20 45 25 6c lu Y%lu Z%lu E%l 8369: 75 0a 25 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 u.%SMaximum acce 8379: 6c 65 72 61 74 69 6f 6e 20 2d 20 73 74 65 61 6c leration - steal 8389: 74 68 20 28 6d 6d 2f 73 32 29 3a 0a 25 53 20 20 th (mm/s2):.%S 8399: 4d 32 30 31 20 58 25 6c 75 20 59 25 6c 75 20 5a M201 X%lu Y%lu Z 83a9: 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 63 65 6c %lu E%lu.%SAccel 83b9: 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 69 6e 74 eration: P=print 83c9: 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 54 3d 74 , R=retract, T=t 83d9: 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 34 20 50 ravel.%S M204 P 83e9: 25 2e 32 66 20 52 25 2e 32 66 20 54 25 2e 32 66 %.2f R%.2f T%.2f 83f9: 0a 25 53 41 64 76 61 6e 63 65 64 20 76 61 72 69 .%SAdvanced vari 8409: 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 66 65 65 ables: S=Min fee 8419: 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 54 3d drate (mm/s), T= 8429: 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 65 64 72 Min travel feedr 8439: 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 3d 6d 69 ate (mm/s), B=mi 8449: 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 20 74 69 nimum segment ti 8459: 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 78 69 6d me (us), X=maxim 8469: 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d 6d 2f 73 um XY jerk (mm/s 8479: 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d 20 5a 20 ), Z=maximum Z 8489: 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 20 45 3d jerk (mm/s), E= 8499: 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 6b 20 28 maximum E jerk ( 84a9: 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 35 20 53 mm/s).%S M205 S 84b9: 25 2e 32 66 20 54 25 2e 32 66 20 42 25 6c 75 20 %.2f T%.2f B%lu 84c9: 58 25 2e 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 X%.2f Y%.2f Z%.2 84d9: 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d 65 20 6f f E%.2f.%SHome o 84e9: 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 53 20 20 ffset (mm):.%S 84f9: 4d 32 30 36 20 58 25 2e 32 66 20 59 25 2e 32 66 M206 X%.2f Y%.2f 8509: 20 5a 25 2e 32 66 0a 00 Z%.2f.. 00008511 : 8511: 54 4d 3a 20 52 5b 25 75 5d 20 65 73 74 69 6d 61 TM: R[%u] estima 8521: 74 65 2e 00 te.. 00008525 : 8525: 54 4d 3a 20 25 53 20 52 20 25 64 43 00 TM: %S R %dC. 00008532 : 8532: 54 4d 3a 20 25 53 20 43 20 65 73 74 2e 00 TM: %S C est.. 00008540 : 8540: 54 4d 3a 20 63 6f 6f 6c 20 64 6f 77 6e 20 3c 25 TM: cool down <% 8550: 64 43 00 dC. 00008553 : 8553: 72 65 66 69 6e 65 00 refine. 0000855a : 855a: 69 6e 69 74 69 61 6c 00 initial. 00008562 : 8562: 54 4d 3a 20 63 61 6c 69 62 72 2e 20 66 61 69 6c TM: calibr. fail 8572: 65 64 21 00 ed!. 00008576 : 8576: 54 4d 3a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 TM: calibration 8586: 73 74 61 72 74 00 start. 0000858c : 858c: 54 4d 3a 20 43 61 6c 2e 20 4e 4f 54 20 49 44 4c TM: Cal. NOT IDL 859c: 45 00 E. 0000859e : 859e: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 000085a9 : 85a9: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 000085b4 : 85b4: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 000085c1 : 85c1: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 85d1: 49 4f 4e 00 ION. 000085d5 : 85d5: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 000085e5 : 85e5: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 000085f5 : ... 000085f6 : 85f6: 33 2e 31 34 2e 31 00 3.14.1. 000085fd : 85fd: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 860d: 20 46 69 6c 65 3a 20 00 File: . 00008615 : 8615: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 00008623 : 8623: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 00008633 : 8633: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 0000863f : 863f: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 0000864f : 864f: 25 33 64 2f 25 33 64 00 %3d/%3d. 00008657 : 8657: 4f 4b 00 OK. 0000865a : 865a: 42 41 44 00 BAD. 0000865e : 865e: 52 41 4d 42 6f 20 46 41 4e 20 00 RAMBo FAN . 00008669 : 8669: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008676 : 8676: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008684 : 8684: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008692 <_ZZ16process_commandsvE3__c__97_>: 8692: 22 28 32 29 00 "(2). 00008697 <_ZZ16process_commandsvE3__c__96_>: 8697: 25 53 3a 20 25 53 0a 00 %S: %S.. 0000869f <_ZZ16process_commandsvE3__c__95_>: 869f: 2c 20 4d 39 30 37 20 45 20 69 67 6e 6f 72 65 64 , M907 E ignored ... 000086b0 <_ZZ16process_commandsvE3__c__94_>: 86b0: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 000086c1 <_ZZ16process_commandsvE3__c__93_>: 86c1: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 000086cb <_ZZ16process_commandsvE3__c__92_>: 86cb: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 000086dc <_ZZ16process_commandsvE3__c__90_>: 86dc: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 86ec: 65 70 2c 20 75 6d 00 ep, um. 000086f3 <_ZZ16process_commandsvE3__c__91_>: 86f3: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 8703: 3a 20 00 : . 00008706 <_ZZ16process_commandsvE3__c__89_>: 8706: 50 3a 00 P:. 00008709 <_ZZ16process_commandsvE3__c__88_>: 8709: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 8719: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 8729: 65 3a 00 e:. 0000872c <_ZZ16process_commandsvE3__c__87_>: 872c: 20 41 00 A. 0000872f <_ZZ16process_commandsvE3__c__86_>: 872f: 20 50 00 P. 00008732 <_ZZ16process_commandsvE3__c__85_>: 8732: 20 42 00 B. 00008735 <_ZZ16process_commandsvE3__c__84_>: 8735: 20 4c 00 L. 00008738 <_ZZ16process_commandsvE3__c__83_>: 8738: 20 52 00 R. 0000873b <_ZZ16process_commandsvE3__c__82_>: 873b: 20 5a 00 Z. 0000873e <_ZZ16process_commandsvE3__c__81_>: 873e: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 0000874f <_ZZ16process_commandsvE3__c__80_>: 874f: 53 68 65 65 74 20 00 Sheet . 00008756 <_ZZ16process_commandsvE3__c__79_>: 8756: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 8766: 52 41 4e 47 45 00 RANGE. 0000876c <_ZZ16process_commandsvE3__c__78_>: 876c: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 877c: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 0000878b <_ZZ16process_commandsvE3__c__77_>: 878b: 41 55 54 4f 00 AUTO. 00008790 <_ZZ16process_commandsvE3__c__76_>: 8790: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 000087a0 <_ZZ16process_commandsvE3__c__75_>: 87a0: 4d 32 35 36 20 42 25 64 20 44 25 64 20 53 25 64 M256 B%d D%d S%d 87b0: 20 54 25 75 0a 00 T%u.. 000087b6 <_ZZ16process_commandsvE3__c__74_>: 87b6: 20 64 3a 00 d:. 000087ba <_ZZ16process_commandsvE3__c__73_>: 87ba: 20 69 3a 00 i:. 000087be <_ZZ16process_commandsvE3__c__72_>: 87be: 20 70 3a 00 p:. 000087c2 <_ZZ16process_commandsvE3__c__71_>: 87c2: 20 64 3a 00 d:. 000087c6 <_ZZ16process_commandsvE3__c__70_>: 87c6: 20 69 3a 00 i:. 000087ca <_ZZ16process_commandsvE3__c__69_>: 87ca: 20 70 3a 00 p:. 000087ce <_ZZ16process_commandsvE3__c__68_>: 87ce: 25 69 25 25 0a 00 %i%%.. 000087d4 <_ZZ16process_commandsvE3__c__67_>: 87d4: 25 69 25 25 0a 00 %i%%.. 000087da <_ZZ16process_commandsvE3__c__66_>: 87da: 22 28 31 29 00 "(1). 000087df <_ZZ16process_commandsvE3__c__59_>: 87df: 2f 2f 00 //. 000087e2 <_ZZ16process_commandsvE3__c__58_>: ... 000087e3 <_ZZ16process_commandsvE3__c__57_>: 87e3: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 87f3: 31 00 1. 000087f5 <_ZZ16process_commandsvE3__c__56_>: 87f5: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 00008804 <_ZZ16process_commandsvE3__c__55_>: 8804: 31 2e 30 00 1.0. 00008808 <_ZZ16process_commandsvE3__c__54_>: 8808: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 8818: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 8828: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 8838: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 8848: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 8858: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 00008862 <_ZZ16process_commandsvE3__c__53_>: 8862: 37 37 33 31 30 32 34 65 64 00 7731024ed. 0000886c <_ZZ16process_commandsvE3__c__52_>: 886c: 5f 00 _. 0000886e <_ZZ16process_commandsvE3__c__51_>: 886e: 38 32 37 39 00 8279. 00008873 <_ZZ16process_commandsvE3__c__50_>: 8873: 2b 00 +. 00008875 <_ZZ16process_commandsvE3__c__49_>: 8875: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 8885: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 00008893 <_ZZ16process_commandsvE3__c__48_>: 8893: 4d 31 31 33 20 53 00 M113 S. 0000889a <_ZZ16process_commandsvE3__c__47_>: 889a: 6f 6b 20 00 ok . 0000889e <_ZZ16process_commandsvE3__c__41_>: 889e: 6e 2f 61 00 n/a. 000088a2 <_ZZ16process_commandsvE3__c__40_>: 88a2: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 88b2: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 000088c2 : 88c2: 00 01 25 31 1d 0c 40 24 30 1c 0b 45 23 2f 1b 0a ..%1..@$0..E#/.. 88d2: 17 ff 04 06 22 2b 1a 03 36 37 35 38 ...."+..6758 000088de <_ZZ16process_commandsvE3__c__39_>: 88de: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 000088ed <_ZZ16process_commandsvE3__c__36_>: 88ed: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 88fd: 25 73 0a 00 %s.. 00008901 <_ZZ16process_commandsvE3__c__30_>: 8901: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 8911: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 0000891f <_ZZ16process_commandsvE3__c__29_>: 891f: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 892f: 74 6f 72 00 tor. 00008933 <_ZZ16process_commandsvE3__c__25_>: 8933: 73 65 74 00 set. 00008937 <_ZZ16process_commandsvE3__c__24_>: 8937: 6e 6f 7a 7a 6c 65 00 nozzle. 0000893e <_ZZ16process_commandsvE3__c__23_>: 893e: 4d 42 4c 00 MBL. 00008942 <_ZZ16process_commandsvE3__c__22_>: 8942: 46 52 00 FR. 00008945 <_ZZ16process_commandsvE3__c__21_>: 8945: 4c 7a 00 Lz. 00008948 <_ZZ16process_commandsvE3__c__20_>: 8948: 4c 61 6e 67 00 Lang. 0000894d <_ZZ16process_commandsvE3__c__19_>: 894d: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 2d 45 49 4e 53 1_75mm_MK3S-EINS 895d: 79 5f 31 30 61 2d 45 33 44 76 36 66 75 6c 6c 00 y_10a-E3Dv6full. 0000896d <_ZZ16process_commandsvE3__c__18_>: 896d: 52 65 76 00 Rev. 00008971 <_ZZ16process_commandsvE3__c__17_>: 8971: 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 0000897d <_ZZ16process_commandsvE3__c__16_>: 897d: 46 69 72 00 Fir. 00008981 <_ZZ16process_commandsvE3__c__15_>: 8981: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 0000898c <_ZZ16process_commandsvE3__c__14_>: 898c: 53 4e 00 SN. 0000898f <_ZZ16process_commandsvE3__c__13_>: 898f: 52 45 53 45 54 00 RESET. 00008995 <_ZZ16process_commandsvE3__c__12_>: 8995: 4d 4d 55 52 45 53 00 MMURES. 0000899c <_ZZ16process_commandsvE3__c__11_>: 899c: 75 76 6c 6f 00 uvlo. 000089a1 : 89a1: 46 41 4e 00 FAN. 000089a5 : 89a5: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 000089af : 89af: 50 52 55 53 41 00 PRUSA. 000089b5 : 89b5: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 000089bf : 89bf: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 000089c9 : 89c9: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 000089d3 : 89d3: 54 4d 43 5f 00 TMC_. 000089d8 : 89d8: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 000089e5 : 89e5: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 000089f3 : 89f3: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 00008a02 : 8a02: 43 52 41 53 48 5f 00 CRASH_. 00008a09 : 8a09: 4d 31 30 34 53 30 00 M104S0. 00008a10 : 8a10: 47 31 58 31 30 59 31 38 30 46 34 30 30 30 00 G1X10Y180F4000. 00008a1f : 8a1f: 47 31 5a 31 30 46 31 33 30 30 00 G1Z10F1300. 00008a2a : 8a2a: 4d 31 34 30 53 30 00 M140S0. 00008a31 : 8a31: 47 31 45 2d 30 2e 30 37 35 46 32 31 30 30 00 G1E-0.075F2100. 00008a40 : 8a40: 4d 32 30 34 53 31 30 30 30 00 M204S1000. 00008a4a : 8a4a: 47 31 5a 35 46 37 32 30 30 00 G1Z5F7200. 00008a54 : 8a54: 47 31 45 2d 31 2e 35 46 32 31 30 30 00 G1E-1.5F2100. 00008a61 : 8a61: 47 31 5a 30 2e 32 00 G1Z0.2. 00008a68 : 8a68: 47 31 58 32 30 32 2e 35 45 38 46 31 34 30 30 00 G1X202.5E8F1400. 00008a78 : 8a78: 47 31 59 2d 32 46 31 30 30 30 00 G1Y-2F1000. 00008a83 : 8a83: 47 31 58 32 34 30 45 32 35 46 32 32 30 30 00 G1X240E25F2200. 00008a92 : 8a92: 47 31 5a 30 2e 33 46 31 30 30 30 00 G1Z0.3F1000. 00008a9e : 8a9e: 47 31 58 35 35 45 38 46 32 30 30 30 00 G1X55E8F2000. 00008aab : 8aab: 47 31 58 35 45 32 39 46 31 38 30 30 00 G1X5E29F1800. 00008ab8 : 8ab8: 47 31 58 35 35 45 32 39 46 31 30 37 33 00 G1X55E29F1073. 00008ac6 : 8ac6: 47 39 32 45 30 00 G92E0. 00008acc : 8acc: 47 32 38 00 G28. 00008ad0 : 8ad0: 4d 31 30 39 00 M109. 00008ad5 : 8ad5: 4d 31 39 30 00 M190. 00008ada : 8ada: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 8aea: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 8afa: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 8b0a: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 8b1a: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 8b2a: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 8b3a: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 8b4a: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 00008b5a : 8b5a: 4d 34 34 00 M44. 00008b5e : 8b5e: 47 32 38 20 58 59 00 G28 XY. 00008b65 : 8b65: 4d 20 38 34 00 M 84. 00008b6a : 8b6a: 85 2e 2e 00 .... 00008b6e : 8b6e: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008b7b : 8b7b: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 00008b88 : 8b88: 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f 72 20 Filament sensor 8b98: 62 6f 61 72 64 20 63 68 61 6e 67 65 20 64 65 74 board change det 8ba8: 65 63 74 65 64 3a 20 72 65 76 69 73 69 6f 6e 25 ected: revision% 8bb8: 53 0a 00 S.. 00008bbb : 8bbb: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8bcb: 74 20 73 65 6e 73 6f 72 20 6c 6f 77 20 6c 65 76 t sensor low lev 8bdb: 65 6c 3a 20 25 34 2e 32 66 56 0a 00 el: %4.2fV.. 00008be7 : 8be7: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8bf7: 74 20 73 65 6e 73 6f 72 20 68 69 67 68 20 6c 65 t sensor high le 8c07: 76 65 6c 3a 20 25 34 2e 32 66 56 0a 00 vel: %4.2fV.. 00008c14 : 8c14: 25 33 64 2f 30 00 %3d/0. 00008c1a : 8c1a: 25 33 64 2f 30 00 %3d/0. 00008c20 : 8c20: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 00008c30 : 8c30: 48 6f 74 65 6e 64 00 Hotend. 00008c37 : 8c37: 42 65 64 00 Bed. 00008c3b : 8c3b: 5a 00 Z. 00008c3d : 8c3d: 59 00 Y. 00008c3f : 8c3f: 58 00 X. 00008c41 <_ZL13STR_SEPARATOR.lto_priv.457>: 8c41: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8c51: 2d 2d 2d 2d 00 ----. 00008c56 : 8c56: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 8c66: 6c 4e 72 00 lNr. 00008c6a : 8c6a: 19 6b 1d 6b 31 8a 2a 8a 1f 8a 10 8a 52 6c 09 8a .k.k1.*.....Rl.. 8c7a: b1 6b .k 00008c7c : 8c7c: 47 31 59 25 2e 34 66 45 25 2e 34 66 00 G1Y%.4fE%.4f. 00008c89 : 8c89: 47 31 5a 25 2e 32 66 00 G1Z%.2f. 00008c91 : 8c91: 47 31 58 35 30 59 31 35 35 00 G1X50Y155. 00008c9b : 8c9b: c6 8a 19 6b 57 6c 54 8a 4a 8a 40 8a ...kWlT.J.@. 00008ca7 : 8ca7: 47 31 58 25 2e 34 66 45 25 2e 34 66 00 G1X%.4fE%.4f. 00008cb4 : 8cb4: 47 31 46 31 30 38 30 00 G1F1080. 00008cbc : 8cbc: b8 8a ab 8a 9e 8a 92 8a c6 8a 83 8a 78 8a 68 8a ............x.h. 8ccc: 61 8a a. 00008cce : 8cce: 54 25 64 00 T%d. 00008cd2 : 8cd2: 47 31 5a 30 2e 34 00 G1Z0.4. 00008cd9 : 8cd9: 47 31 59 2d 33 46 31 30 30 30 00 G1Y-3F1000. 00008ce4 : 8ce4: 1d 6b d5 8a d0 8a cc 8a c6 8a .k........ 00008cee : 8cee: 4d 38 34 20 58 59 00 M84 XY. 00008cf5 : 8cf5: 4d 31 30 39 20 53 32 38 30 00 M109 S280. 00008cff : 8cff: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8d0f: 30 30 00 00. 00008d12 : 8d12: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008d1c : 8d1c: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8d2c: 46 38 30 30 30 00 F8000. 00008d32 : 8d32: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8d42: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8d52: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008d62 : 8d62: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8d72: 20 44 25 2e 32 66 00 D%.2f. 00008d79 : 8d79: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008d86 : 8d86: 52 43 00 RC. 00008d89 : 8d89: 44 45 56 00 DEV. 00008d8d : 8d8d: 42 45 54 41 00 BETA. 00008d92 : 8d92: 41 4c 50 48 41 00 ALPHA. 00008d98 : 8d98: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8da8: 01 01 00 00 04 01 07 01 0a 01 .......... 00008db2 : 8db2: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8dc2: 02 01 00 00 05 01 08 01 0b 01 .......... 00008dcc : 8dcc: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8ddc: 00 01 00 00 03 01 06 01 09 01 .......... 00008de6 : 8de6: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8df6: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8e06: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8e16: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8e26: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8e36: 05 04 04 04 08 08 ...... 00008e3c : 8e3c: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8e4c: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8e5c: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8e6c: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8e7c: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8e8c: 80 10 20 40 04 80 .. @.. 00008e92 : 8e92: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8ebe: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008ee8 : 8ee8: 33 2e 31 34 2e 31 00 3.14.1. 00008eef : 8eef: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8eff: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8f0f: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008f1d : 8f1d: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 00008f2d : 8f2d: 43 5a 50 58 00 CZPX. 00008f32 : 8f32: 3b 53 00 ;S. 00008f35 : 8f35: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00008f43 : 8f43: 61 64 63 5f 69 6e 69 74 00 adc_init. 00008f4c : 8f4c: 20 0a 20 0a 20 0a 20 00 . . . . 00008f54 : 8f54: 41 6c 6c 20 44 61 74 61 00 All Data. 00008f5d : 8f5d: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008f6a : 8f6a: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008f78 : 8f78: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00008f83 : 8f83: 4c 61 6e 67 75 61 67 65 00 Language. 00008f8c <_ZZL13factory_resetcE3__c.lto_priv.553>: 8f8c: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00008f9d : 8f9d: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008fab : 8fab: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008fb5 <_ZL8MSG_INT4.lto_priv.503>: 8fb5: 49 4e 54 34 00 INT4. 00008fba : 8fba: 03 00 0e 00 01 00 40 00 ......@. 00008fc2 : 8fc2: 03 00 02 00 00 00 04 00 ........ 00008fca <_ZZ5setupE3__c__12_>: 8fca: 4e 4f 43 54 55 41 00 NOCTUA. 00008fd1 <_ZZ5setupE3__c__11_>: 8fd1: 41 4c 54 46 41 4e 00 ALTFAN. 00008fd8 : 8fd8: 70 72 75 73 61 33 64 00 prusa3d. 00008fe0 : 8fe0: 32 30 32 35 2d 30 34 2d 32 32 20 32 32 3a 30 33 2025-04-22 22:03 8ff0: 3a 35 33 00 :53. 00008ff4 : 8ff4: 20 33 2e 31 34 2e 31 2d 38 32 37 39 5f 37 37 33 3.14.1-8279_773 9004: 31 30 32 34 65 64 00 1024ed. 0000900b : 900b: 73 74 61 72 74 00 start. 00009011 : 9011: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 00009022 : 9022: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 0000902d : 902d: 43 5a 50 58 00 CZPX. 00009032 : 9032: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 00009043 : 9043: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 00009053 : 9053: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 00009063 : 9063: 4d 32 39 00 M29. 00009067 : 9067: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 0000906f : 906f: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 907f: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 0000908e : 908e: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 909e: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 000090a8 : 90a8: 33 33 29 42 00 00 58 41 9a 99 8d 41 33 33 53 40 33)B..XA...A33S@ 000090b8 : 90b8: 20 0a 20 0a 20 00 . . . 000090be : 90be: 4d 4d 55 32 3a 00 MMU2:. 000090c4 : 90c4: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 000090d5 : 90d5: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 90e5: 6e 74 65 72 0a 00 nter.. 000090eb : 90eb: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 90fb: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 910b: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 911b: 20 61 64 3d 25 64 0a 00 ad=%d.. 00009123 : 9123: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 9133: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 9143: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 00009150 : 9150: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 9160: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 9170: 25 64 0a 00 %d.. 00009174 : 9174: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 9184: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 9194: 0a 00 .. 00009196 : 9196: 25 30 32 78 00 %02x. 0000919b : 919b: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 91ab: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 000091b7 : 91b7: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 91c7: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 000091d3 : 91d3: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 91e3: fc 03 f8 01 f0 00 00 00 ........ 000091eb : 91eb: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 91fb: f8 01 f0 00 00 00 00 00 ........ 00009203 : 9203: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 9213: 65 61 76 65 0a 00 eave.. 00009219 : 9219: 20 3c 20 00 < . 0000921d : 921d: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 922d: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 923d: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 924d: 3a 00 :. 0000924f : ... 00009250 : 9250: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ 9260: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 00009270 : 9270: 25 64 2f 34 00 %d/4. 00009275 : 9275: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 00009281 : 9281: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 9291: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 92a1: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 92b1: 2e 00 .. 000092b3 : 92b3: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 92c3: 64 00 d. 000092c5 : 92c5: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 92d5: 69 78 65 64 00 ixed. 000092da : 92da: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 92ea: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 92fa: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 930a: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 931a: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 932a: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 933a: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 934a: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 935a: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 936a: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 937a: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 938a: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 939a: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 93aa: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 93ba: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 93ca: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 93da: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 93ea: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 93fa: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 940a: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 941a: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 942a: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 943a: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 944a: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 945a: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 946a: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 947a: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 948a: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 949a: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 94aa: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 94ba: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 94ca: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 94da: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 94ea: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 94fa: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 950a: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 951a: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 952a: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 953a: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 954a: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 955a: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 956a: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 957a: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 958a: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 959a: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 95aa: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 95ba: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 95ca: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 95da: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 95ea: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 95fa: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 960a: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 961a: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 962a: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 963a: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 964a: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 965a: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 966a: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 967a: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 968a: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 969a: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 96aa: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 96ba: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 96ca: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 000096da : 96da: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 96ea: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 96fa: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 970a: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 971a: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 972a: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 973a: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 974a: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 975a: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 976a: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 977a: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 978a: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 979a: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 97aa: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 97ba: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 97ca: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 97da: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 97ea: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 97fa: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 980a: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 981a: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 982a: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 983a: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 984a: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 985a: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 986a: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 987a: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 988a: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 989a: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 98aa: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 98ba: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 98ca: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 98da: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 98ea: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 98fa: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 990a: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 991a: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 992a: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 993a: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 994a: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 995a: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 996a: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 997a: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 998a: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 999a: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 99aa: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 99ba: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 99ca: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 99da: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 99ea: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 99fa: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 9a0a: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 9a1a: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 9a2a: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 9a3a: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9a4a: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9a5a: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9a6a: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9a7a: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9a8a: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9a9a: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9aaa: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9aba: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9aca: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009ada <_ZZ12PID_autotunefiiE3__c__16_>: 9ada: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9aea: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9afa: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9b0a: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9b1a: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9b2a: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009b36 <_ZZ12PID_autotunefiiE3__c__15_>: 9b36: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b46: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009b53 <_ZZ12PID_autotunefiiE3__c__14_>: 9b53: 20 40 3a 00 @:. 00009b57 <_ZZ12PID_autotunefiiE3__c__13_>: 9b57: 54 3a 00 T:. 00009b5a <_ZZ12PID_autotunefiiE3__c__12_>: 9b5a: 42 3a 00 B:. 00009b5d <_ZZ12PID_autotunefiiE3__c__11_>: 9b5d: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b6d: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9b7d: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009b87 <_ZZ12PID_autotunefiiE3__c__10_>: 9b87: 20 4b 64 3a 20 00 Kd: . 00009b8d : 9b8d: 20 4b 69 3a 20 00 Ki: . 00009b93 : 9b93: 20 4b 70 3a 20 00 Kp: . 00009b99 : 9b99: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009ba7 : 9ba7: 20 54 75 3a 20 00 Tu: . 00009bad : 9bad: 20 4b 75 3a 20 00 Ku: . 00009bb3 : 9bb3: 20 6d 61 78 3a 20 00 max: . 00009bba : 9bba: 20 6d 69 6e 3a 20 00 min: . 00009bc1 : 9bc1: 20 64 3a 20 00 d: . 00009bc6 : 9bc6: 20 62 69 61 73 3a 20 00 bias: . 00009bce : 9bce: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9bde: 72 74 00 rt. 00009be1 : 9be1: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9bf1: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9c01: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009c0b : 9c0b: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9c1b: 20 25 6c 78 0a 00 %lx.. 00009c21 : 9c21: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009c29 : 9c29: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009c35 : 9c35: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009c41 : 9c41: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009c49 : 9c49: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009c55 : 9c55: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009c61 : 9c61: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9c71: 64 00 d. 00009c73 : 9c73: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9c83: 72 65 64 21 00 red!. 00009c88 : 9c88: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9c98: 66 0a 00 f.. 00009c9b : 9c9b: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9cab: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9cbb: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9ccb: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9cdb: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9ceb: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9cfb: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9d0b: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9d1b: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9d2b: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9d3b: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9d4b: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9d5b: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9d6b: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9d7b: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9d8b: 00 3f 00 00 .?.. 00009d8f : 9d8f: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9d9f: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9daf: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9dbf: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9dcf: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9ddf: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9def: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9dff: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9e0f: f0 3f dd ff f0 3f d8 ff .?...?.. 00009e17 : 9e17: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9e27: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009e2f : 9e2f: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9e3f: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009e48 : 9e48: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009e58 : 9e58: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9e68: 57 41 59 00 WAY. 00009e6c : 9e6c: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e7c: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9e8c: 29 00 ). 00009e8e : 9e8e: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e9e: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9eae: 44 29 00 D). 00009eb1 : 9eb1: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009ebf : 9ebf: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9ecf: 52 00 R. 00009ed1 : 9ed1: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009edd : 9edd: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9eed: 20 6f 66 66 2e 20 00 off. . 00009ef4 : 9ef4: 3a 20 00 : . 00009ef7 : 9ef7: 45 72 72 3a 20 00 Err: . 00009efd : 9efd: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009f0d : 9f0d: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009f1c : 9f1c: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para 9f2c: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e 9f3c: 6e 61 62 6c 65 00 nable. 00009f42 : 9f42: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U 9f52: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f 9f62: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B 9f72: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T 9f82: 25 2e 32 66 0a 00 %.2f.. 00009f88 : 9f88: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. 9f98: 32 66 0a 00 2f.. 00009f9c : 9f9c: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se 9fac: 74 74 69 6e 67 73 3a 00 ttings:. 00009fb4 : 9fb4: 00 00 a4 41 33 33 93 41 9a 99 85 41 33 33 73 41 ...A33.A...A33sA 9fc4: 9a 99 61 41 cd cc 54 41 33 33 4b 41 9a 99 41 41 ..aA..TA33KA..AA 9fd4: 33 33 3b 41 cd cc 34 41 00 00 30 41 cd cc 2c 41 33;A..4A..0A..,A 9fe4: 9a 99 29 41 66 66 26 41 33 33 23 41 9a 99 21 41 ..)Aff&A33#A..!A 00009ff4 : 9ff4: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current a004: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 0000a014 : a014: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 0000a020 : a020: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent a030: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% a040: 30 32 78 29 0a 00 02x).. 0000a046 : a046: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi a056: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom a066: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x a076: 25 30 32 78 0a 00 %02x.. 0000a07c : a07c: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d a08c: 0a 00 .. 0000a08e : a08e: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v a09e: 61 6c 3d 25 32 64 0a 00 al=%2d.. 0000a0a6 : a0a6: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 0000a0b0 : a0b0: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 0000a0c1 : a0c1: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 0000a0d1 <__vector_51::__c>: a0d1: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! a0e1: 21 00 !. 0000a0e3 : a0e3: 3a 20 00 : . 0000a0e6 : a0e6: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 0000a0f4 : a0f4: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000a0fd : a0fd: 20 3a 20 00 : . 0000a101 : a101: 25 33 53 00 %3S. 0000a105 : a105: 25 2d 37 73 00 %-7s. 0000a10a : a10a: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 a11a: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 0000a125 : a125: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a135: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000a144 : a144: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a154: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a164: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a171 : a171: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a181: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a191: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a1a1: 25 2d 33 64 00 %-3d. 0000a1a6 : a1a6: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a1b0 : a1b0: 0a 20 49 52 20 3a 20 20 20 20 20 20 20 25 33 2e . IR : %3. a1c0: 31 66 56 00 1fV. 0000a1c4 : a1c4: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a1d4: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a1e4: 31 66 56 00 1fV. 0000a1e8 : a1e8: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a1f7 : a1f7: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a203 <_ZZL16lcd_support_menuvE3__c__16_>: a203: 20 00 . 0000a205 <_ZZL16lcd_support_menuvE3__c__15_>: a205: 20 00 . 0000a207 <_ZZL16lcd_support_menuvE3__c__14_>: a207: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a217: 3a 00 :. 0000a219 <_ZZL16lcd_support_menuvE3__c__13_>: a219: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a228 <_ZZL16lcd_support_menuvE3__c__12_>: a228: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a231 <_ZZL16lcd_support_menuvE3__c__11_>: a231: 20 46 57 3a 00 FW:. 0000a236 <_ZZL16lcd_support_menuvE3__c__10_>: a236: 46 69 6c 2e 20 73 65 6e 73 6f 72 20 76 2e 3a 00 Fil. sensor v.:. 0000a246 : a246: 32 30 32 35 2d 30 34 2d 32 32 00 2025-04-22. 0000a251 : a251: 45 33 44 76 36 66 75 6c 6c 00 E3Dv6full. 0000a25b : a25b: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a265 : a265: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 00 1_75mm_MK3S. 0000a271 : a271: 20 48 61 73 68 3a 37 37 33 31 30 32 34 65 64 00 Hash:7731024ed. 0000a281 : a281: 20 52 65 70 6f 3a 70 72 75 73 61 33 64 00 Repo:prusa3d. 0000a28f : a28f: 20 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 0000a29c : a29c: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a2a6 : a2a6: 3e 00 >. 0000a2a8 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a2a8: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a2b7 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a2b7: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a2c3 <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a2c3: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a2d3 <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a2d3: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a2df <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a2df: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a2ef <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a2ef: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a2fb <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a2fb: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a30b <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a30b: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a317 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a317: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a326 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a326: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a332 <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a332: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a341 : a341: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a34d : a34d: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a35d : a35d: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a369 : a369: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a379 : a379: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a385 : a385: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a394 : a394: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a3a0 : a3a0: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a3af : a3af: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a3bb : a3bb: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a3ca : a3ca: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a3d4 : a3d4: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a3df : a3df: 58 3a 00 X:. 0000a3e2 : a3e2: 59 3a 00 Y:. 0000a3e5 : a3e5: 5a 3a 00 Z:. 0000a3e8 : a3e8: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a3f9 : a3f9: 25 33 75 00 %3u. 0000a3fd : a3fd: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a40d: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a41d: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a42d: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a438 : a438: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a448: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a458: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a468: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a471 : a471: 47 38 30 00 G80. 0000a475 : a475: 4d 34 35 00 M45. 0000a479 : a479: 4d 34 35 20 5a 00 M45 Z. 0000a47f : a47f: 47 37 36 00 G76. 0000a483 : a483: 4d 37 30 31 20 50 30 00 M701 P0. 0000a48b : a48b: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d a49b: 0a 00 .. 0000a49d : a49d: 4d 39 31 34 00 M914. 0000a4a2 : a4a2: 4d 39 31 35 00 M915. 0000a4a7 : a4a7: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 0000a4b4 : a4b4: 46 73 65 6e 73 6f 72 20 44 65 74 65 63 74 69 6f Fsensor Detectio a4c4: 6e 00 n. 0000a4c6 : a4c6: 30 2e 38 30 00 0.80. 0000a4cb : a4cb: 30 2e 36 30 00 0.60. 0000a4d0 : a4d0: 30 2e 34 30 00 0.40. 0000a4d5 : a4d5: 30 2e 32 35 00 0.25. 0000a4da : a4da: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 0000a4e4 : a4e4: 4d 4d 55 00 MMU. 0000a4e8 : a4e8: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a4f8: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a508: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a518: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a520 <_ZL4endl.lto_priv.390>: a520: 0a 00 .. 0000a522 : a522: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a531 : a531: 25 64 0a 00 %d.. 0000a535 : a535: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a546 : a546: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a556: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a566: 25 25 0a 00 %%.. 0000a56a : a56a: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a57a: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a586 : a586: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a596: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a5a6 <_ZL16ramming_sequence.lto_priv.395>: a5a6: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a5b6: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a5c6: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a5d6: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a5e6: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a5f6: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a606: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a616: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a626: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a636 <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.393>: a636: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a646: 74 73 00 ts. 0000a649 : a649: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a659: 6f 70 70 65 64 00 opped. 0000a65f : a65f: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a66f : a66f: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a67f: 73 74 61 72 74 65 64 00 started. 0000a687 : a687: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a697: 6e 67 00 ng. 0000a69a : a69a: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a6aa: 70 65 6e 64 69 6e 67 00 pending. 0000a6b2 : a6b2: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a6bf : a6bf: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a6c9 <_ZL9mmu2Magic.lto_priv.374>: a6c9: 4d 4d 55 32 3a 00 MMU2:. 0000a6cf : a6cf: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a6df: 20 00 . 0000a6e1 : a6e1: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a6f1: 6e 65 64 00 ned. 0000a6f5 : a6f5: 1d 5a 0c 5a f8 59 e3 59 cd 59 ba 59 a4 59 90 59 .Z.Z.Y.Y.Y.Y.Y.Y a705: 7f 59 69 59 f8 59 0c 5a 55 59 46 59 32 59 21 59 .YiY.Y.ZUYFY2Y!Y a715: 0c 59 b0 5c f6 58 e4 58 d1 58 c0 58 ab 58 98 58 .Y.\.X.X.X.X.X.X a725: 84 58 6f 58 66 58 54 58 3f 58 .XoXfXTX?X 0000a72f : a72f: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a739 : a739: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a749: 75 6e 6f 75 74 21 00 unout!. 0000a750 : a750: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a760: 6d 65 6f 75 74 00 meout. 0000a766 : a766: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a775 : a775: 03 00 03 ... 0000a778 : a778: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a789 : a789: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a797 : a797: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a7a8 : a7a8: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a7b8: 64 00 d. 0000a7ba : a7ba: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a7ca: 65 64 00 ed. 0000a7cd <_ZN4MMU2L11errorTitlesE.lto_priv.510>: a7cd: 7a 5c 65 5c 4e 5c 39 5c 24 5c 10 5c 00 5c e9 5b z\e\N\9\$\.\.\.[ a7dd: d2 5b bb 5b a7 5b 93 5b 7d 5b 7d 5b 7d 5b 68 5b .[.[.[.[}[}[}[h[ a7ed: 68 5b 68 5b 55 5b 55 5b 55 5b 42 5b 42 5b 42 5b h[h[U[U[U[B[B[B[ a7fd: 2b 5b 2b 5b 2b 5b 16 5b 16 5b 16 5b 00 5b 00 5b +[+[+[.[.[.[.[.[ a80d: 00 5b f0 5a db 5a c5 5a af 5a a0 5a 93 5a 7c 5a .[.Z.Z.Z.Z.Z.Z|Z a81d: 69 5a 57 5a 44 5a 32 5a 22 5a iZWZDZ2Z"Z 0000a827 : a827: 42 75 74 74 6f 6e 00 Button. 0000a82e : a82e: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a83e: 74 6e 4c 4d 52 20 00 tnLMR . 0000a845 <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.509>: a845: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a855: 20 20 20 81 00 .. 0000a85a : a85a: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a86a: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a875 : a875: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a883 : a883: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl a893: 65 61 72 65 64 00 eared. 0000a899 : a899: 20 57 3a 00 W:. 0000a89d : a89d: 20 45 3a 00 E:. 0000a8a1 : a8a1: 54 3a 00 T:. 0000a8a4 : a8a4: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000a8b5 : a8b5: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000a8c2 : a8c2: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000a8d0 : a8d0: 20 53 69 7a 65 3a 20 00 Size: . 0000a8d8 : a8d8: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000a8e6 : a8e6: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000a8f7 : a8f7: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000a908 : a908: 22 20 70 6f 73 00 " pos. 0000a90e : a90e: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000a919 : a919: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL a929: 74 61 72 67 65 74 3a 22 00 target:". 0000a932 : a932: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s a942: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w a952: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev a962: 65 6c 73 2e 00 els.. 0000a967 : a967: 20 22 25 73 22 00 "%s". 0000a96d : a96d: 20 25 23 6c 78 00 %#lx. 0000a973 : a973: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000a97c : a97c: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% a98c: 73 22 0a 00 s".. 0000a990 : a990: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000a999 : a999: 04 1a .. 0000a99b : a99b: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt a9ab: 74 65 6d 70 74 73 00 tempts. 0000a9b2 : a9b2: 08 1b 1c ... 0000a9b5 : a9b5: 0b 14 .. 0000a9b7 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.394>: a9b7: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000a9c6 : a9c6: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000a9d5 <_ZL10bufferFull.lto_priv.572>: a9d5: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer a9e5: 20 66 75 6c 6c 21 00 full!. 0000a9ec : a9ec: 45 72 72 6f 72 3a 00 Error:. 0000a9f3 : a9f3: 22 00 ". 0000a9f5 : a9f5: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the aa05: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000aa0e <_ZL9mmu2Magic.lto_priv.375>: aa0e: 4d 4d 55 32 3a 00 MMU2:. 0000aa14 : aa14: 65 63 68 6f 3a 00 echo:. 0000aa1a : aa1a: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000aa22 : aa22: 4d 4d 55 20 69 73 20 00 MMU is . 0000aa2a : aa2a: 25 2e 31 30 53 20 00 %.10S . 0000aa31 : aa31: 25 34 64 00 %4d. 0000aa35 : aa35: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t aa45: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000aa52 : aa52: 25 64 2f 39 00 %d/9. 0000aa57 : aa57: 4d 4d 55 32 3a 00 MMU2:. 0000aa5d : aa5d: 25 33 64 00 %3d. 0000aa61 : aa61: 18 01 04 19 02 0a ...... 0000aa67 : aa67: 65 64 ef 63 75 63 08 63 bf 62 2d 62 b5 61 4d 61 ed.cuc.c.b-b.aMa aa77: fe 60 de 60 92 60 de 60 7b 60 7b 60 7b 60 7b 60 .`.`.`.`{`{`{`{` aa87: 7b 60 7b 60 7b 60 7b 60 7b 60 7b 60 7b 60 7b 60 {`{`{`{`{`{`{`{` aa97: 7b 60 7b 60 7b 60 7b 60 7b 60 7b 60 7b 60 7b 60 {`{`{`{`{`{`{`{` aaa7: 7b 60 7b 60 44 60 03 60 b9 5f 46 5f 11 5f c7 5e {`{`D`.`._F_._.^ aab7: 7d 5e 1f 5e e6 5d a4 5d 87 5d }^.^.].].] 0000aac1 : aac1: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. aad1: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ aae1: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000aaee : aaee: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. aafe: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... ab0e: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. ab1e: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. ab2e: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. ab3e: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000ab48 : ab48: f2 64 5b 65 e7 64 de 64 d7 64 19 4c 58 3c d0 64 .d[e.d.d.d.LX<.d ab58: c6 64 .d 0000ab5a : ab5a: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ab6a: 34 25 68 75 00 4%hu. 0000ab6f : ab6f: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ab7f: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ab8f: 6e 65 63 74 21 00 nect!. 0000ab95 : ab95: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000aba3 : aba3: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000abb3 : abb3: 73 74 61 72 74 0a 00 start.. 0000abba : abba: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ abca: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe abda: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial abea: 20 00 . 0000abec <_ZZL25restore_print_from_eeprombE3__c__12_>: abec: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 0000abf7 <_ZZL25restore_print_from_eeprombE3__c__11_>: abf7: 47 34 20 53 30 00 G4 S0. 0000abfd <_ZZL25restore_print_from_eeprombE3__c__10_>: abfd: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 0000ac07 : ac07: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 0000ac10 : ac10: 4d 31 30 36 20 53 25 75 00 M106 S%u. 0000ac19 : ac19: 47 31 20 46 25 64 00 G1 F%d. 0000ac20 : ac20: 4d 38 32 00 M82. 0000ac24 : ac24: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 0000ac2f : ac2f: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. ac3f: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 0000ac49 : ac49: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 0000ac53 : ac53: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 0000ac60 : ac60: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f ac70: 20 46 33 30 30 30 00 F3000. 0000ac77 : ac77: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 0000ac87 : ac87: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 0000ac91 : ac91: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 0000ac9c : ac9c: 4d 31 30 39 20 53 25 64 00 M109 S%d. 0000aca5 : aca5: 4d 31 34 30 20 53 25 64 00 M140 S%d. 0000acae : acae: 4d 31 30 34 20 53 25 64 00 M104 S%d. 0000acb7 : acb7: 47 32 38 20 58 20 59 00 G28 X Y. 0000acbf : acbf: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 0000accd : accd: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p acdd: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... aced: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b acfd: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... ad0d: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T ad1d: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... ad2d: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F ad3d: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... ad4d: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 ad5d: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. ad6d: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* ad7d: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... ad8d: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. ad9d: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. adad: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. adbd: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. adcd: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. addd: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` aded: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. adfd: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr ae0d: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... ae1d: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D ae2d: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. ae3d: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V ae4d: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... ae5d: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( ae6d: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... ae7d: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: ae8d: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... ae9d: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... aead: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... aebd: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 0000aecd : aecd: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 0000aed6 <__ctors_start>: aed6: 46 3a cpi r20, 0xA6 ; 166 0000aed8 <__ctors_end>: aed8: 3b 65 ori r19, 0x5B ; 91 0000aeda <__dtors_end>: aeda: 11 24 eor r1, r1 aedc: 1f be out 0x3f, r1 ; 63 aede: cf ef ldi r28, 0xFF ; 255 aee0: d1 e2 ldi r29, 0x21 ; 33 aee2: de bf out 0x3e, r29 ; 62 aee4: cd bf out 0x3d, r28 ; 61 aee6: 00 e0 ldi r16, 0x00 ; 0 aee8: 0c bf out 0x3c, r16 ; 60 0000aeea <__do_copy_data>: aeea: 13 e0 ldi r17, 0x03 ; 3 aeec: a0 e0 ldi r26, 0x00 ; 0 aeee: b2 e0 ldi r27, 0x02 ; 2 aef0: e4 e2 ldi r30, 0x24 ; 36 aef2: f8 ec ldi r31, 0xC8 ; 200 aef4: 03 e0 ldi r16, 0x03 ; 3 aef6: 0b bf out 0x3b, r16 ; 59 aef8: 02 c0 rjmp .+4 ; 0xaefe <__do_copy_data+0x14> aefa: 07 90 elpm r0, Z+ aefc: 0d 92 st X+, r0 aefe: a2 32 cpi r26, 0x22 ; 34 af00: b1 07 cpc r27, r17 af02: d9 f7 brne .-10 ; 0xaefa <__do_copy_data+0x10> 0000af04 <__do_clear_bss>: af04: 28 e1 ldi r18, 0x18 ; 24 af06: a2 e2 ldi r26, 0x22 ; 34 af08: b3 e0 ldi r27, 0x03 ; 3 af0a: 01 c0 rjmp .+2 ; 0xaf0e <.do_clear_bss_start> 0000af0c <.do_clear_bss_loop>: af0c: 1d 92 st X+, r1 0000af0e <.do_clear_bss_start>: af0e: a6 31 cpi r26, 0x16 ; 22 af10: b2 07 cpc r27, r18 af12: e1 f7 brne .-8 ; 0xaf0c <.do_clear_bss_loop> 0000af14 <__do_global_ctors>: af14: 17 e5 ldi r17, 0x57 ; 87 af16: cc e6 ldi r28, 0x6C ; 108 af18: d7 e5 ldi r29, 0x57 ; 87 af1a: 00 e0 ldi r16, 0x00 ; 0 af1c: 06 c0 rjmp .+12 ; 0xaf2a <__do_global_ctors+0x16> af1e: 21 97 sbiw r28, 0x01 ; 1 af20: 01 09 sbc r16, r1 af22: 80 2f mov r24, r16 af24: fe 01 movw r30, r28 af26: 0f 94 56 de call 0x3bcac ; 0x3bcac <__tablejump2__> af2a: cb 36 cpi r28, 0x6B ; 107 af2c: d1 07 cpc r29, r17 af2e: 80 e0 ldi r24, 0x00 ; 0 af30: 08 07 cpc r16, r24 af32: a9 f7 brne .-22 ; 0xaf1e <__do_global_ctors+0xa> af34: 0e 94 ba f9 call 0x1f374 ; 0x1f374
af38: 0d 94 00 e4 jmp 0x3c800 ; 0x3c800 <__do_global_dtors> 0000af3c <__bad_interrupt>: af3c: 0c 94 31 68 jmp 0xd062 ; 0xd062 <__vector_default> 0000af40 : af40: 2f 92 push r2 af42: 3f 92 push r3 af44: 4f 92 push r4 af46: 5f 92 push r5 af48: 6f 92 push r6 af4a: 7f 92 push r7 af4c: 8f 92 push r8 af4e: 9f 92 push r9 af50: af 92 push r10 af52: bf 92 push r11 af54: cf 92 push r12 af56: df 92 push r13 af58: ef 92 push r14 af5a: ff 92 push r15 af5c: 0f 93 push r16 af5e: 1f 93 push r17 af60: cf 93 push r28 af62: df 93 push r29 af64: cd b7 in r28, 0x3d ; 61 af66: de b7 in r29, 0x3e ; 62 af68: 2f 97 sbiw r28, 0x0f ; 15 af6a: 0f b6 in r0, 0x3f ; 63 af6c: f8 94 cli af6e: de bf out 0x3e, r29 ; 62 af70: 0f be out 0x3f, r0 ; 63 af72: cd bf out 0x3d, r28 ; 61 af74: 6c 01 movw r12, r24 af76: 1b 01 movw r2, r22 af78: 5a 01 movw r10, r20 af7a: fc 01 movw r30, r24 af7c: 17 82 std Z+7, r1 ; 0x07 af7e: 16 82 std Z+6, r1 ; 0x06 af80: 83 81 ldd r24, Z+3 ; 0x03 af82: 9e 01 movw r18, r28 af84: 2f 5f subi r18, 0xFF ; 255 af86: 3f 4f sbci r19, 0xFF ; 255 af88: 49 01 movw r8, r18 af8a: 81 fd sbrc r24, 1 af8c: d2 c0 rjmp .+420 ; 0xb132 af8e: 8f ef ldi r24, 0xFF ; 255 af90: 9f ef ldi r25, 0xFF ; 255 af92: ee c2 rjmp .+1500 ; 0xb570 af94: f1 2c mov r15, r1 af96: 51 2c mov r5, r1 af98: 00 e0 ldi r16, 0x00 ; 0 af9a: 00 32 cpi r16, 0x20 ; 32 af9c: 38 f4 brcc .+14 ; 0xafac af9e: 8b 32 cpi r24, 0x2B ; 43 afa0: 09 f1 breq .+66 ; 0xafe4 afa2: 90 f4 brcc .+36 ; 0xafc8 afa4: 80 32 cpi r24, 0x20 ; 32 afa6: f9 f0 breq .+62 ; 0xafe6 afa8: 83 32 cpi r24, 0x23 ; 35 afaa: 09 f1 breq .+66 ; 0xafee afac: 07 fd sbrc r16, 7 afae: 34 c0 rjmp .+104 ; 0xb018 afb0: 20 ed ldi r18, 0xD0 ; 208 afb2: 28 0f add r18, r24 afb4: 2a 30 cpi r18, 0x0A ; 10 afb6: 20 f5 brcc .+72 ; 0xb000 afb8: 06 ff sbrs r16, 6 afba: 1b c0 rjmp .+54 ; 0xaff2 afbc: fa e0 ldi r31, 0x0A ; 10 afbe: ff 9e mul r15, r31 afc0: 20 0d add r18, r0 afc2: 11 24 eor r1, r1 afc4: f2 2e mov r15, r18 afc6: 05 c0 rjmp .+10 ; 0xafd2 afc8: 8d 32 cpi r24, 0x2D ; 45 afca: 79 f0 breq .+30 ; 0xafea afcc: 80 33 cpi r24, 0x30 ; 48 afce: 71 f7 brne .-36 ; 0xafac afd0: 01 60 ori r16, 0x01 ; 1 afd2: f1 01 movw r30, r2 afd4: 93 fd sbrc r25, 3 afd6: 85 91 lpm r24, Z+ afd8: 93 ff sbrs r25, 3 afda: 81 91 ld r24, Z+ afdc: 1f 01 movw r2, r30 afde: 81 11 cpse r24, r1 afe0: dc cf rjmp .-72 ; 0xaf9a afe2: 1a c0 rjmp .+52 ; 0xb018 afe4: 02 60 ori r16, 0x02 ; 2 afe6: 04 60 ori r16, 0x04 ; 4 afe8: f4 cf rjmp .-24 ; 0xafd2 afea: 08 60 ori r16, 0x08 ; 8 afec: f2 cf rjmp .-28 ; 0xafd2 afee: 00 61 ori r16, 0x10 ; 16 aff0: f0 cf rjmp .-32 ; 0xafd2 aff2: 3a e0 ldi r19, 0x0A ; 10 aff4: 53 9e mul r5, r19 aff6: 20 0d add r18, r0 aff8: 11 24 eor r1, r1 affa: 52 2e mov r5, r18 affc: 00 62 ori r16, 0x20 ; 32 affe: e9 cf rjmp .-46 ; 0xafd2 b000: 8e 32 cpi r24, 0x2E ; 46 b002: 21 f4 brne .+8 ; 0xb00c b004: 06 fd sbrc r16, 6 b006: b1 c2 rjmp .+1378 ; 0xb56a b008: 00 64 ori r16, 0x40 ; 64 b00a: e3 cf rjmp .-58 ; 0xafd2 b00c: 8c 36 cpi r24, 0x6C ; 108 b00e: 11 f4 brne .+4 ; 0xb014 b010: 00 68 ori r16, 0x80 ; 128 b012: df cf rjmp .-66 ; 0xafd2 b014: 88 36 cpi r24, 0x68 ; 104 b016: e9 f2 breq .-70 ; 0xafd2 b018: 9b eb ldi r25, 0xBB ; 187 b01a: 98 0f add r25, r24 b01c: 93 30 cpi r25, 0x03 ; 3 b01e: 08 f0 brcs .+2 ; 0xb022 b020: 5f c0 rjmp .+190 ; 0xb0e0 b022: 00 61 ori r16, 0x10 ; 16 b024: 80 5e subi r24, 0xE0 ; 224 b026: 06 fd sbrc r16, 6 b028: 02 c0 rjmp .+4 ; 0xb02e b02a: 46 e0 ldi r20, 0x06 ; 6 b02c: f4 2e mov r15, r20 b02e: 10 2f mov r17, r16 b030: 1f 73 andi r17, 0x3F ; 63 b032: 85 36 cpi r24, 0x65 ; 101 b034: 09 f0 breq .+2 ; 0xb038 b036: 5b c0 rjmp .+182 ; 0xb0ee b038: 10 64 ori r17, 0x40 ; 64 b03a: 17 ff sbrs r17, 7 b03c: 61 c0 rjmp .+194 ; 0xb100 b03e: 8f 2d mov r24, r15 b040: 9b e3 ldi r25, 0x3B ; 59 b042: 9f 15 cp r25, r15 b044: 08 f4 brcc .+2 ; 0xb048 b046: 8b e3 ldi r24, 0x3B ; 59 b048: 44 24 eor r4, r4 b04a: 43 94 inc r4 b04c: 48 0e add r4, r24 b04e: 27 e0 ldi r18, 0x07 ; 7 b050: 35 01 movw r6, r10 b052: f4 e0 ldi r31, 0x04 ; 4 b054: 6f 0e add r6, r31 b056: 71 1c adc r7, r1 b058: f5 01 movw r30, r10 b05a: 60 81 ld r22, Z b05c: 71 81 ldd r23, Z+1 ; 0x01 b05e: 82 81 ldd r24, Z+2 ; 0x02 b060: 93 81 ldd r25, Z+3 ; 0x03 b062: 04 2d mov r16, r4 b064: a4 01 movw r20, r8 b066: 0f 94 ff d9 call 0x3b3fe ; 0x3b3fe <__ftoa_engine> b06a: 5c 01 movw r10, r24 b06c: f9 81 ldd r31, Y+1 ; 0x01 b06e: fc 87 std Y+12, r31 ; 0x0c b070: f0 ff sbrs r31, 0 b072: 03 c0 rjmp .+6 ; 0xb07a b074: 0d e2 ldi r16, 0x2D ; 45 b076: f3 ff sbrs r31, 3 b078: 07 c0 rjmp .+14 ; 0xb088 b07a: 0b e2 ldi r16, 0x2B ; 43 b07c: 11 fd sbrc r17, 1 b07e: 04 c0 rjmp .+8 ; 0xb088 b080: 01 2f mov r16, r17 b082: 04 70 andi r16, 0x04 ; 4 b084: 12 fd sbrc r17, 2 b086: 00 e2 ldi r16, 0x20 ; 32 b088: 2c 85 ldd r18, Y+12 ; 0x0c b08a: 2c 70 andi r18, 0x0C ; 12 b08c: e2 2e mov r14, r18 b08e: 09 f4 brne .+2 ; 0xb092 b090: 6b c0 rjmp .+214 ; 0xb168 b092: 01 11 cpse r16, r1 b094: d8 c2 rjmp .+1456 ; 0xb646 b096: f3 e0 ldi r31, 0x03 ; 3 b098: e1 2c mov r14, r1 b09a: f5 15 cp r31, r5 b09c: a0 f4 brcc .+40 ; 0xb0c6 b09e: 83 e0 ldi r24, 0x03 ; 3 b0a0: e5 2c mov r14, r5 b0a2: e8 1a sub r14, r24 b0a4: 13 fd sbrc r17, 3 b0a6: 08 c0 rjmp .+16 ; 0xb0b8 b0a8: b6 01 movw r22, r12 b0aa: 80 e2 ldi r24, 0x20 ; 32 b0ac: 90 e0 ldi r25, 0x00 ; 0 b0ae: 0f 94 ae db call 0x3b75c ; 0x3b75c b0b2: ea 94 dec r14 b0b4: e1 10 cpse r14, r1 b0b6: f8 cf rjmp .-16 ; 0xb0a8 b0b8: 00 23 and r16, r16 b0ba: 29 f0 breq .+10 ; 0xb0c6 b0bc: b6 01 movw r22, r12 b0be: 80 2f mov r24, r16 b0c0: 90 e0 ldi r25, 0x00 ; 0 b0c2: 0f 94 ae db call 0x3b75c ; 0x3b75c b0c6: 3c 85 ldd r19, Y+12 ; 0x0c b0c8: 28 e2 ldi r18, 0x28 ; 40 b0ca: a2 2e mov r10, r18 b0cc: 27 e7 ldi r18, 0x77 ; 119 b0ce: b2 2e mov r11, r18 b0d0: 33 fd sbrc r19, 3 b0d2: 04 c0 rjmp .+8 ; 0xb0dc b0d4: 9c e2 ldi r25, 0x2C ; 44 b0d6: a9 2e mov r10, r25 b0d8: 97 e7 ldi r25, 0x77 ; 119 b0da: b9 2e mov r11, r25 b0dc: 10 71 andi r17, 0x10 ; 16 b0de: 22 c0 rjmp .+68 ; 0xb124 b0e0: 9b e9 ldi r25, 0x9B ; 155 b0e2: 98 0f add r25, r24 b0e4: 93 30 cpi r25, 0x03 ; 3 b0e6: 08 f0 brcs .+2 ; 0xb0ea b0e8: 47 c1 rjmp .+654 ; 0xb378 b0ea: 0f 7e andi r16, 0xEF ; 239 b0ec: 9c cf rjmp .-200 ; 0xb026 b0ee: 86 36 cpi r24, 0x66 ; 102 b0f0: 11 f4 brne .+4 ; 0xb0f6 b0f2: 10 68 ori r17, 0x80 ; 128 b0f4: a2 cf rjmp .-188 ; 0xb03a b0f6: ff 20 and r15, r15 b0f8: 09 f4 brne .+2 ; 0xb0fc b0fa: 9f cf rjmp .-194 ; 0xb03a b0fc: fa 94 dec r15 b0fe: 9d cf rjmp .-198 ; 0xb03a b100: e7 e0 ldi r30, 0x07 ; 7 b102: 2f 2d mov r18, r15 b104: ef 15 cp r30, r15 b106: 18 f4 brcc .+6 ; 0xb10e b108: 27 e0 ldi r18, 0x07 ; 7 b10a: 37 e0 ldi r19, 0x07 ; 7 b10c: f3 2e mov r15, r19 b10e: 41 2c mov r4, r1 b110: 9f cf rjmp .-194 ; 0xb050 b112: 11 11 cpse r17, r1 b114: 80 52 subi r24, 0x20 ; 32 b116: b6 01 movw r22, r12 b118: 90 e0 ldi r25, 0x00 ; 0 b11a: 0f 94 ae db call 0x3b75c ; 0x3b75c b11e: 8f ef ldi r24, 0xFF ; 255 b120: a8 1a sub r10, r24 b122: b8 0a sbc r11, r24 b124: f5 01 movw r30, r10 b126: 84 91 lpm r24, Z b128: 81 11 cpse r24, r1 b12a: f3 cf rjmp .-26 ; 0xb112 b12c: e1 10 cpse r14, r1 b12e: 84 c2 rjmp .+1288 ; 0xb638 b130: 53 01 movw r10, r6 b132: f6 01 movw r30, r12 b134: 93 81 ldd r25, Z+3 ; 0x03 b136: f1 01 movw r30, r2 b138: 93 fd sbrc r25, 3 b13a: 85 91 lpm r24, Z+ b13c: 93 ff sbrs r25, 3 b13e: 81 91 ld r24, Z+ b140: 1f 01 movw r2, r30 b142: 88 23 and r24, r24 b144: 09 f4 brne .+2 ; 0xb148 b146: 11 c2 rjmp .+1058 ; 0xb56a b148: 85 32 cpi r24, 0x25 ; 37 b14a: 41 f4 brne .+16 ; 0xb15c b14c: 93 fd sbrc r25, 3 b14e: 85 91 lpm r24, Z+ b150: 93 ff sbrs r25, 3 b152: 81 91 ld r24, Z+ b154: 1f 01 movw r2, r30 b156: 85 32 cpi r24, 0x25 ; 37 b158: 09 f0 breq .+2 ; 0xb15c b15a: 1c cf rjmp .-456 ; 0xaf94 b15c: b6 01 movw r22, r12 b15e: 90 e0 ldi r25, 0x00 ; 0 b160: 0f 94 ae db call 0x3b75c ; 0x3b75c b164: 35 01 movw r6, r10 b166: e4 cf rjmp .-56 ; 0xb130 b168: 17 ff sbrs r17, 7 b16a: 6f c0 rjmp .+222 ; 0xb24a b16c: 4a 0c add r4, r10 b16e: fc 85 ldd r31, Y+12 ; 0x0c b170: f4 ff sbrs r31, 4 b172: 04 c0 rjmp .+8 ; 0xb17c b174: 8a 81 ldd r24, Y+2 ; 0x02 b176: 81 33 cpi r24, 0x31 ; 49 b178: 09 f4 brne .+2 ; 0xb17c b17a: 4a 94 dec r4 b17c: 14 14 cp r1, r4 b17e: 0c f0 brlt .+2 ; 0xb182 b180: 86 c0 rjmp .+268 ; 0xb28e b182: 28 e0 ldi r18, 0x08 ; 8 b184: 24 15 cp r18, r4 b186: 10 f4 brcc .+4 ; 0xb18c b188: 88 e0 ldi r24, 0x08 ; 8 b18a: 48 2e mov r4, r24 b18c: 85 e0 ldi r24, 0x05 ; 5 b18e: 90 e0 ldi r25, 0x00 ; 0 b190: 17 ff sbrs r17, 7 b192: 06 c0 rjmp .+12 ; 0xb1a0 b194: c5 01 movw r24, r10 b196: b7 fe sbrs r11, 7 b198: 02 c0 rjmp .+4 ; 0xb19e b19a: 90 e0 ldi r25, 0x00 ; 0 b19c: 80 e0 ldi r24, 0x00 ; 0 b19e: 01 96 adiw r24, 0x01 ; 1 b1a0: 01 11 cpse r16, r1 b1a2: 01 96 adiw r24, 0x01 ; 1 b1a4: ff 20 and r15, r15 b1a6: 31 f0 breq .+12 ; 0xb1b4 b1a8: 2f 2d mov r18, r15 b1aa: 30 e0 ldi r19, 0x00 ; 0 b1ac: 2f 5f subi r18, 0xFF ; 255 b1ae: 3f 4f sbci r19, 0xFF ; 255 b1b0: 82 0f add r24, r18 b1b2: 93 1f adc r25, r19 b1b4: 58 16 cp r5, r24 b1b6: 19 06 cpc r1, r25 b1b8: 19 f0 breq .+6 ; 0xb1c0 b1ba: 14 f0 brlt .+4 ; 0xb1c0 b1bc: e5 2c mov r14, r5 b1be: e8 1a sub r14, r24 b1c0: 81 2f mov r24, r17 b1c2: 89 70 andi r24, 0x09 ; 9 b1c4: 11 f4 brne .+4 ; 0xb1ca b1c6: e1 10 cpse r14, r1 b1c8: 67 c0 rjmp .+206 ; 0xb298 b1ca: 00 23 and r16, r16 b1cc: 29 f0 breq .+10 ; 0xb1d8 b1ce: b6 01 movw r22, r12 b1d0: 80 2f mov r24, r16 b1d2: 90 e0 ldi r25, 0x00 ; 0 b1d4: 0f 94 ae db call 0x3b75c ; 0x3b75c b1d8: 13 fd sbrc r17, 3 b1da: 02 c0 rjmp .+4 ; 0xb1e0 b1dc: e1 10 cpse r14, r1 b1de: 63 c0 rjmp .+198 ; 0xb2a6 b1e0: 17 ff sbrs r17, 7 b1e2: 7c c0 rjmp .+248 ; 0xb2dc b1e4: 85 01 movw r16, r10 b1e6: b7 fe sbrs r11, 7 b1e8: 02 c0 rjmp .+4 ; 0xb1ee b1ea: 10 e0 ldi r17, 0x00 ; 0 b1ec: 00 e0 ldi r16, 0x00 ; 0 b1ee: c5 01 movw r24, r10 b1f0: 84 19 sub r24, r4 b1f2: 91 09 sbc r25, r1 b1f4: 2c 01 movw r4, r24 b1f6: 6f 2d mov r22, r15 b1f8: 70 e0 ldi r23, 0x00 ; 0 b1fa: ee 27 eor r30, r30 b1fc: ff 27 eor r31, r31 b1fe: e6 1b sub r30, r22 b200: f7 0b sbc r31, r23 b202: ff 87 std Y+15, r31 ; 0x0f b204: ee 87 std Y+14, r30 ; 0x0e b206: 0f 3f cpi r16, 0xFF ; 255 b208: 10 07 cpc r17, r16 b20a: 29 f4 brne .+10 ; 0xb216 b20c: b6 01 movw r22, r12 b20e: 8e e2 ldi r24, 0x2E ; 46 b210: 90 e0 ldi r25, 0x00 ; 0 b212: 0f 94 ae db call 0x3b75c ; 0x3b75c b216: a0 16 cp r10, r16 b218: b1 06 cpc r11, r17 b21a: 0c f4 brge .+2 ; 0xb21e b21c: 4b c0 rjmp .+150 ; 0xb2b4 b21e: 40 16 cp r4, r16 b220: 51 06 cpc r5, r17 b222: 0c f0 brlt .+2 ; 0xb226 b224: 47 c0 rjmp .+142 ; 0xb2b4 b226: f5 01 movw r30, r10 b228: e0 1b sub r30, r16 b22a: f1 0b sbc r31, r17 b22c: e8 0d add r30, r8 b22e: f9 1d adc r31, r9 b230: 81 81 ldd r24, Z+1 ; 0x01 b232: 01 50 subi r16, 0x01 ; 1 b234: 11 09 sbc r17, r1 b236: 2e 85 ldd r18, Y+14 ; 0x0e b238: 3f 85 ldd r19, Y+15 ; 0x0f b23a: 02 17 cp r16, r18 b23c: 13 07 cpc r17, r19 b23e: e4 f1 brlt .+120 ; 0xb2b8 b240: b6 01 movw r22, r12 b242: 90 e0 ldi r25, 0x00 ; 0 b244: 0f 94 ae db call 0x3b75c ; 0x3b75c b248: de cf rjmp .-68 ; 0xb206 b24a: 16 fd sbrc r17, 6 b24c: 9f cf rjmp .-194 ; 0xb18c b24e: ef 2d mov r30, r15 b250: f0 e0 ldi r31, 0x00 ; 0 b252: ea 15 cp r30, r10 b254: fb 05 cpc r31, r11 b256: 34 f0 brlt .+12 ; 0xb264 b258: 3c ef ldi r19, 0xFC ; 252 b25a: a3 16 cp r10, r19 b25c: 3f ef ldi r19, 0xFF ; 255 b25e: b3 06 cpc r11, r19 b260: 0c f0 brlt .+2 ; 0xb264 b262: 10 68 ori r17, 0x80 ; 128 b264: 32 96 adiw r30, 0x02 ; 2 b266: e8 0d add r30, r8 b268: f9 1d adc r31, r9 b26a: 01 c0 rjmp .+2 ; 0xb26e b26c: fa 94 dec r15 b26e: ff 20 and r15, r15 b270: 19 f0 breq .+6 ; 0xb278 b272: 82 91 ld r24, -Z b274: 80 33 cpi r24, 0x30 ; 48 b276: d1 f3 breq .-12 ; 0xb26c b278: 17 ff sbrs r17, 7 b27a: 88 cf rjmp .-240 ; 0xb18c b27c: 44 24 eor r4, r4 b27e: 43 94 inc r4 b280: 4f 0c add r4, r15 b282: fa 14 cp r15, r10 b284: 1b 04 cpc r1, r11 b286: 31 f0 breq .+12 ; 0xb294 b288: 2c f0 brlt .+10 ; 0xb294 b28a: fa 18 sub r15, r10 b28c: 7f cf rjmp .-258 ; 0xb18c b28e: 44 24 eor r4, r4 b290: 43 94 inc r4 b292: 7c cf rjmp .-264 ; 0xb18c b294: f1 2c mov r15, r1 b296: 7a cf rjmp .-268 ; 0xb18c b298: b6 01 movw r22, r12 b29a: 80 e2 ldi r24, 0x20 ; 32 b29c: 90 e0 ldi r25, 0x00 ; 0 b29e: 0f 94 ae db call 0x3b75c ; 0x3b75c b2a2: ea 94 dec r14 b2a4: 90 cf rjmp .-224 ; 0xb1c6 b2a6: b6 01 movw r22, r12 b2a8: 80 e3 ldi r24, 0x30 ; 48 b2aa: 90 e0 ldi r25, 0x00 ; 0 b2ac: 0f 94 ae db call 0x3b75c ; 0x3b75c b2b0: ea 94 dec r14 b2b2: 94 cf rjmp .-216 ; 0xb1dc b2b4: 80 e3 ldi r24, 0x30 ; 48 b2b6: bd cf rjmp .-134 ; 0xb232 b2b8: a0 16 cp r10, r16 b2ba: b1 06 cpc r11, r17 b2bc: 41 f4 brne .+16 ; 0xb2ce b2be: 9a 81 ldd r25, Y+2 ; 0x02 b2c0: 96 33 cpi r25, 0x36 ; 54 b2c2: 50 f4 brcc .+20 ; 0xb2d8 b2c4: 95 33 cpi r25, 0x35 ; 53 b2c6: 19 f4 brne .+6 ; 0xb2ce b2c8: 3c 85 ldd r19, Y+12 ; 0x0c b2ca: 34 ff sbrs r19, 4 b2cc: 05 c0 rjmp .+10 ; 0xb2d8 b2ce: b6 01 movw r22, r12 b2d0: 90 e0 ldi r25, 0x00 ; 0 b2d2: 0f 94 ae db call 0x3b75c ; 0x3b75c b2d6: 2a cf rjmp .-428 ; 0xb12c b2d8: 81 e3 ldi r24, 0x31 ; 49 b2da: f9 cf rjmp .-14 ; 0xb2ce b2dc: 8a 81 ldd r24, Y+2 ; 0x02 b2de: 81 33 cpi r24, 0x31 ; 49 b2e0: 19 f0 breq .+6 ; 0xb2e8 b2e2: 9c 85 ldd r25, Y+12 ; 0x0c b2e4: 9f 7e andi r25, 0xEF ; 239 b2e6: 9c 87 std Y+12, r25 ; 0x0c b2e8: b6 01 movw r22, r12 b2ea: 90 e0 ldi r25, 0x00 ; 0 b2ec: 0f 94 ae db call 0x3b75c ; 0x3b75c b2f0: ff 20 and r15, r15 b2f2: a9 f0 breq .+42 ; 0xb31e b2f4: b6 01 movw r22, r12 b2f6: 8e e2 ldi r24, 0x2E ; 46 b2f8: 90 e0 ldi r25, 0x00 ; 0 b2fa: 0f 94 ae db call 0x3b75c ; 0x3b75c b2fe: f3 94 inc r15 b300: f3 94 inc r15 b302: e2 e0 ldi r30, 0x02 ; 2 b304: 01 e0 ldi r16, 0x01 ; 1 b306: 0e 0f add r16, r30 b308: e8 0d add r30, r8 b30a: f9 2d mov r31, r9 b30c: f1 1d adc r31, r1 b30e: 80 81 ld r24, Z b310: b6 01 movw r22, r12 b312: 90 e0 ldi r25, 0x00 ; 0 b314: 0f 94 ae db call 0x3b75c ; 0x3b75c b318: e0 2f mov r30, r16 b31a: 0f 11 cpse r16, r15 b31c: f3 cf rjmp .-26 ; 0xb304 b31e: 85 e6 ldi r24, 0x65 ; 101 b320: 90 e0 ldi r25, 0x00 ; 0 b322: 14 ff sbrs r17, 4 b324: 02 c0 rjmp .+4 ; 0xb32a b326: 85 e4 ldi r24, 0x45 ; 69 b328: 90 e0 ldi r25, 0x00 ; 0 b32a: b6 01 movw r22, r12 b32c: 0f 94 ae db call 0x3b75c ; 0x3b75c b330: b7 fc sbrc r11, 7 b332: 06 c0 rjmp .+12 ; 0xb340 b334: a1 14 cp r10, r1 b336: b1 04 cpc r11, r1 b338: c1 f4 brne .+48 ; 0xb36a b33a: ec 85 ldd r30, Y+12 ; 0x0c b33c: e4 ff sbrs r30, 4 b33e: 15 c0 rjmp .+42 ; 0xb36a b340: b1 94 neg r11 b342: a1 94 neg r10 b344: b1 08 sbc r11, r1 b346: 8d e2 ldi r24, 0x2D ; 45 b348: b6 01 movw r22, r12 b34a: 90 e0 ldi r25, 0x00 ; 0 b34c: 0f 94 ae db call 0x3b75c ; 0x3b75c b350: 80 e3 ldi r24, 0x30 ; 48 b352: 2a e0 ldi r18, 0x0A ; 10 b354: a2 16 cp r10, r18 b356: b1 04 cpc r11, r1 b358: 54 f4 brge .+20 ; 0xb36e b35a: b6 01 movw r22, r12 b35c: 90 e0 ldi r25, 0x00 ; 0 b35e: 0f 94 ae db call 0x3b75c ; 0x3b75c b362: b6 01 movw r22, r12 b364: c5 01 movw r24, r10 b366: c0 96 adiw r24, 0x30 ; 48 b368: b4 cf rjmp .-152 ; 0xb2d2 b36a: 8b e2 ldi r24, 0x2B ; 43 b36c: ed cf rjmp .-38 ; 0xb348 b36e: 8f 5f subi r24, 0xFF ; 255 b370: fa e0 ldi r31, 0x0A ; 10 b372: af 1a sub r10, r31 b374: b1 08 sbc r11, r1 b376: ed cf rjmp .-38 ; 0xb352 b378: 83 36 cpi r24, 0x63 ; 99 b37a: c9 f0 breq .+50 ; 0xb3ae b37c: 83 37 cpi r24, 0x73 ; 115 b37e: 71 f1 breq .+92 ; 0xb3dc b380: 83 35 cpi r24, 0x53 ; 83 b382: 09 f0 breq .+2 ; 0xb386 b384: 5b c0 rjmp .+182 ; 0xb43c b386: 35 01 movw r6, r10 b388: f2 e0 ldi r31, 0x02 ; 2 b38a: 6f 0e add r6, r31 b38c: 71 1c adc r7, r1 b38e: f5 01 movw r30, r10 b390: a0 80 ld r10, Z b392: b1 80 ldd r11, Z+1 ; 0x01 b394: 6f 2d mov r22, r15 b396: 70 e0 ldi r23, 0x00 ; 0 b398: 06 fd sbrc r16, 6 b39a: 02 c0 rjmp .+4 ; 0xb3a0 b39c: 6f ef ldi r22, 0xFF ; 255 b39e: 7f ef ldi r23, 0xFF ; 255 b3a0: c5 01 movw r24, r10 b3a2: 0f 94 42 db call 0x3b684 ; 0x3b684 b3a6: 9d 87 std Y+13, r25 ; 0x0d b3a8: 8c 87 std Y+12, r24 ; 0x0c b3aa: 00 68 ori r16, 0x80 ; 128 b3ac: 0d c0 rjmp .+26 ; 0xb3c8 b3ae: 35 01 movw r6, r10 b3b0: 32 e0 ldi r19, 0x02 ; 2 b3b2: 63 0e add r6, r19 b3b4: 71 1c adc r7, r1 b3b6: f5 01 movw r30, r10 b3b8: 80 81 ld r24, Z b3ba: 89 83 std Y+1, r24 ; 0x01 b3bc: 21 e0 ldi r18, 0x01 ; 1 b3be: 30 e0 ldi r19, 0x00 ; 0 b3c0: 3d 87 std Y+13, r19 ; 0x0d b3c2: 2c 87 std Y+12, r18 ; 0x0c b3c4: 54 01 movw r10, r8 b3c6: 0f 77 andi r16, 0x7F ; 127 b3c8: 03 fd sbrc r16, 3 b3ca: 06 c0 rjmp .+12 ; 0xb3d8 b3cc: 2c 85 ldd r18, Y+12 ; 0x0c b3ce: 3d 85 ldd r19, Y+13 ; 0x0d b3d0: 52 16 cp r5, r18 b3d2: 13 06 cpc r1, r19 b3d4: 09 f0 breq .+2 ; 0xb3d8 b3d6: a8 f4 brcc .+42 ; 0xb402 b3d8: e5 2c mov r14, r5 b3da: 2b c0 rjmp .+86 ; 0xb432 b3dc: 35 01 movw r6, r10 b3de: 32 e0 ldi r19, 0x02 ; 2 b3e0: 63 0e add r6, r19 b3e2: 71 1c adc r7, r1 b3e4: f5 01 movw r30, r10 b3e6: a0 80 ld r10, Z b3e8: b1 80 ldd r11, Z+1 ; 0x01 b3ea: 6f 2d mov r22, r15 b3ec: 70 e0 ldi r23, 0x00 ; 0 b3ee: 06 fd sbrc r16, 6 b3f0: 02 c0 rjmp .+4 ; 0xb3f6 b3f2: 6f ef ldi r22, 0xFF ; 255 b3f4: 7f ef ldi r23, 0xFF ; 255 b3f6: c5 01 movw r24, r10 b3f8: 0f 94 67 db call 0x3b6ce ; 0x3b6ce b3fc: 9d 87 std Y+13, r25 ; 0x0d b3fe: 8c 87 std Y+12, r24 ; 0x0c b400: e2 cf rjmp .-60 ; 0xb3c6 b402: b6 01 movw r22, r12 b404: 80 e2 ldi r24, 0x20 ; 32 b406: 90 e0 ldi r25, 0x00 ; 0 b408: 0f 94 ae db call 0x3b75c ; 0x3b75c b40c: 5a 94 dec r5 b40e: de cf rjmp .-68 ; 0xb3cc b410: f5 01 movw r30, r10 b412: 07 fd sbrc r16, 7 b414: 85 91 lpm r24, Z+ b416: 07 ff sbrs r16, 7 b418: 81 91 ld r24, Z+ b41a: 5f 01 movw r10, r30 b41c: b6 01 movw r22, r12 b41e: 90 e0 ldi r25, 0x00 ; 0 b420: 0f 94 ae db call 0x3b75c ; 0x3b75c b424: e1 10 cpse r14, r1 b426: ea 94 dec r14 b428: 8c 85 ldd r24, Y+12 ; 0x0c b42a: 9d 85 ldd r25, Y+13 ; 0x0d b42c: 01 97 sbiw r24, 0x01 ; 1 b42e: 9d 87 std Y+13, r25 ; 0x0d b430: 8c 87 std Y+12, r24 ; 0x0c b432: ec 85 ldd r30, Y+12 ; 0x0c b434: fd 85 ldd r31, Y+13 ; 0x0d b436: ef 2b or r30, r31 b438: 59 f7 brne .-42 ; 0xb410 b43a: 78 ce rjmp .-784 ; 0xb12c b43c: 84 36 cpi r24, 0x64 ; 100 b43e: 19 f0 breq .+6 ; 0xb446 b440: 89 36 cpi r24, 0x69 ; 105 b442: 09 f0 breq .+2 ; 0xb446 b444: 74 c0 rjmp .+232 ; 0xb52e b446: 35 01 movw r6, r10 b448: 07 ff sbrs r16, 7 b44a: 66 c0 rjmp .+204 ; 0xb518 b44c: f4 e0 ldi r31, 0x04 ; 4 b44e: 6f 0e add r6, r31 b450: 71 1c adc r7, r1 b452: f5 01 movw r30, r10 b454: 60 81 ld r22, Z b456: 71 81 ldd r23, Z+1 ; 0x01 b458: 82 81 ldd r24, Z+2 ; 0x02 b45a: 93 81 ldd r25, Z+3 ; 0x03 b45c: 10 2f mov r17, r16 b45e: 1f 76 andi r17, 0x6F ; 111 b460: 97 ff sbrs r25, 7 b462: 08 c0 rjmp .+16 ; 0xb474 b464: 90 95 com r25 b466: 80 95 com r24 b468: 70 95 com r23 b46a: 61 95 neg r22 b46c: 7f 4f sbci r23, 0xFF ; 255 b46e: 8f 4f sbci r24, 0xFF ; 255 b470: 9f 4f sbci r25, 0xFF ; 255 b472: 10 68 ori r17, 0x80 ; 128 b474: 2a e0 ldi r18, 0x0A ; 10 b476: 30 e0 ldi r19, 0x00 ; 0 b478: a4 01 movw r20, r8 b47a: 0f 94 d5 dc call 0x3b9aa ; 0x3b9aa <__ultoa_invert> b47e: a8 2e mov r10, r24 b480: a8 18 sub r10, r8 b482: ba 2c mov r11, r10 b484: 01 2f mov r16, r17 b486: 16 ff sbrs r17, 6 b488: 0a c0 rjmp .+20 ; 0xb49e b48a: 0e 7f andi r16, 0xFE ; 254 b48c: af 14 cp r10, r15 b48e: 38 f4 brcc .+14 ; 0xb49e b490: 14 ff sbrs r17, 4 b492: 04 c0 rjmp .+8 ; 0xb49c b494: 12 fd sbrc r17, 2 b496: 02 c0 rjmp .+4 ; 0xb49c b498: 01 2f mov r16, r17 b49a: 0e 7e andi r16, 0xEE ; 238 b49c: bf 2c mov r11, r15 b49e: 04 ff sbrs r16, 4 b4a0: a3 c0 rjmp .+326 ; 0xb5e8 b4a2: fe 01 movw r30, r28 b4a4: ea 0d add r30, r10 b4a6: f1 1d adc r31, r1 b4a8: 80 81 ld r24, Z b4aa: 80 33 cpi r24, 0x30 ; 48 b4ac: 09 f0 breq .+2 ; 0xb4b0 b4ae: 95 c0 rjmp .+298 ; 0xb5da b4b0: 09 7e andi r16, 0xE9 ; 233 b4b2: f0 2f mov r31, r16 b4b4: f8 70 andi r31, 0x08 ; 8 b4b6: ef 2e mov r14, r31 b4b8: 03 fd sbrc r16, 3 b4ba: a5 c0 rjmp .+330 ; 0xb606 b4bc: 00 ff sbrs r16, 0 b4be: 9f c0 rjmp .+318 ; 0xb5fe b4c0: fa 2c mov r15, r10 b4c2: b5 14 cp r11, r5 b4c4: 10 f4 brcc .+4 ; 0xb4ca b4c6: f5 0c add r15, r5 b4c8: fb 18 sub r15, r11 b4ca: 04 ff sbrs r16, 4 b4cc: a2 c0 rjmp .+324 ; 0xb612 b4ce: b6 01 movw r22, r12 b4d0: 80 e3 ldi r24, 0x30 ; 48 b4d2: 90 e0 ldi r25, 0x00 ; 0 b4d4: 0f 94 ae db call 0x3b75c ; 0x3b75c b4d8: 02 ff sbrs r16, 2 b4da: 09 c0 rjmp .+18 ; 0xb4ee b4dc: 88 e7 ldi r24, 0x78 ; 120 b4de: 90 e0 ldi r25, 0x00 ; 0 b4e0: 01 ff sbrs r16, 1 b4e2: 02 c0 rjmp .+4 ; 0xb4e8 b4e4: 88 e5 ldi r24, 0x58 ; 88 b4e6: 90 e0 ldi r25, 0x00 ; 0 b4e8: b6 01 movw r22, r12 b4ea: 0f 94 ae db call 0x3b75c ; 0x3b75c b4ee: af 14 cp r10, r15 b4f0: 08 f4 brcc .+2 ; 0xb4f4 b4f2: 9b c0 rjmp .+310 ; 0xb62a b4f4: aa 94 dec r10 b4f6: 0a 2d mov r16, r10 b4f8: 10 e0 ldi r17, 0x00 ; 0 b4fa: 0f 5f subi r16, 0xFF ; 255 b4fc: 1f 4f sbci r17, 0xFF ; 255 b4fe: 08 0d add r16, r8 b500: 19 1d adc r17, r9 b502: f8 01 movw r30, r16 b504: 82 91 ld r24, -Z b506: 8f 01 movw r16, r30 b508: b6 01 movw r22, r12 b50a: 90 e0 ldi r25, 0x00 ; 0 b50c: 0f 94 ae db call 0x3b75c ; 0x3b75c b510: 80 16 cp r8, r16 b512: 91 06 cpc r9, r17 b514: b1 f7 brne .-20 ; 0xb502 b516: 0a ce rjmp .-1004 ; 0xb12c b518: f2 e0 ldi r31, 0x02 ; 2 b51a: 6f 0e add r6, r31 b51c: 71 1c adc r7, r1 b51e: f5 01 movw r30, r10 b520: 60 81 ld r22, Z b522: 71 81 ldd r23, Z+1 ; 0x01 b524: 07 2e mov r0, r23 b526: 00 0c add r0, r0 b528: 88 0b sbc r24, r24 b52a: 99 0b sbc r25, r25 b52c: 97 cf rjmp .-210 ; 0xb45c b52e: 10 2f mov r17, r16 b530: 85 37 cpi r24, 0x75 ; 117 b532: a9 f4 brne .+42 ; 0xb55e b534: 1f 7e andi r17, 0xEF ; 239 b536: 2a e0 ldi r18, 0x0A ; 10 b538: 30 e0 ldi r19, 0x00 ; 0 b53a: 35 01 movw r6, r10 b53c: 17 ff sbrs r17, 7 b53e: 44 c0 rjmp .+136 ; 0xb5c8 b540: f4 e0 ldi r31, 0x04 ; 4 b542: 6f 0e add r6, r31 b544: 71 1c adc r7, r1 b546: f5 01 movw r30, r10 b548: 60 81 ld r22, Z b54a: 71 81 ldd r23, Z+1 ; 0x01 b54c: 82 81 ldd r24, Z+2 ; 0x02 b54e: 93 81 ldd r25, Z+3 ; 0x03 b550: a4 01 movw r20, r8 b552: 0f 94 d5 dc call 0x3b9aa ; 0x3b9aa <__ultoa_invert> b556: a8 2e mov r10, r24 b558: a8 18 sub r10, r8 b55a: 1f 77 andi r17, 0x7F ; 127 b55c: 92 cf rjmp .-220 ; 0xb482 b55e: 19 7f andi r17, 0xF9 ; 249 b560: 8f 36 cpi r24, 0x6F ; 111 b562: 79 f1 breq .+94 ; 0xb5c2 b564: f0 f4 brcc .+60 ; 0xb5a2 b566: 88 35 cpi r24, 0x58 ; 88 b568: 39 f1 breq .+78 ; 0xb5b8 b56a: f6 01 movw r30, r12 b56c: 86 81 ldd r24, Z+6 ; 0x06 b56e: 97 81 ldd r25, Z+7 ; 0x07 b570: 2f 96 adiw r28, 0x0f ; 15 b572: 0f b6 in r0, 0x3f ; 63 b574: f8 94 cli b576: de bf out 0x3e, r29 ; 62 b578: 0f be out 0x3f, r0 ; 63 b57a: cd bf out 0x3d, r28 ; 61 b57c: df 91 pop r29 b57e: cf 91 pop r28 b580: 1f 91 pop r17 b582: 0f 91 pop r16 b584: ff 90 pop r15 b586: ef 90 pop r14 b588: df 90 pop r13 b58a: cf 90 pop r12 b58c: bf 90 pop r11 b58e: af 90 pop r10 b590: 9f 90 pop r9 b592: 8f 90 pop r8 b594: 7f 90 pop r7 b596: 6f 90 pop r6 b598: 5f 90 pop r5 b59a: 4f 90 pop r4 b59c: 3f 90 pop r3 b59e: 2f 90 pop r2 b5a0: 08 95 ret b5a2: 80 37 cpi r24, 0x70 ; 112 b5a4: 39 f0 breq .+14 ; 0xb5b4 b5a6: 88 37 cpi r24, 0x78 ; 120 b5a8: 01 f7 brne .-64 ; 0xb56a b5aa: 14 fd sbrc r17, 4 b5ac: 14 60 ori r17, 0x04 ; 4 b5ae: 20 e1 ldi r18, 0x10 ; 16 b5b0: 30 e0 ldi r19, 0x00 ; 0 b5b2: c3 cf rjmp .-122 ; 0xb53a b5b4: 10 61 ori r17, 0x10 ; 16 b5b6: f9 cf rjmp .-14 ; 0xb5aa b5b8: 04 fd sbrc r16, 4 b5ba: 16 60 ori r17, 0x06 ; 6 b5bc: 20 e1 ldi r18, 0x10 ; 16 b5be: 32 e0 ldi r19, 0x02 ; 2 b5c0: bc cf rjmp .-136 ; 0xb53a b5c2: 28 e0 ldi r18, 0x08 ; 8 b5c4: 30 e0 ldi r19, 0x00 ; 0 b5c6: b9 cf rjmp .-142 ; 0xb53a b5c8: f2 e0 ldi r31, 0x02 ; 2 b5ca: 6f 0e add r6, r31 b5cc: 71 1c adc r7, r1 b5ce: f5 01 movw r30, r10 b5d0: 60 81 ld r22, Z b5d2: 71 81 ldd r23, Z+1 ; 0x01 b5d4: 90 e0 ldi r25, 0x00 ; 0 b5d6: 80 e0 ldi r24, 0x00 ; 0 b5d8: bb cf rjmp .-138 ; 0xb550 b5da: 02 fd sbrc r16, 2 b5dc: 02 c0 rjmp .+4 ; 0xb5e2 b5de: b3 94 inc r11 b5e0: 68 cf rjmp .-304 ; 0xb4b2 b5e2: b3 94 inc r11 b5e4: b3 94 inc r11 b5e6: 65 cf rjmp .-310 ; 0xb4b2 b5e8: 80 2f mov r24, r16 b5ea: 86 78 andi r24, 0x86 ; 134 b5ec: 09 f4 brne .+2 ; 0xb5f0 b5ee: 61 cf rjmp .-318 ; 0xb4b2 b5f0: f6 cf rjmp .-20 ; 0xb5de b5f2: b6 01 movw r22, r12 b5f4: 80 e2 ldi r24, 0x20 ; 32 b5f6: 90 e0 ldi r25, 0x00 ; 0 b5f8: 0f 94 ae db call 0x3b75c ; 0x3b75c b5fc: b3 94 inc r11 b5fe: b5 14 cp r11, r5 b600: c0 f3 brcs .-16 ; 0xb5f2 b602: e1 2c mov r14, r1 b604: 62 cf rjmp .-316 ; 0xb4ca b606: e5 2c mov r14, r5 b608: eb 18 sub r14, r11 b60a: b5 14 cp r11, r5 b60c: 08 f4 brcc .+2 ; 0xb610 b60e: 5d cf rjmp .-326 ; 0xb4ca b610: f8 cf rjmp .-16 ; 0xb602 b612: 80 2f mov r24, r16 b614: 86 78 andi r24, 0x86 ; 134 b616: 09 f4 brne .+2 ; 0xb61a b618: 6a cf rjmp .-300 ; 0xb4ee b61a: 8b e2 ldi r24, 0x2B ; 43 b61c: 01 ff sbrs r16, 1 b61e: 80 e2 ldi r24, 0x20 ; 32 b620: 07 fd sbrc r16, 7 b622: 8d e2 ldi r24, 0x2D ; 45 b624: b6 01 movw r22, r12 b626: 90 e0 ldi r25, 0x00 ; 0 b628: 60 cf rjmp .-320 ; 0xb4ea b62a: b6 01 movw r22, r12 b62c: 80 e3 ldi r24, 0x30 ; 48 b62e: 90 e0 ldi r25, 0x00 ; 0 b630: 0f 94 ae db call 0x3b75c ; 0x3b75c b634: fa 94 dec r15 b636: 5b cf rjmp .-330 ; 0xb4ee b638: b6 01 movw r22, r12 b63a: 80 e2 ldi r24, 0x20 ; 32 b63c: 90 e0 ldi r25, 0x00 ; 0 b63e: 0f 94 ae db call 0x3b75c ; 0x3b75c b642: ea 94 dec r14 b644: 73 cd rjmp .-1306 ; 0xb12c b646: 24 e0 ldi r18, 0x04 ; 4 b648: e1 2c mov r14, r1 b64a: 25 15 cp r18, r5 b64c: 08 f0 brcs .+2 ; 0xb650 b64e: 36 cd rjmp .-1428 ; 0xb0bc b650: 84 e0 ldi r24, 0x04 ; 4 b652: 26 cd rjmp .-1460 ; 0xb0a0 0000b654 : 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 ( b654: 20 e0 ldi r18, 0x00 ; 0 b656: 30 e0 ldi r19, 0x00 ; 0 b658: 40 e8 ldi r20, 0x80 ; 128 b65a: 5f eb ldi r21, 0xBF ; 191 b65c: 60 91 ab 02 lds r22, 0x02AB ; 0x8002ab b660: 70 91 ac 02 lds r23, 0x02AC ; 0x8002ac b664: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad b668: 90 91 ae 02 lds r25, 0x02AE ; 0x8002ae b66c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> b670: 88 23 and r24, r24 b672: 21 f1 breq .+72 ; 0xb6bc (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b674: e0 91 6d 12 lds r30, 0x126D ; 0x80126d b678: f0 91 6e 12 lds r31, 0x126E ; 0x80126e b67c: e0 58 subi r30, 0x80 ; 128 b67e: 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) && ( b680: 80 81 ld r24, Z b682: 8b 7f andi r24, 0xFB ; 251 b684: 82 30 cpi r24, 0x02 ; 2 b686: d1 f4 brne .+52 ; 0xb6bc (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)); b688: 80 e1 ldi r24, 0x10 ; 16 b68a: eb ea ldi r30, 0xAB ; 171 b68c: f2 e0 ldi r31, 0x02 ; 2 b68e: a0 e4 ldi r26, 0x40 ; 64 b690: b7 e0 ldi r27, 0x07 ; 7 b692: 01 90 ld r0, Z+ b694: 0d 92 st X+, r0 b696: 8a 95 dec r24 b698: e1 f7 brne .-8 ; 0xb692 saved_start_position[0] = SAVED_START_POSITION_UNSET; b69a: 80 e0 ldi r24, 0x00 ; 0 b69c: 90 e0 ldi r25, 0x00 ; 0 b69e: a0 e8 ldi r26, 0x80 ; 128 b6a0: bf eb ldi r27, 0xBF ; 191 b6a2: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab b6a6: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac b6aa: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad b6ae: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae return saved_segment_idx; b6b2: 80 91 08 18 lds r24, 0x1808 ; 0x801808 b6b6: 90 91 09 18 lds r25, 0x1809 ; 0x801809 b6ba: 08 95 ret } else return 1; //begin with the first segment b6bc: 81 e0 ldi r24, 0x01 ; 1 b6be: 90 e0 ldi r25, 0x00 ; 0 } b6c0: 08 95 ret 0000b6c2 : 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) { b6c2: cf 92 push r12 b6c4: df 92 push r13 b6c6: ef 92 push r14 b6c8: ff 92 push r15 b6ca: 0f 93 push r16 b6cc: 1f 93 push r17 b6ce: cf 93 push r28 b6d0: 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); b6d2: 90 e0 ldi r25, 0x00 ; 0 b6d4: ec 01 movw r28, r24 b6d6: cc 0f add r28, r28 b6d8: dd 1f adc r29, r29 b6da: cc 0f add r28, r28 b6dc: dd 1f adc r29, r29 b6de: fe 01 movw r30, r28 b6e0: e6 52 subi r30, 0x26 ; 38 b6e2: 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); b6e4: 25 91 lpm r18, Z+ b6e6: 35 91 lpm r19, Z+ b6e8: 45 91 lpm r20, Z+ b6ea: 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]; b6ec: fe 01 movw r30, r28 b6ee: ed 53 subi r30, 0x3D ; 61 b6f0: f9 4f sbci r31, 0xF9 ; 249 b6f2: c0 80 ld r12, Z b6f4: d1 80 ldd r13, Z+1 ; 0x01 b6f6: e2 80 ldd r14, Z+2 ; 0x02 b6f8: f3 80 ldd r15, Z+3 ; 0x03 b6fa: 8e 01 movw r16, r28 b6fc: 00 5c subi r16, 0xC0 ; 192 b6fe: 18 4f sbci r17, 0xF8 ; 248 b700: c7 01 movw r24, r14 b702: b6 01 movw r22, r12 b704: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> b708: f8 01 movw r30, r16 b70a: 60 83 st Z, r22 b70c: 71 83 std Z+1, r23 ; 0x01 b70e: 82 83 std Z+2, r24 ; 0x02 b710: 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); b712: fe 01 movw r30, r28 b714: e2 53 subi r30, 0x32 ; 50 b716: 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); b718: 25 91 lpm r18, Z+ b71a: 35 91 lpm r19, Z+ b71c: 45 91 lpm r20, Z+ b71e: 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]; b720: 8e 01 movw r16, r28 b722: 0f 5d subi r16, 0xDF ; 223 b724: 1d 4f sbci r17, 0xFD ; 253 b726: c7 01 movw r24, r14 b728: b6 01 movw r22, r12 b72a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> b72e: f8 01 movw r30, r16 b730: 60 83 st Z, r22 b732: 71 83 std Z+1, r23 ; 0x01 b734: 82 83 std Z+2, r24 ; 0x02 b736: 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); b738: fe 01 movw r30, r28 b73a: ee 53 subi r30, 0x3E ; 62 b73c: 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); b73e: 25 91 lpm r18, Z+ b740: 35 91 lpm r19, Z+ b742: 45 91 lpm r20, Z+ b744: 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]; b746: cb 5e subi r28, 0xEB ; 235 b748: dd 4f sbci r29, 0xFD ; 253 b74a: c7 01 movw r24, r14 b74c: b6 01 movw r22, r12 b74e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> b752: 68 83 st Y, r22 b754: 79 83 std Y+1, r23 ; 0x01 b756: 8a 83 std Y+2, r24 ; 0x02 b758: 9b 83 std Y+3, r25 ; 0x03 } b75a: df 91 pop r29 b75c: cf 91 pop r28 b75e: 1f 91 pop r17 b760: 0f 91 pop r16 b762: ff 90 pop r15 b764: ef 90 pop r14 b766: df 90 pop r13 b768: cf 90 pop r12 b76a: 08 95 ret 0000b76c : 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)); } b76c: 80 e1 ldi r24, 0x10 ; 16 b76e: e1 e5 ldi r30, 0x51 ; 81 b770: f5 e0 ldi r31, 0x05 ; 5 b772: a0 e4 ldi r26, 0x40 ; 64 b774: b7 e0 ldi r27, 0x07 ; 7 b776: 01 90 ld r0, Z+ b778: 0d 92 st X+, r0 b77a: 8a 95 dec r24 b77c: e1 f7 brne .-8 ; 0xb776 b77e: 08 95 ret 0000b780 : /// @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)); b780: ed e4 ldi r30, 0x4D ; 77 b782: fc e7 ldi r31, 0x7C ; 124 b784: 83 30 cpi r24, 0x03 ; 3 b786: 21 f0 breq .+8 ; 0xb790 b788: e8 2f mov r30, r24 b78a: f0 e0 ldi r31, 0x00 ; 0 b78c: e6 5b subi r30, 0xB6 ; 182 b78e: f3 48 sbci r31, 0x83 ; 131 b790: 84 91 lpm r24, Z } b792: 08 95 ret 0000b794 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b794: 40 91 7e 10 lds r20, 0x107E ; 0x80107e b798: 50 91 7f 10 lds r21, 0x107F ; 0x80107f return 0; b79c: 90 e0 ldi r25, 0x00 ; 0 b79e: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b7a0: 41 15 cp r20, r1 b7a2: 51 05 cpc r21, r1 b7a4: b1 f1 breq .+108 ; 0xb812 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b7a6: 20 91 6d 12 lds r18, 0x126D ; 0x80126d b7aa: 30 91 6e 12 lds r19, 0x126E ; 0x80126e char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b7ae: 90 e0 ldi r25, 0x00 ; 0 b7b0: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b7b2: f9 01 movw r30, r18 b7b4: e0 58 subi r30, 0x80 ; 128 b7b6: ff 4e sbci r31, 0xEF ; 239 b7b8: a0 81 ld r26, Z b7ba: a2 30 cpi r26, 0x02 ; 2 b7bc: 21 f4 brne .+8 ; 0xb7c6 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b7be: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b7c0: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b7c2: 86 0f add r24, r22 b7c4: 97 1f adc r25, r23 } if (-- _buflen == 0) b7c6: 41 50 subi r20, 0x01 ; 1 b7c8: 51 09 sbc r21, r1 b7ca: 19 f1 breq .+70 ; 0xb812 b7cc: f9 01 movw r30, r18 b7ce: ed 57 subi r30, 0x7D ; 125 b7d0: 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) ; b7d2: a1 91 ld r26, Z+ b7d4: 9f 01 movw r18, r30 b7d6: 20 58 subi r18, 0x80 ; 128 b7d8: 30 41 sbci r19, 0x10 ; 16 b7da: a1 11 cpse r26, r1 b7dc: fa cf rjmp .-12 ; 0xb7d2 b7de: f9 01 movw r30, r18 b7e0: e0 58 subi r30, 0x80 ; 128 b7e2: 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) ; b7e4: 2d 3e cpi r18, 0xED ; 237 b7e6: a1 e0 ldi r26, 0x01 ; 1 b7e8: 3a 07 cpc r19, r26 b7ea: 30 f4 brcc .+12 ; 0xb7f8 b7ec: a1 91 ld r26, Z+ b7ee: a1 11 cpse r26, r1 b7f0: e0 cf rjmp .-64 ; 0xb7b2 b7f2: 2f 5f subi r18, 0xFF ; 255 b7f4: 3f 4f sbci r19, 0xFF ; 255 b7f6: f6 cf rjmp .-20 ; 0xb7e4 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b7f8: 2d 3e cpi r18, 0xED ; 237 b7fa: e1 e0 ldi r30, 0x01 ; 1 b7fc: 3e 07 cpc r19, r30 b7fe: c9 f6 brne .-78 ; 0xb7b2 b800: e0 e8 ldi r30, 0x80 ; 128 b802: f0 e1 ldi r31, 0x10 ; 16 b804: 9f 01 movw r18, r30 b806: 20 58 subi r18, 0x80 ; 128 b808: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b80a: a1 91 ld r26, Z+ b80c: aa 23 and r26, r26 b80e: d1 f3 breq .-12 ; 0xb804 b810: d0 cf rjmp .-96 ; 0xb7b2 } } return sdlen; } b812: 08 95 ret 0000b814 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b814: 98 2f mov r25, r24 b816: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b818: 83 ff sbrs r24, 3 b81a: 0d c0 rjmp .+26 ; 0xb836 b81c: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b820: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b822: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b826: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b82a: 88 7f andi r24, 0xF8 ; 248 b82c: 97 70 andi r25, 0x07 ; 7 b82e: 89 2b or r24, r25 b830: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b834: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b836: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b83a: 87 7f andi r24, 0xF7 ; 247 b83c: f2 cf rjmp .-28 ; 0xb822 0000b83e : 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)); }; b83e: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b842: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b846: 4a e0 ldi r20, 0x0A ; 10 b848: 50 e0 ldi r21, 0x00 ; 0 b84a: 70 e0 ldi r23, 0x00 ; 0 b84c: 60 e0 ldi r22, 0x00 ; 0 b84e: 01 96 adiw r24, 0x01 ; 1 b850: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 b854: 86 2f mov r24, r22 b856: 08 95 ret 0000b858 : // 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)); }; b858: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b85c: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b860: 4a e0 ldi r20, 0x0A ; 10 b862: 50 e0 ldi r21, 0x00 ; 0 b864: 70 e0 ldi r23, 0x00 ; 0 b866: 60 e0 ldi r22, 0x00 ; 0 b868: 01 96 adiw r24, 0x01 ; 1 b86a: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 b86e: cb 01 movw r24, r22 b870: 08 95 ret 0000b872 : // 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); } b872: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b876: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b87a: 4a e0 ldi r20, 0x0A ; 10 b87c: 50 e0 ldi r21, 0x00 ; 0 b87e: 70 e0 ldi r23, 0x00 ; 0 b880: 60 e0 ldi r22, 0x00 ; 0 b882: 01 96 adiw r24, 0x01 ; 1 b884: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 0000b888 : // 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; b888: 80 91 92 04 lds r24, 0x0492 ; 0x800492 b88c: 90 91 93 04 lds r25, 0x0493 ; 0x800493 b890: 90 93 91 04 sts 0x0491, r25 ; 0x800491 b894: 80 93 90 04 sts 0x0490, r24 ; 0x800490 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); b898: 84 e4 ldi r24, 0x44 ; 68 b89a: 9e e6 ldi r25, 0x6E ; 110 b89c: 9f 93 push r25 b89e: 8f 93 push r24 b8a0: 80 91 78 03 lds r24, 0x0378 ; 0x800378 b8a4: 90 91 79 03 lds r25, 0x0379 ; 0x800379 b8a8: a0 91 7a 03 lds r26, 0x037A ; 0x80037a b8ac: b0 91 7b 03 lds r27, 0x037B ; 0x80037b b8b0: 01 96 adiw r24, 0x01 ; 1 b8b2: a1 1d adc r26, r1 b8b4: b1 1d adc r27, r1 b8b6: bf 93 push r27 b8b8: af 93 push r26 b8ba: 9f 93 push r25 b8bc: 8f 93 push r24 b8be: 83 e2 ldi r24, 0x23 ; 35 b8c0: 97 e6 ldi r25, 0x67 ; 103 b8c2: 9f 93 push r25 b8c4: 8f 93 push r24 b8c6: 8a e2 ldi r24, 0x2A ; 42 b8c8: 97 e6 ldi r25, 0x67 ; 103 b8ca: 9f 93 push r25 b8cc: 8f 93 push r24 b8ce: 0f 94 08 dc call 0x3b810 ; 0x3b810 b8d2: 8d b7 in r24, 0x3d ; 61 b8d4: 9e b7 in r25, 0x3e ; 62 b8d6: 0a 96 adiw r24, 0x0a ; 10 b8d8: 0f b6 in r0, 0x3f ; 63 b8da: f8 94 cli b8dc: 9e bf out 0x3e, r25 ; 62 b8de: 0f be out 0x3f, r0 ; 63 b8e0: 8d bf out 0x3d, r24 ; 61 } b8e2: 08 95 ret 0000b8e4 : 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) { b8e4: 0f 93 push r16 b8e6: 1f 93 push r17 b8e8: cf 93 push r28 b8ea: df 93 push r29 b8ec: ec 01 movw r28, r24 b8ee: c6 0f add r28, r22 b8f0: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b8f2: 8c 17 cp r24, r28 b8f4: 9d 07 cpc r25, r29 b8f6: 79 f0 breq .+30 ; 0xb916 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b8f8: 8c 01 movw r16, r24 b8fa: 0f 5f subi r16, 0xFF ; 255 b8fc: 1f 4f sbci r17, 0xFF ; 255 b8fe: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c b902: 8f 3f cpi r24, 0xFF ; 255 b904: 31 f0 breq .+12 ; 0xb912 return true; b906: 81 e0 ldi r24, 0x01 ; 1 } return false; } b908: df 91 pop r29 b90a: cf 91 pop r28 b90c: 1f 91 pop r17 b90e: 0f 91 pop r16 b910: 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) b912: c8 01 movw r24, r16 b914: ee cf rjmp .-36 ; 0xb8f2 return true; } return false; b916: 80 e0 ldi r24, 0x00 ; 0 b918: f7 cf rjmp .-18 ; 0xb908 0000b91a : #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; } b91a: 68 2f mov r22, r24 b91c: 88 0f add r24, r24 b91e: 77 0b sbc r23, r23 b920: 80 91 6d 12 lds r24, 0x126D ; 0x80126d b924: 90 91 6e 12 lds r25, 0x126E ; 0x80126e b928: 8d 57 subi r24, 0x7D ; 125 b92a: 9f 4e sbci r25, 0xEF ; 239 b92c: 0f 94 9d e3 call 0x3c73a ; 0x3c73a b930: 9c 01 movw r18, r24 b932: 90 93 94 03 sts 0x0394, r25 ; 0x800394 b936: 80 93 93 03 sts 0x0393, r24 ; 0x800393 b93a: 81 e0 ldi r24, 0x01 ; 1 b93c: 23 2b or r18, r19 b93e: 09 f4 brne .+2 ; 0xb942 b940: 80 e0 ldi r24, 0x00 ; 0 b942: 08 95 ret 0000b944 : #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 { b944: 0f 93 push r16 b946: 1f 93 push r17 b948: cf 93 push r28 b94a: df 93 push r29 b94c: 8c 01 movw r16, r24 b94e: 86 2f mov r24, r22 b950: ea 01 movw r28, r20 if (code_seen(code)) { b952: 0e 94 8d 5c call 0xb91a ; 0xb91a b956: 88 23 and r24, r24 b958: 19 f1 breq .+70 ; 0xb9a0 // Verify value is within allowed range int16_t temp = code_value_short(); b95a: 0e 94 2c 5c call 0xb858 ; 0xb858 if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { b95e: 9c 01 movw r18, r24 b960: 97 ff sbrs r25, 7 b962: 03 c0 rjmp .+6 ; 0xb96a b964: 31 95 neg r19 b966: 21 95 neg r18 b968: 31 09 sbc r19, r1 b96a: 25 36 cpi r18, 0x65 ; 101 b96c: 31 05 cpc r19, r1 b96e: 9c f0 brlt .+38 ; 0xb996 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); b970: 9f 93 push r25 b972: 8f 93 push r24 b974: 8c ee ldi r24, 0xEC ; 236 b976: 99 ea ldi r25, 0xA9 ; 169 b978: 9f 93 push r25 b97a: 8f 93 push r24 b97c: 8f e3 ldi r24, 0x3F ; 63 b97e: 9d e7 ldi r25, 0x7D ; 125 b980: 9f 93 push r25 b982: 8f 93 push r24 b984: 0f 94 08 dc call 0x3b810 ; 0x3b810 b988: 0f 90 pop r0 b98a: 0f 90 pop r0 b98c: 0f 90 pop r0 b98e: 0f 90 pop r0 b990: 0f 90 pop r0 b992: 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; b994: 80 e0 ldi r24, 0x00 ; 0 }; b996: df 91 pop r29 b998: cf 91 pop r28 b99a: 1f 91 pop r17 b99c: 0f 91 pop r16 b99e: 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) { b9a0: f8 01 movw r30, r16 b9a2: 80 81 ld r24, Z b9a4: 88 23 and r24, r24 b9a6: b1 f3 breq .-20 ; 0xb994 return (int8_t)eeprom_read_byte(eep_address); b9a8: ce 01 movw r24, r28 } return 0; }; b9aa: df 91 pop r29 b9ac: cf 91 pop r28 b9ae: 1f 91 pop r17 b9b0: 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); b9b2: 0d 94 46 dd jmp 0x3ba8c ; 0x3ba8c 0000b9b6 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); b9b6: 60 e0 ldi r22, 0x00 ; 0 b9b8: 86 e6 ldi r24, 0x66 ; 102 b9ba: 9f e0 ldi r25, 0x0F ; 15 b9bc: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 b9c0: 60 e0 ldi r22, 0x00 ; 0 b9c2: 88 e6 ldi r24, 0x68 ; 104 b9c4: 9f e0 ldi r25, 0x0F ; 15 b9c6: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 b9ca: 60 e0 ldi r22, 0x00 ; 0 b9cc: 85 e6 ldi r24, 0x65 ; 101 b9ce: 9f e0 ldi r25, 0x0F ; 15 b9d0: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 b9d4: 60 e0 ldi r22, 0x00 ; 0 b9d6: 84 e6 ldi r24, 0x64 ; 100 b9d8: 9f e0 ldi r25, 0x0F ; 15 b9da: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 b9de: 60 e0 ldi r22, 0x00 ; 0 b9e0: 82 ed ldi r24, 0xD2 ; 210 b9e2: 9e e0 ldi r25, 0x0E ; 14 b9e4: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 b9e8: 60 e0 ldi r22, 0x00 ; 0 b9ea: 8f ec ldi r24, 0xCF ; 207 b9ec: 9e e0 ldi r25, 0x0E ; 14 b9ee: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0000b9f2 : return altfanStatus.isAltfan; } void altfanOverride_toggle() { altfanStatus.altfanOverride = !altfanStatus.altfanOverride; b9f2: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> b9f6: 81 fb bst r24, 1 b9f8: 66 27 eor r22, r22 b9fa: 60 f9 bld r22, 0 b9fc: 91 e0 ldi r25, 0x01 ; 1 b9fe: 69 27 eor r22, r25 ba00: 60 fb bst r22, 0 ba02: 81 f9 bld r24, 1 ba04: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> ba08: 8b e2 ldi r24, 0x2B ; 43 ba0a: 9d e0 ldi r25, 0x0D ; 13 ba0c: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0000ba10 : // 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) ba10: 80 36 cpi r24, 0x60 ; 96 ba12: 91 05 cpc r25, r1 ba14: f8 f4 brcc .+62 ; 0xba54 return false; if (bufindr == bufindw && buflen > 0) ba16: 40 91 6d 12 lds r20, 0x126D ; 0x80126d ba1a: 50 91 6e 12 lds r21, 0x126E ; 0x80126e ba1e: 20 91 7b 10 lds r18, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> ba22: 30 91 7c 10 lds r19, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> ba26: 42 17 cp r20, r18 ba28: 53 07 cpc r21, r19 ba2a: 39 f4 brne .+14 ; 0xba3a ba2c: 60 91 7e 10 lds r22, 0x107E ; 0x80107e ba30: 70 91 7f 10 lds r23, 0x107F ; 0x80107f ba34: 16 16 cp r1, r22 ba36: 17 06 cpc r1, r23 ba38: 6c f0 brlt .+26 ; 0xba54 // 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); ba3a: b9 01 movw r22, r18 ba3c: 68 0f add r22, r24 ba3e: 79 1f adc r23, r25 ba40: fb 01 movw r30, r22 ba42: e3 59 subi r30, 0x93 ; 147 ba44: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) ba46: 24 17 cp r18, r20 ba48: 35 07 cpc r19, r21 ba4a: 30 f4 brcc .+12 ; 0xba58 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; ba4c: 81 e0 ldi r24, 0x01 ; 1 ba4e: 4e 17 cp r20, r30 ba50: 5f 07 cpc r21, r31 ba52: 08 f4 brcc .+2 ; 0xba56 // 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; ba54: 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; } ba56: 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? ba58: ee 3e cpi r30, 0xEE ; 238 ba5a: f1 40 sbci r31, 0x01 ; 1 ba5c: f8 f0 brcs .+62 ; 0xba9c // 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); ba5e: 6c 5f subi r22, 0xFC ; 252 ba60: 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) || ba62: 6e 3e cpi r22, 0xEE ; 238 ba64: 71 40 sbci r23, 0x01 ; 1 ba66: 18 f4 brcc .+6 ; 0xba6e // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) ba68: 49 36 cpi r20, 0x69 ; 105 ba6a: 51 05 cpc r21, r1 ba6c: b8 f4 brcc .+46 ; 0xba9c return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { ba6e: 83 59 subi r24, 0x93 ; 147 ba70: 9f 4f sbci r25, 0xFF ; 255 ba72: 48 17 cp r20, r24 ba74: 59 07 cpc r21, r25 ba76: 70 f3 brcs .-36 ; 0xba54 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); ba78: 4d ee ldi r20, 0xED ; 237 ba7a: 51 e0 ldi r21, 0x01 ; 1 ba7c: 42 1b sub r20, r18 ba7e: 53 0b sbc r21, r19 ba80: 70 e0 ldi r23, 0x00 ; 0 ba82: 60 e0 ldi r22, 0x00 ; 0 ba84: c9 01 movw r24, r18 ba86: 80 58 subi r24, 0x80 ; 128 ba88: 9f 4e sbci r25, 0xEF ; 239 ba8a: 0f 94 78 e3 call 0x3c6f0 ; 0x3c6f0 // 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; } ba8e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); ba90: f8 94 cli ba92: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> ba96: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.570> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; ba9a: 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; ba9c: 81 e0 ldi r24, 0x01 ; 1 ba9e: 08 95 ret 0000baa0 : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { baa0: 2f 92 push r2 baa2: 3f 92 push r3 baa4: 4f 92 push r4 baa6: 5f 92 push r5 baa8: 6f 92 push r6 baaa: 7f 92 push r7 baac: 8f 92 push r8 baae: 9f 92 push r9 bab0: af 92 push r10 bab2: bf 92 push r11 bab4: cf 92 push r12 bab6: df 92 push r13 bab8: ef 92 push r14 baba: ff 92 push r15 babc: 0f 93 push r16 babe: 1f 93 push r17 bac0: cf 93 push r28 bac2: df 93 push r29 bac4: cd b7 in r28, 0x3d ; 61 bac6: de b7 in r29, 0x3e ; 62 bac8: cc 58 subi r28, 0x8C ; 140 baca: d2 40 sbci r29, 0x02 ; 2 bacc: 0f b6 in r0, 0x3f ; 63 bace: f8 94 cli bad0: de bf out 0x3e, r29 ; 62 bad2: 0f be out 0x3f, r0 ; 63 bad4: cd bf out 0x3d, r28 ; 61 bad6: cb 58 subi r28, 0x8B ; 139 bad8: dd 4f sbci r29, 0xFD ; 253 bada: 68 83 st Y, r22 badc: 79 83 std Y+1, r23 ; 0x01 bade: 8a 83 std Y+2, r24 ; 0x02 bae0: 9b 83 std Y+3, r25 ; 0x03 bae2: c5 57 subi r28, 0x75 ; 117 bae4: 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; bae6: fe 01 movw r30, r28 bae8: e7 54 subi r30, 0x47 ; 71 baea: fe 4f sbci r31, 0xFE ; 254 baec: 88 e2 ldi r24, 0x28 ; 40 baee: df 01 movw r26, r30 baf0: 1d 92 st X+, r1 baf2: 8a 95 dec r24 baf4: e9 f7 brne .-6 ; 0xbaf0 baf6: e8 5b subi r30, 0xB8 ; 184 baf8: f1 40 sbci r31, 0x01 ; 1 bafa: 1f 01 movw r2, r30 bafc: 80 e9 ldi r24, 0x90 ; 144 bafe: 91 e0 ldi r25, 0x01 ; 1 bb00: df 01 movw r26, r30 bb02: fc 01 movw r30, r24 bb04: 1d 92 st X+, r1 bb06: 31 97 sbiw r30, 0x01 ; 1 bb08: e9 f7 brne .-6 ; 0xbb04 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; bb0a: c7 5a subi r28, 0xA7 ; 167 bb0c: dd 4f sbci r29, 0xFD ; 253 bb0e: 19 82 std Y+1, r1 ; 0x01 bb10: 18 82 st Y, r1 bb12: c9 55 subi r28, 0x59 ; 89 bb14: d2 40 sbci r29, 0x02 ; 2 bb16: 9e 01 movw r18, r28 bb18: 2f 51 subi r18, 0x1F ; 31 bb1a: 3e 4f sbci r19, 0xFE ; 254 bb1c: c1 59 subi r28, 0x91 ; 145 bb1e: dd 4f sbci r29, 0xFD ; 253 bb20: 39 83 std Y+1, r19 ; 0x01 bb22: 28 83 st Y, r18 bb24: cf 56 subi r28, 0x6F ; 111 bb26: d2 40 sbci r29, 0x02 ; 2 bb28: 8e 01 movw r16, r28 bb2a: 07 5a subi r16, 0xA7 ; 167 bb2c: 1d 4f sbci r17, 0xFD ; 253 bb2e: ce 01 movw r24, r28 bb30: 8f 5c subi r24, 0xCF ; 207 bb32: 9d 4f sbci r25, 0xFD ; 253 bb34: c3 59 subi r28, 0x93 ; 147 bb36: dd 4f sbci r29, 0xFD ; 253 bb38: 99 83 std Y+1, r25 ; 0x01 bb3a: 88 83 st Y, r24 bb3c: cd 56 subi r28, 0x6D ; 109 bb3e: d2 40 sbci r29, 0x02 ; 2 bb40: 3c 01 movw r6, r24 bb42: 49 01 movw r8, r18 bb44: 40 eb ldi r20, 0xB0 ; 176 bb46: a4 2e mov r10, r20 bb48: 4f e0 ldi r20, 0x0F ; 15 bb4a: b4 2e mov r11, r20 bb4c: 53 e2 ldi r21, 0x23 ; 35 bb4e: c5 2e mov r12, r21 bb50: d1 2c mov r13, r1 for (i = 0; i < n; i++) { bb52: f1 2c mov r15, r1 bb54: 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]; bb56: b6 01 movw r22, r12 bb58: 0d 2c mov r0, r13 bb5a: 00 0c add r0, r0 bb5c: 88 0b sbc r24, r24 bb5e: 99 0b sbc r25, r25 bb60: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> bb64: d4 01 movw r26, r8 bb66: 6d 93 st X+, r22 bb68: 7d 93 st X+, r23 bb6a: 8d 93 st X+, r24 bb6c: 9d 93 st X+, r25 bb6e: 4d 01 movw r8, r26 f[i] = (float)shift[i]; bb70: f8 01 movw r30, r16 bb72: 61 91 ld r22, Z+ bb74: 71 91 ld r23, Z+ bb76: 8f 01 movw r16, r30 bb78: 07 2e mov r0, r23 bb7a: 00 0c add r0, r0 bb7c: 88 0b sbc r24, r24 bb7e: 99 0b sbc r25, r25 bb80: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> bb84: d3 01 movw r26, r6 bb86: 6d 93 st X+, r22 bb88: 7d 93 st X+, r23 bb8a: 8d 93 st X+, r24 bb8c: 9d 93 st X+, r25 bb8e: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { bb90: bf ef ldi r27, 0xFF ; 255 bb92: eb 1a sub r14, r27 bb94: fb 0a sbc r15, r27 bb96: e6 e0 ldi r30, 0x06 ; 6 bb98: ee 16 cp r14, r30 bb9a: f1 04 cpc r15, r1 bb9c: 09 f0 breq .+2 ; 0xbba0 bb9e: 38 c3 rjmp .+1648 ; 0xc210 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; bba0: cb 58 subi r28, 0x8B ; 139 bba2: dd 4f sbci r29, 0xFD ; 253 bba4: 28 81 ld r18, Y bba6: 39 81 ldd r19, Y+1 ; 0x01 bba8: 4a 81 ldd r20, Y+2 ; 0x02 bbaa: 5b 81 ldd r21, Y+3 ; 0x03 bbac: c5 57 subi r28, 0x75 ; 117 bbae: d2 40 sbci r29, 0x02 ; 2 bbb0: c1 59 subi r28, 0x91 ; 145 bbb2: dd 4f sbci r29, 0xFD ; 253 bbb4: a8 81 ld r26, Y bbb6: b9 81 ldd r27, Y+1 ; 0x01 bbb8: cf 56 subi r28, 0x6F ; 111 bbba: d2 40 sbci r29, 0x02 ; 2 bbbc: 6d 91 ld r22, X+ bbbe: 7d 91 ld r23, X+ bbc0: 8d 91 ld r24, X+ bbc2: 9c 91 ld r25, X bbc4: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> bbc8: 41 2c mov r4, r1 bbca: 51 2c mov r5, r1 bbcc: 32 01 movw r6, r4 bbce: 18 16 cp r1, r24 bbd0: 0c f4 brge .+2 ; 0xbbd4 bbd2: 02 c3 rjmp .+1540 ; 0xc1d8 bbd4: c3 59 subi r28, 0x93 ; 147 bbd6: dd 4f sbci r29, 0xFD ; 253 bbd8: 08 81 ld r16, Y bbda: 19 81 ldd r17, Y+1 ; 0x01 bbdc: cd 56 subi r28, 0x6D ; 109 bbde: d2 40 sbci r29, 0x02 ; 2 bbe0: 0c 5e subi r16, 0xEC ; 236 bbe2: 1f 4f sbci r17, 0xFF ; 255 bbe4: c1 59 subi r28, 0x91 ; 145 bbe6: dd 4f sbci r29, 0xFD ; 253 bbe8: e8 80 ld r14, Y bbea: f9 80 ldd r15, Y+1 ; 0x01 bbec: cf 56 subi r28, 0x6F ; 111 bbee: d2 40 sbci r29, 0x02 ; 2 bbf0: b4 e1 ldi r27, 0x14 ; 20 bbf2: eb 0e add r14, r27 bbf4: f1 1c adc r15, r1 bbf6: 6e 01 movw r12, r28 bbf8: ef ed ldi r30, 0xDF ; 223 bbfa: ce 1a sub r12, r30 bbfc: ed ef ldi r30, 0xFD ; 253 bbfe: de 0a sbc r13, r30 bc00: 9e 01 movw r18, r28 bc02: 2b 55 subi r18, 0x5B ; 91 bc04: 3e 4f sbci r19, 0xFE ; 254 bc06: cf 58 subi r28, 0x8F ; 143 bc08: dd 4f sbci r29, 0xFD ; 253 bc0a: 39 83 std Y+1, r19 ; 0x01 bc0c: 28 83 st Y, r18 bc0e: c1 57 subi r28, 0x71 ; 113 bc10: 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]); bc12: d8 01 movw r26, r16 bc14: 4d 90 ld r4, X+ bc16: 5d 90 ld r5, X+ bc18: 6d 90 ld r6, X+ bc1a: 7c 90 ld r7, X bc1c: f7 01 movw r30, r14 bc1e: 60 81 ld r22, Z bc20: 71 81 ldd r23, Z+1 ; 0x01 bc22: 82 81 ldd r24, Z+2 ; 0x02 bc24: 93 81 ldd r25, Z+3 ; 0x03 bc26: d7 01 movw r26, r14 bc28: 5e 91 ld r21, -X bc2a: 4e 91 ld r20, -X bc2c: 3e 91 ld r19, -X bc2e: 2e 91 ld r18, -X bc30: 7d 01 movw r14, r26 bc32: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> bc36: 4b 01 movw r8, r22 bc38: 5c 01 movw r10, r24 bc3a: f8 01 movw r30, r16 bc3c: 52 91 ld r21, -Z bc3e: 42 91 ld r20, -Z bc40: 32 91 ld r19, -Z bc42: 22 91 ld r18, -Z bc44: 8f 01 movw r16, r30 bc46: c3 01 movw r24, r6 bc48: b2 01 movw r22, r4 bc4a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> bc4e: a5 01 movw r20, r10 bc50: 94 01 movw r18, r8 bc52: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> bc56: d6 01 movw r26, r12 bc58: 9e 93 st -X, r25 bc5a: 8e 93 st -X, r24 bc5c: 7e 93 st -X, r23 bc5e: 6e 93 st -X, r22 bc60: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; bc62: cf 58 subi r28, 0x8F ; 143 bc64: dd 4f sbci r29, 0xFD ; 253 bc66: e8 81 ld r30, Y bc68: f9 81 ldd r31, Y+1 ; 0x01 bc6a: c1 57 subi r28, 0x71 ; 113 bc6c: d2 40 sbci r29, 0x02 ; 2 bc6e: b2 92 st -Z, r11 bc70: a2 92 st -Z, r10 bc72: 92 92 st -Z, r9 bc74: 82 92 st -Z, r8 bc76: cf 58 subi r28, 0x8F ; 143 bc78: dd 4f sbci r29, 0xFD ; 253 bc7a: f9 83 std Y+1, r31 ; 0x01 bc7c: e8 83 st Y, r30 bc7e: c1 57 subi r28, 0x71 ; 113 bc80: 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--) { bc82: c3 59 subi r28, 0x93 ; 147 bc84: dd 4f sbci r29, 0xFD ; 253 bc86: 28 81 ld r18, Y bc88: 39 81 ldd r19, Y+1 ; 0x01 bc8a: cd 56 subi r28, 0x6D ; 109 bc8c: d2 40 sbci r29, 0x02 ; 2 bc8e: 02 17 cp r16, r18 bc90: 13 07 cpc r17, r19 bc92: 09 f0 breq .+2 ; 0xbc96 bc94: be cf rjmp .-132 ; 0xbc12 bc96: 4e 01 movw r8, r28 bc98: 3f e6 ldi r19, 0x6F ; 111 bc9a: 83 1a sub r8, r19 bc9c: 3e ef ldi r19, 0xFE ; 254 bc9e: 93 0a sbc r9, r19 bca0: 5e 01 movw r10, r28 bca2: 83 ef ldi r24, 0xF3 ; 243 bca4: a8 1a sub r10, r24 bca6: 8d ef ldi r24, 0xFD ; 253 bca8: b8 0a sbc r11, r24 bcaa: 61 01 movw r12, r2 bcac: 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 bcd0: 9b 01 movw r18, r22 bcd2: ac 01 movw r20, r24 bcd4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> bcd8: f8 01 movw r30, r16 bcda: 64 a7 std Z+44, r22 ; 0x2c bcdc: 75 a7 std Z+45, r23 ; 0x2d bcde: 86 a7 std Z+46, r24 ; 0x2e bce0: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { bce2: f1 e0 ldi r31, 0x01 ; 1 bce4: ef 16 cp r14, r31 bce6: f1 04 cpc r15, r1 bce8: 61 f0 breq .+24 ; 0xbd02 m[i][i - 1] = h[i - 1]; bcea: d8 01 movw r26, r16 bcec: 98 96 adiw r26, 0x28 ; 40 bcee: 4d 92 st X+, r4 bcf0: 5d 92 st X+, r5 bcf2: 6d 92 st X+, r6 bcf4: 7c 92 st X, r7 bcf6: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; bcf8: f8 01 movw r30, r16 bcfa: 44 82 std Z+4, r4 ; 0x04 bcfc: 55 82 std Z+5, r5 ; 0x05 bcfe: 66 82 std Z+6, r6 ; 0x06 bd00: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); bd02: ff ef ldi r31, 0xFF ; 255 bd04: ef 1a sub r14, r31 bd06: ff 0a sbc r15, r31 bd08: f5 01 movw r30, r10 bd0a: 20 81 ld r18, Z bd0c: 31 81 ldd r19, Z+1 ; 0x01 bd0e: 42 81 ldd r20, Z+2 ; 0x02 bd10: 53 81 ldd r21, Z+3 ; 0x03 bd12: 84 e0 ldi r24, 0x04 ; 4 bd14: a8 0e add r10, r24 bd16: b1 1c adc r11, r1 bd18: 64 81 ldd r22, Z+4 ; 0x04 bd1a: 75 81 ldd r23, Z+5 ; 0x05 bd1c: 86 81 ldd r24, Z+6 ; 0x06 bd1e: 97 81 ldd r25, Z+7 ; 0x07 bd20: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> bd24: 20 e0 ldi r18, 0x00 ; 0 bd26: 30 e0 ldi r19, 0x00 ; 0 bd28: 40 ec ldi r20, 0xC0 ; 192 bd2a: 50 e4 ldi r21, 0x40 ; 64 bd2c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> bd30: d6 01 movw r26, r12 bd32: dc 96 adiw r26, 0x3c ; 60 bd34: 6d 93 st X+, r22 bd36: 7d 93 st X+, r23 bd38: 8d 93 st X+, r24 bd3a: 9c 93 st X, r25 bd3c: df 97 sbiw r26, 0x3f ; 63 bd3e: 04 5d subi r16, 0xD4 ; 212 bd40: 1f 4f sbci r17, 0xFF ; 255 bd42: b8 e2 ldi r27, 0x28 ; 40 bd44: cb 0e add r12, r27 bd46: 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 bd50: b1 cf rjmp .-158 ; 0xbcb4 bd52: 7e 01 movw r14, r28 bd54: fd e2 ldi r31, 0x2D ; 45 bd56: ef 0e add r14, r31 bd58: f1 1c adc r15, r1 bd5a: 28 e2 ldi r18, 0x28 ; 40 bd5c: a2 2e mov r10, r18 bd5e: b1 2c mov r11, r1 bd60: 00 eb ldi r16, 0xB0 ; 176 bd62: 1f ef ldi r17, 0xFF ; 255 bd64: 24 e0 ldi r18, 0x04 ; 4 bd66: 22 0e add r2, r18 bd68: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bd86: 2b 01 movw r4, r22 bd88: 3c 01 movw r6, r24 bd8a: 61 01 movw r12, r2 bd8c: c0 1a sub r12, r16 bd8e: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) bd90: 88 24 eor r8, r8 bd92: 83 94 inc r8 bd94: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; bd96: f6 01 movw r30, r12 bd98: e0 0f add r30, r16 bd9a: f1 1f adc r31, r17 bd9c: ea 0d add r30, r10 bd9e: fb 1d adc r31, r11 bda0: 20 81 ld r18, Z bda2: 31 81 ldd r19, Z+1 ; 0x01 bda4: 42 81 ldd r20, Z+2 ; 0x02 bda6: 53 81 ldd r21, Z+3 ; 0x03 bda8: c3 01 movw r24, r6 bdaa: b2 01 movw r22, r4 bdac: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> bdb0: 9b 01 movw r18, r22 bdb2: ac 01 movw r20, r24 bdb4: f6 01 movw r30, r12 bdb6: 60 81 ld r22, Z bdb8: 71 81 ldd r23, Z+1 ; 0x01 bdba: 82 81 ldd r24, Z+2 ; 0x02 bdbc: 93 81 ldd r25, Z+3 ; 0x03 bdbe: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> bdc2: d6 01 movw r26, r12 bdc4: 6d 93 st X+, r22 bdc6: 7d 93 st X+, r23 bdc8: 8d 93 st X+, r24 bdca: 9d 93 st X+, r25 bdcc: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bddc: 3c e2 ldi r19, 0x2C ; 44 bdde: e3 0e add r14, r19 bde0: f1 1c adc r15, r1 bde2: 08 52 subi r16, 0x28 ; 40 bde4: 11 09 sbc r17, r1 bde6: 88 e2 ldi r24, 0x28 ; 40 bde8: a8 0e add r10, r24 bdea: 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 bdf4: ba cf rjmp .-140 ; 0xbd6a bdf6: 1e 01 movw r2, r28 bdf8: f5 eb ldi r31, 0xB5 ; 181 bdfa: 2f 0e add r2, r31 bdfc: 31 1c adc r3, r1 bdfe: 6e 01 movw r12, r28 be00: 21 eb ldi r18, 0xB1 ; 177 be02: c2 0e add r12, r18 be04: d1 1c adc r13, r1 be06: 7e 01 movw r14, r28 be08: 37 e3 ldi r19, 0x37 ; 55 be0a: e3 1a sub r14, r19 be0c: 3e ef ldi r19, 0xFE ; 254 be0e: 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--) { be10: 04 e0 ldi r16, 0x04 ; 4 be12: 10 e0 ldi r17, 0x00 ; 0 be14: 48 01 movw r8, r16 be16: b1 2c mov r11, r1 be18: a1 2c mov r10, r1 sum = 0; be1a: 41 2c mov r4, r1 be1c: 51 2c mov r5, r1 be1e: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; be20: f6 01 movw r30, r12 be22: ea 0d add r30, r10 be24: fb 1d adc r31, r11 be26: d7 01 movw r26, r14 be28: aa 0d add r26, r10 be2a: bb 1d adc r27, r11 be2c: 2d 91 ld r18, X+ be2e: 3d 91 ld r19, X+ be30: 4d 91 ld r20, X+ be32: 5c 91 ld r21, X be34: 60 81 ld r22, Z be36: 71 81 ldd r23, Z+1 ; 0x01 be38: 82 81 ldd r24, Z+2 ; 0x02 be3a: 93 81 ldd r25, Z+3 ; 0x03 be3c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> be40: 9b 01 movw r18, r22 be42: ac 01 movw r20, r24 be44: c3 01 movw r24, r6 be46: b2 01 movw r22, r4 be48: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> be4c: 2b 01 movw r4, r22 be4e: 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++) be50: 8f ef ldi r24, 0xFF ; 255 be52: 88 1a sub r8, r24 be54: 98 0a sbc r9, r24 be56: 94 e0 ldi r25, 0x04 ; 4 be58: a9 0e add r10, r25 be5a: b1 1c adc r11, r1 be5c: a5 e0 ldi r26, 0x05 ; 5 be5e: 8a 16 cp r8, r26 be60: 91 04 cpc r9, r1 be62: f1 f6 brne .-68 ; 0xbe20 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; be64: a3 01 movw r20, r6 be66: 92 01 movw r18, r4 be68: f1 01 movw r30, r2 be6a: 60 81 ld r22, Z be6c: 71 81 ldd r23, Z+1 ; 0x01 be6e: 82 81 ldd r24, Z+2 ; 0x02 be70: 93 81 ldd r25, Z+3 ; 0x03 be72: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> be76: d6 01 movw r26, r12 be78: 2d 91 ld r18, X+ be7a: 3d 91 ld r19, X+ be7c: 4d 91 ld r20, X+ be7e: 5c 91 ld r21, X be80: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> be84: f7 01 movw r30, r14 be86: 60 83 st Z, r22 be88: 71 83 std Z+1, r23 ; 0x01 be8a: 82 83 std Z+2, r24 ; 0x02 be8c: 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--) { be8e: 01 50 subi r16, 0x01 ; 1 be90: 11 09 sbc r17, r1 be92: f8 e2 ldi r31, 0x28 ; 40 be94: 2f 1a sub r2, r31 be96: 31 08 sbc r3, r1 be98: 2c e2 ldi r18, 0x2C ; 44 be9a: c2 1a sub r12, r18 be9c: d1 08 sbc r13, r1 be9e: 34 e0 ldi r19, 0x04 ; 4 bea0: e3 1a sub r14, r19 bea2: f1 08 sbc r15, r1 bea4: 01 15 cp r16, r1 bea6: 11 05 cpc r17, r1 bea8: 09 f0 breq .+2 ; 0xbeac beaa: b4 cf rjmp .-152 ; 0xbe14 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { beac: cb 50 subi r28, 0x0B ; 11 beae: de 4f sbci r29, 0xFE ; 254 beb0: 88 81 ld r24, Y beb2: 99 81 ldd r25, Y+1 ; 0x01 beb4: aa 81 ldd r26, Y+2 ; 0x02 beb6: bb 81 ldd r27, Y+3 ; 0x03 beb8: c5 5f subi r28, 0xF5 ; 245 beba: d1 40 sbci r29, 0x01 ; 1 bebc: cf 57 subi r28, 0x7F ; 127 bebe: dd 4f sbci r29, 0xFD ; 253 bec0: 88 83 st Y, r24 bec2: 99 83 std Y+1, r25 ; 0x01 bec4: aa 83 std Y+2, r26 ; 0x02 bec6: bb 83 std Y+3, r27 ; 0x03 bec8: c1 58 subi r28, 0x81 ; 129 beca: d2 40 sbci r29, 0x02 ; 2 becc: 1e 01 movw r2, r28 bece: 97 e4 ldi r25, 0x47 ; 71 bed0: 29 1a sub r2, r25 bed2: 9e ef ldi r25, 0xFE ; 254 bed4: 39 0a sbc r3, r25 bed6: 10 e0 ldi r17, 0x00 ; 0 bed8: 00 e0 ldi r16, 0x00 ; 0 beda: c1 59 subi r28, 0x91 ; 145 bedc: dd 4f sbci r29, 0xFD ; 253 bede: a8 81 ld r26, Y bee0: b9 81 ldd r27, Y+1 ; 0x01 bee2: cf 56 subi r28, 0x6F ; 111 bee4: d2 40 sbci r29, 0x02 ; 2 bee6: cd 90 ld r12, X+ bee8: dd 90 ld r13, X+ beea: ed 90 ld r14, X+ beec: fd 90 ld r15, X+ beee: c1 59 subi r28, 0x91 ; 145 bef0: dd 4f sbci r29, 0xFD ; 253 bef2: b9 83 std Y+1, r27 ; 0x01 bef4: a8 83 st Y, r26 bef6: cf 56 subi r28, 0x6F ; 111 bef8: d2 40 sbci r29, 0x02 ; 2 befa: cb 58 subi r28, 0x8B ; 139 befc: dd 4f sbci r29, 0xFD ; 253 befe: 28 81 ld r18, Y bf00: 39 81 ldd r19, Y+1 ; 0x01 bf02: 4a 81 ldd r20, Y+2 ; 0x02 bf04: 5b 81 ldd r21, Y+3 ; 0x03 bf06: c5 57 subi r28, 0x75 ; 117 bf08: d2 40 sbci r29, 0x02 ; 2 bf0a: c7 01 movw r24, r14 bf0c: b6 01 movw r22, r12 bf0e: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> bf12: 18 16 cp r1, r24 bf14: b4 f0 brlt .+44 ; 0xbf42 bf16: cb 58 subi r28, 0x8B ; 139 bf18: dd 4f sbci r29, 0xFD ; 253 bf1a: 28 81 ld r18, Y bf1c: 39 81 ldd r19, Y+1 ; 0x01 bf1e: 4a 81 ldd r20, Y+2 ; 0x02 bf20: 5b 81 ldd r21, Y+3 ; 0x03 bf22: c5 57 subi r28, 0x75 ; 117 bf24: d2 40 sbci r29, 0x02 ; 2 bf26: c1 59 subi r28, 0x91 ; 145 bf28: dd 4f sbci r29, 0xFD ; 253 bf2a: e8 81 ld r30, Y bf2c: f9 81 ldd r31, Y+1 ; 0x01 bf2e: cf 56 subi r28, 0x6F ; 111 bf30: d2 40 sbci r29, 0x02 ; 2 bf32: 60 81 ld r22, Z bf34: 71 81 ldd r23, Z+1 ; 0x01 bf36: 82 81 ldd r24, Z+2 ; 0x02 bf38: 93 81 ldd r25, Z+3 ; 0x03 bf3a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> bf3e: 87 ff sbrs r24, 7 bf40: 18 c0 rjmp .+48 ; 0xbf72 bf42: 04 30 cpi r16, 0x04 ; 4 bf44: 11 05 cpc r17, r1 bf46: 09 f0 breq .+2 ; 0xbf4a bf48: 30 c1 rjmp .+608 ; 0xc1aa bf4a: cb 58 subi r28, 0x8B ; 139 bf4c: dd 4f sbci r29, 0xFD ; 253 bf4e: 28 81 ld r18, Y bf50: 39 81 ldd r19, Y+1 ; 0x01 bf52: 4a 81 ldd r20, Y+2 ; 0x02 bf54: 5b 81 ldd r21, Y+3 ; 0x03 bf56: c5 57 subi r28, 0x75 ; 117 bf58: d2 40 sbci r29, 0x02 ; 2 bf5a: cf 57 subi r28, 0x7F ; 127 bf5c: dd 4f sbci r29, 0xFD ; 253 bf5e: 68 81 ld r22, Y bf60: 79 81 ldd r23, Y+1 ; 0x01 bf62: 8a 81 ldd r24, Y+2 ; 0x02 bf64: 9b 81 ldd r25, Y+3 ; 0x03 bf66: c1 58 subi r28, 0x81 ; 129 bf68: d2 40 sbci r29, 0x02 ; 2 bf6a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> bf6e: 87 ff sbrs r24, 7 bf70: 1c c1 rjmp .+568 ; 0xc1aa a = (s[i + 1] - s[i]) / (6 * h[i]); bf72: d1 01 movw r26, r2 bf74: 14 96 adiw r26, 0x04 ; 4 bf76: 8d 90 ld r8, X+ bf78: 9d 90 ld r9, X+ bf7a: ad 90 ld r10, X+ bf7c: bc 90 ld r11, X bf7e: 17 97 sbiw r26, 0x07 ; 7 bf80: 8d 91 ld r24, X+ bf82: 9d 91 ld r25, X+ bf84: 0d 90 ld r0, X+ bf86: bc 91 ld r27, X bf88: a0 2d mov r26, r0 bf8a: cf 58 subi r28, 0x8F ; 143 bf8c: dd 4f sbci r29, 0xFD ; 253 bf8e: 88 83 st Y, r24 bf90: 99 83 std Y+1, r25 ; 0x01 bf92: aa 83 std Y+2, r26 ; 0x02 bf94: bb 83 std Y+3, r27 ; 0x03 bf96: c1 57 subi r28, 0x71 ; 113 bf98: d2 40 sbci r29, 0x02 ; 2 bf9a: f8 01 movw r30, r16 bf9c: ee 0f add r30, r30 bf9e: ff 1f adc r31, r31 bfa0: ee 0f add r30, r30 bfa2: ff 1f adc r31, r31 bfa4: 21 e9 ldi r18, 0x91 ; 145 bfa6: 31 e0 ldi r19, 0x01 ; 1 bfa8: 2c 0f add r18, r28 bfaa: 3d 1f adc r19, r29 bfac: e2 0f add r30, r18 bfae: f3 1f adc r31, r19 bfb0: 40 80 ld r4, Z bfb2: 51 80 ldd r5, Z+1 ; 0x01 bfb4: 62 80 ldd r6, Z+2 ; 0x02 bfb6: 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; bfb8: c3 59 subi r28, 0x93 ; 147 bfba: dd 4f sbci r29, 0xFD ; 253 bfbc: a8 81 ld r26, Y bfbe: b9 81 ldd r27, Y+1 ; 0x01 bfc0: cd 56 subi r28, 0x6D ; 109 bfc2: d2 40 sbci r29, 0x02 ; 2 bfc4: 8d 91 ld r24, X+ bfc6: 9d 91 ld r25, X+ bfc8: 0d 90 ld r0, X+ bfca: bc 91 ld r27, X bfcc: a0 2d mov r26, r0 bfce: c3 58 subi r28, 0x83 ; 131 bfd0: dd 4f sbci r29, 0xFD ; 253 bfd2: 88 83 st Y, r24 bfd4: 99 83 std Y+1, r25 ; 0x01 bfd6: aa 83 std Y+2, r26 ; 0x02 bfd8: bb 83 std Y+3, r27 ; 0x03 bfda: cd 57 subi r28, 0x7D ; 125 bfdc: 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; bfde: a7 01 movw r20, r14 bfe0: 96 01 movw r18, r12 bfe2: cb 58 subi r28, 0x8B ; 139 bfe4: dd 4f sbci r29, 0xFD ; 253 bfe6: 68 81 ld r22, Y bfe8: 79 81 ldd r23, Y+1 ; 0x01 bfea: 8a 81 ldd r24, Y+2 ; 0x02 bfec: 9b 81 ldd r25, Y+3 ; 0x03 bfee: c5 57 subi r28, 0x75 ; 117 bff0: d2 40 sbci r29, 0x02 ; 2 bff2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> bff6: 6b 01 movw r12, r22 bff8: 7c 01 movw r14, r24 bffa: 20 e0 ldi r18, 0x00 ; 0 bffc: 30 e0 ldi r19, 0x00 ; 0 bffe: 40 e4 ldi r20, 0x40 ; 64 c000: 50 e4 ldi r21, 0x40 ; 64 c002: 0f 94 de e1 call 0x3c3bc ; 0x3c3bc c006: cb 57 subi r28, 0x7B ; 123 c008: dd 4f sbci r29, 0xFD ; 253 c00a: 68 83 st Y, r22 c00c: 79 83 std Y+1, r23 ; 0x01 c00e: 8a 83 std Y+2, r24 ; 0x02 c010: 9b 83 std Y+3, r25 ; 0x03 c012: c5 58 subi r28, 0x85 ; 133 c014: 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; c016: c3 58 subi r28, 0x83 ; 131 c018: dd 4f sbci r29, 0xFD ; 253 c01a: 28 81 ld r18, Y c01c: 39 81 ldd r19, Y+1 ; 0x01 c01e: 4a 81 ldd r20, Y+2 ; 0x02 c020: 5b 81 ldd r21, Y+3 ; 0x03 c022: cd 57 subi r28, 0x7D ; 125 c024: d2 40 sbci r29, 0x02 ; 2 c026: c3 59 subi r28, 0x93 ; 147 c028: dd 4f sbci r29, 0xFD ; 253 c02a: e8 81 ld r30, Y c02c: f9 81 ldd r31, Y+1 ; 0x01 c02e: cd 56 subi r28, 0x6D ; 109 c030: d2 40 sbci r29, 0x02 ; 2 c032: 64 81 ldd r22, Z+4 ; 0x04 c034: 75 81 ldd r23, Z+5 ; 0x05 c036: 86 81 ldd r24, Z+6 ; 0x06 c038: 97 81 ldd r25, Z+7 ; 0x07 c03a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> c03e: a3 01 movw r20, r6 c040: 92 01 movw r18, r4 c042: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> c046: c7 58 subi r28, 0x87 ; 135 c048: dd 4f sbci r29, 0xFD ; 253 c04a: 68 83 st Y, r22 c04c: 79 83 std Y+1, r23 ; 0x01 c04e: 8a 83 std Y+2, r24 ; 0x02 c050: 9b 83 std Y+3, r25 ; 0x03 c052: c9 57 subi r28, 0x79 ; 121 c054: d2 40 sbci r29, 0x02 ; 2 c056: a3 01 movw r20, r6 c058: 92 01 movw r18, r4 c05a: c3 01 movw r24, r6 c05c: b2 01 movw r22, r4 c05e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> c062: cf 58 subi r28, 0x8F ; 143 c064: dd 4f sbci r29, 0xFD ; 253 c066: 28 81 ld r18, Y c068: 39 81 ldd r19, Y+1 ; 0x01 c06a: 4a 81 ldd r20, Y+2 ; 0x02 c06c: 5b 81 ldd r21, Y+3 ; 0x03 c06e: c1 57 subi r28, 0x71 ; 113 c070: d2 40 sbci r29, 0x02 ; 2 c072: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c076: c7 57 subi r28, 0x77 ; 119 c078: dd 4f sbci r29, 0xFD ; 253 c07a: 68 83 st Y, r22 c07c: 79 83 std Y+1, r23 ; 0x01 c07e: 8a 83 std Y+2, r24 ; 0x02 c080: 9b 83 std Y+3, r25 ; 0x03 c082: c9 58 subi r28, 0x89 ; 137 c084: d2 40 sbci r29, 0x02 ; 2 c086: a3 01 movw r20, r6 c088: 92 01 movw r18, r4 c08a: c5 01 movw r24, r10 c08c: b4 01 movw r22, r8 c08e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c092: 9b 01 movw r18, r22 c094: ac 01 movw r20, r24 c096: c7 57 subi r28, 0x77 ; 119 c098: dd 4f sbci r29, 0xFD ; 253 c09a: 68 81 ld r22, Y c09c: 79 81 ldd r23, Y+1 ; 0x01 c09e: 8a 81 ldd r24, Y+2 ; 0x02 c0a0: 9b 81 ldd r25, Y+3 ; 0x03 c0a2: c9 58 subi r28, 0x89 ; 137 c0a4: d2 40 sbci r29, 0x02 ; 2 c0a6: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> c0aa: 20 e0 ldi r18, 0x00 ; 0 c0ac: 30 e0 ldi r19, 0x00 ; 0 c0ae: 40 ec ldi r20, 0xC0 ; 192 c0b0: 50 e4 ldi r21, 0x40 ; 64 c0b2: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> c0b6: 9b 01 movw r18, r22 c0b8: ac 01 movw r20, r24 c0ba: c7 58 subi r28, 0x87 ; 135 c0bc: dd 4f sbci r29, 0xFD ; 253 c0be: 68 81 ld r22, Y c0c0: 79 81 ldd r23, Y+1 ; 0x01 c0c2: 8a 81 ldd r24, Y+2 ; 0x02 c0c4: 9b 81 ldd r25, Y+3 ; 0x03 c0c6: c9 57 subi r28, 0x79 ; 121 c0c8: d2 40 sbci r29, 0x02 ; 2 c0ca: 0f 94 6d de call 0x3bcda ; 0x3bcda <__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; c0ce: a7 01 movw r20, r14 c0d0: 96 01 movw r18, r12 c0d2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c0d6: c7 58 subi r28, 0x87 ; 135 c0d8: dd 4f sbci r29, 0xFD ; 253 c0da: 68 83 st Y, r22 c0dc: 79 83 std Y+1, r23 ; 0x01 c0de: 8a 83 std Y+2, r24 ; 0x02 c0e0: 9b 83 std Y+3, r25 ; 0x03 c0e2: c9 57 subi r28, 0x79 ; 121 c0e4: 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]); c0e6: cf 58 subi r28, 0x8F ; 143 c0e8: dd 4f sbci r29, 0xFD ; 253 c0ea: 28 81 ld r18, Y c0ec: 39 81 ldd r19, Y+1 ; 0x01 c0ee: 4a 81 ldd r20, Y+2 ; 0x02 c0f0: 5b 81 ldd r21, Y+3 ; 0x03 c0f2: c1 57 subi r28, 0x71 ; 113 c0f4: d2 40 sbci r29, 0x02 ; 2 c0f6: c5 01 movw r24, r10 c0f8: b4 01 movw r22, r8 c0fa: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> c0fe: 4b 01 movw r8, r22 c100: 5c 01 movw r10, r24 c102: 20 e0 ldi r18, 0x00 ; 0 c104: 30 e0 ldi r19, 0x00 ; 0 c106: 40 ec ldi r20, 0xC0 ; 192 c108: 50 e4 ldi r21, 0x40 ; 64 c10a: c3 01 movw r24, r6 c10c: b2 01 movw r22, r4 c10e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c112: 9b 01 movw r18, r22 c114: ac 01 movw r20, r24 c116: c5 01 movw r24, r10 c118: b4 01 movw r22, r8 c11a: 0f 94 6d df call 0x3beda ; 0x3beda <__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; c11e: cb 57 subi r28, 0x7B ; 123 c120: dd 4f sbci r29, 0xFD ; 253 c122: 28 81 ld r18, Y c124: 39 81 ldd r19, Y+1 ; 0x01 c126: 4a 81 ldd r20, Y+2 ; 0x02 c128: 5b 81 ldd r21, Y+3 ; 0x03 c12a: c5 58 subi r28, 0x85 ; 133 c12c: d2 40 sbci r29, 0x02 ; 2 c12e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c132: 4b 01 movw r8, r22 c134: 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; c136: 20 e0 ldi r18, 0x00 ; 0 c138: 30 e0 ldi r19, 0x00 ; 0 c13a: 40 e0 ldi r20, 0x00 ; 0 c13c: 5f e3 ldi r21, 0x3F ; 63 c13e: cf 58 subi r28, 0x8F ; 143 c140: dd 4f sbci r29, 0xFD ; 253 c142: 68 81 ld r22, Y c144: 79 81 ldd r23, Y+1 ; 0x01 c146: 8a 81 ldd r24, Y+2 ; 0x02 c148: 9b 81 ldd r25, Y+3 ; 0x03 c14a: c1 57 subi r28, 0x71 ; 113 c14c: d2 40 sbci r29, 0x02 ; 2 c14e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c152: 2b 01 movw r4, r22 c154: 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; c156: a7 01 movw r20, r14 c158: 96 01 movw r18, r12 c15a: c7 01 movw r24, r14 c15c: b6 01 movw r22, r12 c15e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c162: 9b 01 movw r18, r22 c164: ac 01 movw r20, r24 c166: c3 01 movw r24, r6 c168: b2 01 movw r22, r4 c16a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c16e: 9b 01 movw r18, r22 c170: ac 01 movw r20, r24 c172: c5 01 movw r24, r10 c174: b4 01 movw r22, r8 c176: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> c17a: 9b 01 movw r18, r22 c17c: ac 01 movw r20, r24 c17e: c7 58 subi r28, 0x87 ; 135 c180: dd 4f sbci r29, 0xFD ; 253 c182: 68 81 ld r22, Y c184: 79 81 ldd r23, Y+1 ; 0x01 c186: 8a 81 ldd r24, Y+2 ; 0x02 c188: 9b 81 ldd r25, Y+3 ; 0x03 c18a: c9 57 subi r28, 0x79 ; 121 c18c: d2 40 sbci r29, 0x02 ; 2 c18e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> c192: c3 58 subi r28, 0x83 ; 131 c194: dd 4f sbci r29, 0xFD ; 253 c196: 28 81 ld r18, Y c198: 39 81 ldd r19, Y+1 ; 0x01 c19a: 4a 81 ldd r20, Y+2 ; 0x02 c19c: 5b 81 ldd r21, Y+3 ; 0x03 c19e: cd 57 subi r28, 0x7D ; 125 c1a0: d2 40 sbci r29, 0x02 ; 2 c1a2: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> c1a6: 2b 01 movw r4, r22 c1a8: 3c 01 movw r6, r24 c1aa: 0f 5f subi r16, 0xFF ; 255 c1ac: 1f 4f sbci r17, 0xFF ; 255 c1ae: f4 e0 ldi r31, 0x04 ; 4 c1b0: 2f 0e add r2, r31 c1b2: 31 1c adc r3, r1 c1b4: c3 59 subi r28, 0x93 ; 147 c1b6: dd 4f sbci r29, 0xFD ; 253 c1b8: 28 81 ld r18, Y c1ba: 39 81 ldd r19, Y+1 ; 0x01 c1bc: cd 56 subi r28, 0x6D ; 109 c1be: d2 40 sbci r29, 0x02 ; 2 c1c0: 2c 5f subi r18, 0xFC ; 252 c1c2: 3f 4f sbci r19, 0xFF ; 255 c1c4: c3 59 subi r28, 0x93 ; 147 c1c6: dd 4f sbci r29, 0xFD ; 253 c1c8: 39 83 std Y+1, r19 ; 0x01 c1ca: 28 83 st Y, r18 c1cc: cd 56 subi r28, 0x6D ; 109 c1ce: 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 c1d6: 81 ce rjmp .-766 ; 0xbeda sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } c1d8: c3 01 movw r24, r6 c1da: b2 01 movw r22, r4 c1dc: c4 57 subi r28, 0x74 ; 116 c1de: dd 4f sbci r29, 0xFD ; 253 c1e0: 0f b6 in r0, 0x3f ; 63 c1e2: f8 94 cli c1e4: de bf out 0x3e, r29 ; 62 c1e6: 0f be out 0x3f, r0 ; 63 c1e8: cd bf out 0x3d, r28 ; 61 c1ea: df 91 pop r29 c1ec: cf 91 pop r28 c1ee: 1f 91 pop r17 c1f0: 0f 91 pop r16 c1f2: ff 90 pop r15 c1f4: ef 90 pop r14 c1f6: df 90 pop r13 c1f8: cf 90 pop r12 c1fa: bf 90 pop r11 c1fc: af 90 pop r10 c1fe: 9f 90 pop r9 c200: 8f 90 pop r8 c202: 7f 90 pop r7 c204: 6f 90 pop r6 c206: 5f 90 pop r5 c208: 4f 90 pop r4 c20a: 3f 90 pop r3 c20c: 2f 90 pop r2 c20e: 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)); c210: c5 01 movw r24, r10 c212: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 c216: d8 01 movw r26, r16 c218: 8d 93 st X+, r24 c21a: 9c 93 st X, r25 c21c: b5 e0 ldi r27, 0x05 ; 5 c21e: cb 0e add r12, r27 c220: d1 1c adc r13, r1 c222: e2 e0 ldi r30, 0x02 ; 2 c224: ae 0e add r10, r30 c226: b1 1c adc r11, r1 c228: 96 cc rjmp .-1748 ; 0xbb56 0000c22a : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { c22a: 0f 93 push r16 c22c: 1f 93 push r17 c22e: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) c230: 20 91 95 13 lds r18, 0x1395 ; 0x801395 c234: 21 30 cpi r18, 0x01 ; 1 c236: 79 f5 brne .+94 ; 0xc296 c238: 8c 01 movw r16, r24 c23a: 80 e5 ldi r24, 0x50 ; 80 c23c: 0e 94 8d 5c call 0xb91a ; 0xb91a c240: 88 23 and r24, r24 c242: 49 f1 breq .+82 ; 0xc296 { mmuSlotIndex = code_value_uint8(); c244: 0e 94 1f 5c call 0xb83e ; 0xb83e c248: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { c24a: 85 30 cpi r24, 0x05 ; 5 c24c: 20 f5 brcc .+72 ; 0xc296 switch (gcode) c24e: 01 3c cpi r16, 0xC1 ; 193 c250: 82 e0 ldi r24, 0x02 ; 2 c252: 18 07 cpc r17, r24 c254: 49 f0 breq .+18 ; 0xc268 c256: 02 3c cpi r16, 0xC2 ; 194 c258: 12 40 sbci r17, 0x02 ; 2 c25a: 69 f0 breq .+26 ; 0xc276 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c25c: 8c 2f mov r24, r28 default: break; } } } } c25e: cf 91 pop r28 c260: 1f 91 pop r17 c262: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c264: 0d 94 3a a0 jmp 0x34074 ; 0x34074 break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c268: 60 e0 ldi r22, 0x00 ; 0 c26a: 8c 2f mov r24, r28 default: break; } } } } c26c: cf 91 pop r28 c26e: 1f 91 pop r17 c270: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c272: 0d 94 7d a0 jmp 0x340fa ; 0x340fa break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ c276: 8e ec ldi r24, 0xCE ; 206 c278: 9e e0 ldi r25, 0x0E ; 14 c27a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c c27e: 88 23 and r24, r24 c280: 51 f0 breq .+20 ; 0xc296 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { c282: 0f 94 0b 88 call 0x31016 ; 0x31016 c286: 88 23 and r24, r24 c288: 31 f0 breq .+12 ; 0xc296 c28a: 8c 2f mov r24, r28 default: break; } } } } c28c: cf 91 pop r28 c28e: 1f 91 pop r17 c290: 0f 91 pop r16 c292: 0d 94 fa a0 jmp 0x341f4 ; 0x341f4 c296: cf 91 pop r28 c298: 1f 91 pop r17 c29a: 0f 91 pop r16 c29c: 08 95 ret 0000c29e : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c29e: cf 93 push r28 c2a0: 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(); c2a2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 cli(); c2a6: f8 94 cli tmc2130_mode = mode; c2a8: c0 93 69 06 sts 0x0669, r28 ; 0x800669 update_mode_profile(); c2ac: 0f 94 7c aa call 0x354f8 ; 0x354f8 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(); c2b0: 0e 94 aa f9 call 0x1f354 ; 0x1f354 1 #else 0 #endif ) , enableECool(enableECool) { } c2b4: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c2b6: 82 70 andi r24, 0x02 ; 2 c2b8: 0f 94 f1 3b call 0x277e2 ; 0x277e2 // 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(); c2bc: 0f 94 3b 59 call 0x2b276 ; 0x2b276 sei(); c2c0: 78 94 sei } c2c2: cf 91 pop r28 c2c4: 08 95 ret 0000c2c6 : 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);} c2c6: 8f 92 push r8 c2c8: 9f 92 push r9 c2ca: af 92 push r10 c2cc: bf 92 push r11 c2ce: cf 92 push r12 c2d0: df 92 push r13 c2d2: ef 92 push r14 c2d4: ff 92 push r15 c2d6: 0f 93 push r16 c2d8: 1f 93 push r17 c2da: cf 93 push r28 c2dc: df 93 push r29 c2de: 00 91 93 03 lds r16, 0x0393 ; 0x800393 c2e2: 10 91 94 03 lds r17, 0x0394 ; 0x800394 c2e6: 0f 5f subi r16, 0xFF ; 255 c2e8: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c2ea: 68 01 movw r12, r16 c2ec: 8f ef ldi r24, 0xFF ; 255 c2ee: c8 1a sub r12, r24 c2f0: d8 0a sbc r13, r24 c2f2: d8 01 movw r26, r16 c2f4: dc 91 ld r29, X } while (isspace(c)); c2f6: 8d 2f mov r24, r29 c2f8: 90 e0 ldi r25, 0x00 ; 0 c2fa: 0f 94 d7 da call 0x3b5ae ; 0x3b5ae c2fe: 7c 01 movw r14, r24 c300: 89 2b or r24, r25 c302: 01 f5 brne .+64 ; 0xc344 flag = 0; if (c == '-') { c304: dd 32 cpi r29, 0x2D ; 45 c306: 01 f5 brne .+64 ; 0xc348 flag = FL_MINUS; c = *nptr++; c308: 68 01 movw r12, r16 c30a: b2 e0 ldi r27, 0x02 ; 2 c30c: cb 0e add r12, r27 c30e: d1 1c adc r13, r1 c310: f8 01 movw r30, r16 c312: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c314: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c316: 86 01 movw r16, r12 c318: 01 50 subi r16, 0x01 ; 1 c31a: 11 09 sbc r17, r1 c31c: 43 e0 ldi r20, 0x03 ; 3 c31e: 50 e0 ldi r21, 0x00 ; 0 c320: 61 e8 ldi r22, 0x81 ; 129 c322: 7c e7 ldi r23, 0x7C ; 124 c324: c8 01 movw r24, r16 c326: 0f 94 0d db call 0x3b61a ; 0x3b61a c32a: 89 2b or r24, r25 c32c: c1 f4 brne .+48 ; 0xc35e nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c32e: 60 e0 ldi r22, 0x00 ; 0 c330: 70 e0 ldi r23, 0x00 ; 0 c332: 80 e8 ldi r24, 0x80 ; 128 c334: 9f ef ldi r25, 0xFF ; 255 c336: c1 11 cpse r28, r1 c338: db c0 rjmp .+438 ; 0xc4f0 c33a: 60 e0 ldi r22, 0x00 ; 0 c33c: 70 e0 ldi r23, 0x00 ; 0 c33e: 80 e8 ldi r24, 0x80 ; 128 c340: 9f e7 ldi r25, 0x7F ; 127 c342: d6 c0 rjmp .+428 ; 0xc4f0 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c344: 86 01 movw r16, r12 c346: d1 cf rjmp .-94 ; 0xc2ea flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c348: db 32 cpi r29, 0x2B ; 43 c34a: 39 f4 brne .+14 ; 0xc35a c = *nptr++; c34c: 68 01 movw r12, r16 c34e: f2 e0 ldi r31, 0x02 ; 2 c350: cf 0e add r12, r31 c352: d1 1c adc r13, r1 c354: d8 01 movw r26, r16 c356: 11 96 adiw r26, 0x01 ; 1 c358: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c35a: c0 e0 ldi r28, 0x00 ; 0 c35c: dc cf rjmp .-72 ; 0xc316 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)) { c35e: 43 e0 ldi r20, 0x03 ; 3 c360: 50 e0 ldi r21, 0x00 ; 0 c362: 6e e7 ldi r22, 0x7E ; 126 c364: 7c e7 ldi r23, 0x7C ; 124 c366: c8 01 movw r24, r16 c368: 0f 94 0d db call 0x3b61a ; 0x3b61a c36c: 89 2b or r24, r25 c36e: 09 f4 brne .+2 ; 0xc372 c370: cc c0 rjmp .+408 ; 0xc50a c372: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c374: 10 e0 ldi r17, 0x00 ; 0 c376: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c378: 20 e0 ldi r18, 0x00 ; 0 c37a: 30 e0 ldi r19, 0x00 ; 0 c37c: a9 01 movw r20, r18 c37e: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c380: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c382: da 30 cpi r29, 0x0A ; 10 c384: 60 f5 brcc .+88 ; 0xc3de flag |= FL_ANY; c386: bc 2e mov r11, r28 c388: 68 94 set c38a: b1 f8 bld r11, 1 c38c: 8c 2f mov r24, r28 c38e: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c390: c2 ff sbrs r28, 2 c392: 09 c0 rjmp .+18 ; 0xc3a6 if (!(flag & FL_DOT)) c394: 81 11 cpse r24, r1 c396: 02 c0 rjmp .+4 ; 0xc39c exp += 1; c398: 0f 5f subi r16, 0xFF ; 255 c39a: 1f 4f sbci r17, 0xFF ; 255 c39c: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c39e: d6 01 movw r26, r12 c3a0: dc 91 ld r29, X c3a2: cb 2d mov r28, r11 c3a4: ec cf rjmp .-40 ; 0xc37e if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c3a6: 88 23 and r24, r24 c3a8: 11 f0 breq .+4 ; 0xc3ae exp -= 1; c3aa: 01 50 subi r16, 0x01 ; 1 c3ac: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c3ae: a5 e0 ldi r26, 0x05 ; 5 c3b0: b0 e0 ldi r27, 0x00 ; 0 c3b2: 0f 94 db dd call 0x3bbb6 ; 0x3bbb6 <__muluhisi3> c3b6: 9b 01 movw r18, r22 c3b8: ac 01 movw r20, r24 c3ba: 22 0f add r18, r18 c3bc: 33 1f adc r19, r19 c3be: 44 1f adc r20, r20 c3c0: 55 1f adc r21, r21 c3c2: 2d 0f add r18, r29 c3c4: 31 1d adc r19, r1 c3c6: 41 1d adc r20, r1 c3c8: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c3ca: 28 39 cpi r18, 0x98 ; 152 c3cc: b9 e9 ldi r27, 0x99 ; 153 c3ce: 3b 07 cpc r19, r27 c3d0: 4b 07 cpc r20, r27 c3d2: b9 e1 ldi r27, 0x19 ; 25 c3d4: 5b 07 cpc r21, r27 c3d6: 10 f3 brcs .-60 ; 0xc39c flag |= FL_OVFL; c3d8: c6 60 ori r28, 0x06 ; 6 c3da: bc 2e mov r11, r28 c3dc: df cf rjmp .-66 ; 0xc39c } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c3de: de 3f cpi r29, 0xFE ; 254 c3e0: 31 f4 brne .+12 ; 0xc3ee c3e2: c3 fd sbrc r28, 3 c3e4: 33 c0 rjmp .+102 ; 0xc44c flag |= FL_DOT; c3e6: bc 2e mov r11, r28 c3e8: 68 94 set c3ea: b3 f8 bld r11, 3 c3ec: d7 cf rjmp .-82 ; 0xc39c } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c3ee: d5 33 cpi r29, 0x35 ; 53 c3f0: 69 f5 brne .+90 ; 0xc44c { int i; c = *nptr++; c3f2: 80 81 ld r24, Z i = 2; if (c == '-') { c3f4: 8d 32 cpi r24, 0x2D ; 45 c3f6: 31 f4 brne .+12 ; 0xc404 flag |= FL_MEXP; c3f8: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c3fa: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c3fc: 6e 5f subi r22, 0xFE ; 254 c3fe: 7f 4f sbci r23, 0xFF ; 255 c400: 81 81 ldd r24, Z+1 ; 0x01 c402: 05 c0 rjmp .+10 ; 0xc40e c404: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c406: 8b 32 cpi r24, 0x2B ; 43 c408: c9 f3 breq .-14 ; 0xc3fc // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c40a: 6f 5f subi r22, 0xFF ; 255 c40c: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c40e: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c410: 8a 30 cpi r24, 0x0A ; 10 c412: e0 f4 brcc .+56 ; 0xc44c c414: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c416: b0 e8 ldi r27, 0x80 ; 128 c418: eb 16 cp r14, r27 c41a: bc e0 ldi r27, 0x0C ; 12 c41c: fb 06 cpc r15, r27 c41e: 5c f4 brge .+22 ; 0xc436 i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c420: b7 01 movw r22, r14 c422: 66 0f add r22, r22 c424: 77 1f adc r23, r23 c426: 66 0f add r22, r22 c428: 77 1f adc r23, r23 c42a: e6 0e add r14, r22 c42c: f7 1e adc r15, r23 c42e: ee 0c add r14, r14 c430: ff 1c adc r15, r15 c432: e8 0e add r14, r24 c434: f1 1c adc r15, r1 c = *nptr++ - '0'; c436: 81 91 ld r24, Z+ c438: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c43a: 8a 30 cpi r24, 0x0A ; 10 c43c: 60 f3 brcs .-40 ; 0xc416 if (flag & FL_MEXP) c43e: c4 ff sbrs r28, 4 c440: 03 c0 rjmp .+6 ; 0xc448 i = -i; c442: f1 94 neg r15 c444: e1 94 neg r14 c446: f1 08 sbc r15, r1 exp += i; c448: 0e 0d add r16, r14 c44a: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c44c: ca 01 movw r24, r20 c44e: b9 01 movw r22, r18 c450: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c454: c3 70 andi r28, 0x03 ; 3 c456: c3 30 cpi r28, 0x03 ; 3 c458: 09 f4 brne .+2 ; 0xc45c x.flt = -x.flt; c45a: 90 58 subi r25, 0x80 ; 128 c45c: 4b 01 movw r8, r22 c45e: 5c 01 movw r10, r24 if (x.flt != 0) { c460: 20 e0 ldi r18, 0x00 ; 0 c462: 30 e0 ldi r19, 0x00 ; 0 c464: a9 01 movw r20, r18 c466: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> c46a: 88 23 and r24, r24 c46c: 09 f4 brne .+2 ; 0xc470 c46e: 3e c0 rjmp .+124 ; 0xc4ec if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c470: ca e7 ldi r28, 0x7A ; 122 c472: 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) { c474: 17 ff sbrs r17, 7 c476: 05 c0 rjmp .+10 ; 0xc482 nptr = (void*)(pwr_m10 + 5); exp = -exp; c478: 11 95 neg r17 c47a: 01 95 neg r16 c47c: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c47e: c2 e6 ldi r28, 0x62 ; 98 c480: dc e7 ldi r29, 0x7C ; 124 c482: 6e 01 movw r12, r28 c484: e8 e1 ldi r30, 0x18 ; 24 c486: ce 1a sub r12, r30 c488: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c48a: 80 e2 ldi r24, 0x20 ; 32 c48c: e8 2e mov r14, r24 c48e: f1 2c mov r15, r1 c490: 0d c0 rjmp .+26 ; 0xc4ac for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c492: fe 01 movw r30, r28 c494: 25 91 lpm r18, Z+ c496: 35 91 lpm r19, Z+ c498: 45 91 lpm r20, Z+ c49a: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c49c: 0e 19 sub r16, r14 c49e: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c4a0: c5 01 movw r24, r10 c4a2: b4 01 movw r22, r8 c4a4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c4a8: 4b 01 movw r8, r22 c4aa: 5c 01 movw r10, r24 c4ac: d5 01 movw r26, r10 c4ae: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c4b0: 0e 15 cp r16, r14 c4b2: 1f 05 cpc r17, r15 c4b4: 74 f7 brge .-36 ; 0xc492 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c4b6: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c4b8: f5 94 asr r15 c4ba: e7 94 ror r14 c4bc: cc 16 cp r12, r28 c4be: dd 06 cpc r13, r29 c4c0: a9 f7 brne .-22 ; 0xc4ac not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c4c2: 8a 2f mov r24, r26 c4c4: 88 0f add r24, r24 c4c6: 8b 2f mov r24, r27 c4c8: 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) c4ca: 8f 3f cpi r24, 0xFF ; 255 c4cc: 49 f0 breq .+18 ; 0xc4e0 c4ce: 20 e0 ldi r18, 0x00 ; 0 c4d0: 30 e0 ldi r19, 0x00 ; 0 c4d2: a9 01 movw r20, r18 c4d4: c5 01 movw r24, r10 c4d6: b4 01 movw r22, r8 c4d8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> c4dc: 81 11 cpse r24, r1 c4de: 06 c0 rjmp .+12 ; 0xc4ec errno = ERANGE; c4e0: 82 e2 ldi r24, 0x22 ; 34 c4e2: 90 e0 ldi r25, 0x00 ; 0 c4e4: 90 93 0b 18 sts 0x180B, r25 ; 0x80180b c4e8: 80 93 0a 18 sts 0x180A, r24 ; 0x80180a } return x.flt; c4ec: c5 01 movw r24, r10 c4ee: b4 01 movw r22, r8 c4f0: df 91 pop r29 c4f2: cf 91 pop r28 c4f4: 1f 91 pop r17 c4f6: 0f 91 pop r16 c4f8: ff 90 pop r15 c4fa: ef 90 pop r14 c4fc: df 90 pop r13 c4fe: cf 90 pop r12 c500: bf 90 pop r11 c502: af 90 pop r10 c504: 9f 90 pop r9 c506: 8f 90 pop r8 c508: 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; c50a: 60 e0 ldi r22, 0x00 ; 0 c50c: 70 e0 ldi r23, 0x00 ; 0 c50e: 80 ec ldi r24, 0xC0 ; 192 c510: 9f e7 ldi r25, 0x7F ; 127 c512: ee cf rjmp .-36 ; 0xc4f0 0000c514 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c514: 2f 92 push r2 c516: 3f 92 push r3 c518: 4f 92 push r4 c51a: 5f 92 push r5 c51c: 6f 92 push r6 c51e: 7f 92 push r7 c520: 8f 92 push r8 c522: 9f 92 push r9 c524: af 92 push r10 c526: bf 92 push r11 c528: cf 92 push r12 c52a: df 92 push r13 c52c: ef 92 push r14 c52e: ff 92 push r15 c530: 0f 93 push r16 c532: 1f 93 push r17 c534: cf 93 push r28 c536: df 93 push r29 c538: 00 d0 rcall .+0 ; 0xc53a c53a: cd b7 in r28, 0x3d ; 61 c53c: de b7 in r29, 0x3e ; 62 c53e: 8d ed ldi r24, 0xDD ; 221 c540: c8 2e mov r12, r24 c542: 82 e0 ldi r24, 0x02 ; 2 c544: d8 2e mov r13, r24 c546: 81 e5 ldi r24, 0x51 ; 81 c548: 95 e0 ldi r25, 0x05 ; 5 c54a: 9b 83 std Y+3, r25 ; 0x03 c54c: 8a 83 std Y+2, r24 ; 0x02 c54e: 90 e4 ldi r25, 0x40 ; 64 c550: e9 2e mov r14, r25 c552: 97 e0 ldi r25, 0x07 ; 7 c554: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c556: 33 24 eor r3, r3 c558: 33 94 inc r3 c55a: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c55c: f6 01 movw r30, r12 c55e: 81 91 ld r24, Z+ c560: 6f 01 movw r12, r30 c562: 0e 94 8d 5c call 0xb91a ; 0xb91a c566: 28 2e mov r2, r24 c568: 88 23 and r24, r24 c56a: 09 f4 brne .+2 ; 0xc56e c56c: a6 c0 rjmp .+332 ; 0xc6ba { bool relative = axis_relative_modes & mask; c56e: 10 91 dd 03 lds r17, 0x03DD ; 0x8003dd c572: 13 21 and r17, r3 destination[i] = code_value(); c574: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 c578: 2b 01 movw r4, r22 c57a: 3c 01 movw r6, r24 c57c: ea 81 ldd r30, Y+2 ; 0x02 c57e: fb 81 ldd r31, Y+3 ; 0x03 c580: 40 82 st Z, r4 c582: 51 82 std Z+1, r5 ; 0x01 c584: 62 82 std Z+2, r6 ; 0x02 c586: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c588: 03 30 cpi r16, 0x03 ; 3 c58a: 09 f0 breq .+2 ; 0xc58e c58c: 46 c0 rjmp .+140 ; 0xc61a 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; c58e: f1 e0 ldi r31, 0x01 ; 1 c590: f9 83 std Y+1, r31 ; 0x01 c592: 11 11 cpse r17, r1 c594: 01 c0 rjmp .+2 ; 0xc598 c596: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c598: 80 90 bb 02 lds r8, 0x02BB ; 0x8002bb c59c: 90 90 bc 02 lds r9, 0x02BC ; 0x8002bc c5a0: a0 90 bd 02 lds r10, 0x02BD ; 0x8002bd c5a4: b0 90 be 02 lds r11, 0x02BE ; 0x8002be if (emult != 1.) { c5a8: 20 e0 ldi r18, 0x00 ; 0 c5aa: 30 e0 ldi r19, 0x00 ; 0 c5ac: 40 e8 ldi r20, 0x80 ; 128 c5ae: 5f e3 ldi r21, 0x3F ; 63 c5b0: c5 01 movw r24, r10 c5b2: b4 01 movw r22, r8 c5b4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> c5b8: 88 23 and r24, r24 c5ba: 59 f1 breq .+86 ; 0xc612 if (! relative) { c5bc: 11 11 cpse r17, r1 c5be: 15 c0 rjmp .+42 ; 0xc5ea destination[i] -= current_position[i]; c5c0: 20 91 4c 07 lds r18, 0x074C ; 0x80074c c5c4: 30 91 4d 07 lds r19, 0x074D ; 0x80074d c5c8: 40 91 4e 07 lds r20, 0x074E ; 0x80074e c5cc: 50 91 4f 07 lds r21, 0x074F ; 0x80074f c5d0: c3 01 movw r24, r6 c5d2: b2 01 movw r22, r4 c5d4: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> c5d8: 60 93 5d 05 sts 0x055D, r22 ; 0x80055d c5dc: 70 93 5e 05 sts 0x055E, r23 ; 0x80055e c5e0: 80 93 5f 05 sts 0x055F, r24 ; 0x80055f c5e4: 90 93 60 05 sts 0x0560, r25 ; 0x800560 relative = true; c5e8: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c5ea: a5 01 movw r20, r10 c5ec: 94 01 movw r18, r8 c5ee: 60 91 5d 05 lds r22, 0x055D ; 0x80055d c5f2: 70 91 5e 05 lds r23, 0x055E ; 0x80055e c5f6: 80 91 5f 05 lds r24, 0x055F ; 0x80055f c5fa: 90 91 60 05 lds r25, 0x0560 ; 0x800560 c5fe: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> c602: 60 93 5d 05 sts 0x055D, r22 ; 0x80055d c606: 70 93 5e 05 sts 0x055E, r23 ; 0x80055e c60a: 80 93 5f 05 sts 0x055F, r24 ; 0x80055f c60e: 90 93 60 05 sts 0x0560, r25 ; 0x800560 } } if (relative) c612: e9 81 ldd r30, Y+1 ; 0x01 c614: e1 11 cpse r30, r1 c616: 03 c0 rjmp .+6 ; 0xc61e c618: 22 c0 rjmp .+68 ; 0xc65e c61a: 11 23 and r17, r17 c61c: 99 f0 breq .+38 ; 0xc644 destination[i] += current_position[i]; c61e: f7 01 movw r30, r14 c620: 20 81 ld r18, Z c622: 31 81 ldd r19, Z+1 ; 0x01 c624: 42 81 ldd r20, Z+2 ; 0x02 c626: 53 81 ldd r21, Z+3 ; 0x03 c628: ea 81 ldd r30, Y+2 ; 0x02 c62a: fb 81 ldd r31, Y+3 ; 0x03 c62c: 60 81 ld r22, Z c62e: 71 81 ldd r23, Z+1 ; 0x01 c630: 82 81 ldd r24, Z+2 ; 0x02 c632: 93 81 ldd r25, Z+3 ; 0x03 c634: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> c638: ea 81 ldd r30, Y+2 ; 0x02 c63a: fb 81 ldd r31, Y+3 ; 0x03 c63c: 60 83 st Z, r22 c63e: 71 83 std Z+1, r23 ; 0x01 c640: 82 83 std Z+2, r24 ; 0x02 c642: 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) { c644: 0f 5f subi r16, 0xFF ; 255 c646: 33 0c add r3, r3 c648: 8a 81 ldd r24, Y+2 ; 0x02 c64a: 9b 81 ldd r25, Y+3 ; 0x03 c64c: 04 96 adiw r24, 0x04 ; 4 c64e: 9b 83 std Y+3, r25 ; 0x03 c650: 8a 83 std Y+2, r24 ; 0x02 c652: 94 e0 ldi r25, 0x04 ; 4 c654: e9 0e add r14, r25 c656: f1 1c adc r15, r1 c658: 04 30 cpi r16, 0x04 ; 4 c65a: 09 f0 breq .+2 ; 0xc65e c65c: 7f cf rjmp .-258 ; 0xc55c 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')) { c65e: 86 e4 ldi r24, 0x46 ; 70 c660: 0e 94 8d 5c call 0xb91a ; 0xb91a c664: 88 23 and r24, r24 c666: 99 f0 breq .+38 ; 0xc68e const float next_feedrate = code_value(); c668: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 c66c: 6b 01 movw r12, r22 c66e: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c670: 20 e0 ldi r18, 0x00 ; 0 c672: 30 e0 ldi r19, 0x00 ; 0 c674: a9 01 movw r20, r18 c676: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> c67a: 18 16 cp r1, r24 c67c: 44 f4 brge .+16 ; 0xc68e c67e: c0 92 90 02 sts 0x0290, r12 ; 0x800290 c682: d0 92 91 02 sts 0x0291, r13 ; 0x800291 c686: e0 92 92 02 sts 0x0292, r14 ; 0x800292 c68a: f0 92 93 02 sts 0x0293, r15 ; 0x800293 } } c68e: 0f 90 pop r0 c690: 0f 90 pop r0 c692: 0f 90 pop r0 c694: df 91 pop r29 c696: cf 91 pop r28 c698: 1f 91 pop r17 c69a: 0f 91 pop r16 c69c: ff 90 pop r15 c69e: ef 90 pop r14 c6a0: df 90 pop r13 c6a2: cf 90 pop r12 c6a4: bf 90 pop r11 c6a6: af 90 pop r10 c6a8: 9f 90 pop r9 c6aa: 8f 90 pop r8 c6ac: 7f 90 pop r7 c6ae: 6f 90 pop r6 c6b0: 5f 90 pop r5 c6b2: 4f 90 pop r4 c6b4: 3f 90 pop r3 c6b6: 2f 90 pop r2 c6b8: 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? c6ba: f7 01 movw r30, r14 c6bc: 80 81 ld r24, Z c6be: 91 81 ldd r25, Z+1 ; 0x01 c6c0: a2 81 ldd r26, Z+2 ; 0x02 c6c2: b3 81 ldd r27, Z+3 ; 0x03 c6c4: ea 81 ldd r30, Y+2 ; 0x02 c6c6: fb 81 ldd r31, Y+3 ; 0x03 c6c8: 80 83 st Z, r24 c6ca: 91 83 std Z+1, r25 ; 0x01 c6cc: a2 83 std Z+2, r26 ; 0x02 c6ce: b3 83 std Z+3, r27 ; 0x03 c6d0: b9 cf rjmp .-142 ; 0xc644 0000c6d2 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c6d2: 2f 92 push r2 c6d4: 3f 92 push r3 c6d6: 4f 92 push r4 c6d8: 5f 92 push r5 c6da: 6f 92 push r6 c6dc: 7f 92 push r7 c6de: 8f 92 push r8 c6e0: 9f 92 push r9 c6e2: af 92 push r10 c6e4: bf 92 push r11 c6e6: cf 92 push r12 c6e8: df 92 push r13 c6ea: ef 92 push r14 c6ec: ff 92 push r15 c6ee: 0f 93 push r16 c6f0: 1f 93 push r17 c6f2: cf 93 push r28 c6f4: df 93 push r29 c6f6: cd b7 in r28, 0x3d ; 61 c6f8: de b7 in r29, 0x3e ; 62 c6fa: 65 97 sbiw r28, 0x15 ; 21 c6fc: 0f b6 in r0, 0x3f ; 63 c6fe: f8 94 cli c700: de bf out 0x3e, r29 ; 62 c702: 0f be out 0x3f, r0 ; 63 c704: cd bf out 0x3d, r28 ; 61 c706: 69 8b std Y+17, r22 ; 0x11 c708: 7a 8b std Y+18, r23 ; 0x12 c70a: 8b 8b std Y+19, r24 ; 0x13 c70c: 9c 8b std Y+20, r25 ; 0x14 c70e: 49 01 movw r8, r18 c710: 5a 01 movw r10, r20 c712: 30 2e mov r3, r16 c714: cd 8a std Y+21, r12 ; 0x15 c716: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c718: 81 e0 ldi r24, 0x01 ; 1 c71a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c71e: df 92 push r13 c720: 2d 89 ldd r18, Y+21 ; 0x15 c722: 2f 93 push r18 c724: 1f 92 push r1 c726: ef 92 push r14 c728: 85 e6 ldi r24, 0x65 ; 101 c72a: 96 e6 ldi r25, 0x66 ; 102 c72c: 9f 93 push r25 c72e: 8f 93 push r24 c730: 0f 94 08 dc call 0x3b810 ; 0x3b810 daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c734: 81 e4 ldi r24, 0x41 ; 65 c736: 0e 94 8d 5c call 0xb91a ; 0xb91a c73a: 0f 90 pop r0 c73c: 0f 90 pop r0 c73e: 0f 90 pop r0 c740: 0f 90 pop r0 c742: 0f 90 pop r0 c744: 0f 90 pop r0 c746: 88 23 and r24, r24 c748: a1 f0 breq .+40 ; 0xc772 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c74a: 80 91 93 03 lds r24, 0x0393 ; 0x800393 c74e: 90 91 94 03 lds r25, 0x0394 ; 0x800394 c752: fc 01 movw r30, r24 c754: 21 81 ldd r18, Z+1 ; 0x01 c756: 28 37 cpi r18, 0x78 ; 120 c758: 09 f0 breq .+2 ; 0xc75c c75a: 69 c0 rjmp .+210 ; 0xc82e c75c: 40 e1 ldi r20, 0x10 ; 16 c75e: 50 e0 ldi r21, 0x00 ; 0 c760: 70 e0 ldi r23, 0x00 ; 0 c762: 60 e0 ldi r22, 0x00 ; 0 c764: 02 96 adiw r24, 0x02 ; 2 c766: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 c76a: 69 8b std Y+17, r22 ; 0x11 c76c: 7a 8b std Y+18, r23 ; 0x12 c76e: 8b 8b std Y+19, r24 ; 0x13 c770: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c772: 83 e4 ldi r24, 0x43 ; 67 c774: 0e 94 8d 5c call 0xb91a ; 0xb91a c778: 88 23 and r24, r24 c77a: 09 f4 brne .+2 ; 0xc77e c77c: 65 c0 rjmp .+202 ; 0xc848 count = code_value_long(); c77e: 0e 94 39 5c call 0xb872 ; 0xb872 c782: 2b 01 movw r4, r22 c784: 3c 01 movw r6, r24 c786: c9 88 ldd r12, Y+17 ; 0x11 c788: da 88 ldd r13, Y+18 ; 0x12 c78a: eb 88 ldd r14, Y+19 ; 0x13 c78c: fc 88 ldd r15, Y+20 ; 0x14 c78e: 8c 14 cp r8, r12 c790: 9d 04 cpc r9, r13 c792: ae 04 cpc r10, r14 c794: bf 04 cpc r11, r15 c796: 10 f4 brcc .+4 ; 0xc79c c798: 75 01 movw r14, r10 c79a: 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) c79c: d3 01 movw r26, r6 c79e: c2 01 movw r24, r4 c7a0: 8c 0d add r24, r12 c7a2: 9d 1d adc r25, r13 c7a4: ae 1d adc r26, r14 c7a6: bf 1d adc r27, r15 c7a8: 88 16 cp r8, r24 c7aa: 99 06 cpc r9, r25 c7ac: aa 06 cpc r10, r26 c7ae: bb 06 cpc r11, r27 c7b0: 28 f0 brcs .+10 ; 0xc7bc c7b2: 8c 15 cp r24, r12 c7b4: 9d 05 cpc r25, r13 c7b6: ae 05 cpc r26, r14 c7b8: bf 05 cpc r27, r15 c7ba: 30 f4 brcc .+12 ; 0xc7c8 count = addr_end - addr_start; c7bc: 24 01 movw r4, r8 c7be: 35 01 movw r6, r10 c7c0: 4c 18 sub r4, r12 c7c2: 5d 08 sbc r5, r13 c7c4: 6e 08 sbc r6, r14 c7c6: 7f 08 sbc r7, r15 if (code_seen('X')) c7c8: 88 e5 ldi r24, 0x58 ; 88 c7ca: 0e 94 8d 5c call 0xb91a ; 0xb91a c7ce: 88 23 and r24, r24 c7d0: 09 f4 brne .+2 ; 0xc7d4 c7d2: 91 c0 rjmp .+290 ; 0xc8f6 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c7d4: 20 91 93 03 lds r18, 0x0393 ; 0x800393 c7d8: 30 91 94 03 lds r19, 0x0394 ; 0x800394 c7dc: 2f 5f subi r18, 0xFF ; 255 c7de: 3f 4f sbci r19, 0xFF ; 255 c7e0: fe 01 movw r30, r28 c7e2: 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; c7e4: 10 e0 ldi r17, 0x00 ; 0 c7e6: 00 e0 ldi r16, 0x00 ; 0 c7e8: 4f 01 movw r8, r30 c7ea: d9 01 movw r26, r18 while (*hex) c7ec: 8c 91 ld r24, X c7ee: 2f 5f subi r18, 0xFF ; 255 c7f0: 3f 4f sbci r19, 0xFF ; 255 c7f2: 88 23 and r24, r24 c7f4: 09 f4 brne .+2 ; 0xc7f8 c7f6: 3f c0 rjmp .+126 ; 0xc876 { if (count && (parsed >= count)) break; c7f8: 00 31 cpi r16, 0x10 ; 16 c7fa: 11 05 cpc r17, r1 c7fc: e1 f1 breq .+120 ; 0xc876 char c = *(hex++); if (c == ' ') continue; c7fe: 80 32 cpi r24, 0x20 ; 32 c800: a1 f3 breq .-24 ; 0xc7ea if (c == '\n') break; c802: 8a 30 cpi r24, 0x0A ; 10 c804: c1 f1 breq .+112 ; 0xc876 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c806: 90 ed ldi r25, 0xD0 ; 208 c808: 98 0f add r25, r24 c80a: 9a 30 cpi r25, 0x0A ; 10 c80c: 10 f5 brcc .+68 ; 0xc852 c80e: 82 95 swap r24 c810: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c812: 9d 01 movw r18, r26 c814: 2e 5f subi r18, 0xFE ; 254 c816: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c818: 11 96 adiw r26, 0x01 ; 1 c81a: 9c 91 ld r25, X c81c: 40 ed ldi r20, 0xD0 ; 208 c81e: 49 0f add r20, r25 c820: 4a 30 cpi r20, 0x0A ; 10 c822: f8 f4 brcc .+62 ; 0xc862 c824: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c826: 81 93 st Z+, r24 parsed++; c828: 0f 5f subi r16, 0xFF ; 255 c82a: 1f 4f sbci r17, 0xFF ; 255 c82c: de cf rjmp .-68 ; 0xc7ea { 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(); c82e: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 c832: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> c836: 9b 01 movw r18, r22 c838: 77 0f add r23, r23 c83a: 44 0b sbc r20, r20 c83c: 55 0b sbc r21, r21 c83e: 29 8b std Y+17, r18 ; 0x11 c840: 3a 8b std Y+18, r19 ; 0x12 c842: 4b 8b std Y+19, r20 ; 0x13 c844: 5c 8b std Y+20, r21 ; 0x14 c846: 95 cf rjmp .-214 ; 0xc772 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 c848: 44 24 eor r4, r4 c84a: 4a 94 dec r4 c84c: 54 2c mov r5, r4 c84e: 32 01 movw r6, r4 c850: 9a cf rjmp .-204 ; 0xc786 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); c852: 9f e9 ldi r25, 0x9F ; 159 c854: 98 0f add r25, r24 c856: 96 30 cpi r25, 0x06 ; 6 c858: 58 f4 brcc .+22 ; 0xc870 c85a: 82 95 swap r24 c85c: 80 7f andi r24, 0xF0 ; 240 c85e: 80 57 subi r24, 0x70 ; 112 c860: d8 cf rjmp .-80 ; 0xc812 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c862: 4f e9 ldi r20, 0x9F ; 159 c864: 49 0f add r20, r25 c866: 46 30 cpi r20, 0x06 ; 6 c868: 18 f4 brcc .+6 ; 0xc870 c86a: 97 55 subi r25, 0x57 ; 87 c86c: 89 2b or r24, r25 c86e: db cf rjmp .-74 ; 0xc826 else return -parsed; c870: 11 95 neg r17 c872: 01 95 neg r16 c874: 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); c876: 28 01 movw r4, r16 c878: 01 2e mov r0, r17 c87a: 00 0c add r0, r0 c87c: 66 08 sbc r6, r6 c87e: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c880: da 8a std Y+18, r13 ; 0x12 c882: 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++) c884: b1 2c mov r11, r1 c886: a1 2c mov r10, r1 c888: 0a 15 cp r16, r10 c88a: 1b 05 cpc r17, r11 c88c: f1 f0 breq .+60 ; 0xc8ca { switch (type) c88e: 33 20 and r3, r3 c890: 39 f0 breq .+14 ; 0xc8a0 c892: 31 e0 ldi r19, 0x01 ; 1 c894: 33 16 cp r3, r19 c896: 71 f0 breq .+28 ; 0xc8b4 } // 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++) c898: 4f ef ldi r20, 0xFF ; 255 c89a: a4 1a sub r10, r20 c89c: b4 0a sbc r11, r20 c89e: f4 cf rjmp .-24 ; 0xc888 { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c8a0: f4 01 movw r30, r8 c8a2: ea 0d add r30, r10 c8a4: fb 1d adc r31, r11 c8a6: 80 81 ld r24, Z c8a8: e9 89 ldd r30, Y+17 ; 0x11 c8aa: fa 89 ldd r31, Y+18 ; 0x12 c8ac: ea 0d add r30, r10 c8ae: fb 1d adc r31, r11 c8b0: 80 83 st Z, r24 c8b2: f2 cf rjmp .-28 ; 0xc898 case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c8b4: f4 01 movw r30, r8 c8b6: ea 0d add r30, r10 c8b8: 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); c8ba: 60 81 ld r22, Z c8bc: 89 89 ldd r24, Y+17 ; 0x11 c8be: 9a 89 ldd r25, Y+18 ; 0x12 c8c0: 8a 0d add r24, r10 c8c2: 9b 1d adc r25, r11 c8c4: 0f 94 8e dd call 0x3bb1c ; 0x3bb1c c8c8: e7 cf rjmp .-50 ; 0xc898 { 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); c8ca: ff 92 push r15 c8cc: ef 92 push r14 c8ce: df 92 push r13 c8d0: cf 92 push r12 c8d2: 2f 92 push r2 c8d4: 5d 89 ldd r21, Y+21 ; 0x15 c8d6: 5f 93 push r21 c8d8: 7f 92 push r7 c8da: 6f 92 push r6 c8dc: 5f 92 push r5 c8de: 4f 92 push r4 c8e0: 89 e3 ldi r24, 0x39 ; 57 c8e2: 96 e6 ldi r25, 0x66 ; 102 c8e4: 9f 93 push r25 c8e6: 8f 93 push r24 c8e8: 0f 94 08 dc call 0x3b810 ; 0x3b810 c8ec: 0f b6 in r0, 0x3f ; 63 c8ee: f8 94 cli c8f0: de bf out 0x3e, r29 ; 62 c8f2: 0f be out 0x3f, r0 ; 63 c8f4: 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); c8f6: 03 2d mov r16, r3 c8f8: a3 01 movw r20, r6 c8fa: 92 01 movw r18, r4 c8fc: c7 01 movw r24, r14 c8fe: b6 01 movw r22, r12 c900: 0f 94 94 86 call 0x30d28 ; 0x30d28 } c904: 65 96 adiw r28, 0x15 ; 21 c906: 0f b6 in r0, 0x3f ; 63 c908: f8 94 cli c90a: de bf out 0x3e, r29 ; 62 c90c: 0f be out 0x3f, r0 ; 63 c90e: cd bf out 0x3d, r28 ; 61 c910: df 91 pop r29 c912: cf 91 pop r28 c914: 1f 91 pop r17 c916: 0f 91 pop r16 c918: ff 90 pop r15 c91a: ef 90 pop r14 c91c: df 90 pop r13 c91e: cf 90 pop r12 c920: bf 90 pop r11 c922: af 90 pop r10 c924: 9f 90 pop r9 c926: 8f 90 pop r8 c928: 7f 90 pop r7 c92a: 6f 90 pop r6 c92c: 5f 90 pop r5 c92e: 4f 90 pop r4 c930: 3f 90 pop r3 c932: 2f 90 pop r2 c934: 08 95 ret 0000c936 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); c936: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> c93a: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> c93e: 90 e0 ldi r25, 0x00 ; 0 c940: 8a 30 cpi r24, 0x0A ; 10 c942: 20 f0 brcs .+8 ; 0xc94c c944: 89 5a subi r24, 0xA9 ; 169 c946: 9f 4f sbci r25, 0xFF ; 255 c948: 0d 94 ae db jmp 0x3b75c ; 0x3b75c c94c: c0 96 adiw r24, 0x30 ; 48 c94e: fc cf rjmp .-8 ; 0xc948 0000c950 : 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); c950: 84 ff sbrs r24, 4 c952: 18 c0 rjmp .+48 ; 0xc984 c954: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); c956: 85 ff sbrs r24, 5 c958: 17 c0 rjmp .+46 ; 0xc988 c95a: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); c95c: 2f b7 in r18, 0x3f ; 63 c95e: 86 ff sbrs r24, 6 c960: 15 c0 rjmp .+42 ; 0xc98c c962: f8 94 cli c964: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c968: 90 68 ori r25, 0x80 ; 128 c96a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c96e: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); c970: 87 ff sbrs r24, 7 c972: 11 c0 rjmp .+34 ; 0xc996 c974: 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); c976: 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); c978: 85 e0 ldi r24, 0x05 ; 5 c97a: 8a 95 dec r24 c97c: f1 f7 brne .-4 ; 0xc97a c97e: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); c980: 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(); } c982: 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); c984: 8d 98 cbi 0x11, 5 ; 17 c986: e7 cf rjmp .-50 ; 0xc956 WRITE(LCD_PINS_D5, value & 0x20); c988: a4 98 cbi 0x14, 4 ; 20 c98a: e8 cf rjmp .-48 ; 0xc95c WRITE(LCD_PINS_D6, value & 0x40); c98c: f8 94 cli c98e: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c992: 9f 77 andi r25, 0x7F ; 127 c994: ea cf rjmp .-44 ; 0xc96a WRITE(LCD_PINS_D7, value & 0x80); c996: a3 98 cbi 0x14, 3 ; 20 c998: ee cf rjmp .-36 ; 0xc976 0000c99a : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { c99a: 0f 93 push r16 c99c: 1f 93 push r17 c99e: cf 93 push r28 c9a0: df 93 push r29 c9a2: c8 2f mov r28, r24 c9a4: d6 2f mov r29, r22 c9a6: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); c9a8: 60 ff sbrs r22, 0 c9aa: 15 c0 rjmp .+42 ; 0xc9d6 c9ac: 5d 9a sbi 0x0b, 5 ; 11 c9ae: 8a e1 ldi r24, 0x1A ; 26 c9b0: 8a 95 dec r24 c9b2: f1 f7 brne .-4 ; 0xc9b0 c9b4: 00 c0 rjmp .+0 ; 0xc9b6 _delay_us(5); lcd_writebits(data); c9b6: 8c 2f mov r24, r28 c9b8: 0e 94 a8 64 call 0xc950 ; 0xc950 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { c9bc: d1 fd sbrc r29, 1 c9be: 04 c0 rjmp .+8 ; 0xc9c8 // _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 c9c0: 8c 2f mov r24, r28 c9c2: 82 95 swap r24 c9c4: 0e 94 a8 64 call 0xc950 ; 0xc950 } #endif delayMicroseconds(duration); c9c8: c8 01 movw r24, r16 } c9ca: df 91 pop r29 c9cc: cf 91 pop r28 c9ce: 1f 91 pop r17 c9d0: 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); c9d2: 0c 94 12 df jmp 0x1be24 ; 0x1be24 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); c9d6: 5d 98 cbi 0x0b, 5 ; 11 c9d8: ea cf rjmp .-44 ; 0xc9ae 0000c9da : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { c9da: cf 92 push r12 c9dc: df 92 push r13 c9de: ef 92 push r14 c9e0: ff 92 push r15 c9e2: cf 93 push r28 c9e4: df 93 push r29 c9e6: ec 01 movw r28, r24 c9e8: 6a 01 movw r12, r20 c9ea: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) c9ec: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c c9f0: 6f 3f cpi r22, 0xFF ; 255 c9f2: 7f 4f sbci r23, 0xFF ; 255 c9f4: 8f 4f sbci r24, 0xFF ; 255 c9f6: 9f 4f sbci r25, 0xFF ; 255 c9f8: 59 f4 brne .+22 ; 0xca10 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); c9fa: b7 01 movw r22, r14 c9fc: a6 01 movw r20, r12 c9fe: 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); } ca00: df 91 pop r29 ca02: cf 91 pop r28 ca04: ff 90 pop r15 ca06: ef 90 pop r14 ca08: df 90 pop r13 ca0a: 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); ca0c: 0d 94 9c dd jmp 0x3bb38 ; 0x3bb38 } 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); } ca10: df 91 pop r29 ca12: cf 91 pop r28 ca14: ff 90 pop r15 ca16: ef 90 pop r14 ca18: df 90 pop r13 ca1a: cf 90 pop r12 ca1c: 08 95 ret 0000ca1e : /// 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)); ca1e: 80 e1 ldi r24, 0x10 ; 16 ca20: e0 e4 ldi r30, 0x40 ; 64 ca22: f7 e0 ldi r31, 0x07 ; 7 ca24: ab e9 ldi r26, 0x9B ; 155 ca26: b2 e0 ldi r27, 0x02 ; 2 ca28: 01 90 ld r0, Z+ ca2a: 0d 92 st X+, r0 ca2c: 8a 95 dec r24 ca2e: e1 f7 brne .-8 ; 0xca28 saved_feedmultiply2 = feedmultiply; //save feedmultiply ca30: 80 91 39 02 lds r24, 0x0239 ; 0x800239 ca34: 90 91 3a 02 lds r25, 0x023A ; 0x80023a ca38: 90 93 70 03 sts 0x0370, r25 ; 0x800370 ca3c: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); ca40: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a ca44: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b ca48: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab ca4c: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa saved_bed_temperature = (uint8_t)degTargetBed(); ca50: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 ca54: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; ca58: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd ca5c: 83 fb bst r24, 3 ca5e: 88 27 eor r24, r24 ca60: 80 f9 bld r24, 0 ca62: 80 93 03 18 sts 0x1803, r24 ; 0x801803 saved_fan_speed = fanSpeed; ca66: 80 91 df 03 lds r24, 0x03DF ; 0x8003df ca6a: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 isPartialBackupAvailable = true; ca6e: 81 e0 ldi r24, 0x01 ; 1 ca70: 80 93 50 07 sts 0x0750, r24 ; 0x800750 } ca74: 08 95 ret 0000ca76 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } ca76: cf 93 push r28 ca78: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { ca7a: 8b ef ldi r24, 0xFB ; 251 ca7c: 96 e1 ldi r25, 0x16 ; 22 ca7e: 0e 94 cd 78 call 0xf19a ; 0xf19a #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader ca82: 89 e3 ldi r24, 0x39 ; 57 ca84: 95 e1 ldi r25, 0x15 ; 21 ca86: 89 2b or r24, r25 ca88: 51 f0 breq .+20 ; 0xca9e <_GLOBAL__sub_D_card+0x28> ca8a: cb e0 ldi r28, 0x0B ; 11 ca8c: d6 e1 ldi r29, 0x16 ; 22 ca8e: a3 97 sbiw r28, 0x23 ; 35 ca90: ce 01 movw r24, r28 ca92: 0e 94 cd 78 call 0xf19a ; 0xf19a ca96: 85 e1 ldi r24, 0x15 ; 21 ca98: c9 33 cpi r28, 0x39 ; 57 ca9a: d8 07 cpc r29, r24 ca9c: c1 f7 brne .-16 ; 0xca8e <_GLOBAL__sub_D_card+0x18> ca9e: 86 e1 ldi r24, 0x16 ; 22 caa0: 95 e1 ldi r25, 0x15 ; 21 caa2: 0e 94 cd 78 call 0xf19a ; 0xf19a caa6: 81 ef ldi r24, 0xF1 ; 241 caa8: 94 e1 ldi r25, 0x14 ; 20 caaa: df 91 pop r29 caac: cf 91 pop r28 caae: 0c 94 cd 78 jmp 0xf19a ; 0xf19a 0000cab2 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { cab2: cf 93 push r28 cab4: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; cab6: c0 e4 ldi r28, 0x40 ; 64 cab8: d7 e0 ldi r29, 0x07 ; 7 caba: 20 e0 ldi r18, 0x00 ; 0 cabc: 30 e0 ldi r19, 0x00 ; 0 cabe: 48 ec ldi r20, 0xC8 ; 200 cac0: 51 e4 ldi r21, 0x41 ; 65 cac2: 6c 85 ldd r22, Y+12 ; 0x0c cac4: 7d 85 ldd r23, Y+13 ; 0x0d cac6: 8e 85 ldd r24, Y+14 ; 0x0e cac8: 9f 85 ldd r25, Y+15 ; 0x0f caca: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> cace: 6c 87 std Y+12, r22 ; 0x0c cad0: 7d 87 std Y+13, r23 ; 0x0d cad2: 8e 87 std Y+14, r24 ; 0x0e cad4: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cad6: 63 e3 ldi r22, 0x33 ; 51 cad8: 73 e3 ldi r23, 0x33 ; 51 cada: 83 e5 ldi r24, 0x53 ; 83 cadc: 90 e4 ldi r25, 0x40 ; 64 } cade: df 91 pop r29 cae0: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cae2: 0d 94 48 ba jmp 0x37490 ; 0x37490 0000cae6 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); cae6: 60 e0 ldi r22, 0x00 ; 0 cae8: 85 ea ldi r24, 0xA5 ; 165 caea: 9f e0 ldi r25, 0x0F ; 15 caec: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 caf0: 60 e0 ldi r22, 0x00 ; 0 caf2: 8f e7 ldi r24, 0x7F ; 127 caf4: 9c e0 ldi r25, 0x0C ; 12 caf6: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 // 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; cafa: 80 e0 ldi r24, 0x00 ; 0 cafc: 90 e0 ldi r25, 0x00 ; 0 cafe: a0 e8 ldi r26, 0x80 ; 128 cb00: bf eb ldi r27, 0xBF ; 191 cb02: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab cb06: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac cb0a: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad cb0e: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cb12: 82 e0 ldi r24, 0x02 ; 2 cb14: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; cb18: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 } cb1c: 08 95 ret 0000cb1e : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) cb1e: 80 91 aa 05 lds r24, 0x05AA ; 0x8005aa cb22: 90 91 ab 05 lds r25, 0x05AB ; 0x8005ab cb26: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a cb2a: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b cb2e: 28 17 cp r18, r24 cb30: 39 07 cpc r19, r25 cb32: 71 f0 breq .+28 ; 0xcb50 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; cb34: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b cb38: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; cb3c: 81 e0 ldi r24, 0x01 ; 1 cb3e: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db wait_for_heater(_millis(), active_extruder); cb42: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 cb46: 0f 94 4c 82 call 0x30498 ; 0x30498 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; cb4a: 82 e0 ldi r24, 0x02 ; 2 cb4c: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db } } cb50: 08 95 ret 0000cb52 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { cb52: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 cb56: 88 23 and r24, r24 cb58: 41 f0 breq .+16 ; 0xcb6a // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; cb5a: 80 91 39 02 lds r24, 0x0239 ; 0x800239 cb5e: 90 91 3a 02 lds r25, 0x023A ; 0x80023a cb62: 90 93 70 03 sts 0x0370, r25 ; 0x800370 cb66: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f } cb6a: 08 95 ret 0000cb6c : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) cb6c: 80 91 9f 05 lds r24, 0x059F ; 0x80059f cb70: 90 91 a0 05 lds r25, 0x05A0 ; 0x8005a0 cb74: 00 97 sbiw r24, 0x00 ; 0 cb76: 29 f1 breq .+74 ; 0xcbc2 cb78: 20 91 56 0e lds r18, 0x0E56 ; 0x800e56 cb7c: 21 11 cpse r18, r1 cb7e: 21 c0 rjmp .+66 ; 0xcbc2 cb80: 20 91 55 0e lds r18, 0x0E55 ; 0x800e55 cb84: 21 11 cpse r18, r1 cb86: 1d c0 rjmp .+58 ; 0xcbc2 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); cb88: fc 01 movw r30, r24 cb8a: e8 5a subi r30, 0xA8 ; 168 cb8c: ff 4f sbci r31, 0xFF ; 255 cb8e: 20 e1 ldi r18, 0x10 ; 16 cb90: ab ea ldi r26, 0xAB ; 171 cb92: b2 e0 ldi r27, 0x02 ; 2 cb94: 01 90 ld r0, Z+ cb96: 0d 92 st X+, r0 cb98: 2a 95 dec r18 cb9a: e1 f7 brne .-8 ; 0xcb94 saved_feedrate2 = current_block->gcode_feedrate; cb9c: fc 01 movw r30, r24 cb9e: e6 59 subi r30, 0x96 ; 150 cba0: ff 4f sbci r31, 0xFF ; 255 cba2: 20 81 ld r18, Z cba4: 31 81 ldd r19, Z+1 ; 0x01 cba6: 30 93 fe 17 sts 0x17FE, r19 ; 0x8017fe cbaa: 20 93 fd 17 sts 0x17FD, r18 ; 0x8017fd saved_segment_idx = current_block->segment_idx; cbae: 88 59 subi r24, 0x98 ; 152 cbb0: 9f 4f sbci r25, 0xFF ; 255 cbb2: fc 01 movw r30, r24 cbb4: 80 81 ld r24, Z cbb6: 91 81 ldd r25, Z+1 ; 0x01 cbb8: 90 93 09 18 sts 0x1809, r25 ; 0x801809 cbbc: 80 93 08 18 sts 0x1808, r24 ; 0x801808 cbc0: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; cbc2: 80 e0 ldi r24, 0x00 ; 0 cbc4: 90 e0 ldi r25, 0x00 ; 0 cbc6: a0 e8 ldi r26, 0x80 ; 128 cbc8: bf eb ldi r27, 0xBF ; 191 cbca: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab cbce: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac cbd2: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad cbd6: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_feedrate2 = feedrate; cbda: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cbde: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cbe2: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cbe6: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cbea: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> cbee: 70 93 fe 17 sts 0x17FE, r23 ; 0x8017fe cbf2: 60 93 fd 17 sts 0x17FD, r22 ; 0x8017fd saved_segment_idx = 0; cbf6: 10 92 09 18 sts 0x1809, r1 ; 0x801809 cbfa: 10 92 08 18 sts 0x1808, r1 ; 0x801808 } } cbfe: 08 95 ret 0000cc00 : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { cc00: cf 92 push r12 cc02: df 92 push r13 cc04: ef 92 push r14 cc06: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { cc08: 80 91 6b 14 lds r24, 0x146B ; 0x80146b cc0c: 88 23 and r24, r24 cc0e: d9 f1 breq .+118 ; 0xcc86 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue cc10: 80 91 80 03 lds r24, 0x0380 ; 0x800380 cc14: 90 91 81 03 lds r25, 0x0381 ; 0x800381 cc18: a0 91 82 03 lds r26, 0x0382 ; 0x800382 cc1c: b0 91 83 03 lds r27, 0x0383 ; 0x800383 cc20: 80 93 ff 17 sts 0x17FF, r24 ; 0x8017ff cc24: 90 93 00 18 sts 0x1800, r25 ; 0x801800 cc28: a0 93 01 18 sts 0x1801, r26 ; 0x801801 cc2c: b0 93 02 18 sts 0x1802, r27 ; 0x801802 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner cc30: 0f 94 0a aa call 0x35414 ; 0x35414 saved_sdpos -= sdlen_planner; cc34: c0 90 ff 17 lds r12, 0x17FF ; 0x8017ff cc38: d0 90 00 18 lds r13, 0x1800 ; 0x801800 cc3c: e0 90 01 18 lds r14, 0x1801 ; 0x801801 cc40: f0 90 02 18 lds r15, 0x1802 ; 0x801802 cc44: c8 1a sub r12, r24 cc46: d9 0a sbc r13, r25 cc48: e1 08 sbc r14, r1 cc4a: f1 08 sbc r15, r1 cc4c: c0 92 ff 17 sts 0x17FF, r12 ; 0x8017ff cc50: d0 92 00 18 sts 0x1800, r13 ; 0x801800 cc54: e0 92 01 18 sts 0x1801, r14 ; 0x801801 cc58: f0 92 02 18 sts 0x1802, r15 ; 0x801802 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue cc5c: 0e 94 ca 5b call 0xb794 ; 0xb794 saved_sdpos -= sdlen_cmdqueue; cc60: c8 1a sub r12, r24 cc62: d9 0a sbc r13, r25 cc64: e1 08 sbc r14, r1 cc66: f1 08 sbc r15, r1 cc68: c0 92 ff 17 sts 0x17FF, r12 ; 0x8017ff cc6c: d0 92 00 18 sts 0x1800, r13 ; 0x801800 cc70: e0 92 01 18 sts 0x1801, r14 ; 0x801801 cc74: f0 92 02 18 sts 0x1802, r15 ; 0x801802 saved_printing_type = PowerPanic::PRINT_TYPE_SD; cc78: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } cc7c: ff 90 pop r15 cc7e: ef 90 pop r14 cc80: df 90 pop r13 cc82: cf 90 pop r12 cc84: 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 cc86: 80 91 0e 05 lds r24, 0x050E ; 0x80050e cc8a: 88 23 and r24, r24 cc8c: b1 f1 breq .+108 ; 0xccfa saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue cc8e: 80 91 78 03 lds r24, 0x0378 ; 0x800378 cc92: 90 91 79 03 lds r25, 0x0379 ; 0x800379 cc96: a0 91 7a 03 lds r26, 0x037A ; 0x80037a cc9a: b0 91 7b 03 lds r27, 0x037B ; 0x80037b cc9e: 80 93 ff 17 sts 0x17FF, r24 ; 0x8017ff cca2: 90 93 00 18 sts 0x1800, r25 ; 0x801800 cca6: a0 93 01 18 sts 0x1801, r26 ; 0x801801 ccaa: b0 93 02 18 sts 0x1802, r27 ; 0x801802 //reuse planner_calc_sd_length function for getting number of lines of commands in planner: nlines = planner_calc_sd_length(); //number of lines of commands in planner ccae: 0f 94 0a aa call 0x35414 ; 0x35414 saved_sdpos -= nlines; ccb2: 40 91 ff 17 lds r20, 0x17FF ; 0x8017ff ccb6: 50 91 00 18 lds r21, 0x1800 ; 0x801800 ccba: 60 91 01 18 lds r22, 0x1801 ; 0x801801 ccbe: 70 91 02 18 lds r23, 0x1802 ; 0x801802 ccc2: 48 1b sub r20, r24 ccc4: 51 09 sbc r21, r1 ccc6: 61 09 sbc r22, r1 ccc8: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer ccca: 80 91 7e 10 lds r24, 0x107E ; 0x80107e ccce: 90 91 7f 10 lds r25, 0x107F ; 0x80107f ccd2: 09 2e mov r0, r25 ccd4: 00 0c add r0, r0 ccd6: aa 0b sbc r26, r26 ccd8: bb 0b sbc r27, r27 ccda: 48 1b sub r20, r24 ccdc: 59 0b sbc r21, r25 ccde: 6a 0b sbc r22, r26 cce0: 7b 0b sbc r23, r27 cce2: 40 93 ff 17 sts 0x17FF, r20 ; 0x8017ff cce6: 50 93 00 18 sts 0x1800, r21 ; 0x801800 ccea: 60 93 01 18 sts 0x1801, r22 ; 0x801801 ccee: 70 93 02 18 sts 0x1802, r23 ; 0x801802 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; ccf2: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; ccf4: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a ccf8: c1 cf rjmp .-126 ; 0xcc7c ccfa: 82 e0 ldi r24, 0x02 ; 2 ccfc: fb cf rjmp .-10 ; 0xccf4 0000ccfe : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { ccfe: cf 92 push r12 cd00: df 92 push r13 cd02: ef 92 push r14 cd04: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cd06: c0 90 03 07 lds r12, 0x0703 ; 0x800703 cd0a: d0 90 04 07 lds r13, 0x0704 ; 0x800704 cd0e: e0 90 05 07 lds r14, 0x0705 ; 0x800705 cd12: f0 90 06 07 lds r15, 0x0706 ; 0x800706 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { cd16: 80 91 02 07 lds r24, 0x0702 ; 0x800702 cd1a: 88 23 and r24, r24 cd1c: 09 f4 brne .+2 ; 0xcd20 cd1e: 4e c0 rjmp .+156 ; 0xcdbc cd20: 20 e0 ldi r18, 0x00 ; 0 cd22: 30 e0 ldi r19, 0x00 ; 0 cd24: a9 01 movw r20, r18 cd26: c7 01 movw r24, r14 cd28: b6 01 movw r22, r12 cd2a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> cd2e: 18 16 cp r1, r24 cd30: 0c f0 brlt .+2 ; 0xcd34 cd32: 44 c0 rjmp .+136 ; 0xcdbc float area = M_PI * diameter * diameter * 0.25; cd34: 2b ed ldi r18, 0xDB ; 219 cd36: 3f e0 ldi r19, 0x0F ; 15 cd38: 49 e4 ldi r20, 0x49 ; 73 cd3a: 50 e4 ldi r21, 0x40 ; 64 cd3c: c7 01 movw r24, r14 cd3e: b6 01 movw r22, r12 cd40: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> cd44: a7 01 movw r20, r14 cd46: 96 01 movw r18, r12 cd48: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> cd4c: 20 e0 ldi r18, 0x00 ; 0 cd4e: 30 e0 ldi r19, 0x00 ; 0 cd50: 40 e8 ldi r20, 0x80 ; 128 cd52: 5e e3 ldi r21, 0x3E ; 62 cd54: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> cd58: 9b 01 movw r18, r22 cd5a: ac 01 movw r20, r24 out = 1.f / area; cd5c: 60 e0 ldi r22, 0x00 ; 0 cd5e: 70 e0 ldi r23, 0x00 ; 0 cd60: 80 e8 ldi r24, 0x80 ; 128 cd62: 9f e3 ldi r25, 0x3F ; 63 cd64: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> cd68: 6b 01 movw r12, r22 cd6a: 7c 01 movw r14, r24 } if (extrudemultiply != 100) cd6c: 60 91 94 02 lds r22, 0x0294 ; 0x800294 cd70: 70 91 95 02 lds r23, 0x0295 ; 0x800295 cd74: 64 36 cpi r22, 0x64 ; 100 cd76: 71 05 cpc r23, r1 cd78: a1 f0 breq .+40 ; 0xcda2 out *= float(extrudemultiply) * 0.01f; cd7a: 07 2e mov r0, r23 cd7c: 00 0c add r0, r0 cd7e: 88 0b sbc r24, r24 cd80: 99 0b sbc r25, r25 cd82: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> cd86: 2a e0 ldi r18, 0x0A ; 10 cd88: 37 ed ldi r19, 0xD7 ; 215 cd8a: 43 e2 ldi r20, 0x23 ; 35 cd8c: 5c e3 ldi r21, 0x3C ; 60 cd8e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> cd92: 9b 01 movw r18, r22 cd94: ac 01 movw r20, r24 cd96: c7 01 movw r24, r14 cd98: b6 01 movw r22, r12 cd9a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> cd9e: 6b 01 movw r12, r22 cda0: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cda2: c0 92 bb 02 sts 0x02BB, r12 ; 0x8002bb cda6: d0 92 bc 02 sts 0x02BC, r13 ; 0x8002bc cdaa: e0 92 bd 02 sts 0x02BD, r14 ; 0x8002bd cdae: 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 } cdb2: ff 90 pop r15 cdb4: ef 90 pop r14 cdb6: df 90 pop r13 cdb8: cf 90 pop r12 cdba: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; cdbc: c1 2c mov r12, r1 cdbe: d1 2c mov r13, r1 cdc0: 80 e8 ldi r24, 0x80 ; 128 cdc2: e8 2e mov r14, r24 cdc4: 8f e3 ldi r24, 0x3F ; 63 cdc6: f8 2e mov r15, r24 cdc8: d1 cf rjmp .-94 ; 0xcd6c 0000cdca : } } #endif //FAST_PWM_FAN void save_statistics() { cdca: 8f 92 push r8 cdcc: 9f 92 push r9 cdce: af 92 push r10 cdd0: bf 92 push r11 cdd2: cf 92 push r12 cdd4: df 92 push r13 cdd6: ef 92 push r14 cdd8: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: centimeter cdda: 81 ef ldi r24, 0xF1 ; 241 cddc: 9f e0 ldi r25, 0x0F ; 15 cdde: 0f 94 36 7c call 0x2f86c ; 0x2f86c cde2: 6b 01 movw r12, r22 cde4: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cde6: 8d ee ldi r24, 0xED ; 237 cde8: 9f e0 ldi r25, 0x0F ; 15 cdea: 0f 94 36 7c call 0x2f86c ; 0x2f86c cdee: 4b 01 movw r8, r22 cdf0: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; cdf2: 0f 94 b3 54 call 0x2a966 ; 0x2a966 cdf6: 2c e3 ldi r18, 0x3C ; 60 cdf8: 30 e0 ldi r19, 0x00 ; 0 cdfa: 40 e0 ldi r20, 0x00 ; 0 cdfc: 50 e0 ldi r21, 0x00 ; 0 cdfe: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min ce02: ba 01 movw r22, r20 ce04: a9 01 movw r20, r18 ce06: 48 0d add r20, r8 ce08: 59 1d adc r21, r9 ce0a: 6a 1d adc r22, r10 ce0c: 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); ce0e: 8d ee ldi r24, 0xED ; 237 ce10: 9f e0 ldi r25, 0x0F ; 15 ce12: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); ce16: 60 91 5f 06 lds r22, 0x065F ; 0x80065f ce1a: 70 91 60 06 lds r23, 0x0660 ; 0x800660 ce1e: 80 91 61 06 lds r24, 0x0661 ; 0x800661 ce22: 90 91 62 06 lds r25, 0x0662 ; 0x800662 ce26: 28 ee ldi r18, 0xE8 ; 232 ce28: 33 e0 ldi r19, 0x03 ; 3 ce2a: 40 e0 ldi r20, 0x00 ; 0 ce2c: 50 e0 ldi r21, 0x00 ; 0 ce2e: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> ce32: ba 01 movw r22, r20 ce34: a9 01 movw r20, r18 ce36: 4c 0d add r20, r12 ce38: 5d 1d adc r21, r13 ce3a: 6e 1d adc r22, r14 ce3c: 7f 1d adc r23, r15 ce3e: 81 ef ldi r24, 0xF1 ; 241 ce40: 9f e0 ldi r25, 0x0F ; 15 ce42: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 print_job_timer.reset(); ce46: 0f 94 6b 58 call 0x2b0d6 ; 0x2b0d6 total_filament_used = 0; ce4a: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f ce4e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 ce52: 10 92 61 06 sts 0x0661, r1 ; 0x800661 ce56: 10 92 62 06 sts 0x0662, r1 ; 0x800662 if (MMU2::mmu2.Enabled()) { ce5a: 80 91 95 13 lds r24, 0x1395 ; 0x801395 ce5e: 81 30 cpi r24, 0x01 ; 1 ce60: 81 f4 brne .+32 ; 0xce82 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); ce62: 60 91 99 13 lds r22, 0x1399 ; 0x801399 ce66: 70 91 9a 13 lds r23, 0x139A ; 0x80139a ce6a: 90 e0 ldi r25, 0x00 ; 0 ce6c: 80 e0 ldi r24, 0x00 ; 0 ce6e: 0f 94 1e 7c call 0x2f83c ; 0x2f83c /// @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; }; ce72: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a ce76: 10 92 99 13 sts 0x1399, r1 ; 0x801399 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } ce7a: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c ce7e: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b // @@TODO why were EEPROM_MMU_FAIL_TOT and EEPROM_MMU_LOAD_FAIL_TOT behaving differently - i.e. updated with every change? MMU2::mmu2.ClearToolChangeCounter(); MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } ce82: ff 90 pop r15 ce84: ef 90 pop r14 ce86: df 90 pop r13 ce88: cf 90 pop r12 ce8a: bf 90 pop r11 ce8c: af 90 pop r10 ce8e: 9f 90 pop r9 ce90: 8f 90 pop r8 ce92: 08 95 ret 0000ce94 : } #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); ce94: 80 91 df 03 lds r24, 0x03DF ; 0x8003df ce98: 1f 92 push r1 ce9a: 8f 93 push r24 ce9c: 80 91 69 03 lds r24, 0x0369 ; 0x800369 cea0: 1f 92 push r1 cea2: 8f 93 push r24 cea4: ee ea ldi r30, 0xAE ; 174 cea6: f4 e0 ldi r31, 0x04 ; 4 cea8: 42 81 ldd r20, Z+2 ; 0x02 ceaa: 53 81 ldd r21, Z+3 ; 0x03 ceac: 2c e3 ldi r18, 0x3C ; 60 ceae: 24 9f mul r18, r20 ceb0: c0 01 movw r24, r0 ceb2: 25 9f mul r18, r21 ceb4: 90 0d add r25, r0 ceb6: 11 24 eor r1, r1 ceb8: 9f 93 push r25 ceba: 8f 93 push r24 cebc: 40 81 ld r20, Z cebe: 51 81 ldd r21, Z+1 ; 0x01 cec0: 24 9f mul r18, r20 cec2: c0 01 movw r24, r0 cec4: 25 9f mul r18, r21 cec6: 90 0d add r25, r0 cec8: 11 24 eor r1, r1 ceca: 9f 93 push r25 cecc: 8f 93 push r24 cece: 8c ef ldi r24, 0xFC ; 252 ced0: 96 e6 ldi r25, 0x66 ; 102 ced2: 9f 93 push r25 ced4: 8f 93 push r24 ced6: 0f 94 08 dc call 0x3b810 ; 0x3b810 ceda: 8d b7 in r24, 0x3d ; 61 cedc: 9e b7 in r25, 0x3e ; 62 cede: 0a 96 adiw r24, 0x0a ; 10 cee0: 0f b6 in r0, 0x3f ; 63 cee2: f8 94 cli cee4: 9e bf out 0x3e, r25 ; 62 cee6: 0f be out 0x3f, r0 ; 63 cee8: 8d bf out 0x3d, r24 ; 61 } ceea: 08 95 ret 0000ceec : // 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) { ceec: cf 93 push r28 ceee: 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); cef0: 8f ef ldi r24, 0xFF ; 255 cef2: 9f e0 ldi r25, 0x0F ; 15 cef4: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { cef8: 81 30 cpi r24, 0x01 ; 1 cefa: 21 f0 breq .+8 ; 0xcf04 cefc: 80 91 69 06 lds r24, 0x0669 ; 0x800669 cf00: 81 30 cpi r24, 0x01 ; 1 cf02: 29 f4 brne .+10 ; 0xcf0e //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); cf04: 81 e0 ldi r24, 0x01 ; 1 cf06: 8c 27 eor r24, r28 } } cf08: 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); cf0a: 0c 94 4f 61 jmp 0xc29e ; 0xc29e } } cf0e: cf 91 pop r28 cf10: 08 95 ret 0000cf12 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cf12: 84 e8 ldi r24, 0x84 ; 132 cf14: 93 e0 ldi r25, 0x03 ; 3 cf16: 0d 94 fe 41 jmp 0x283fc ; 0x283fc ::start()> 0000cf1a : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cf1a: 20 e0 ldi r18, 0x00 ; 0 cf1c: 30 e0 ldi r19, 0x00 ; 0 cf1e: 40 e7 ldi r20, 0x70 ; 112 cf20: 52 e4 ldi r21, 0x42 ; 66 cf22: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> } cf26: 08 95 ret 0000cf28 : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cf28: 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; cf2c: 40 91 64 03 lds r20, 0x0364 ; 0x800364 cf30: 50 91 65 03 lds r21, 0x0365 ; 0x800365 cf34: 60 91 66 03 lds r22, 0x0366 ; 0x800366 cf38: 70 91 67 03 lds r23, 0x0367 ; 0x800367 cf3c: 40 93 90 02 sts 0x0290, r20 ; 0x800290 cf40: 50 93 91 02 sts 0x0291, r21 ; 0x800291 cf44: 60 93 92 02 sts 0x0292, r22 ; 0x800292 cf48: 70 93 93 02 sts 0x0293, r23 ; 0x800293 feedmultiply = original_feedmultiply; cf4c: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cf50: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cf54: 84 e8 ldi r24, 0x84 ; 132 cf56: 93 e0 ldi r25, 0x03 ; 3 cf58: 0d 94 fe 41 jmp 0x283fc ; 0x283fc ::start()> 0000cf5c : 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) { cf5c: 1f 93 push r17 cf5e: cf 93 push r28 cf60: df 93 push r29 cf62: 18 2f mov r17, r24 saved_feedrate = feedrate; cf64: 80 91 90 02 lds r24, 0x0290 ; 0x800290 cf68: 90 91 91 02 lds r25, 0x0291 ; 0x800291 cf6c: a0 91 92 02 lds r26, 0x0292 ; 0x800292 cf70: b0 91 93 02 lds r27, 0x0293 ; 0x800293 cf74: 80 93 64 03 sts 0x0364, r24 ; 0x800364 cf78: 90 93 65 03 sts 0x0365, r25 ; 0x800365 cf7c: a0 93 66 03 sts 0x0366, r26 ; 0x800366 cf80: b0 93 67 03 sts 0x0367, r27 ; 0x800367 int l_feedmultiply = feedmultiply; cf84: c0 91 39 02 lds r28, 0x0239 ; 0x800239 cf88: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; cf8c: 84 e6 ldi r24, 0x64 ; 100 cf8e: 90 e0 ldi r25, 0x00 ; 0 cf90: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cf94: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cf98: 84 e8 ldi r24, 0x84 ; 132 cf9a: 93 e0 ldi r25, 0x03 ; 3 cf9c: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> cfa0: 10 93 8f 02 sts 0x028F, r17 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(enable_endstops_now); return l_feedmultiply; } cfa4: ce 01 movw r24, r28 cfa6: df 91 pop r29 cfa8: cf 91 pop r28 cfaa: 1f 91 pop r17 cfac: 08 95 ret 0000cfae : cfae: 40 e0 ldi r20, 0x00 ; 0 cfb0: 50 e0 ldi r21, 0x00 ; 0 cfb2: ba 01 movw r22, r20 cfb4: 8d ee ldi r24, 0xED ; 237 cfb6: 9f e0 ldi r25, 0x0F ; 15 cfb8: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 cfbc: 40 e0 ldi r20, 0x00 ; 0 cfbe: 50 e0 ldi r21, 0x00 ; 0 cfc0: ba 01 movw r22, r20 cfc2: 81 ef ldi r24, 0xF1 ; 241 cfc4: 9f e0 ldi r25, 0x0F ; 15 cfc6: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 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(); cfca: 0e 94 db 5c call 0xb9b6 ; 0xb9b6 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); cfce: 70 e0 ldi r23, 0x00 ; 0 cfd0: 60 e0 ldi r22, 0x00 ; 0 cfd2: 85 e0 ldi r24, 0x05 ; 5 cfd4: 9f e0 ldi r25, 0x0F ; 15 cfd6: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 cfda: 70 e0 ldi r23, 0x00 ; 0 cfdc: 60 e0 ldi r22, 0x00 ; 0 cfde: 83 e0 ldi r24, 0x03 ; 3 cfe0: 9f e0 ldi r25, 0x0F ; 15 cfe2: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 cfe6: 70 e0 ldi r23, 0x00 ; 0 cfe8: 60 e0 ldi r22, 0x00 ; 0 cfea: 81 e0 ldi r24, 0x01 ; 1 cfec: 9f e0 ldi r25, 0x0F ; 15 cfee: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 cff2: 70 e0 ldi r23, 0x00 ; 0 cff4: 60 e0 ldi r22, 0x00 ; 0 cff6: 8f ef ldi r24, 0xFF ; 255 cff8: 9e e0 ldi r25, 0x0E ; 14 cffa: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 cffe: 70 e0 ldi r23, 0x00 ; 0 d000: 60 e0 ldi r22, 0x00 ; 0 d002: 83 ed ldi r24, 0xD3 ; 211 d004: 9e e0 ldi r25, 0x0E ; 14 d006: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 d00a: 70 e0 ldi r23, 0x00 ; 0 d00c: 60 e0 ldi r22, 0x00 ; 0 d00e: 80 ed ldi r24, 0xD0 ; 208 d010: 9e e0 ldi r25, 0x0E ; 14 d012: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); d016: 40 e0 ldi r20, 0x00 ; 0 d018: 50 e0 ldi r21, 0x00 ; 0 d01a: ba 01 movw r22, r20 d01c: 88 ea ldi r24, 0xA8 ; 168 d01e: 9c e0 ldi r25, 0x0C ; 12 d020: 0d 94 7c dd jmp 0x3baf8 ; 0x3baf8 0000d024 : wdt_disable(); } } void softReset(void) { cli(); d024: 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" ); d026: 88 e1 ldi r24, 0x18 ; 24 d028: 98 e0 ldi r25, 0x08 ; 8 d02a: 0f b6 in r0, 0x3f ; 63 d02c: f8 94 cli d02e: a8 95 wdr d030: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d034: 0f be out 0x3f, r0 ; 63 d036: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d03a: ff cf rjmp .-2 ; 0xd03a 0000d03c : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { d03c: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); d03e: 9f b7 in r25, 0x3f ; 63 d040: f8 94 cli d042: e2 e0 ldi r30, 0x02 ; 2 d044: f1 e0 ldi r31, 0x01 ; 1 d046: 80 81 ld r24, Z d048: 84 60 ori r24, 0x04 ; 4 d04a: 80 83 st Z, r24 d04c: 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); d04e: 6c 2f mov r22, r28 d050: 83 e0 ldi r24, 0x03 ; 3 d052: 9d e0 ldi r25, 0x0D ; 13 d054: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); d058: 8c 2f mov r24, r28 d05a: 0e 94 4b e4 call 0x1c896 ; 0x1c896 #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); d05e: 0e 94 12 68 call 0xd024 ; 0xd024 0000d062 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { d062: 1f 92 push r1 d064: 0f 92 push r0 d066: 0f b6 in r0, 0x3f ; 63 d068: 0f 92 push r0 d06a: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); d06c: 83 e0 ldi r24, 0x03 ; 3 d06e: 0e 94 1e 68 call 0xd03c ; 0xd03c 0000d072 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { d072: 1f 92 push r1 d074: 0f 92 push r0 d076: 0f b6 in r0, 0x3f ; 63 d078: 0f 92 push r0 d07a: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); d07c: 82 e0 ldi r24, 0x02 ; 2 d07e: 0e 94 1e 68 call 0xd03c ; 0xd03c 0000d082 : } #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); d082: 85 ea ldi r24, 0xA5 ; 165 d084: 9f e0 ldi r25, 0x0F ; 15 d086: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c d08a: 91 e0 ldi r25, 0x01 ; 1 d08c: 81 11 cpse r24, r1 d08e: 01 c0 rjmp .+2 ; 0xd092 d090: 90 e0 ldi r25, 0x00 ; 0 } d092: 89 2f mov r24, r25 d094: 08 95 ret 0000d096 : 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(); d096: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc d09a: 81 11 cpse r24, r1 d09c: 06 c0 rjmp .+12 ; 0xd0aa d09e: 81 e0 ldi r24, 0x01 ; 1 d0a0: 90 91 99 03 lds r25, 0x0399 ; 0x800399 d0a4: 92 30 cpi r25, 0x02 ; 2 d0a6: 09 f0 breq .+2 ; 0xd0aa d0a8: 80 e0 ldi r24, 0x00 ; 0 } d0aa: 08 95 ret 0000d0ac : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); d0ac: 80 91 6b 14 lds r24, 0x146B ; 0x80146b d0b0: 81 11 cpse r24, r1 d0b2: 0a c0 rjmp .+20 ; 0xd0c8 d0b4: 80 91 0e 05 lds r24, 0x050E ; 0x80050e d0b8: 81 11 cpse r24, r1 d0ba: 06 c0 rjmp .+12 ; 0xd0c8 d0bc: 81 e0 ldi r24, 0x01 ; 1 d0be: 90 91 99 03 lds r25, 0x0399 ; 0x800399 d0c2: 91 30 cpi r25, 0x01 ; 1 d0c4: 09 f0 breq .+2 ; 0xd0c8 d0c6: 80 e0 ldi r24, 0x00 ; 0 } d0c8: 08 95 ret 0000d0ca : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { d0ca: cf 93 push r28 d0cc: df 93 push r29 return ( !homing_flag d0ce: c0 91 55 0e lds r28, 0x0E55 ; 0x800e55 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d0d2: c1 11 cpse r28, r1 d0d4: 1f c0 rjmp .+62 ; 0xd114 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag d0d6: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 d0da: 81 11 cpse r24, r1 d0dc: 1c c0 rjmp .+56 ; 0xd116 && !printingIsPaused() d0de: 0e 94 4b 68 call 0xd096 ; 0xd096 d0e2: 81 11 cpse r24, r1 d0e4: 18 c0 rjmp .+48 ; 0xd116 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d0e6: d0 91 62 0e lds r29, 0x0E62 ; 0x800e62 d0ea: d4 30 cpi r29, 0x04 ; 4 d0ec: 61 f4 brne .+24 ; 0xd106 d0ee: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a d0f2: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b d0f6: 89 2b or r24, r25 d0f8: 91 f4 brne .+36 ; 0xd11e d0fa: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 d0fe: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 d102: 89 2b or r24, r25 d104: 61 f4 brne .+24 ; 0xd11e || printJobOngoing() d106: 0e 94 56 68 call 0xd0ac ; 0xd0ac d10a: c8 2f mov r28, r24 d10c: 81 11 cpse r24, r1 d10e: 03 c0 rjmp .+6 ; 0xd116 || lcd_commands_type == LcdCommands::Idle d110: c1 e0 ldi r28, 0x01 ; 1 d112: 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) d114: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } d116: 8c 2f mov r24, r28 d118: df 91 pop r29 d11a: cf 91 pop r28 d11c: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d11e: c1 e0 ldi r28, 0x01 ; 1 d120: fa cf rjmp .-12 ; 0xd116 0000d122 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); d122: 0e 94 65 68 call 0xd0ca ; 0xd0ca d126: 88 23 and r24, r24 d128: 89 f0 breq .+34 ; 0xd14c d12a: 20 e0 ldi r18, 0x00 ; 0 d12c: 30 e0 ldi r19, 0x00 ; 0 d12e: 40 e0 ldi r20, 0x00 ; 0 d130: 50 e4 ldi r21, 0x40 ; 64 d132: 60 91 48 07 lds r22, 0x0748 ; 0x800748 d136: 70 91 49 07 lds r23, 0x0749 ; 0x800749 d13a: 80 91 4a 07 lds r24, 0x074A ; 0x80074a d13e: 90 91 4b 07 lds r25, 0x074B ; 0x80074b d142: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> d146: 88 1f adc r24, r24 d148: 88 27 eor r24, r24 d14a: 88 1f adc r24, r24 } d14c: 08 95 ret 0000d14e : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() d14e: 0e 94 56 68 call 0xd0ac ; 0xd0ac || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; d152: 81 11 cpse r24, r1 d154: 18 c0 rjmp .+48 ; 0xd186 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() d156: 0e 94 4b 68 call 0xd096 ; 0xd096 d15a: 81 11 cpse r24, r1 d15c: 14 c0 rjmp .+40 ; 0xd186 || saved_printing d15e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 d162: 81 11 cpse r24, r1 d164: 10 c0 rjmp .+32 ; 0xd186 || (lcd_commands_type != LcdCommands::Idle) d166: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 d16a: 81 11 cpse r24, r1 d16c: 0b c0 rjmp .+22 ; 0xd184 || MMU2::mmu2.MMU_PRINT_SAVED() d16e: 80 91 96 13 lds r24, 0x1396 ; 0x801396 d172: 81 11 cpse r24, r1 d174: 07 c0 rjmp .+14 ; 0xd184 || homing_flag d176: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 d17a: 81 11 cpse r24, r1 d17c: 04 c0 rjmp .+8 ; 0xd186 || mesh_bed_leveling_flag; d17e: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 d182: 08 95 ret d184: 81 e0 ldi r24, 0x01 ; 1 } d186: 08 95 ret 0000d188 : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; d188: fc 01 movw r30, r24 d18a: 20 81 ld r18, Z d18c: 21 11 cpse r18, r1 d18e: 01 c0 rjmp .+2 ; 0xd192 d190: 66 95 lsr r22 d192: fc 01 movw r30, r24 d194: 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() } d196: 08 95 ret 0000d198 : 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) { d198: fc 01 movw r30, r24 iRun = ir; d19a: 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); d19c: 21 e0 ldi r18, 0x01 ; 1 d19e: 60 32 cpi r22, 0x20 ; 32 d1a0: 08 f0 brcs .+2 ; 0xd1a4 d1a2: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { d1a4: 90 81 ld r25, Z d1a6: 29 17 cp r18, r25 d1a8: 81 f0 breq .+32 ; 0xd1ca d1aa: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { d1ac: 99 23 and r25, r25 d1ae: 51 f0 breq .+20 ; 0xd1c4 // 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; d1b0: 90 e0 ldi r25, 0x00 ; 0 d1b2: 95 95 asr r25 d1b4: 87 95 ror r24 d1b6: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; d1b8: 70 e0 ldi r23, 0x00 ; 0 d1ba: 75 95 asr r23 d1bc: 67 95 ror r22 d1be: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; d1c0: 20 83 st Z, r18 d1c2: 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; d1c4: 88 0f add r24, r24 d1c6: 82 83 std Z+2, r24 ; 0x02 d1c8: fb cf rjmp .-10 ; 0xd1c0 } // Update vSense vSense = newvSense; } else if (!vSense) { d1ca: 21 11 cpse r18, r1 d1cc: 04 c0 rjmp .+8 ; 0xd1d6 // 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; d1ce: 70 e0 ldi r23, 0x00 ; 0 d1d0: 75 95 asr r23 d1d2: 67 95 ror r22 d1d4: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } d1d6: 08 95 ret 0000d1d8 : } #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; } d1d8: 20 91 6d 12 lds r18, 0x126D ; 0x80126d d1dc: 30 91 6e 12 lds r19, 0x126E ; 0x80126e d1e0: bc 01 movw r22, r24 d1e2: c9 01 movw r24, r18 d1e4: 8d 57 subi r24, 0x7D ; 125 d1e6: 9f 4e sbci r25, 0xEF ; 239 d1e8: 0f 94 4d db call 0x3b69a ; 0x3b69a d1ec: 9c 01 movw r18, r24 d1ee: 90 93 94 03 sts 0x0394, r25 ; 0x800394 d1f2: 80 93 93 03 sts 0x0393, r24 ; 0x800393 d1f6: 81 e0 ldi r24, 0x01 ; 1 d1f8: 23 2b or r18, r19 d1fa: 09 f4 brne .+2 ; 0xd1fe d1fc: 80 e0 ldi r24, 0x00 ; 0 d1fe: 08 95 ret 0000d200 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } d200: 80 e1 ldi r24, 0x10 ; 16 d202: e0 e4 ldi r30, 0x40 ; 64 d204: f7 e0 ldi r31, 0x07 ; 7 d206: a1 e5 ldi r26, 0x51 ; 81 d208: b5 e0 ldi r27, 0x05 ; 5 d20a: 01 90 ld r0, Z+ d20c: 0d 92 st X+, r0 d20e: 8a 95 dec r24 d210: e1 f7 brne .-8 ; 0xd20a d212: 08 95 ret 0000d214 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { d214: 4f 92 push r4 d216: 5f 92 push r5 d218: 6f 92 push r6 d21a: 7f 92 push r7 d21c: 8f 92 push r8 d21e: 9f 92 push r9 d220: af 92 push r10 d222: bf 92 push r11 d224: cf 92 push r12 d226: df 92 push r13 d228: ef 92 push r14 d22a: ff 92 push r15 d22c: 0f 93 push r16 d22e: 1f 93 push r17 d230: cf 93 push r28 d232: df 93 push r29 d234: 00 d0 rcall .+0 ; 0xd236 d236: 00 d0 rcall .+0 ; 0xd238 d238: 1f 92 push r1 d23a: 1f 92 push r1 d23c: cd b7 in r28, 0x3d ; 61 d23e: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; d240: 20 91 57 0e lds r18, 0x0E57 ; 0x800e57 d244: 22 23 and r18, r18 d246: 09 f4 brne .+2 ; 0xd24a d248: 73 c1 rjmp .+742 ; 0xd530 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; d24a: 20 91 de 03 lds r18, 0x03DE ; 0x8003de d24e: 22 30 cpi r18, 0x02 ; 2 d250: 09 f4 brne .+2 ; 0xd254 d252: 6e c1 rjmp .+732 ; 0xd530 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb d254: 20 91 de 03 lds r18, 0x03DE ; 0x8003de d258: 21 30 cpi r18, 0x01 ; 1 d25a: 11 f4 brne .+4 ; 0xd260 d25c: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de d260: 2b 01 movw r4, r22 d262: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; d264: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) d268: 10 91 ac 05 lds r17, 0x05AC ; 0x8005ac d26c: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee d270: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef d274: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 d278: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 d27c: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> d280: 61 17 cp r22, r17 d282: 31 f0 breq .+12 ; 0xd290 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; d284: 81 2f mov r24, r17 d286: 90 e0 ldi r25, 0x00 ; 0 d288: 90 93 69 0e sts 0x0E69, r25 ; 0x800e69 d28c: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d290: 0e 94 8f 65 call 0xcb1e ; 0xcb1e // Restore saved fan speed fanSpeed = saved_fan_speed; d294: 80 91 a9 05 lds r24, 0x05A9 ; 0x8005a9 d298: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d29c: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd d2a0: 80 91 03 18 lds r24, 0x1803 ; 0x801803 d2a4: 81 95 neg r24 d2a6: 89 27 eor r24, r25 d2a8: 88 70 andi r24, 0x08 ; 8 d2aa: 89 27 eor r24, r25 d2ac: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd float e = saved_pos[E_AXIS] - e_move; d2b0: a3 01 movw r20, r6 d2b2: 92 01 movw r18, r4 d2b4: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d2b8: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d2bc: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d2c0: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d2c4: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> d2c8: 6d 83 std Y+5, r22 ; 0x05 d2ca: 7e 83 std Y+6, r23 ; 0x06 d2cc: 8f 83 std Y+7, r24 ; 0x07 d2ce: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d2d0: ce 01 movw r24, r28 d2d2: 05 96 adiw r24, 0x05 ; 5 d2d4: 0f 94 99 aa call 0x35532 ; 0x35532 #ifdef FANCHECK fans_check_enabled = false; d2d8: 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) d2dc: 20 e0 ldi r18, 0x00 ; 0 d2de: 30 e0 ldi r19, 0x00 ; 0 d2e0: 40 e8 ldi r20, 0x80 ; 128 d2e2: 5f eb ldi r21, 0xBF ; 191 d2e4: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d2e8: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d2ec: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d2f0: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d2f4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> d2f8: 81 11 cpse r24, r1 d2fa: 20 c0 rjmp .+64 ; 0xd33c { saved_pos[X_AXIS] = current_position[X_AXIS]; d2fc: 80 91 40 07 lds r24, 0x0740 ; 0x800740 d300: 90 91 41 07 lds r25, 0x0741 ; 0x800741 d304: a0 91 42 07 lds r26, 0x0742 ; 0x800742 d308: b0 91 43 07 lds r27, 0x0743 ; 0x800743 d30c: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b d310: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c d314: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d d318: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_pos[Y_AXIS] = current_position[Y_AXIS]; d31c: 80 91 44 07 lds r24, 0x0744 ; 0x800744 d320: 90 91 45 07 lds r25, 0x0745 ; 0x800745 d324: a0 91 46 07 lds r26, 0x0746 ; 0x800746 d328: b0 91 47 07 lds r27, 0x0747 ; 0x800747 d32c: 80 93 9f 02 sts 0x029F, r24 ; 0x80029f d330: 90 93 a0 02 sts 0x02A0, r25 ; 0x8002a0 d334: a0 93 a1 02 sts 0x02A1, r26 ; 0x8002a1 d338: 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); d33c: a3 01 movw r20, r6 d33e: 92 01 movw r18, r4 d340: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d344: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d348: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d34c: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d350: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> d354: 69 83 std Y+1, r22 ; 0x01 d356: 7a 83 std Y+2, r23 ; 0x02 d358: 8b 83 std Y+3, r24 ; 0x03 d35a: 9c 83 std Y+4, r25 ; 0x04 d35c: e0 90 48 07 lds r14, 0x0748 ; 0x800748 d360: f0 90 49 07 lds r15, 0x0749 ; 0x800749 d364: 00 91 4a 07 lds r16, 0x074A ; 0x80074a d368: 10 91 4b 07 lds r17, 0x074B ; 0x80074b d36c: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d370: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d374: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d378: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d37c: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d380: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d384: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d388: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d38c: 1f 92 push r1 d38e: 1f 92 push r1 d390: 1f 92 push r1 d392: 1f 92 push r1 d394: e2 e6 ldi r30, 0x62 ; 98 d396: 8e 2e mov r8, r30 d398: e7 e2 ldi r30, 0x27 ; 39 d39a: 9e 2e mov r9, r30 d39c: e6 e7 ldi r30, 0x76 ; 118 d39e: ae 2e mov r10, r30 d3a0: e2 e4 ldi r30, 0x42 ; 66 d3a2: be 2e mov r11, r30 d3a4: fe 01 movw r30, r28 d3a6: 31 96 adiw r30, 0x01 ; 1 d3a8: 6f 01 movw r12, r30 d3aa: 0f 94 f3 aa call 0x355e6 ; 0x355e6 //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); d3ae: a3 01 movw r20, r6 d3b0: 92 01 movw r18, r4 d3b2: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d3b6: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d3ba: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d3be: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d3c2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> d3c6: 69 83 std Y+1, r22 ; 0x01 d3c8: 7a 83 std Y+2, r23 ; 0x02 d3ca: 8b 83 std Y+3, r24 ; 0x03 d3cc: 9c 83 std Y+4, r25 ; 0x04 d3ce: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d3d2: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d3d6: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d3da: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d3de: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d3e2: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d3e6: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d3ea: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d3ee: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d3f2: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d3f6: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d3fa: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d3fe: 1f 92 push r1 d400: 1f 92 push r1 d402: 1f 92 push r1 d404: 1f 92 push r1 d406: 0f 94 f3 aa call 0x355e6 ; 0x355e6 //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); d40a: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d40e: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d412: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d416: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d41a: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d41e: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d422: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d426: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d42a: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d42e: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d432: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d436: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d43a: 1f 92 push r1 d43c: 1f 92 push r1 d43e: 1f 92 push r1 d440: 1f 92 push r1 d442: 81 2c mov r8, r1 d444: 91 2c mov r9, r1 d446: f8 ee ldi r31, 0xE8 ; 232 d448: af 2e mov r10, r31 d44a: f2 e4 ldi r31, 0x42 ; 66 d44c: bf 2e mov r11, r31 d44e: a7 ea ldi r26, 0xA7 ; 167 d450: ca 2e mov r12, r26 d452: a2 e0 ldi r26, 0x02 ; 2 d454: da 2e mov r13, r26 d456: 0f 94 f3 aa call 0x355e6 ; 0x355e6 st_synchronize(); d45a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 #ifdef FANCHECK fans_check_enabled = true; d45e: 11 e0 ldi r17, 0x01 ; 1 d460: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d464: 60 91 fd 17 lds r22, 0x17FD ; 0x8017fd d468: 70 91 fe 17 lds r23, 0x17FE ; 0x8017fe d46c: 90 e0 ldi r25, 0x00 ; 0 d46e: 80 e0 ldi r24, 0x00 ; 0 d470: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> d474: 60 93 90 02 sts 0x0290, r22 ; 0x800290 d478: 70 93 91 02 sts 0x0291, r23 ; 0x800291 d47c: 80 93 92 02 sts 0x0292, r24 ; 0x800292 d480: 90 93 93 02 sts 0x0293, r25 ; 0x800293 feedmultiply = saved_feedmultiply2; d484: 80 91 6f 03 lds r24, 0x036F ; 0x80036f d488: 90 91 70 03 lds r25, 0x0370 ; 0x800370 d48c: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d490: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d494: 80 e1 ldi r24, 0x10 ; 16 d496: eb e9 ldi r30, 0x9B ; 155 d498: f2 e0 ldi r31, 0x02 ; 2 d49a: a0 e4 ldi r26, 0x40 ; 64 d49c: b7 e0 ldi r27, 0x07 ; 7 d49e: 01 90 ld r0, Z+ d4a0: 0d 92 st X+, r0 d4a2: 8a 95 dec r24 d4a4: e1 f7 brne .-8 ; 0xd49e set_destination_to_current(); d4a6: 0e 94 00 69 call 0xd200 ; 0xd200 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d4aa: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d4ae: 0f b6 in r0, 0x3f ; 63 d4b0: f8 94 cli d4b2: de bf out 0x3e, r29 ; 62 d4b4: 0f be out 0x3f, r0 ; 63 d4b6: cd bf out 0x3d, r28 ; 61 d4b8: 81 11 cpse r24, r1 d4ba: 51 c0 rjmp .+162 ; 0xd55e card.setIndex(saved_sdpos); d4bc: 60 91 ff 17 lds r22, 0x17FF ; 0x8017ff d4c0: 70 91 00 18 lds r23, 0x1800 ; 0x801800 d4c4: 80 91 01 18 lds r24, 0x1801 ; 0x801801 d4c8: 90 91 02 18 lds r25, 0x1802 ; 0x801802 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; d4cc: 60 93 7f 17 sts 0x177F, r22 ; 0x80177f d4d0: 70 93 80 17 sts 0x1780, r23 ; 0x801780 d4d4: 80 93 81 17 sts 0x1781, r24 ; 0x801781 d4d8: 90 93 82 17 sts 0x1782, r25 ; 0x801782 d4dc: 0f 94 75 77 call 0x2eeea ; 0x2eeea sdpos_atomic = saved_sdpos; d4e0: 80 91 ff 17 lds r24, 0x17FF ; 0x8017ff d4e4: 90 91 00 18 lds r25, 0x1800 ; 0x801800 d4e8: a0 91 01 18 lds r26, 0x1801 ; 0x801801 d4ec: b0 91 02 18 lds r27, 0x1802 ; 0x801802 d4f0: 80 93 80 03 sts 0x0380, r24 ; 0x800380 d4f4: 90 93 81 03 sts 0x0381, r25 ; 0x800381 d4f8: a0 93 82 03 sts 0x0382, r26 ; 0x800382 d4fc: b0 93 83 03 sts 0x0383, r27 ; 0x800383 card.sdprinting = true; d500: 10 93 6b 14 sts 0x146B, r17 ; 0x80146b d504: 60 e0 ldi r22, 0x00 ; 0 d506: 85 ea ldi r24, 0xA5 ; 165 d508: 9f e0 ldi r25, 0x0F ; 15 d50a: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 d50e: 60 e0 ldi r22, 0x00 ; 0 d510: 8f e7 ldi r24, 0x7F ; 127 d512: 9c e0 ldi r25, 0x0C ; 12 d514: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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); d518: 8d ea ldi r24, 0xAD ; 173 d51a: 90 e7 ldi r25, 0x70 ; 112 d51c: 0f 94 be 0b call 0x2177c ; 0x2177c saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d520: 82 e0 ldi r24, 0x02 ; 2 d522: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d526: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 planner_aborted = true; // unroll the stack d52a: 81 e0 ldi r24, 0x01 ; 1 d52c: 80 93 5a 0e sts 0x0E5A, r24 ; 0x800e5a } d530: 28 96 adiw r28, 0x08 ; 8 d532: 0f b6 in r0, 0x3f ; 63 d534: f8 94 cli d536: de bf out 0x3e, r29 ; 62 d538: 0f be out 0x3f, r0 ; 63 d53a: cd bf out 0x3d, r28 ; 61 d53c: df 91 pop r29 d53e: cf 91 pop r28 d540: 1f 91 pop r17 d542: 0f 91 pop r16 d544: ff 90 pop r15 d546: ef 90 pop r14 d548: df 90 pop r13 d54a: cf 90 pop r12 d54c: bf 90 pop r11 d54e: af 90 pop r10 d550: 9f 90 pop r9 d552: 8f 90 pop r8 d554: 7f 90 pop r7 d556: 6f 90 pop r6 d558: 5f 90 pop r5 d55a: 4f 90 pop r4 d55c: 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 d55e: 81 30 cpi r24, 0x01 ; 1 d560: 89 f6 brne .-94 ; 0xd504 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d562: 80 91 ff 17 lds r24, 0x17FF ; 0x8017ff d566: 90 91 00 18 lds r25, 0x1800 ; 0x801800 d56a: a0 91 01 18 lds r26, 0x1801 ; 0x801801 d56e: b0 91 02 18 lds r27, 0x1802 ; 0x801802 d572: 80 93 78 03 sts 0x0378, r24 ; 0x800378 d576: 90 93 79 03 sts 0x0379, r25 ; 0x800379 d57a: a0 93 7a 03 sts 0x037A, r26 ; 0x80037a d57e: b0 93 7b 03 sts 0x037B, r27 ; 0x80037b serial_count = 0; d582: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a d586: 10 92 79 10 sts 0x1079, r1 ; 0x801079 FlushSerialRequestResend(); d58a: 0e 94 44 5c call 0xb888 ; 0xb888 d58e: ba cf rjmp .-140 ; 0xd504 0000d590 : 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) { d590: 3f 92 push r3 d592: 4f 92 push r4 d594: 5f 92 push r5 d596: 6f 92 push r6 d598: 7f 92 push r7 d59a: 8f 92 push r8 d59c: 9f 92 push r9 d59e: af 92 push r10 d5a0: bf 92 push r11 d5a2: cf 92 push r12 d5a4: df 92 push r13 d5a6: ef 92 push r14 d5a8: ff 92 push r15 d5aa: 0f 93 push r16 d5ac: 1f 93 push r17 d5ae: cf 93 push r28 d5b0: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d5b2: 30 90 e8 17 lds r3, 0x17E8 ; 0x8017e8 d5b6: 33 20 and r3, r3 d5b8: 09 f4 brne .+2 ; 0xd5bc d5ba: 80 c0 rjmp .+256 ; 0xd6bc d5bc: 8b 01 movw r16, r22 d5be: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d5c0: 31 fe sbrs r3, 1 d5c2: 54 c0 rjmp .+168 ; 0xd66c // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d5c4: 88 80 ld r8, Y d5c6: 99 80 ldd r9, Y+1 ; 0x01 d5c8: aa 80 ldd r10, Y+2 ; 0x02 d5ca: bb 80 ldd r11, Y+3 ; 0x03 d5cc: fb 01 movw r30, r22 d5ce: c0 80 ld r12, Z d5d0: d1 80 ldd r13, Z+1 ; 0x01 d5d2: e2 80 ldd r14, Z+2 ; 0x02 d5d4: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d5d6: 20 91 bd 17 lds r18, 0x17BD ; 0x8017bd d5da: 30 91 be 17 lds r19, 0x17BE ; 0x8017be d5de: 40 91 bf 17 lds r20, 0x17BF ; 0x8017bf d5e2: 50 91 c0 17 lds r21, 0x17C0 ; 0x8017c0 d5e6: c5 01 movw r24, r10 d5e8: b4 01 movw r22, r8 d5ea: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> d5ee: 2b 01 movw r4, r22 d5f0: 3c 01 movw r6, r24 d5f2: 20 91 c1 17 lds r18, 0x17C1 ; 0x8017c1 d5f6: 30 91 c2 17 lds r19, 0x17C2 ; 0x8017c2 d5fa: 40 91 c3 17 lds r20, 0x17C3 ; 0x8017c3 d5fe: 50 91 c4 17 lds r21, 0x17C4 ; 0x8017c4 d602: c7 01 movw r24, r14 d604: b6 01 movw r22, r12 d606: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> d60a: 9b 01 movw r18, r22 d60c: ac 01 movw r20, r24 d60e: c3 01 movw r24, r6 d610: b2 01 movw r22, r4 d612: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> d616: 2b 01 movw r4, r22 d618: 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; d61a: 20 91 b5 17 lds r18, 0x17B5 ; 0x8017b5 d61e: 30 91 b6 17 lds r19, 0x17B6 ; 0x8017b6 d622: 40 91 b7 17 lds r20, 0x17B7 ; 0x8017b7 d626: 50 91 b8 17 lds r21, 0x17B8 ; 0x8017b8 d62a: c5 01 movw r24, r10 d62c: b4 01 movw r22, r8 d62e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> d632: 4b 01 movw r8, r22 d634: 5c 01 movw r10, r24 d636: 20 91 b9 17 lds r18, 0x17B9 ; 0x8017b9 d63a: 30 91 ba 17 lds r19, 0x17BA ; 0x8017ba d63e: 40 91 bb 17 lds r20, 0x17BB ; 0x8017bb d642: 50 91 bc 17 lds r21, 0x17BC ; 0x8017bc d646: c7 01 movw r24, r14 d648: b6 01 movw r22, r12 d64a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> d64e: 9b 01 movw r18, r22 d650: ac 01 movw r20, r24 d652: c5 01 movw r24, r10 d654: b4 01 movw r22, r8 d656: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; 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 = out_y; d662: f8 01 movw r30, r16 d664: 40 82 st Z, r4 d666: 51 82 std Z+1, r5 ; 0x01 d668: 62 82 std Z+2, r6 ; 0x02 d66a: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d66c: 30 fe sbrs r3, 0 d66e: 26 c0 rjmp .+76 ; 0xd6bc // Then add the offset. x += world2machine_shift[0]; d670: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 d674: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 d678: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 d67c: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 d680: 68 81 ld r22, Y d682: 79 81 ldd r23, Y+1 ; 0x01 d684: 8a 81 ldd r24, Y+2 ; 0x02 d686: 9b 81 ldd r25, Y+3 ; 0x03 d688: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> d68c: 68 83 st Y, r22 d68e: 79 83 std Y+1, r23 ; 0x01 d690: 8a 83 std Y+2, r24 ; 0x02 d692: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d694: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 d698: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 d69c: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 d6a0: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 d6a4: f8 01 movw r30, r16 d6a6: 60 81 ld r22, Z d6a8: 71 81 ldd r23, Z+1 ; 0x01 d6aa: 82 81 ldd r24, Z+2 ; 0x02 d6ac: 93 81 ldd r25, Z+3 ; 0x03 d6ae: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> d6b2: f8 01 movw r30, r16 d6b4: 60 83 st Z, r22 d6b6: 71 83 std Z+1, r23 ; 0x01 d6b8: 82 83 std Z+2, r24 ; 0x02 d6ba: 93 83 std Z+3, r25 ; 0x03 } } } d6bc: df 91 pop r29 d6be: cf 91 pop r28 d6c0: 1f 91 pop r17 d6c2: 0f 91 pop r16 d6c4: ff 90 pop r15 d6c6: ef 90 pop r14 d6c8: df 90 pop r13 d6ca: cf 90 pop r12 d6cc: bf 90 pop r11 d6ce: af 90 pop r10 d6d0: 9f 90 pop r9 d6d2: 8f 90 pop r8 d6d4: 7f 90 pop r7 d6d6: 6f 90 pop r6 d6d8: 5f 90 pop r5 d6da: 4f 90 pop r4 d6dc: 3f 90 pop r3 d6de: 08 95 ret 0000d6e0 : } } } inline bool world2machine_clamp(float &x, float &y) { d6e0: 2f 92 push r2 d6e2: 3f 92 push r3 d6e4: 4f 92 push r4 d6e6: 5f 92 push r5 d6e8: 6f 92 push r6 d6ea: 7f 92 push r7 d6ec: 8f 92 push r8 d6ee: 9f 92 push r9 d6f0: af 92 push r10 d6f2: bf 92 push r11 d6f4: cf 92 push r12 d6f6: df 92 push r13 d6f8: ef 92 push r14 d6fa: ff 92 push r15 d6fc: 0f 93 push r16 d6fe: 1f 93 push r17 d700: cf 93 push r28 d702: df 93 push r29 d704: 00 d0 rcall .+0 ; 0xd706 d706: 00 d0 rcall .+0 ; 0xd708 d708: 1f 92 push r1 d70a: 1f 92 push r1 d70c: cd b7 in r28, 0x3d ; 61 d70e: de b7 in r29, 0x3e ; 62 d710: 8c 01 movw r16, r24 d712: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d714: fc 01 movw r30, r24 d716: 80 81 ld r24, Z d718: 91 81 ldd r25, Z+1 ; 0x01 d71a: a2 81 ldd r26, Z+2 ; 0x02 d71c: b3 81 ldd r27, Z+3 ; 0x03 d71e: 89 83 std Y+1, r24 ; 0x01 d720: 9a 83 std Y+2, r25 ; 0x02 d722: ab 83 std Y+3, r26 ; 0x03 d724: bc 83 std Y+4, r27 ; 0x04 out_y = y; d726: fb 01 movw r30, r22 d728: 80 81 ld r24, Z d72a: 91 81 ldd r25, Z+1 ; 0x01 d72c: a2 81 ldd r26, Z+2 ; 0x02 d72e: b3 81 ldd r27, Z+3 ; 0x03 d730: 8d 83 std Y+5, r24 ; 0x05 d732: 9e 83 std Y+6, r25 ; 0x06 d734: af 83 std Y+7, r26 ; 0x07 d736: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d738: be 01 movw r22, r28 d73a: 6b 5f subi r22, 0xFB ; 251 d73c: 7f 4f sbci r23, 0xFF ; 255 d73e: ce 01 movw r24, r28 d740: 01 96 adiw r24, 0x01 ; 1 d742: 0e 94 c8 6a call 0xd590 ; 0xd590 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d746: c9 80 ldd r12, Y+1 ; 0x01 d748: da 80 ldd r13, Y+2 ; 0x02 d74a: eb 80 ldd r14, Y+3 ; 0x03 d74c: fc 80 ldd r15, Y+4 ; 0x04 d74e: 20 e0 ldi r18, 0x00 ; 0 d750: 30 e0 ldi r19, 0x00 ; 0 d752: a9 01 movw r20, r18 d754: c7 01 movw r24, r14 d756: b6 01 movw r22, r12 d758: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> d75c: 87 ff sbrs r24, 7 d75e: 35 c0 rjmp .+106 ; 0xd7ca tmpx = X_MIN_POS; d760: 19 82 std Y+1, r1 ; 0x01 d762: 1a 82 std Y+2, r1 ; 0x02 d764: 1b 82 std Y+3, r1 ; 0x03 d766: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d768: ff 24 eor r15, r15 d76a: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d76c: 8d 80 ldd r8, Y+5 ; 0x05 d76e: 9e 80 ldd r9, Y+6 ; 0x06 d770: af 80 ldd r10, Y+7 ; 0x07 d772: b8 84 ldd r11, Y+8 ; 0x08 d774: 20 e0 ldi r18, 0x00 ; 0 d776: 30 e0 ldi r19, 0x00 ; 0 d778: 40 e8 ldi r20, 0x80 ; 128 d77a: 50 ec ldi r21, 0xC0 ; 192 d77c: c5 01 movw r24, r10 d77e: b4 01 movw r22, r8 d780: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> d784: 87 ff sbrs r24, 7 d786: 35 c0 rjmp .+106 ; 0xd7f2 tmpy = Y_MIN_POS; d788: 80 e0 ldi r24, 0x00 ; 0 d78a: 90 e0 ldi r25, 0x00 ; 0 d78c: a0 e8 ldi r26, 0x80 ; 128 d78e: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d790: 8d 83 std Y+5, r24 ; 0x05 d792: 9e 83 std Y+6, r25 ; 0x06 d794: af 83 std Y+7, r26 ; 0x07 d796: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d798: cd 80 ldd r12, Y+5 ; 0x05 d79a: de 80 ldd r13, Y+6 ; 0x06 d79c: ef 80 ldd r14, Y+7 ; 0x07 d79e: f8 84 ldd r15, Y+8 ; 0x08 d7a0: 89 80 ldd r8, Y+1 ; 0x01 d7a2: 9a 80 ldd r9, Y+2 ; 0x02 d7a4: ab 80 ldd r10, Y+3 ; 0x03 d7a6: 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) { d7a8: 70 90 e8 17 lds r7, 0x17E8 ; 0x8017e8 d7ac: 71 10 cpse r7, r1 d7ae: 4c c0 rjmp .+152 ; 0xd848 // No correction. out_x = x; d7b0: f8 01 movw r30, r16 d7b2: 80 82 st Z, r8 d7b4: 91 82 std Z+1, r9 ; 0x01 d7b6: a2 82 std Z+2, r10 ; 0x02 d7b8: b3 82 std Z+3, r11 ; 0x03 out_y = y; d7ba: f1 01 movw r30, r2 d7bc: c0 82 st Z, r12 d7be: d1 82 std Z+1, r13 ; 0x01 d7c0: e2 82 std Z+2, r14 ; 0x02 d7c2: 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) { d7c4: ff 24 eor r15, r15 d7c6: f3 94 inc r15 d7c8: 25 c0 rjmp .+74 ; 0xd814 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) { d7ca: 20 e0 ldi r18, 0x00 ; 0 d7cc: 30 e0 ldi r19, 0x00 ; 0 d7ce: 4f e7 ldi r20, 0x7F ; 127 d7d0: 53 e4 ldi r21, 0x43 ; 67 d7d2: c7 01 movw r24, r14 d7d4: b6 01 movw r22, r12 d7d6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d7da: 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) { d7dc: 18 16 cp r1, r24 d7de: 34 f6 brge .-116 ; 0xd76c tmpx = X_MAX_POS; d7e0: 80 e0 ldi r24, 0x00 ; 0 d7e2: 90 e0 ldi r25, 0x00 ; 0 d7e4: af e7 ldi r26, 0x7F ; 127 d7e6: b3 e4 ldi r27, 0x43 ; 67 d7e8: 89 83 std Y+1, r24 ; 0x01 d7ea: 9a 83 std Y+2, r25 ; 0x02 d7ec: ab 83 std Y+3, r26 ; 0x03 d7ee: bc 83 std Y+4, r27 ; 0x04 d7f0: bb cf rjmp .-138 ; 0xd768 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d7f2: 20 e0 ldi r18, 0x00 ; 0 d7f4: 30 e8 ldi r19, 0x80 ; 128 d7f6: 44 e5 ldi r20, 0x54 ; 84 d7f8: 53 e4 ldi r21, 0x43 ; 67 d7fa: c5 01 movw r24, r10 d7fc: b4 01 movw r22, r8 d7fe: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> d802: 18 16 cp r1, r24 d804: 2c f4 brge .+10 ; 0xd810 tmpy = Y_MAX_POS; d806: 80 e0 ldi r24, 0x00 ; 0 d808: 90 e8 ldi r25, 0x80 ; 128 d80a: a4 e5 ldi r26, 0x54 ; 84 d80c: b3 e4 ldi r27, 0x43 ; 67 d80e: c0 cf rjmp .-128 ; 0xd790 clamped = true; } if (clamped) d810: f1 10 cpse r15, r1 d812: c2 cf rjmp .-124 ; 0xd798 machine2world(tmpx, tmpy, x, y); return clamped; } d814: 8f 2d mov r24, r15 d816: 28 96 adiw r28, 0x08 ; 8 d818: 0f b6 in r0, 0x3f ; 63 d81a: f8 94 cli d81c: de bf out 0x3e, r29 ; 62 d81e: 0f be out 0x3f, r0 ; 63 d820: cd bf out 0x3d, r28 ; 61 d822: df 91 pop r29 d824: cf 91 pop r28 d826: 1f 91 pop r17 d828: 0f 91 pop r16 d82a: ff 90 pop r15 d82c: ef 90 pop r14 d82e: df 90 pop r13 d830: cf 90 pop r12 d832: bf 90 pop r11 d834: af 90 pop r10 d836: 9f 90 pop r9 d838: 8f 90 pop r8 d83a: 7f 90 pop r7 d83c: 6f 90 pop r6 d83e: 5f 90 pop r5 d840: 4f 90 pop r4 d842: 3f 90 pop r3 d844: 2f 90 pop r2 d846: 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) { d848: 70 fe sbrs r7, 0 d84a: 1c c0 rjmp .+56 ; 0xd884 // Then add the offset. x -= world2machine_shift[0]; d84c: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 d850: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 d854: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 d858: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 d85c: c5 01 movw r24, r10 d85e: b4 01 movw r22, r8 d860: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> d864: 4b 01 movw r8, r22 d866: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d868: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 d86c: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 d870: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 d874: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 d878: c7 01 movw r24, r14 d87a: b6 01 movw r22, r12 d87c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> d880: 6b 01 movw r12, r22 d882: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d884: 71 fe sbrs r7, 1 d886: 9e cf rjmp .-196 ; 0xd7c4 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d888: 20 91 d0 17 lds r18, 0x17D0 ; 0x8017d0 d88c: 30 91 d1 17 lds r19, 0x17D1 ; 0x8017d1 d890: 40 91 d2 17 lds r20, 0x17D2 ; 0x8017d2 d894: 50 91 d3 17 lds r21, 0x17D3 ; 0x8017d3 d898: c5 01 movw r24, r10 d89a: b4 01 movw r22, r8 d89c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> d8a0: 2b 01 movw r4, r22 d8a2: 3c 01 movw r6, r24 d8a4: 20 91 d4 17 lds r18, 0x17D4 ; 0x8017d4 d8a8: 30 91 d5 17 lds r19, 0x17D5 ; 0x8017d5 d8ac: 40 91 d6 17 lds r20, 0x17D6 ; 0x8017d6 d8b0: 50 91 d7 17 lds r21, 0x17D7 ; 0x8017d7 d8b4: c7 01 movw r24, r14 d8b6: b6 01 movw r22, r12 d8b8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> d8bc: 9b 01 movw r18, r22 d8be: ac 01 movw r20, r24 d8c0: c3 01 movw r24, r6 d8c2: b2 01 movw r22, r4 d8c4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> d8c8: f8 01 movw r30, r16 d8ca: 60 83 st Z, r22 d8cc: 71 83 std Z+1, r23 ; 0x01 d8ce: 82 83 std Z+2, r24 ; 0x02 d8d0: 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; d8d2: 20 91 d8 17 lds r18, 0x17D8 ; 0x8017d8 d8d6: 30 91 d9 17 lds r19, 0x17D9 ; 0x8017d9 d8da: 40 91 da 17 lds r20, 0x17DA ; 0x8017da d8de: 50 91 db 17 lds r21, 0x17DB ; 0x8017db d8e2: c5 01 movw r24, r10 d8e4: b4 01 movw r22, r8 d8e6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> d8ea: 4b 01 movw r8, r22 d8ec: 5c 01 movw r10, r24 d8ee: 20 91 dc 17 lds r18, 0x17DC ; 0x8017dc d8f2: 30 91 dd 17 lds r19, 0x17DD ; 0x8017dd d8f6: 40 91 de 17 lds r20, 0x17DE ; 0x8017de d8fa: 50 91 df 17 lds r21, 0x17DF ; 0x8017df d8fe: c7 01 movw r24, r14 d900: b6 01 movw r22, r12 d902: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> d906: 9b 01 movw r18, r22 d908: ac 01 movw r20, r24 d90a: c5 01 movw r24, r10 d90c: b4 01 movw r22, r8 d90e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> d912: f1 01 movw r30, r2 d914: 60 83 st Z, r22 d916: 71 83 std Z+1, r23 ; 0x01 d918: 82 83 std Z+2, r24 ; 0x02 d91a: 93 83 std Z+3, r25 ; 0x03 d91c: 53 cf rjmp .-346 ; 0xd7c4 0000d91e : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d91e: cf 92 push r12 d920: df 92 push r13 d922: ef 92 push r14 d924: ff 92 push r15 d926: cf 93 push r28 d928: df 93 push r29 d92a: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d92c: bc 01 movw r22, r24 d92e: 6c 5f subi r22, 0xFC ; 252 d930: 7f 4f sbci r23, 0xFF ; 255 d932: 0e 94 70 6b call 0xd6e0 ; 0xd6e0 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d936: c0 90 29 02 lds r12, 0x0229 ; 0x800229 d93a: d0 90 2a 02 lds r13, 0x022A ; 0x80022a d93e: e0 90 2b 02 lds r14, 0x022B ; 0x80022b d942: f0 90 2c 02 lds r15, 0x022C ; 0x80022c d946: a7 01 movw r20, r14 d948: 96 01 movw r18, r12 d94a: 68 85 ldd r22, Y+8 ; 0x08 d94c: 79 85 ldd r23, Y+9 ; 0x09 d94e: 8a 85 ldd r24, Y+10 ; 0x0a d950: 9b 85 ldd r25, Y+11 ; 0x0b d952: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> d956: 87 ff sbrs r24, 7 d958: 04 c0 rjmp .+8 ; 0xd962 d95a: c8 86 std Y+8, r12 ; 0x08 d95c: d9 86 std Y+9, r13 ; 0x09 d95e: ea 86 std Y+10, r14 ; 0x0a d960: 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]; d962: c0 90 1d 02 lds r12, 0x021D ; 0x80021d d966: d0 90 1e 02 lds r13, 0x021E ; 0x80021e d96a: e0 90 1f 02 lds r14, 0x021F ; 0x80021f d96e: f0 90 20 02 lds r15, 0x0220 ; 0x800220 d972: a7 01 movw r20, r14 d974: 96 01 movw r18, r12 d976: 68 85 ldd r22, Y+8 ; 0x08 d978: 79 85 ldd r23, Y+9 ; 0x09 d97a: 8a 85 ldd r24, Y+10 ; 0x0a d97c: 9b 85 ldd r25, Y+11 ; 0x0b d97e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> d982: 18 16 cp r1, r24 d984: 24 f4 brge .+8 ; 0xd98e d986: c8 86 std Y+8, r12 ; 0x08 d988: d9 86 std Y+9, r13 ; 0x09 d98a: ea 86 std Y+10, r14 ; 0x0a d98c: fb 86 std Y+11, r15 ; 0x0b } } d98e: df 91 pop r29 d990: cf 91 pop r28 d992: ff 90 pop r15 d994: ef 90 pop r14 d996: df 90 pop r13 d998: cf 90 pop r12 d99a: 08 95 ret 0000d99c : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d99c: 2f 92 push r2 d99e: 3f 92 push r3 d9a0: 4f 92 push r4 d9a2: 5f 92 push r5 d9a4: 6f 92 push r6 d9a6: 7f 92 push r7 d9a8: 8f 92 push r8 d9aa: 9f 92 push r9 d9ac: af 92 push r10 d9ae: bf 92 push r11 d9b0: cf 92 push r12 d9b2: df 92 push r13 d9b4: ef 92 push r14 d9b6: ff 92 push r15 d9b8: 0f 93 push r16 d9ba: 1f 93 push r17 d9bc: cf 93 push r28 d9be: df 93 push r29 d9c0: cd b7 in r28, 0x3d ; 61 d9c2: de b7 in r29, 0x3e ; 62 d9c4: a2 97 sbiw r28, 0x22 ; 34 d9c6: 0f b6 in r0, 0x3f ; 63 d9c8: f8 94 cli d9ca: de bf out 0x3e, r29 ; 62 d9cc: 0f be out 0x3f, r0 ; 63 d9ce: cd bf out 0x3d, r28 ; 61 d9d0: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d9d2: 81 e5 ldi r24, 0x51 ; 81 d9d4: 95 e0 ldi r25, 0x05 ; 5 d9d6: 0e 94 8f 6c call 0xd91e ; 0xd91e previous_millis_cmd.start(); d9da: 84 e8 ldi r24, 0x84 ; 132 d9dc: 93 e0 ldi r25, 0x03 ; 3 d9de: 0f 94 fe 41 call 0x283fc ; 0x283fc ::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])) { d9e2: 40 90 40 07 lds r4, 0x0740 ; 0x800740 d9e6: 50 90 41 07 lds r5, 0x0741 ; 0x800741 d9ea: 60 90 42 07 lds r6, 0x0742 ; 0x800742 d9ee: 70 90 43 07 lds r7, 0x0743 ; 0x800743 d9f2: c0 90 51 05 lds r12, 0x0551 ; 0x800551 d9f6: d0 90 52 05 lds r13, 0x0552 ; 0x800552 d9fa: e0 90 53 05 lds r14, 0x0553 ; 0x800553 d9fe: f0 90 54 05 lds r15, 0x0554 ; 0x800554 da02: a7 01 movw r20, r14 da04: 96 01 movw r18, r12 da06: c3 01 movw r24, r6 da08: b2 01 movw r22, r4 da0a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> da0e: 81 11 cpse r24, r1 da10: 3f c0 rjmp .+126 ; 0xda90 da12: 20 91 55 05 lds r18, 0x0555 ; 0x800555 da16: 30 91 56 05 lds r19, 0x0556 ; 0x800556 da1a: 40 91 57 05 lds r20, 0x0557 ; 0x800557 da1e: 50 91 58 05 lds r21, 0x0558 ; 0x800558 da22: 60 91 44 07 lds r22, 0x0744 ; 0x800744 da26: 70 91 45 07 lds r23, 0x0745 ; 0x800745 da2a: 80 91 46 07 lds r24, 0x0746 ; 0x800746 da2e: 90 91 47 07 lds r25, 0x0747 ; 0x800747 da32: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> da36: 81 11 cpse r24, r1 da38: 2b c0 rjmp .+86 ; 0xda90 plan_buffer_line_destinationXYZE(feedrate/60); da3a: 20 e0 ldi r18, 0x00 ; 0 da3c: 30 e0 ldi r19, 0x00 ; 0 da3e: 40 e7 ldi r20, 0x70 ; 112 da40: 52 e4 ldi r21, 0x42 ; 66 da42: 60 91 90 02 lds r22, 0x0290 ; 0x800290 da46: 70 91 91 02 lds r23, 0x0291 ; 0x800291 da4a: 80 91 92 02 lds r24, 0x0292 ; 0x800292 da4e: 90 91 93 02 lds r25, 0x0293 ; 0x800293 da52: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> da56: 0f 94 15 ba call 0x3742a ; 0x3742a #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); da5a: 0e 94 b6 5b call 0xb76c ; 0xb76c } da5e: a2 96 adiw r28, 0x22 ; 34 da60: 0f b6 in r0, 0x3f ; 63 da62: f8 94 cli da64: de bf out 0x3e, r29 ; 62 da66: 0f be out 0x3f, r0 ; 63 da68: cd bf out 0x3d, r28 ; 61 da6a: df 91 pop r29 da6c: cf 91 pop r28 da6e: 1f 91 pop r17 da70: 0f 91 pop r16 da72: ff 90 pop r15 da74: ef 90 pop r14 da76: df 90 pop r13 da78: cf 90 pop r12 da7a: bf 90 pop r11 da7c: af 90 pop r10 da7e: 9f 90 pop r9 da80: 8f 90 pop r8 da82: 7f 90 pop r7 da84: 6f 90 pop r6 da86: 5f 90 pop r5 da88: 4f 90 pop r4 da8a: 3f 90 pop r3 da8c: 2f 90 pop r2 da8e: 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); da90: 60 91 39 02 lds r22, 0x0239 ; 0x800239 da94: 70 91 3a 02 lds r23, 0x023A ; 0x80023a da98: 07 2e mov r0, r23 da9a: 00 0c add r0, r0 da9c: 88 0b sbc r24, r24 da9e: 99 0b sbc r25, r25 daa0: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> daa4: 20 91 90 02 lds r18, 0x0290 ; 0x800290 daa8: 30 91 91 02 lds r19, 0x0291 ; 0x800291 daac: 40 91 92 02 lds r20, 0x0292 ; 0x800292 dab0: 50 91 93 02 lds r21, 0x0293 ; 0x800293 dab4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> dab8: 2e e3 ldi r18, 0x3E ; 62 daba: 33 ec ldi r19, 0xC3 ; 195 dabc: 4e e2 ldi r20, 0x2E ; 46 dabe: 59 e3 ldi r21, 0x39 ; 57 dac0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> dac4: 6f 83 std Y+7, r22 ; 0x07 dac6: 78 87 std Y+8, r23 ; 0x08 dac8: 89 87 std Y+9, r24 ; 0x09 daca: 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) { dacc: 80 91 9d 13 lds r24, 0x139D ; 0x80139d dad0: 88 23 and r24, r24 dad2: 09 f4 brne .+2 ; 0xdad6 dad4: 0f c1 rjmp .+542 ; 0xdcf4 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]; dad6: a3 01 movw r20, r6 dad8: 92 01 movw r18, r4 dada: c7 01 movw r24, r14 dadc: b6 01 movw r22, r12 dade: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> dae2: 2b 01 movw r4, r22 dae4: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; dae6: 20 91 44 07 lds r18, 0x0744 ; 0x800744 daea: 30 91 45 07 lds r19, 0x0745 ; 0x800745 daee: 40 91 46 07 lds r20, 0x0746 ; 0x800746 daf2: 50 91 47 07 lds r21, 0x0747 ; 0x800747 daf6: 60 91 55 05 lds r22, 0x0555 ; 0x800555 dafa: 70 91 56 05 lds r23, 0x0556 ; 0x800556 dafe: 80 91 57 05 lds r24, 0x0557 ; 0x800557 db02: 90 91 58 05 lds r25, 0x0558 ; 0x800558 db06: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> db0a: 6b 87 std Y+11, r22 ; 0x0b db0c: 7c 87 std Y+12, r23 ; 0x0c db0e: 8d 87 std Y+13, r24 ; 0x0d db10: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); db12: c3 01 movw r24, r6 db14: b2 01 movw r22, r4 db16: 9f 77 andi r25, 0x7F ; 127 db18: 2b 85 ldd r18, Y+11 ; 0x0b db1a: 3c 85 ldd r19, Y+12 ; 0x0c db1c: 4d 85 ldd r20, Y+13 ; 0x0d db1e: 5e 85 ldd r21, Y+14 ; 0x0e db20: 5f 77 andi r21, 0x7F ; 127 db22: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> db26: 6b 01 movw r12, r22 db28: 7c 01 movw r14, r24 if (len > 0) db2a: 20 e0 ldi r18, 0x00 ; 0 db2c: 30 e0 ldi r19, 0x00 ; 0 db2e: a9 01 movw r20, r18 db30: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> db34: 18 16 cp r1, r24 db36: 0c f0 brlt .+2 ; 0xdb3a db38: dd c0 rjmp .+442 ; 0xdcf4 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); db3a: 20 e0 ldi r18, 0x00 ; 0 db3c: 30 e0 ldi r19, 0x00 ; 0 db3e: 40 ef ldi r20, 0xF0 ; 240 db40: 51 e4 ldi r21, 0x41 ; 65 db42: c7 01 movw r24, r14 db44: b6 01 movw r22, r12 db46: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> db4a: 0f 94 4c df call 0x3be98 ; 0x3be98 db4e: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> db52: 7e 83 std Y+6, r23 ; 0x06 db54: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { db56: 62 30 cpi r22, 0x02 ; 2 db58: 71 05 cpc r23, r1 db5a: 08 f4 brcc .+2 ; 0xdb5e db5c: cb c0 rjmp .+406 ; 0xdcf4 db5e: 21 14 cp r2, r1 db60: 31 04 cpc r3, r1 db62: 09 f4 brne .+2 ; 0xdb66 db64: c7 c0 rjmp .+398 ; 0xdcf4 float dz = z - current_position[Z_AXIS]; db66: 20 91 48 07 lds r18, 0x0748 ; 0x800748 db6a: 30 91 49 07 lds r19, 0x0749 ; 0x800749 db6e: 40 91 4a 07 lds r20, 0x074A ; 0x80074a db72: 50 91 4b 07 lds r21, 0x074B ; 0x80074b db76: 60 91 59 05 lds r22, 0x0559 ; 0x800559 db7a: 70 91 5a 05 lds r23, 0x055A ; 0x80055a db7e: 80 91 5b 05 lds r24, 0x055B ; 0x80055b db82: 90 91 5c 05 lds r25, 0x055C ; 0x80055c db86: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> db8a: 6f 87 std Y+15, r22 ; 0x0f db8c: 78 8b std Y+16, r23 ; 0x10 db8e: 89 8b std Y+17, r24 ; 0x11 db90: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; db92: 20 91 4c 07 lds r18, 0x074C ; 0x80074c db96: 30 91 4d 07 lds r19, 0x074D ; 0x80074d db9a: 40 91 4e 07 lds r20, 0x074E ; 0x80074e db9e: 50 91 4f 07 lds r21, 0x074F ; 0x80074f dba2: 60 91 5d 05 lds r22, 0x055D ; 0x80055d dba6: 70 91 5e 05 lds r23, 0x055E ; 0x80055e dbaa: 80 91 5f 05 lds r24, 0x055F ; 0x80055f dbae: 90 91 60 05 lds r25, 0x0560 ; 0x800560 dbb2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> dbb6: 6b 8b std Y+19, r22 ; 0x13 dbb8: 7c 8b std Y+20, r23 ; 0x14 dbba: 8d 8b std Y+21, r24 ; 0x15 dbbc: 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); dbbe: ad 81 ldd r26, Y+5 ; 0x05 dbc0: be 81 ldd r27, Y+6 ; 0x06 dbc2: cd 01 movw r24, r26 dbc4: b0 e0 ldi r27, 0x00 ; 0 dbc6: a0 e0 ldi r26, 0x00 ; 0 dbc8: 8f 8f std Y+31, r24 ; 0x1f dbca: 98 a3 std Y+32, r25 ; 0x20 dbcc: a9 a3 std Y+33, r26 ; 0x21 dbce: 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) { dbd0: 2d 81 ldd r18, Y+5 ; 0x05 dbd2: 3e 81 ldd r19, Y+6 ; 0x06 dbd4: 22 16 cp r2, r18 dbd6: 33 06 cpc r3, r19 dbd8: 08 f0 brcs .+2 ; 0xdbdc dbda: 8c c0 rjmp .+280 ; 0xdcf4 float t = float(i) / float(n_segments); dbdc: b1 01 movw r22, r2 dbde: 90 e0 ldi r25, 0x00 ; 0 dbe0: 80 e0 ldi r24, 0x00 ; 0 dbe2: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> dbe6: 6b 01 movw r12, r22 dbe8: 7c 01 movw r14, r24 dbea: 6f 8d ldd r22, Y+31 ; 0x1f dbec: 78 a1 ldd r23, Y+32 ; 0x20 dbee: 89 a1 ldd r24, Y+33 ; 0x21 dbf0: 9a a1 ldd r25, Y+34 ; 0x22 dbf2: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> dbf6: 9b 01 movw r18, r22 dbf8: ac 01 movw r20, r24 dbfa: c7 01 movw r24, r14 dbfc: b6 01 movw r22, r12 dbfe: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> dc02: 6b 01 movw r12, r22 dc04: 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, dc06: ac 01 movw r20, r24 dc08: 9b 01 movw r18, r22 dc0a: 6b 89 ldd r22, Y+19 ; 0x13 dc0c: 7c 89 ldd r23, Y+20 ; 0x14 dc0e: 8d 89 ldd r24, Y+21 ; 0x15 dc10: 9e 89 ldd r25, Y+22 ; 0x16 dc12: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> dc16: 9b 01 movw r18, r22 dc18: ac 01 movw r20, r24 dc1a: 60 91 4c 07 lds r22, 0x074C ; 0x80074c dc1e: 70 91 4d 07 lds r23, 0x074D ; 0x80074d dc22: 80 91 4e 07 lds r24, 0x074E ; 0x80074e dc26: 90 91 4f 07 lds r25, 0x074F ; 0x80074f dc2a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> dc2e: 69 83 std Y+1, r22 ; 0x01 dc30: 7a 83 std Y+2, r23 ; 0x02 dc32: 8b 83 std Y+3, r24 ; 0x03 dc34: 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, dc36: a7 01 movw r20, r14 dc38: 96 01 movw r18, r12 dc3a: 6f 85 ldd r22, Y+15 ; 0x0f dc3c: 78 89 ldd r23, Y+16 ; 0x10 dc3e: 89 89 ldd r24, Y+17 ; 0x11 dc40: 9a 89 ldd r25, Y+18 ; 0x12 dc42: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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, dc46: 20 91 48 07 lds r18, 0x0748 ; 0x800748 dc4a: 30 91 49 07 lds r19, 0x0749 ; 0x800749 dc4e: 40 91 4a 07 lds r20, 0x074A ; 0x80074a dc52: 50 91 4b 07 lds r21, 0x074B ; 0x80074b dc56: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> dc5a: 6f 8b std Y+23, r22 ; 0x17 dc5c: 78 8f std Y+24, r23 ; 0x18 dc5e: 89 8f std Y+25, r24 ; 0x19 dc60: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, dc62: a7 01 movw r20, r14 dc64: 96 01 movw r18, r12 dc66: 6b 85 ldd r22, Y+11 ; 0x0b dc68: 7c 85 ldd r23, Y+12 ; 0x0c dc6a: 8d 85 ldd r24, Y+13 ; 0x0d dc6c: 9e 85 ldd r25, Y+14 ; 0x0e dc6e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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, dc72: 20 91 44 07 lds r18, 0x0744 ; 0x800744 dc76: 30 91 45 07 lds r19, 0x0745 ; 0x800745 dc7a: 40 91 46 07 lds r20, 0x0746 ; 0x800746 dc7e: 50 91 47 07 lds r21, 0x0747 ; 0x800747 dc82: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> dc86: 6b 8f std Y+27, r22 ; 0x1b dc88: 7c 8f std Y+28, r23 ; 0x1c dc8a: 8d 8f std Y+29, r24 ; 0x1d dc8c: 9e 8f std Y+30, r25 ; 0x1e dc8e: a7 01 movw r20, r14 dc90: 96 01 movw r18, r12 dc92: c3 01 movw r24, r6 dc94: b2 01 movw r22, r4 dc96: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> dc9a: 20 91 40 07 lds r18, 0x0740 ; 0x800740 dc9e: 30 91 41 07 lds r19, 0x0741 ; 0x800741 dca2: 40 91 42 07 lds r20, 0x0742 ; 0x800742 dca6: 50 91 43 07 lds r21, 0x0743 ; 0x800743 dcaa: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> dcae: 3f 92 push r3 dcb0: 2f 92 push r2 dcb2: a0 e4 ldi r26, 0x40 ; 64 dcb4: b7 e0 ldi r27, 0x07 ; 7 dcb6: bf 93 push r27 dcb8: af 93 push r26 dcba: 8f 80 ldd r8, Y+7 ; 0x07 dcbc: 98 84 ldd r9, Y+8 ; 0x08 dcbe: a9 84 ldd r10, Y+9 ; 0x09 dcc0: ba 84 ldd r11, Y+10 ; 0x0a dcc2: de 01 movw r26, r28 dcc4: 11 96 adiw r26, 0x01 ; 1 dcc6: 6d 01 movw r12, r26 dcc8: ef 88 ldd r14, Y+23 ; 0x17 dcca: f8 8c ldd r15, Y+24 ; 0x18 dccc: 09 8d ldd r16, Y+25 ; 0x19 dcce: 1a 8d ldd r17, Y+26 ; 0x1a dcd0: 2b 8d ldd r18, Y+27 ; 0x1b dcd2: 3c 8d ldd r19, Y+28 ; 0x1c dcd4: 4d 8d ldd r20, Y+29 ; 0x1d dcd6: 5e 8d ldd r21, Y+30 ; 0x1e dcd8: 0f 94 f3 aa call 0x355e6 ; 0x355e6 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) dcdc: 0f 90 pop r0 dcde: 0f 90 pop r0 dce0: 0f 90 pop r0 dce2: 0f 90 pop r0 dce4: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a dce8: 81 11 cpse r24, r1 dcea: b7 ce rjmp .-658 ; 0xda5a 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) { dcec: bf ef ldi r27, 0xFF ; 255 dcee: 2b 1a sub r2, r27 dcf0: 3b 0a sbc r3, r27 dcf2: 6e cf rjmp .-292 ; 0xdbd0 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); dcf4: e0 90 59 05 lds r14, 0x0559 ; 0x800559 dcf8: f0 90 5a 05 lds r15, 0x055A ; 0x80055a dcfc: 00 91 5b 05 lds r16, 0x055B ; 0x80055b dd00: 10 91 5c 05 lds r17, 0x055C ; 0x80055c dd04: 20 91 55 05 lds r18, 0x0555 ; 0x800555 dd08: 30 91 56 05 lds r19, 0x0556 ; 0x800556 dd0c: 40 91 57 05 lds r20, 0x0557 ; 0x800557 dd10: 50 91 58 05 lds r21, 0x0558 ; 0x800558 dd14: 60 91 51 05 lds r22, 0x0551 ; 0x800551 dd18: 70 91 52 05 lds r23, 0x0552 ; 0x800552 dd1c: 80 91 53 05 lds r24, 0x0553 ; 0x800553 dd20: 90 91 54 05 lds r25, 0x0554 ; 0x800554 dd24: 1f 92 push r1 dd26: 1f 92 push r1 dd28: e0 e4 ldi r30, 0x40 ; 64 dd2a: f7 e0 ldi r31, 0x07 ; 7 dd2c: ff 93 push r31 dd2e: ef 93 push r30 dd30: 8f 80 ldd r8, Y+7 ; 0x07 dd32: 98 84 ldd r9, Y+8 ; 0x08 dd34: a9 84 ldd r10, Y+9 ; 0x09 dd36: ba 84 ldd r11, Y+10 ; 0x0a dd38: ed e5 ldi r30, 0x5D ; 93 dd3a: ce 2e mov r12, r30 dd3c: e5 e0 ldi r30, 0x05 ; 5 dd3e: de 2e mov r13, r30 dd40: 0f 94 f3 aa call 0x355e6 ; 0x355e6 dd44: 0f 90 pop r0 dd46: 0f 90 pop r0 dd48: 0f 90 pop r0 dd4a: 0f 90 pop r0 dd4c: 86 ce rjmp .-756 ; 0xda5a 0000dd4e : /// @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) { dd4e: cf 92 push r12 dd50: df 92 push r13 dd52: ef 92 push r14 dd54: ff 92 push r15 dd56: cf 93 push r28 dd58: 9b 01 movw r18, r22 dd5a: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; dd5c: c0 90 48 07 lds r12, 0x0748 ; 0x800748 dd60: d0 90 49 07 lds r13, 0x0749 ; 0x800749 dd64: e0 90 4a 07 lds r14, 0x074A ; 0x80074a dd68: f0 90 4b 07 lds r15, 0x074B ; 0x80074b // Prepare to move Z axis current_position[Z_AXIS] += delta; dd6c: c7 01 movw r24, r14 dd6e: b6 01 movw r22, r12 dd70: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> dd74: 60 93 48 07 sts 0x0748, r22 ; 0x800748 dd78: 70 93 49 07 sts 0x0749, r23 ; 0x800749 dd7c: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a dd80: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); dd84: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) dd86: 90 91 3f 07 lds r25, 0x073F ; 0x80073f dd8a: 91 11 cpse r25, r1 dd8c: 02 c0 rjmp .+4 ; 0xdd92 dd8e: 84 ff sbrs r24, 4 dd90: 26 c0 rjmp .+76 ; 0xddde { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); dd92: 80 e4 ldi r24, 0x40 ; 64 dd94: 97 e0 ldi r25, 0x07 ; 7 dd96: 0e 94 8f 6c call 0xd91e ; 0xd91e plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); dd9a: e0 91 99 02 lds r30, 0x0299 ; 0x800299 dd9e: f0 91 9a 02 lds r31, 0x029A ; 0x80029a dda2: 60 85 ldd r22, Z+8 ; 0x08 dda4: 71 85 ldd r23, Z+9 ; 0x09 dda6: 82 85 ldd r24, Z+10 ; 0x0a dda8: 93 85 ldd r25, Z+11 ; 0x0b ddaa: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); ddae: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; ddb2: a7 01 movw r20, r14 ddb4: 96 01 movw r18, r12 ddb6: 60 91 48 07 lds r22, 0x0748 ; 0x800748 ddba: 70 91 49 07 lds r23, 0x0749 ; 0x800749 ddbe: 80 91 4a 07 lds r24, 0x074A ; 0x80074a ddc2: 90 91 4b 07 lds r25, 0x074B ; 0x80074b ddc6: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> ddca: 6b 01 movw r12, r22 ddcc: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } ddce: c7 01 movw r24, r14 ddd0: b6 01 movw r22, r12 ddd2: cf 91 pop r28 ddd4: ff 90 pop r15 ddd6: ef 90 pop r14 ddd8: df 90 pop r13 ddda: cf 90 pop r12 dddc: 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(); ddde: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); dde0: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); dde4: 81 e0 ldi r24, 0x01 ; 1 dde6: 0f 94 0f 64 call 0x2c81e ; 0x2c81e ddea: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); ddec: 84 e0 ldi r24, 0x04 ; 4 ddee: 0f 94 63 3b call 0x276c6 ; 0x276c6 #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); ddf2: 65 e5 ldi r22, 0x55 ; 85 ddf4: 75 e5 ldi r23, 0x55 ; 85 ddf6: 85 e5 ldi r24, 0x55 ; 85 ddf8: 91 e4 ldi r25, 0x41 ; 65 ddfa: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); ddfe: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; de02: 82 e0 ldi r24, 0x02 ; 2 de04: 0f 94 cd 58 call 0x2b19a ; 0x2b19a de08: a7 01 movw r20, r14 de0a: 96 01 movw r18, r12 de0c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> de10: 6b 01 movw r12, r22 de12: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) de14: 0f 94 1d 64 call 0x2c83a ; 0x2c83a de18: 88 23 and r24, r24 de1a: 91 f0 breq .+36 ; 0xde40 { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; de1c: 80 91 1d 02 lds r24, 0x021D ; 0x80021d de20: 90 91 1e 02 lds r25, 0x021E ; 0x80021e de24: a0 91 1f 02 lds r26, 0x021F ; 0x80021f de28: b0 91 20 02 lds r27, 0x0220 ; 0x800220 de2c: 80 93 48 07 sts 0x0748, r24 ; 0x800748 de30: 90 93 49 07 sts 0x0749, r25 ; 0x800749 de34: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a de38: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_set_position_curposXYZE(); de3c: 0f 94 08 b9 call 0x37210 ; 0x37210 } tmc2130_home_exit(); de40: 0f 94 34 3b call 0x27668 ; 0x27668 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); de44: 8c 2f mov r24, r28 de46: 0f 94 0f 64 call 0x2c81e ; 0x2c81e de4a: c1 cf rjmp .-126 ; 0xddce 0000de4c : // // 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) { de4c: 8f 92 push r8 de4e: 9f 92 push r9 de50: af 92 push r10 de52: bf 92 push r11 de54: cf 92 push r12 de56: df 92 push r13 de58: ef 92 push r14 de5a: ff 92 push r15 de5c: 4b 01 movw r8, r22 de5e: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) de60: c0 90 48 07 lds r12, 0x0748 ; 0x800748 de64: d0 90 49 07 lds r13, 0x0749 ; 0x800749 de68: e0 90 4a 07 lds r14, 0x074A ; 0x80074a de6c: f0 90 4b 07 lds r15, 0x074B ; 0x80074b de70: ac 01 movw r20, r24 de72: 9b 01 movw r18, r22 de74: c7 01 movw r24, r14 de76: b6 01 movw r22, r12 de78: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> de7c: 87 ff sbrs r24, 7 de7e: 11 c0 rjmp .+34 ; 0xdea2 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); de80: a5 01 movw r20, r10 de82: 94 01 movw r18, r8 de84: c7 01 movw r24, r14 de86: b6 01 movw r22, r12 de88: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> de8c: 9f 77 andi r25, 0x7F ; 127 } de8e: ff 90 pop r15 de90: ef 90 pop r14 de92: df 90 pop r13 de94: cf 90 pop r12 de96: bf 90 pop r11 de98: af 90 pop r10 de9a: 9f 90 pop r9 de9c: 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)); de9e: 0c 94 a7 6e jmp 0xdd4e ; 0xdd4e } dea2: ff 90 pop r15 dea4: ef 90 pop r14 dea6: df 90 pop r13 dea8: cf 90 pop r12 deaa: bf 90 pop r11 deac: af 90 pop r10 deae: 9f 90 pop r9 deb0: 8f 90 pop r8 deb2: 08 95 ret 0000deb4 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { deb4: ec e5 ldi r30, 0x5C ; 92 deb6: 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; deb8: 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]; deba: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty debc: 8f 37 cpi r24, 0x7F ; 127 debe: 31 f0 breq .+12 ; 0xdecc dec0: df 01 movw r26, r30 dec2: 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 dec4: 87 ff sbrs r24, 7 dec6: 07 c0 rjmp .+14 ; 0xded6 lcd_custom_characters[i] = c & 0x7F; dec8: 8f 77 andi r24, 0x7F ; 127 deca: 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++) { decc: 83 e0 ldi r24, 0x03 ; 3 dece: e4 36 cpi r30, 0x64 ; 100 ded0: f8 07 cpc r31, r24 ded2: 99 f7 brne .-26 ; 0xdeba for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } ded4: 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; ded6: 9c 93 st X, r25 ded8: f9 cf rjmp .-14 ; 0xdecc 0000deda : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) deda: 90 91 6d 02 lds r25, 0x026D ; 0x80026d dede: 98 17 cp r25, r24 dee0: 10 f4 brcc .+4 ; 0xdee6 lcd_draw_update = lcdDrawUpdateOverride; dee2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; dee6: 80 91 6e 02 lds r24, 0x026E ; 0x80026e deea: 88 23 and r24, r24 deec: 39 f0 breq .+14 ; 0xdefc if (lcd_lcdupdate_func) deee: e0 91 0c 04 lds r30, 0x040C ; 0x80040c def2: f0 91 0d 04 lds r31, 0x040D ; 0x80040d def6: 30 97 sbiw r30, 0x00 ; 0 def8: 09 f0 breq .+2 ; 0xdefc lcd_lcdupdate_func(); defa: 19 94 eijmp } defc: 08 95 ret 0000defe : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { defe: cf 93 push r28 df00: df 93 push r29 df02: cd b7 in r28, 0x3d ; 61 df04: de b7 in r29, 0x3e ; 62 df06: ae 01 movw r20, r28 df08: 4a 5f subi r20, 0xFA ; 250 df0a: 5f 4f sbci r21, 0xFF ; 255 df0c: fa 01 movw r30, r20 df0e: 61 91 ld r22, Z+ df10: 71 91 ld r23, Z+ df12: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); df14: 8c ef ldi r24, 0xFC ; 252 df16: 93 e0 ldi r25, 0x03 ; 3 df18: 0f 94 8d dc call 0x3b91a ; 0x3b91a va_end(args); return ret; } df1c: df 91 pop r29 df1e: cf 91 pop r28 df20: 08 95 ret 0000df22 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); df22: 6c ef ldi r22, 0xFC ; 252 df24: 73 e0 ldi r23, 0x03 ; 3 df26: 0d 94 de db jmp 0x3b7bc ; 0x3b7bc 0000df2a : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); df2a: 6c ef ldi r22, 0xFC ; 252 df2c: 73 e0 ldi r23, 0x03 ; 3 df2e: 08 2e mov r0, r24 df30: 00 0c add r0, r0 df32: 99 0b sbc r25, r25 df34: 0d 94 ae db jmp 0x3b75c ; 0x3b75c 0000df38 : va_end(args); return ret; } void lcd_space(uint8_t n) { df38: cf 93 push r28 df3a: c8 2f mov r28, r24 while (n--) lcd_putc(' '); df3c: c1 50 subi r28, 0x01 ; 1 df3e: 20 f0 brcs .+8 ; 0xdf48 df40: 80 e2 ldi r24, 0x20 ; 32 df42: 0e 94 95 6f call 0xdf2a ; 0xdf2a df46: fa cf rjmp .-12 ; 0xdf3c } df48: cf 91 pop r28 df4a: 08 95 ret 0000df4c : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { df4c: cf 93 push r28 df4e: c8 2f mov r28, r24 df50: 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); df52: 64 30 cpi r22, 0x04 ; 4 df54: 08 f0 brcs .+2 ; 0xdf58 df56: 83 e0 ldi r24, 0x03 ; 3 df58: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b } void lcd_set_cursor(uint8_t col, uint8_t row) { lcd_set_current_row(row); uint8_t addr = col + lcd_get_row_offset(lcd_currline); df5c: 0e 94 c0 5b call 0xb780 ; 0xb780 df60: 8c 0f add r24, r28 lcd_ddram_address = addr; df62: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df66: 44 e6 ldi r20, 0x64 ; 100 df68: 50 e0 ldi r21, 0x00 ; 0 df6a: 60 e0 ldi r22, 0x00 ; 0 df6c: 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); } df6e: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df70: 0c 94 cd 64 jmp 0xc99a ; 0xc99a 0000df74 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { df74: cf 93 push r28 df76: df 93 push r29 df78: ea 01 movw r28, r20 lcd_set_cursor(c, r); df7a: 0e 94 a6 6f call 0xdf4c ; 0xdf4c return fputs_P(str, lcdout); df7e: 6c ef ldi r22, 0xFC ; 252 df80: 73 e0 ldi r23, 0x03 ; 3 df82: ce 01 movw r24, r28 } df84: df 91 pop r29 df86: 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); df88: 0d 94 de db jmp 0x3b7bc ; 0x3b7bc 0000df8c : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { df8c: cf 93 push r28 df8e: c4 2f mov r28, r20 lcd_set_cursor(c, r); df90: 0e 94 a6 6f call 0xdf4c ; 0xdf4c return fputc(ch, lcdout); df94: 6c ef ldi r22, 0xFC ; 252 df96: 73 e0 ldi r23, 0x03 ; 3 df98: 8c 2f mov r24, r28 df9a: cc 0f add r28, r28 df9c: 99 0b sbc r25, r25 } df9e: 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); dfa0: 0d 94 ae db jmp 0x3b75c ; 0x3b75c 0000dfa4 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); dfa4: 60 e0 ldi r22, 0x00 ; 0 dfa6: 80 e0 ldi r24, 0x00 ; 0 dfa8: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_ddram_address = 0; dfac: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a } dfb0: 08 95 ret 0000dfb2 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); dfb2: 40 e4 ldi r20, 0x40 ; 64 dfb4: 56 e0 ldi r21, 0x06 ; 6 dfb6: 60 e0 ldi r22, 0x00 ; 0 dfb8: 81 e0 ldi r24, 0x01 ; 1 dfba: 0e 94 cd 64 call 0xc99a ; 0xc99a // 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; dfbe: 10 92 5b 03 sts 0x035B, r1 ; 0x80035b lcd_ddram_address = 0; dfc2: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); dfc6: 48 e0 ldi r20, 0x08 ; 8 dfc8: 50 e0 ldi r21, 0x00 ; 0 dfca: 6f e7 ldi r22, 0x7F ; 127 dfcc: 70 e0 ldi r23, 0x00 ; 0 dfce: 8c e5 ldi r24, 0x5C ; 92 dfd0: 93 e0 ldi r25, 0x03 ; 3 dfd2: 0d 94 78 e3 jmp 0x3c6f0 ; 0x3c6f0 0000dfd6 : } 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) dfd6: 90 91 6e 02 lds r25, 0x026E ; 0x80026e dfda: 98 17 cp r25, r24 dfdc: 09 f1 breq .+66 ; 0xe020 { lcd_update_enabled = enabled; dfde: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) dfe2: 88 23 and r24, r24 dfe4: e9 f0 breq .+58 ; 0xe020 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; dfe6: 10 92 35 05 sts 0x0535, r1 ; 0x800535 dfea: 10 92 34 05 sts 0x0534, r1 ; 0x800534 lcd_encoder_diff = 0; dfee: 10 92 cf 05 sts 0x05CF, r1 ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.559> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); dff2: 84 ed ldi r24, 0xD4 ; 212 dff4: 93 e0 ldi r25, 0x03 ; 3 dff6: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; dffa: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 dffe: 61 50 subi r22, 0x01 ; 1 e000: 71 09 sbc r23, r1 e002: 81 09 sbc r24, r1 e004: 91 09 sbc r25, r1 e006: 60 93 d0 03 sts 0x03D0, r22 ; 0x8003d0 e00a: 70 93 d1 03 sts 0x03D1, r23 ; 0x8003d1 e00e: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 e012: 90 93 d3 03 sts 0x03D3, r25 ; 0x8003d3 // Full update. lcd_clear(); e016: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_update(2); e01a: 82 e0 ldi r24, 0x02 ; 2 e01c: 0c 94 6d 6f jmp 0xdeda ; 0xdeda } else { // Clear the LCD always, or let it to the caller? } } } e020: 08 95 ret 0000e022 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { e022: cf 93 push r28 e024: c8 2f mov r28, r24 lcd_currline = 0; e026: 10 92 5b 03 sts 0x035B, r1 ; 0x80035b lcd_ddram_address = 0; e02a: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); e02e: 48 e0 ldi r20, 0x08 ; 8 e030: 50 e0 ldi r21, 0x00 ; 0 e032: 6f e7 ldi r22, 0x7F ; 127 e034: 70 e0 ldi r23, 0x00 ; 0 e036: 8c e5 ldi r24, 0x5C ; 92 e038: 93 e0 ldi r25, 0x03 ; 3 e03a: 0f 94 78 e3 call 0x3c6f0 ; 0x3c6f0 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 e03e: 44 e9 ldi r20, 0x94 ; 148 e040: 51 e1 ldi r21, 0x11 ; 17 e042: 62 e0 ldi r22, 0x02 ; 2 e044: 80 e3 ldi r24, 0x30 ; 48 e046: 0e 94 cd 64 call 0xc99a ; 0xc99a // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e04a: 46 e9 ldi r20, 0x96 ; 150 e04c: 50 e0 ldi r21, 0x00 ; 0 e04e: 62 e0 ldi r22, 0x02 ; 2 e050: 80 e3 ldi r24, 0x30 ; 48 e052: 0e 94 cd 64 call 0xc99a ; 0xc99a // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e056: 46 e9 ldi r20, 0x96 ; 150 e058: 50 e0 ldi r21, 0x00 ; 0 e05a: 62 e0 ldi r22, 0x02 ; 2 e05c: 80 e3 ldi r24, 0x30 ; 48 e05e: 0e 94 cd 64 call 0xc99a ; 0xc99a #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); e062: 46 e9 ldi r20, 0x96 ; 150 e064: 50 e0 ldi r21, 0x00 ; 0 e066: 62 e0 ldi r22, 0x02 ; 2 e068: 80 e2 ldi r24, 0x20 ; 32 e06a: 0e 94 cd 64 call 0xc99a ; 0xc99a #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); e06e: 80 91 0a 04 lds r24, 0x040A ; 0x80040a <_ZL19lcd_displayfunction.lto_priv.569> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e072: 44 e6 ldi r20, 0x64 ; 100 e074: 50 e0 ldi r21, 0x00 ; 0 e076: 60 e0 ldi r22, 0x00 ; 0 e078: 80 62 ori r24, 0x20 ; 32 e07a: 0e 94 cd 64 call 0xc99a ; 0xc99a } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; e07e: 84 e0 ldi r24, 0x04 ; 4 e080: 80 93 59 03 sts 0x0359, r24 ; 0x800359 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e084: 44 e6 ldi r20, 0x64 ; 100 e086: 50 e0 ldi r21, 0x00 ; 0 e088: 60 e0 ldi r22, 0x00 ; 0 e08a: 8c e0 ldi r24, 0x0C ; 12 e08c: 0e 94 cd 64 call 0xc99a ; 0xc99a 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(); e090: c1 11 cpse r28, r1 e092: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e096: 44 e6 ldi r20, 0x64 ; 100 e098: 50 e0 ldi r21, 0x00 ; 0 e09a: 60 e0 ldi r22, 0x00 ; 0 e09c: 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); } e09e: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e0a0: 0c 94 cd 64 jmp 0xc99a ; 0xc99a 0000e0a4 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); e0a4: 81 e0 ldi r24, 0x01 ; 1 e0a6: 0c 94 11 70 jmp 0xe022 ; 0xe022 0000e0aa : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { e0aa: cf 92 push r12 e0ac: df 92 push r13 e0ae: ff 92 push r15 e0b0: 0f 93 push r16 e0b2: 1f 93 push r17 e0b4: cf 93 push r28 e0b6: df 93 push r29 e0b8: 00 d0 rcall .+0 ; 0xe0ba e0ba: 00 d0 rcall .+0 ; 0xe0bc e0bc: 1f 92 push r1 e0be: 1f 92 push r1 e0c0: cd b7 in r28, 0x3d ; 61 e0c2: de b7 in r29, 0x3e ; 62 if (value == '\n') { e0c4: 8a 30 cpi r24, 0x0A ; 10 e0c6: d9 f4 brne .+54 ; 0xe0fe if (lcd_currline > 3) lcd_currline = -1; e0c8: 80 91 5b 03 lds r24, 0x035B ; 0x80035b e0cc: 84 30 cpi r24, 0x04 ; 4 e0ce: 18 f0 brcs .+6 ; 0xe0d6 e0d0: 8f ef ldi r24, 0xFF ; 255 e0d2: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b lcd_set_cursor(0, lcd_currline + 1); // LF e0d6: 60 91 5b 03 lds r22, 0x035B ; 0x80035b e0da: 6f 5f subi r22, 0xFF ; 255 e0dc: 80 e0 ldi r24, 0x00 ; 0 e0de: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } e0e2: 28 96 adiw r28, 0x08 ; 8 e0e4: 0f b6 in r0, 0x3f ; 63 e0e6: f8 94 cli e0e8: de bf out 0x3e, r29 ; 62 e0ea: 0f be out 0x3f, r0 ; 63 e0ec: cd bf out 0x3d, r28 ; 61 e0ee: df 91 pop r29 e0f0: cf 91 pop r28 e0f2: 1f 91 pop r17 e0f4: 0f 91 pop r16 e0f6: ff 90 pop r15 e0f8: df 90 pop r13 e0fa: cf 90 pop r12 e0fc: 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))) { e0fe: 90 e8 ldi r25, 0x80 ; 128 e100: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); e102: 44 e6 ldi r20, 0x64 ; 100 e104: 50 e0 ldi r21, 0x00 ; 0 e106: 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))) { e108: 9a 34 cpi r25, 0x4A ; 74 e10a: 08 f5 brcc .+66 ; 0xe14e // 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. e10c: 48 2f mov r20, r24 e10e: 40 58 subi r20, 0x80 ; 128 e110: 55 0b sbc r21, r21 e112: 9a 01 movw r18, r20 e114: 96 e0 ldi r25, 0x06 ; 6 e116: 92 9f mul r25, r18 e118: a0 01 movw r20, r0 e11a: 93 9f mul r25, r19 e11c: 50 0d add r21, r0 e11e: 11 24 eor r1, r1 e120: fa 01 movw r30, r20 e122: ed 56 subi r30, 0x6D ; 109 e124: f5 48 sbci r31, 0x85 ; 133 e126: f4 90 lpm r15, Z e128: ec e5 ldi r30, 0x5C ; 92 e12a: f3 e0 ldi r31, 0x03 ; 3 e12c: 30 e0 ldi r19, 0x00 ; 0 e12e: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; e130: 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)) { e132: 61 91 ld r22, Z+ e134: 78 2f mov r23, r24 e136: 76 27 eor r23, r22 e138: 7f 77 andi r23, 0x7F ; 127 e13a: 89 f4 brne .+34 ; 0xe15e lcd_custom_characters[i] = c; // mark the custom character as used e13c: f9 01 movw r30, r18 e13e: e4 5a subi r30, 0xA4 ; 164 e140: fc 4f sbci r31, 0xFC ; 252 e142: 80 83 st Z, r24 e144: 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); e146: 44 e6 ldi r20, 0x64 ; 100 e148: 50 e0 ldi r21, 0x00 ; 0 e14a: 61 e0 ldi r22, 0x01 ; 1 e14c: 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); e14e: 0e 94 cd 64 call 0xc99a ; 0xc99a lcd_ddram_address++; // no need for preventing ddram overflow e152: 80 91 5a 03 lds r24, 0x035A ; 0x80035a e156: 8f 5f subi r24, 0xFF ; 255 e158: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a e15c: c2 cf rjmp .-124 ; 0xe0e2 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 e15e: 6f 37 cpi r22, 0x7F ; 127 e160: 09 f0 breq .+2 ; 0xe164 e162: 3c c0 rjmp .+120 ; 0xe1dc lcd_custom_characters[i] = c; // mark the custom character as used e164: f9 01 movw r30, r18 e166: e4 5a subi r30, 0xA4 ; 164 e168: fc 4f sbci r31, 0xFC ; 252 e16a: 80 83 st Z, r24 slotToUse = i; e16c: 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; e16e: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e170: fa 01 movw r30, r20 e172: e2 57 subi r30, 0x72 ; 114 e174: f5 48 sbci r31, 0x85 ; 133 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e176: 8e 01 movw r16, r28 e178: 0f 5f subi r16, 0xFF ; 255 e17a: 1f 4f sbci r17, 0xFF ; 255 e17c: d8 01 movw r26, r16 e17e: 95 91 lpm r25, Z+ e180: 88 e0 ldi r24, 0x08 ; 8 e182: 18 2e mov r1, r24 0000e184 : e184: 10 fe sbrs r1, 0 e186: 05 90 lpm r0, Z+ e188: 02 94 swap r0 e18a: 80 2d mov r24, r0 e18c: 97 95 ror r25 e18e: 88 1f adc r24, r24 e190: 8d 93 st X+, r24 e192: 1a 94 dec r1 e194: b9 f7 brne .-18 ; 0xe184 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e196: bf 2d mov r27, r15 e198: e8 e0 ldi r30, 0x08 ; 8 e19a: be 02 muls r27, r30 e19c: c0 01 movw r24, r0 e19e: 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); e1a0: 44 e6 ldi r20, 0x64 ; 100 e1a2: 50 e0 ldi r21, 0x00 ; 0 e1a4: 60 e0 ldi r22, 0x00 ; 0 e1a6: 80 64 ori r24, 0x40 ; 64 e1a8: 0e 94 cd 64 call 0xc99a ; 0xc99a e1ac: 6e 01 movw r12, r28 e1ae: f9 e0 ldi r31, 0x09 ; 9 e1b0: cf 0e add r12, r31 e1b2: 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); e1b4: 44 e6 ldi r20, 0x64 ; 100 e1b6: 50 e0 ldi r21, 0x00 ; 0 e1b8: 61 e0 ldi r22, 0x01 ; 1 e1ba: d8 01 movw r26, r16 e1bc: 8d 91 ld r24, X+ e1be: 8d 01 movw r16, r26 e1c0: 0e 94 cd 64 call 0xc99a ; 0xc99a : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e1c4: c0 16 cp r12, r16 e1c6: d1 06 cpc r13, r17 e1c8: a9 f7 brne .-22 ; 0xe1b4 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e1ca: 80 91 5a 03 lds r24, 0x035A ; 0x80035a delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1ce: 44 e6 ldi r20, 0x64 ; 100 e1d0: 50 e0 ldi r21, 0x00 ; 0 e1d2: 60 e0 ldi r22, 0x00 ; 0 e1d4: 80 68 ori r24, 0x80 ; 128 e1d6: 0e 94 cd 64 call 0xc99a ; 0xc99a e1da: b5 cf rjmp .-150 ; 0xe146 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 e1dc: 67 ff sbrs r22, 7 slotToUse = i; e1de: 92 2f mov r25, r18 e1e0: 2f 5f subi r18, 0xFF ; 255 e1e2: 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++) { e1e4: 28 30 cpi r18, 0x08 ; 8 e1e6: 31 05 cpc r19, r1 e1e8: 09 f0 breq .+2 ; 0xe1ec e1ea: a3 cf rjmp .-186 ; 0xe132 } // 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) { e1ec: 9f 3f cpi r25, 0xFF ; 255 e1ee: 09 f0 breq .+2 ; 0xe1f2 e1f0: be cf rjmp .-132 ; 0xe16e e1f2: a9 cf rjmp .-174 ; 0xe146 0000e1f4 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e1f4: 8f 92 push r8 e1f6: 9f 92 push r9 e1f8: af 92 push r10 e1fa: bf 92 push r11 e1fc: ef 92 push r14 e1fe: ff 92 push r15 e200: 0f 93 push r16 e202: 1f 93 push r17 e204: cf 93 push r28 e206: df 93 push r29 e208: cd b7 in r28, 0x3d ; 61 e20a: de b7 in r29, 0x3e ; 62 e20c: a0 97 sbiw r28, 0x20 ; 32 e20e: 0f b6 in r0, 0x3f ; 63 e210: f8 94 cli e212: de bf out 0x3e, r29 ; 62 e214: 0f be out 0x3f, r0 ; 63 e216: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e218: 61 15 cp r22, r1 e21a: 71 05 cpc r23, r1 e21c: 81 05 cpc r24, r1 e21e: 91 05 cpc r25, r1 e220: 99 f4 brne .+38 ; 0xe248 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e222: 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)); } e224: a0 96 adiw r28, 0x20 ; 32 e226: 0f b6 in r0, 0x3f ; 63 e228: f8 94 cli e22a: de bf out 0x3e, r29 ; 62 e22c: 0f be out 0x3f, r0 ; 63 e22e: cd bf out 0x3d, r28 ; 61 e230: df 91 pop r29 e232: cf 91 pop r28 e234: 1f 91 pop r17 e236: 0f 91 pop r16 e238: ff 90 pop r15 e23a: ef 90 pop r14 e23c: bf 90 pop r11 e23e: af 90 pop r10 e240: 9f 90 pop r9 e242: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e244: 0c 94 55 70 jmp 0xe0aa ; 0xe0aa } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e248: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e24a: 84 2e mov r8, r20 e24c: 91 2c mov r9, r1 e24e: b1 2c mov r11, r1 e250: a1 2c mov r10, r1 e252: 9e 01 movw r18, r28 e254: 2f 5f subi r18, 0xFF ; 255 e256: 3f 4f sbci r19, 0xFF ; 255 e258: 79 01 movw r14, r18 e25a: a5 01 movw r20, r10 e25c: 94 01 movw r18, r8 e25e: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> e262: f7 01 movw r30, r14 e264: e0 0f add r30, r16 e266: f1 1d adc r31, r1 e268: 60 83 st Z, r22 n /= base; e26a: b9 01 movw r22, r18 e26c: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e26e: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e270: 61 15 cp r22, r1 e272: 71 05 cpc r23, r1 e274: 81 05 cpc r24, r1 e276: 91 05 cpc r25, r1 e278: 81 f7 brne .-32 ; 0xe25a e27a: 0e 0d add r16, r14 e27c: 1f 2d mov r17, r15 e27e: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e280: e0 16 cp r14, r16 e282: f1 06 cpc r15, r17 e284: 59 f0 breq .+22 ; 0xe29c lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e286: f8 01 movw r30, r16 e288: 82 91 ld r24, -Z e28a: 8f 01 movw r16, r30 e28c: 8a 30 cpi r24, 0x0A ; 10 e28e: 20 f4 brcc .+8 ; 0xe298 e290: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e292: 0e 94 55 70 call 0xe0aa ; 0xe0aa e296: f4 cf rjmp .-24 ; 0xe280 { 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)); e298: 89 5c subi r24, 0xC9 ; 201 e29a: fb cf rjmp .-10 ; 0xe292 } e29c: a0 96 adiw r28, 0x20 ; 32 e29e: 0f b6 in r0, 0x3f ; 63 e2a0: f8 94 cli e2a2: de bf out 0x3e, r29 ; 62 e2a4: 0f be out 0x3f, r0 ; 63 e2a6: cd bf out 0x3d, r28 ; 61 e2a8: df 91 pop r29 e2aa: cf 91 pop r28 e2ac: 1f 91 pop r17 e2ae: 0f 91 pop r16 e2b0: ff 90 pop r15 e2b2: ef 90 pop r14 e2b4: bf 90 pop r11 e2b6: af 90 pop r10 e2b8: 9f 90 pop r9 e2ba: 8f 90 pop r8 e2bc: 08 95 ret 0000e2be : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e2be: cf 92 push r12 e2c0: df 92 push r13 e2c2: ef 92 push r14 e2c4: ff 92 push r15 e2c6: 6b 01 movw r12, r22 e2c8: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e2ca: f7 fe sbrs r15, 7 e2cc: 0b c0 rjmp .+22 ; 0xe2e4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e2ce: 8d e2 ldi r24, 0x2D ; 45 e2d0: 0e 94 55 70 call 0xe0aa ; 0xe0aa else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e2d4: f0 94 com r15 e2d6: e0 94 com r14 e2d8: d0 94 com r13 e2da: c0 94 com r12 e2dc: c1 1c adc r12, r1 e2de: d1 1c adc r13, r1 e2e0: e1 1c adc r14, r1 e2e2: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e2e4: 4a e0 ldi r20, 0x0A ; 10 e2e6: c7 01 movw r24, r14 e2e8: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e2ea: ff 90 pop r15 e2ec: ef 90 pop r14 e2ee: df 90 pop r13 e2f0: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e2f2: 0c 94 fa 70 jmp 0xe1f4 ; 0xe1f4 0000e2f6 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e2f6: 0f 93 push r16 e2f8: 1f 93 push r17 e2fa: cf 93 push r28 e2fc: 8c 01 movw r16, r24 e2fe: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e300: cc 23 and r28, r28 e302: 59 f0 breq .+22 ; 0xe31a e304: f8 01 movw r30, r16 e306: 24 91 lpm r18, Z e308: 22 23 and r18, r18 e30a: 39 f0 breq .+14 ; 0xe31a lcd_write(pgm_read_byte(s++)); e30c: 0f 5f subi r16, 0xFF ; 255 e30e: 1f 4f sbci r17, 0xFF ; 255 e310: 84 91 lpm r24, Z e312: 0e 94 55 70 call 0xe0aa ; 0xe0aa --len; e316: c1 50 subi r28, 0x01 ; 1 e318: f3 cf rjmp .-26 ; 0xe300 } lcd_space(len); e31a: 8c 2f mov r24, r28 e31c: 0e 94 9c 6f call 0xdf38 ; 0xdf38 return len; } e320: 8c 2f mov r24, r28 e322: cf 91 pop r28 e324: 1f 91 pop r17 e326: 0f 91 pop r16 e328: 08 95 ret 0000e32a : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e32a: 0f 93 push r16 e32c: 1f 93 push r17 e32e: cf 93 push r28 e330: 8c 01 movw r16, r24 e332: c6 2f mov r28, r22 while (len && *s) { e334: cc 23 and r28, r28 e336: 49 f0 breq .+18 ; 0xe34a e338: f8 01 movw r30, r16 e33a: 81 91 ld r24, Z+ e33c: 8f 01 movw r16, r30 e33e: 88 23 and r24, r24 e340: 21 f0 breq .+8 ; 0xe34a lcd_write(*(s++)); e342: 0e 94 55 70 call 0xe0aa ; 0xe0aa --len; e346: c1 50 subi r28, 0x01 ; 1 e348: f5 cf rjmp .-22 ; 0xe334 } lcd_space(len); e34a: 8c 2f mov r24, r28 e34c: 0e 94 9c 6f call 0xdf38 ; 0xdf38 return len; } e350: 8c 2f mov r24, r28 e352: cf 91 pop r28 e354: 1f 91 pop r17 e356: 0f 91 pop r16 e358: 08 95 ret 0000e35a : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e35a: cf 93 push r28 e35c: df 93 push r29 e35e: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e360: 89 91 ld r24, Y+ e362: 88 23 and r24, r24 e364: 19 f0 breq .+6 ; 0xe36c e366: 0e 94 55 70 call 0xe0aa ; 0xe0aa e36a: fa cf rjmp .-12 ; 0xe360 } e36c: df 91 pop r29 e36e: cf 91 pop r28 e370: 08 95 ret 0000e372 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e372: 0e 94 55 70 call 0xe0aa ; 0xe0aa return 0; } e376: 90 e0 ldi r25, 0x00 ; 0 e378: 80 e0 ldi r24, 0x00 ; 0 e37a: 08 95 ret 0000e37c : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e37c: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 lcd_longpress_trigger = 0; e380: 10 92 d2 05 sts 0x05D2, r1 ; 0x8005d2 } e384: 08 95 ret 0000e386 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e386: cf 93 push r28 bool clicked = LCD_CLICKED; e388: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 e38c: c1 e0 ldi r28, 0x01 ; 1 e38e: 81 11 cpse r24, r1 e390: 04 c0 rjmp .+8 ; 0xe39a e392: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e394: 8c 2f mov r24, r28 e396: cf 91 pop r28 e398: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e39a: 0e 94 be 71 call 0xe37c ; 0xe37c e39e: fa cf rjmp .-12 ; 0xe394 0000e3a0 : 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 e3a0: e0 e0 ldi r30, 0x00 ; 0 e3a2: f1 e0 ldi r31, 0x01 ; 1 e3a4: 85 91 lpm r24, Z+ e3a6: 95 91 lpm r25, Z+ e3a8: a5 91 lpm r26, Z+ e3aa: b4 91 lpm r27, Z e3ac: 85 3a cpi r24, 0xA5 ; 165 e3ae: 9a 45 sbci r25, 0x5A ; 90 e3b0: a4 4b sbci r26, 0xB4 ; 180 e3b2: bb 44 sbci r27, 0x4B ; 75 e3b4: 29 f4 brne .+10 ; 0xe3c0 return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e3b6: ea e0 ldi r30, 0x0A ; 10 e3b8: f1 e0 ldi r31, 0x01 ; 1 e3ba: 85 91 lpm r24, Z+ e3bc: 94 91 lpm r25, Z e3be: 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 e3c0: 8f e3 ldi r24, 0x3F ; 63 e3c2: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e3c4: 08 95 ret 0000e3c6 : 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); e3c6: 8e ef ldi r24, 0xFE ; 254 e3c8: 9f e0 ldi r25, 0x0F ; 15 e3ca: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e3ce: 8e 3f cpi r24, 0xFE ; 254 e3d0: 39 f0 breq .+14 ; 0xe3e0 e3d2: 91 e0 ldi r25, 0x01 ; 1 e3d4: 20 91 58 03 lds r18, 0x0358 ; 0x800358 e3d8: 28 13 cpse r18, r24 e3da: 90 e0 ldi r25, 0x00 ; 0 e3dc: 89 2f mov r24, r25 e3de: 08 95 ret e3e0: 80 e0 ldi r24, 0x00 ; 0 } e3e2: 08 95 ret 0000e3e4 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e3e4: 10 92 58 03 sts 0x0358, r1 ; 0x800358 eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e3e8: 6e ef ldi r22, 0xFE ; 254 e3ea: 8e ef ldi r24, 0xFE ; 254 e3ec: 9f e0 ldi r25, 0x0F ; 15 e3ee: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0000e3f2 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e3f2: 85 37 cpi r24, 0x75 ; 117 e3f4: 28 e6 ldi r18, 0x68 ; 104 e3f6: 92 07 cpc r25, r18 e3f8: 09 f4 brne .+2 ; 0xe3fc e3fa: 59 c0 rjmp .+178 ; 0xe4ae e3fc: f8 f4 brcc .+62 ; 0xe43c e3fe: 8e 36 cpi r24, 0x6E ; 110 e400: 25 e6 ldi r18, 0x65 ; 101 e402: 92 07 cpc r25, r18 e404: 09 f4 brne .+2 ; 0xe408 e406: 59 c0 rjmp .+178 ; 0xe4ba e408: 50 f4 brcc .+20 ; 0xe41e e40a: 83 37 cpi r24, 0x73 ; 115 e40c: 23 e6 ldi r18, 0x63 ; 99 e40e: 92 07 cpc r25, r18 e410: b1 f1 breq .+108 ; 0xe47e e412: 85 36 cpi r24, 0x65 ; 101 e414: 94 46 sbci r25, 0x64 ; 100 e416: b1 f1 breq .+108 ; 0xe484 //#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("??"); e418: 8a e7 ldi r24, 0x7A ; 122 e41a: 96 e6 ldi r25, 0x66 ; 102 e41c: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e41e: 82 37 cpi r24, 0x72 ; 114 e420: 26 e6 ldi r18, 0x66 ; 102 e422: 92 07 cpc r25, r18 e424: 91 f1 breq .+100 ; 0xe48a e426: 82 37 cpi r24, 0x72 ; 114 e428: 28 e6 ldi r18, 0x68 ; 104 e42a: 92 07 cpc r25, r18 e42c: 09 f4 brne .+2 ; 0xe430 e42e: 42 c0 rjmp .+132 ; 0xe4b4 e430: 83 37 cpi r24, 0x73 ; 115 e432: 95 46 sbci r25, 0x65 ; 101 e434: 89 f7 brne .-30 ; 0xe418 { 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"); e436: 81 ed ldi r24, 0xD1 ; 209 e438: 96 e6 ldi r25, 0x66 ; 102 e43a: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e43c: 8c 36 cpi r24, 0x6C ; 108 e43e: 20 e7 ldi r18, 0x70 ; 112 e440: 92 07 cpc r25, r18 e442: 31 f1 breq .+76 ; 0xe490 e444: 70 f4 brcc .+28 ; 0xe462 e446: 8c 36 cpi r24, 0x6C ; 108 e448: 2e e6 ldi r18, 0x6E ; 110 e44a: 92 07 cpc r25, r18 e44c: 21 f1 breq .+72 ; 0xe496 e44e: 8f 36 cpi r24, 0x6F ; 111 e450: 2e e6 ldi r18, 0x6E ; 110 e452: 92 07 cpc r25, r18 e454: 31 f1 breq .+76 ; 0xe4a2 e456: 84 37 cpi r24, 0x74 ; 116 e458: 99 46 sbci r25, 0x69 ; 105 e45a: f1 f6 brne .-68 ; 0xe418 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"); e45c: 8f eb ldi r24, 0xBF ; 191 e45e: 96 e6 ldi r25, 0x66 ; 102 e460: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e462: 8b 36 cpi r24, 0x6B ; 107 e464: 23 e7 ldi r18, 0x73 ; 115 e466: 92 07 cpc r25, r18 e468: f9 f0 breq .+62 ; 0xe4a8 e46a: 86 37 cpi r24, 0x76 ; 118 e46c: 23 e7 ldi r18, 0x73 ; 115 e46e: 92 07 cpc r25, r18 e470: a9 f0 breq .+42 ; 0xe49c e472: 8f 36 cpi r24, 0x6F ; 111 e474: 92 47 sbci r25, 0x72 ; 114 e476: 81 f6 brne .-96 ; 0xe418 #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 e478: 8d e7 ldi r24, 0x7D ; 125 e47a: 96 e6 ldi r25, 0x66 ; 102 e47c: 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"); e47e: 81 ee ldi r24, 0xE1 ; 225 e480: 96 e6 ldi r25, 0x66 ; 102 e482: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e484: 89 ed ldi r24, 0xD9 ; 217 e486: 96 e6 ldi r25, 0x66 ; 102 e488: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e48a: 88 ec ldi r24, 0xC8 ; 200 e48c: 96 e6 ldi r25, 0x66 ; 102 e48e: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e490: 88 eb ldi r24, 0xB8 ; 184 e492: 96 e6 ldi r25, 0x66 ; 102 e494: 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 e496: 8d ea ldi r24, 0xAD ; 173 e498: 96 e6 ldi r25, 0x66 ; 102 e49a: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e49c: 85 ea ldi r24, 0xA5 ; 165 e49e: 96 e6 ldi r25, 0x66 ; 102 e4a0: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e4a2: 8f e9 ldi r24, 0x9F ; 159 e4a4: 96 e6 ldi r25, 0x66 ; 102 e4a6: 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 e4a8: 84 e9 ldi r24, 0x94 ; 148 e4aa: 96 e6 ldi r25, 0x66 ; 102 e4ac: 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 e4ae: 8d e8 ldi r24, 0x8D ; 141 e4b0: 96 e6 ldi r25, 0x66 ; 102 e4b2: 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 e4b4: 84 e8 ldi r24, 0x84 ; 132 e4b6: 96 e6 ldi r25, 0x66 ; 102 e4b8: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e4ba: 89 ee ldi r24, 0xE9 ; 233 e4bc: 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("??"); } e4be: 08 95 ret 0000e4c0 : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e4c0: cf 92 push r12 e4c2: df 92 push r13 e4c4: ef 92 push r14 e4c6: ff 92 push r15 e4c8: 1f 93 push r17 e4ca: cf 93 push r28 e4cc: df 93 push r29 e4ce: cd b7 in r28, 0x3d ; 61 e4d0: de b7 in r29, 0x3e ; 62 e4d2: 60 97 sbiw r28, 0x10 ; 16 e4d4: 0f b6 in r0, 0x3f ; 63 e4d6: f8 94 cli e4d8: de bf out 0x3e, r29 ; 62 e4da: 0f be out 0x3f, r0 ; 63 e4dc: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e4de: 88 23 and r24, r24 e4e0: c1 f1 breq .+112 ; 0xe552 e4e2: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e4e4: 81 30 cpi r24, 0x01 ; 1 e4e6: 81 f4 brne .+32 ; 0xe508 e4e8: 0e 94 d0 71 call 0xe3a0 ; 0xe3a0 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e4ec: 60 96 adiw r28, 0x10 ; 16 e4ee: 0f b6 in r0, 0x3f ; 63 e4f0: f8 94 cli e4f2: de bf out 0x3e, r29 ; 62 e4f4: 0f be out 0x3f, r0 ; 63 e4f6: cd bf out 0x3d, r28 ; 61 e4f8: df 91 pop r29 e4fa: cf 91 pop r28 e4fc: 1f 91 pop r17 e4fe: ff 90 pop r15 e500: ef 90 pop r14 e502: df 90 pop r13 e504: cf 90 pop r12 e506: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e508: 8c e5 ldi r24, 0x5C ; 92 e50a: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e50c: 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--; e50e: 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; e510: c1 2c mov r12, r1 e512: d1 2c mov r13, r1 e514: 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 e516: 20 e1 ldi r18, 0x10 ; 16 e518: 30 e0 ldi r19, 0x00 ; 0 e51a: ae 01 movw r20, r28 e51c: 4f 5f subi r20, 0xFF ; 255 e51e: 5f 4f sbci r21, 0xFF ; 255 e520: c7 01 movw r24, r14 e522: b6 01 movw r22, r12 e524: 0e 94 76 e3 call 0x1c6ec ; 0x1c6ec if (header.magic != LANG_MAGIC) break; //break if not valid e528: 89 81 ldd r24, Y+1 ; 0x01 e52a: 9a 81 ldd r25, Y+2 ; 0x02 e52c: ab 81 ldd r26, Y+3 ; 0x03 e52e: bc 81 ldd r27, Y+4 ; 0x04 e530: 85 3a cpi r24, 0xA5 ; 165 e532: 9a 45 sbci r25, 0x5A ; 90 e534: a4 4b sbci r26, 0xB4 ; 180 e536: bb 44 sbci r27, 0x4B ; 75 e538: 79 f4 brne .+30 ; 0xe558 if (--lang == 0) return header.code; e53a: 11 50 subi r17, 0x01 ; 1 e53c: 19 f4 brne .+6 ; 0xe544 e53e: 8b 85 ldd r24, Y+11 ; 0x0b e540: 9c 85 ldd r25, Y+12 ; 0x0c e542: d4 cf rjmp .-88 ; 0xe4ec addr += header.size; //calc address of next table e544: 8d 81 ldd r24, Y+5 ; 0x05 e546: 9e 81 ldd r25, Y+6 ; 0x06 e548: c8 0e add r12, r24 e54a: d9 1e adc r13, r25 e54c: e1 1c adc r14, r1 e54e: f1 1c adc r15, r1 e550: e2 cf rjmp .-60 ; 0xe516 return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e552: 8e e6 ldi r24, 0x6E ; 110 e554: 95 e6 ldi r25, 0x65 ; 101 e556: ca cf rjmp .-108 ; 0xe4ec 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; e558: 8f e3 ldi r24, 0x3F ; 63 e55a: 9f e3 ldi r25, 0x3F ; 63 e55c: c7 cf rjmp .-114 ; 0xe4ec 0000e55e : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e55e: cf 92 push r12 e560: df 92 push r13 e562: ef 92 push r14 e564: ff 92 push r15 e566: 1f 93 push r17 e568: cf 93 push r28 e56a: df 93 push r29 e56c: cd b7 in r28, 0x3d ; 61 e56e: de b7 in r29, 0x3e ; 62 e570: 60 97 sbiw r28, 0x10 ; 16 e572: 0f b6 in r0, 0x3f ; 63 e574: f8 94 cli e576: de bf out 0x3e, r29 ; 62 e578: 0f be out 0x3f, r0 ; 63 e57a: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e57c: ea e8 ldi r30, 0x8A ; 138 e57e: fa e7 ldi r31, 0x7A ; 122 e580: 85 91 lpm r24, Z+ e582: 95 91 lpm r25, Z+ e584: a5 91 lpm r26, Z+ e586: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e588: 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) e58a: 8f 3f cpi r24, 0xFF ; 255 e58c: 9f 4f sbci r25, 0xFF ; 255 e58e: af 4f sbci r26, 0xFF ; 255 e590: bf 4f sbci r27, 0xFF ; 255 e592: 09 f1 breq .+66 ; 0xe5d6 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e594: 8c e5 ldi r24, 0x5C ; 92 e596: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e598: 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; e59a: c1 2c mov r12, r1 e59c: d1 2c mov r13, r1 e59e: 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) e5a0: 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 e5a2: 20 e1 ldi r18, 0x10 ; 16 e5a4: 30 e0 ldi r19, 0x00 ; 0 e5a6: ae 01 movw r20, r28 e5a8: 4f 5f subi r20, 0xFF ; 255 e5aa: 5f 4f sbci r21, 0xFF ; 255 e5ac: c7 01 movw r24, r14 e5ae: b6 01 movw r22, r12 e5b0: 0e 94 76 e3 call 0x1c6ec ; 0x1c6ec if (header.magic != LANG_MAGIC) break; //break if magic not valid e5b4: 89 81 ldd r24, Y+1 ; 0x01 e5b6: 9a 81 ldd r25, Y+2 ; 0x02 e5b8: ab 81 ldd r26, Y+3 ; 0x03 e5ba: bc 81 ldd r27, Y+4 ; 0x04 e5bc: 85 3a cpi r24, 0xA5 ; 165 e5be: 9a 45 sbci r25, 0x5A ; 90 e5c0: a4 4b sbci r26, 0xB4 ; 180 e5c2: bb 44 sbci r27, 0x4B ; 75 e5c4: 41 f4 brne .+16 ; 0xe5d6 addr += header.size; //calc address of next table e5c6: 8d 81 ldd r24, Y+5 ; 0x05 e5c8: 9e 81 ldd r25, Y+6 ; 0x06 e5ca: c8 0e add r12, r24 e5cc: d9 1e adc r13, r25 e5ce: e1 1c adc r14, r1 e5d0: f1 1c adc r15, r1 count++; //inc counter e5d2: 1f 5f subi r17, 0xFF ; 255 e5d4: e6 cf rjmp .-52 ; 0xe5a2 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e5d6: 81 2f mov r24, r17 e5d8: 60 96 adiw r28, 0x10 ; 16 e5da: 0f b6 in r0, 0x3f ; 63 e5dc: f8 94 cli e5de: de bf out 0x3e, r29 ; 62 e5e0: 0f be out 0x3f, r0 ; 63 e5e2: cd bf out 0x3d, r28 ; 61 e5e4: df 91 pop r29 e5e6: cf 91 pop r28 e5e8: 1f 91 pop r17 e5ea: ff 90 pop r15 e5ec: ef 90 pop r14 e5ee: df 90 pop r13 e5f0: cf 90 pop r12 e5f2: 08 95 ret 0000e5f4 : 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) { e5f4: 0f 93 push r16 e5f6: 1f 93 push r17 e5f8: cf 93 push r28 e5fa: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e5fc: 81 11 cpse r24, r1 e5fe: 06 c0 rjmp .+12 ; 0xe60c { lang_table = 0; e600: 10 92 57 03 sts 0x0357, r1 ; 0x800357 e604: 10 92 56 03 sts 0x0356, r1 ; 0x800356 lang_selected = lang; e608: 10 92 58 03 sts 0x0358, r1 ; 0x800358 } #ifdef XFLASH if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; e60c: 8c 2f mov r24, r28 e60e: 0e 94 60 72 call 0xe4c0 ; 0xe4c0 e612: 8c 01 movw r16, r24 e614: 0e 94 d0 71 call 0xe3a0 ; 0xe3a0 e618: 08 17 cp r16, r24 e61a: 19 07 cpc r17, r25 e61c: 19 f0 breq .+6 ; 0xe624 if (lang == LANG_ID_SEC) //current secondary language e61e: c1 30 cpi r28, 0x01 ; 1 e620: 09 f0 breq .+2 ; 0xe624 e622: 3e c0 rjmp .+124 ; 0xe6a0 { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e624: e0 e0 ldi r30, 0x00 ; 0 e626: f1 e0 ldi r31, 0x01 ; 1 e628: 85 91 lpm r24, Z+ e62a: 95 91 lpm r25, Z+ e62c: a5 91 lpm r26, Z+ e62e: b4 91 lpm r27, Z e630: 85 3a cpi r24, 0xA5 ; 165 e632: 9a 45 sbci r25, 0x5A ; 90 e634: a4 4b sbci r26, 0xB4 ; 180 e636: bb 44 sbci r27, 0x4B ; 75 e638: 09 f0 breq .+2 ; 0xe63c e63a: 31 c0 rjmp .+98 ; 0xe69e } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e63c: e4 e0 ldi r30, 0x04 ; 4 e63e: f1 e0 ldi r31, 0x01 ; 1 e640: 65 91 lpm r22, Z+ e642: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e644: e8 e0 ldi r30, 0x08 ; 8 e646: f1 e0 ldi r31, 0x01 ; 1 e648: 45 91 lpm r20, Z+ e64a: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e64c: 30 e0 ldi r19, 0x00 ; 0 e64e: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e650: 90 e0 ldi r25, 0x00 ; 0 e652: 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++) e654: 62 17 cp r22, r18 e656: 73 07 cpc r23, r19 e658: 89 f5 brne .+98 ; 0xe6bc sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e65a: 84 1b sub r24, r20 e65c: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e65e: 98 27 eor r25, r24 e660: 89 27 eor r24, r25 e662: 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)) e664: 48 17 cp r20, r24 e666: 59 07 cpc r21, r25 e668: d1 f4 brne .+52 ; 0xe69e if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e66a: ec e0 ldi r30, 0x0C ; 12 e66c: f1 e0 ldi r31, 0x01 ; 1 e66e: 45 91 lpm r20, Z+ e670: 55 91 lpm r21, Z+ e672: 65 91 lpm r22, Z+ e674: 74 91 lpm r23, Z e676: ea e8 ldi r30, 0x8A ; 138 e678: fa e7 ldi r31, 0x7A ; 122 e67a: 85 91 lpm r24, Z+ e67c: 95 91 lpm r25, Z+ e67e: a5 91 lpm r26, Z+ e680: b4 91 lpm r27, Z e682: 48 17 cp r20, r24 e684: 59 07 cpc r21, r25 e686: 6a 07 cpc r22, r26 e688: 7b 07 cpc r23, r27 e68a: 49 f4 brne .+18 ; 0xe69e { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e68c: 80 e0 ldi r24, 0x00 ; 0 e68e: 91 e0 ldi r25, 0x01 ; 1 e690: 90 93 57 03 sts 0x0357, r25 ; 0x800357 e694: 80 93 56 03 sts 0x0356, r24 ; 0x800356 lang_selected = lang; // set language id e698: 81 e0 ldi r24, 0x01 ; 1 e69a: 80 93 58 03 sts 0x0358, r24 ; 0x800358 if (lang == LANG_ID_SEC) //current secondary language { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid { if (lang_check(_SEC_LANG_TABLE)) if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e69e: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e6a0: 80 91 58 03 lds r24, 0x0358 ; 0x800358 e6a4: 8c 13 cpse r24, r28 e6a6: 1c c0 rjmp .+56 ; 0xe6e0 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e6a8: 6c 2f mov r22, r28 e6aa: 8e ef ldi r24, 0xFE ; 254 e6ac: 9f e0 ldi r25, 0x0F ; 15 e6ae: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 return 1; e6b2: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e6b4: cf 91 pop r28 e6b6: 1f 91 pop r17 e6b8: 0f 91 pop r16 e6ba: 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); e6bc: f9 01 movw r30, r18 e6be: e0 50 subi r30, 0x00 ; 0 e6c0: ff 4f sbci r31, 0xFF ; 255 e6c2: e4 91 lpm r30, Z e6c4: f0 e0 ldi r31, 0x00 ; 0 e6c6: a8 e0 ldi r26, 0x08 ; 8 e6c8: 20 fd sbrc r18, 0 e6ca: a0 e0 ldi r26, 0x00 ; 0 e6cc: 02 c0 rjmp .+4 ; 0xe6d2 e6ce: ee 0f add r30, r30 e6d0: ff 1f adc r31, r31 e6d2: aa 95 dec r26 e6d4: e2 f7 brpl .-8 ; 0xe6ce e6d6: 8e 0f add r24, r30 e6d8: 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++) e6da: 2f 5f subi r18, 0xFF ; 255 e6dc: 3f 4f sbci r19, 0xFF ; 255 e6de: ba cf rjmp .-140 ; 0xe654 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e6e0: 80 e0 ldi r24, 0x00 ; 0 e6e2: e8 cf rjmp .-48 ; 0xe6b4 0000e6e4 : //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. e6e4: 20 91 58 03 lds r18, 0x0358 ; 0x800358 e6e8: 21 11 cpse r18, r1 e6ea: 04 c0 rjmp .+8 ; 0xe6f4 e6ec: fc 01 movw r30, r24 e6ee: 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 } e6f0: cf 01 movw r24, r30 e6f2: 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. e6f4: 40 91 56 03 lds r20, 0x0356 ; 0x800356 e6f8: 50 91 57 03 lds r21, 0x0357 ; 0x800357 e6fc: 41 15 cp r20, r1 e6fe: 51 05 cpc r21, r1 e700: a9 f3 breq .-22 ; 0xe6ec uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e702: fc 01 movw r30, r24 e704: 25 91 lpm r18, Z+ e706: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e708: 2f 3f cpi r18, 0xFF ; 255 e70a: 32 07 cpc r19, r18 e70c: 79 f3 breq .-34 ; 0xe6ec ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e70e: f9 01 movw r30, r18 e710: 38 96 adiw r30, 0x08 ; 8 e712: ee 0f add r30, r30 e714: ff 1f adc r31, r31 e716: e4 0f add r30, r20 e718: f5 1f adc r31, r21 e71a: 25 91 lpm r18, Z+ e71c: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e71e: fa 01 movw r30, r20 e720: e2 0f add r30, r18 e722: f3 1f adc r31, r19 e724: 24 91 lpm r18, Z e726: 22 23 and r18, r18 e728: 09 f3 breq .-62 ; 0xe6ec e72a: e2 cf rjmp .-60 ; 0xe6f0 0000e72c : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e72c: cf 93 push r28 e72e: df 93 push r29 e730: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e732: 20 e0 ldi r18, 0x00 ; 0 e734: 30 e0 ldi r19, 0x00 ; 0 e736: 4c e8 ldi r20, 0x8C ; 140 e738: 52 e4 ldi r21, 0x42 ; 66 e73a: 60 91 4c 07 lds r22, 0x074C ; 0x80074c e73e: 70 91 4d 07 lds r23, 0x074D ; 0x80074d e742: 80 91 4e 07 lds r24, 0x074E ; 0x80074e e746: 90 91 4f 07 lds r25, 0x074F ; 0x80074f e74a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> e74e: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c e752: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d e756: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e e75a: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e75e: 60 e0 ldi r22, 0x00 ; 0 e760: 70 e0 ldi r23, 0x00 ; 0 e762: 80 ea ldi r24, 0xA0 ; 160 e764: 91 e4 ldi r25, 0x41 ; 65 e766: 0f 94 48 ba call 0x37490 ; 0x37490 load_filament_final_feed(); e76a: 0e 94 59 65 call 0xcab2 ; 0xcab2 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e76e: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e772: 80 eb ldi r24, 0xB0 ; 176 e774: 9c e5 ldi r25, 0x5C ; 92 e776: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 e77a: ac 01 movw r20, r24 e77c: 60 e0 ldi r22, 0x00 ; 0 e77e: 80 e0 ldi r24, 0x00 ; 0 e780: 0e 94 ba 6f call 0xdf74 ; 0xdf74 if (filament_name[0]) { e784: 88 81 ld r24, Y e786: 88 23 and r24, r24 e788: 39 f0 breq .+14 ; 0xe798 lcd_set_cursor(0, 1); e78a: 61 e0 ldi r22, 0x01 ; 1 e78c: 80 e0 ldi r24, 0x00 ; 0 e78e: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print(filament_name); e792: ce 01 movw r24, r28 e794: 0e 94 ad 71 call 0xe35a ; 0xe35a } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e798: 89 e9 ldi r24, 0x99 ; 153 e79a: 99 e3 ldi r25, 0x39 ; 57 e79c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 e7a0: ac 01 movw r20, r24 e7a2: 62 e0 ldi r22, 0x02 ; 2 e7a4: 80 e0 ldi r24, 0x00 ; 0 e7a6: 0e 94 ba 6f call 0xdf74 ; 0xdf74 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 e7aa: 83 e4 ldi r24, 0x43 ; 67 e7ac: 9b e2 ldi r25, 0x2B ; 43 e7ae: 0f 94 a0 36 call 0x26d40 ; 0x26d40 lcd_loading_filament(filament_name); st_synchronize(); } e7b2: df 91 pop r29 e7b4: 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(); e7b6: 0d 94 e1 58 jmp 0x2b1c2 ; 0x2b1c2 0000e7ba : * 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; e7ba: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 e7be: 8f 3f cpi r24, 0xFF ; 255 e7c0: 11 f1 breq .+68 ; 0xe806 lcd_update_enable(false); e7c2: 80 e0 ldi r24, 0x00 ; 0 e7c4: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_clear(); e7c8: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e7cc: 8c e0 ldi r24, 0x0C ; 12 e7ce: 99 e5 ldi r25, 0x59 ; 89 e7d0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 e7d4: ac 01 movw r20, r24 e7d6: 61 e0 ldi r22, 0x01 ; 1 e7d8: 80 e0 ldi r24, 0x00 ; 0 e7da: 0e 94 ba 6f call 0xdf74 ; 0xdf74 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e7de: 80 e2 ldi r24, 0x20 ; 32 e7e0: 0e 94 55 70 call 0xe0aa ; 0xe0aa lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e7e4: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 e7e8: 68 2f mov r22, r24 e7ea: 70 e0 ldi r23, 0x00 ; 0 e7ec: 6f 5f subi r22, 0xFF ; 255 e7ee: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e7f0: 07 2e mov r0, r23 e7f2: 00 0c add r0, r0 e7f4: 88 0b sbc r24, r24 e7f6: 99 0b sbc r25, r25 e7f8: 0e 94 5f 71 call 0xe2be ; 0xe2be // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e7fc: 0f 94 22 a0 call 0x34044 ; 0x34044 lcd_update_enable(true); e800: 81 e0 ldi r24, 0x01 ; 1 e802: 0c 94 eb 6f jmp 0xdfd6 ; 0xdfd6 } e806: 08 95 ret 0000e808 : } #ifdef TMC2130 bool calibrate_z_auto() { e808: 4f 92 push r4 e80a: 5f 92 push r5 e80c: 6f 92 push r6 e80e: 7f 92 push r7 e810: 8f 92 push r8 e812: 9f 92 push r9 e814: af 92 push r10 e816: bf 92 push r11 e818: ef 92 push r14 e81a: ff 92 push r15 e81c: 0f 93 push r16 e81e: 1f 93 push r17 e820: cf 93 push r28 e822: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e824: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e828: 83 ed ldi r24, 0xD3 ; 211 e82a: 99 e4 ldi r25, 0x49 ; 73 e82c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 e830: ac 01 movw r20, r24 e832: 61 e0 ldi r22, 0x01 ; 1 e834: 80 e0 ldi r24, 0x00 ; 0 e836: 0e 94 ba 6f call 0xdf74 ; 0xdf74 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e83a: d0 91 8f 02 lds r29, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; e83e: 81 e0 ldi r24, 0x01 ; 1 e840: 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); e844: e8 e1 ldi r30, 0x18 ; 24 e846: fd e7 ldi r31, 0x7D ; 125 e848: 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); e84a: 84 e0 ldi r24, 0x04 ; 4 e84c: 0f 94 63 3b call 0x276c6 ; 0x276c6 current_position[Z_AXIS] = 0; e850: 80 e4 ldi r24, 0x40 ; 64 e852: e8 2e mov r14, r24 e854: 87 e0 ldi r24, 0x07 ; 7 e856: f8 2e mov r15, r24 e858: f7 01 movw r30, r14 e85a: 10 86 std Z+8, r1 ; 0x08 e85c: 11 86 std Z+9, r1 ; 0x09 e85e: 12 86 std Z+10, r1 ; 0x0a e860: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e862: 0f 94 08 b9 call 0x37210 ; 0x37210 set_destination_to_current(); e866: 0e 94 00 69 call 0xd200 ; 0xd200 #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); e86a: e2 e1 ldi r30, 0x12 ; 18 e86c: fd e7 ldi r31, 0x7D ; 125 e86e: 85 90 lpm r8, Z+ e870: 95 90 lpm r9, Z+ e872: a5 90 lpm r10, Z+ e874: 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); e876: 01 e5 ldi r16, 0x51 ; 81 e878: 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); e87a: 8c 2f mov r24, r28 e87c: 99 27 eor r25, r25 e87e: 81 95 neg r24 e880: 0c f4 brge .+2 ; 0xe884 e882: 90 95 com r25 e884: 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); e886: 07 2e mov r0, r23 e888: 00 0c add r0, r0 e88a: 88 0b sbc r24, r24 e88c: 99 0b sbc r25, r25 e88e: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> e892: 2b 01 movw r4, r22 e894: 3c 01 movw r6, r24 e896: 2d ec ldi r18, 0xCD ; 205 e898: 3c ec ldi r19, 0xCC ; 204 e89a: 4c e8 ldi r20, 0x8C ; 140 e89c: 5f e3 ldi r21, 0x3F ; 63 e89e: c5 01 movw r24, r10 e8a0: b4 01 movw r22, r8 e8a2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> e8a6: 9b 01 movw r18, r22 e8a8: ac 01 movw r20, r24 e8aa: c3 01 movw r24, r6 e8ac: b2 01 movw r22, r4 e8ae: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> e8b2: f8 01 movw r30, r16 e8b4: 20 85 ldd r18, Z+8 ; 0x08 e8b6: 31 85 ldd r19, Z+9 ; 0x09 e8b8: 42 85 ldd r20, Z+10 ; 0x0a e8ba: 53 85 ldd r21, Z+11 ; 0x0b e8bc: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> e8c0: f8 01 movw r30, r16 e8c2: 60 87 std Z+8, r22 ; 0x08 e8c4: 71 87 std Z+9, r23 ; 0x09 e8c6: 82 87 std Z+10, r24 ; 0x0a e8c8: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e8ca: 80 e0 ldi r24, 0x00 ; 0 e8cc: 90 e0 ldi r25, 0x00 ; 0 e8ce: a8 e4 ldi r26, 0x48 ; 72 e8d0: b4 e4 ldi r27, 0x44 ; 68 e8d2: 80 93 90 02 sts 0x0290, r24 ; 0x800290 e8d6: 90 93 91 02 sts 0x0291, r25 ; 0x800291 e8da: a0 93 92 02 sts 0x0292, r26 ; 0x800292 e8de: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); e8e2: 65 e5 ldi r22, 0x55 ; 85 e8e4: 75 e5 ldi r23, 0x55 ; 85 e8e6: 85 e5 ldi r24, 0x55 ; 85 e8e8: 91 e4 ldi r25, 0x41 ; 65 e8ea: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); e8ee: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e8f2: 0f 94 34 3b call 0x27668 ; 0x27668 e8f6: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[Z_AXIS] = 0; e8fa: f7 01 movw r30, r14 e8fc: 10 86 std Z+8, r1 ; 0x08 e8fe: 11 86 std Z+9, r1 ; 0x09 e900: 12 86 std Z+10, r1 ; 0x0a e902: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e904: 0f 94 08 b9 call 0x37210 ; 0x37210 set_destination_to_current(); e908: 0e 94 00 69 call 0xd200 ; 0xd200 destination[Z_AXIS] += 10 * axis_up_dir; //10mm up e90c: f6 ef ldi r31, 0xF6 ; 246 e90e: cf 02 muls r28, r31 e910: b0 01 movw r22, r0 e912: 11 24 eor r1, r1 e914: 07 2e mov r0, r23 e916: 00 0c add r0, r0 e918: 88 0b sbc r24, r24 e91a: 99 0b sbc r25, r25 e91c: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> e920: 9b 01 movw r18, r22 e922: ac 01 movw r20, r24 e924: f8 01 movw r30, r16 e926: 60 85 ldd r22, Z+8 ; 0x08 e928: 71 85 ldd r23, Z+9 ; 0x09 e92a: 82 85 ldd r24, Z+10 ; 0x0a e92c: 93 85 ldd r25, Z+11 ; 0x0b e92e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> e932: f8 01 movw r30, r16 e934: 60 87 std Z+8, r22 ; 0x08 e936: 71 87 std Z+9, r23 ; 0x09 e938: 82 87 std Z+10, r24 ; 0x0a e93a: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; e93c: 80 e0 ldi r24, 0x00 ; 0 e93e: 90 e0 ldi r25, 0x00 ; 0 e940: a8 ec ldi r26, 0xC8 ; 200 e942: b3 e4 ldi r27, 0x43 ; 67 e944: 80 93 90 02 sts 0x0290, r24 ; 0x800290 e948: 90 93 91 02 sts 0x0291, r25 ; 0x800291 e94c: a0 93 92 02 sts 0x0292, r26 ; 0x800292 e950: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); e954: 65 e5 ldi r22, 0x55 ; 85 e956: 75 e5 ldi r23, 0x55 ; 85 e958: 85 ed ldi r24, 0xD5 ; 213 e95a: 90 e4 ldi r25, 0x40 ; 64 e95c: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); e960: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 e964: 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; e968: 80 e0 ldi r24, 0x00 ; 0 e96a: 90 e0 ldi r25, 0x00 ; 0 e96c: ab e5 ldi r26, 0x5B ; 91 e96e: b3 e4 ldi r27, 0x43 ; 67 e970: f7 01 movw r30, r14 e972: 80 87 std Z+8, r24 ; 0x08 e974: 91 87 std Z+9, r25 ; 0x09 e976: a2 87 std Z+10, r26 ; 0x0a e978: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); e97a: 0f 94 08 b9 call 0x37210 ; 0x37210 return true; } e97e: 81 e0 ldi r24, 0x01 ; 1 e980: df 91 pop r29 e982: cf 91 pop r28 e984: 1f 91 pop r17 e986: 0f 91 pop r16 e988: ff 90 pop r15 e98a: ef 90 pop r14 e98c: bf 90 pop r11 e98e: af 90 pop r10 e990: 9f 90 pop r9 e992: 8f 90 pop r8 e994: 7f 90 pop r7 e996: 6f 90 pop r6 e998: 5f 90 pop r5 e99a: 4f 90 pop r4 e99c: 08 95 ret 0000e99e : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { e99e: cf 93 push r28 e9a0: df 93 push r29 e9a2: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; e9a4: 60 ff sbrs r22, 0 e9a6: 03 c0 rjmp .+6 ; 0xe9ae e9a8: 28 e5 ldi r18, 0x58 ; 88 e9aa: 28 83 st Y, r18 e9ac: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; e9ae: 61 ff sbrs r22, 1 e9b0: 03 c0 rjmp .+6 ; 0xe9b8 e9b2: 29 e5 ldi r18, 0x59 ; 89 e9b4: 28 83 st Y, r18 e9b6: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; e9b8: 80 e2 ldi r24, 0x20 ; 32 e9ba: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); e9bc: 80 e0 ldi r24, 0x00 ; 0 e9be: 96 e3 ldi r25, 0x36 ; 54 e9c0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 e9c4: bc 01 movw r22, r24 e9c6: ce 01 movw r24, r28 } e9c8: df 91 pop r29 e9ca: 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)); e9cc: 0d 94 fd da jmp 0x3b5fa ; 0x3b5fa 0000e9d0 <__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 { e9d0: 1f 92 push r1 e9d2: 0f 92 push r0 e9d4: 0f b6 in r0, 0x3f ; 63 e9d6: 0f 92 push r0 e9d8: 11 24 eor r1, r1 e9da: 0b b6 in r0, 0x3b ; 59 e9dc: 0f 92 push r0 e9de: 2f 93 push r18 e9e0: 8f 93 push r24 e9e2: 9f 93 push r25 e9e4: ef 93 push r30 e9e6: ff 93 push r31 switch(state){ e9e8: e0 91 51 03 lds r30, 0x0351 ; 0x800351 e9ec: e8 30 cpi r30, 0x08 ; 8 e9ee: e8 f4 brcc .+58 ; 0xea2a <__vector_23+0x5a> e9f0: f0 e0 ldi r31, 0x00 ; 0 e9f2: 88 27 eor r24, r24 e9f4: e1 50 subi r30, 0x01 ; 1 e9f6: fb 48 sbci r31, 0x8B ; 139 e9f8: 8f 4f sbci r24, 0xFF ; 255 e9fa: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> e9fe: 07 75 andi r16, 0x57 ; 87 ea00: 21 75 andi r18, 0x51 ; 81 ea02: 2c 75 andi r18, 0x5C ; 92 ea04: 3a 75 andi r19, 0x5A ; 90 ea06: 50 75 andi r21, 0x50 ; 80 ea08: 59 75 andi r21, 0x59 ; 89 ea0a: 7c 75 andi r23, 0x5C ; 92 ea0c: 8e 75 andi r24, 0x5E ; 94 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin ea0e: 80 91 6a 06 lds r24, 0x066A ; 0x80066a ea12: 81 11 cpse r24, r1 ea14: 0a c0 rjmp .+20 ; 0xea2a <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! ea16: 80 91 17 06 lds r24, 0x0617 ; 0x800617 ea1a: 88 0f add r24, r24 ea1c: 80 93 50 03 sts 0x0350, r24 ; 0x800350 if( pwm != 0 ){ ea20: 88 23 and r24, r24 ea22: 19 f0 breq .+6 ; 0xea2a <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period ea24: 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 ea26: 80 93 51 03 sts 0x0351, r24 ; 0x800351 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } ea2a: ff 91 pop r31 ea2c: ef 91 pop r30 ea2e: 9f 91 pop r25 ea30: 8f 91 pop r24 ea32: 2f 91 pop r18 ea34: 0f 90 pop r0 ea36: 0b be out 0x3b, r0 ; 59 ea38: 0f 90 pop r0 ea3a: 0f be out 0x3f, r0 ; 63 ea3c: 0f 90 pop r0 ea3e: 1f 90 pop r1 ea40: 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) ea42: 80 91 4f 03 lds r24, 0x034F ; 0x80034f ea46: 8f 5f subi r24, 0xFF ; 255 ea48: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f if( slowCounter > pwm ){ ea4c: 90 91 50 03 lds r25, 0x0350 ; 0x800350 ea50: 98 17 cp r25, r24 ea52: 58 f3 brcs .-42 ; 0xea2a <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 ea54: 82 e0 ldi r24, 0x02 ; 2 ea56: e7 cf rjmp .-50 ; 0xea26 <__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 ea58: 83 e0 ldi r24, 0x03 ; 3 ea5a: 80 93 51 03 sts 0x0351, r24 ; 0x800351 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ea5e: 8f e0 ldi r24, 0x0F ; 15 ea60: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e TCNT0 = 255; // force overflow on the next clock cycle ea64: 8f ef ldi r24, 0xFF ; 255 ea66: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ea68: 81 e0 ldi r24, 0x01 ; 1 ea6a: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) ea6c: 84 b5 in r24, 0x24 ; 36 ea6e: 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 ea70: 84 bd out 0x24, r24 ; 36 ea72: db cf rjmp .-74 ; 0xea2a <__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; ea74: 80 91 4e 03 lds r24, 0x034E ; 0x80034e ea78: 82 95 swap r24 ea7a: 80 7f andi r24, 0xF0 ; 240 ea7c: 81 95 neg r24 ea7e: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ ea80: 80 91 4e 03 lds r24, 0x034E ; 0x80034e ea84: 88 23 and r24, r24 ea86: 21 f0 breq .+8 ; 0xea90 <__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; ea88: 81 50 subi r24, 0x01 ; 1 ea8a: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e ea8e: cd cf rjmp .-102 ; 0xea2a <__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; ea90: 84 e0 ldi r24, 0x04 ; 4 ea92: 80 93 51 03 sts 0x0351, r24 ; 0x800351 OCR0B = 255; // full duty ea96: 8f ef ldi r24, 0xFF ; 255 ea98: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle ea9a: 8e ef ldi r24, 0xFE ; 254 ea9c: 86 bd out 0x26, r24 ; 38 ea9e: c5 cf rjmp .-118 ; 0xea2a <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; eaa0: 85 e0 ldi r24, 0x05 ; 5 eaa2: 80 93 51 03 sts 0x0351, r24 ; 0x800351 OCR0B = 255; // full duty eaa6: 8f ef ldi r24, 0xFF ; 255 eaa8: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle eaaa: 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 eaac: 82 e0 ldi r24, 0x02 ; 2 eaae: 85 bd out 0x25, r24 ; 37 eab0: bc cf rjmp .-136 ; 0xea2a <__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; eab2: 2f ef ldi r18, 0xFF ; 255 eab4: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin eab6: 80 91 6a 06 lds r24, 0x066A ; 0x80066a eaba: 81 11 cpse r24, r1 eabc: b6 cf rjmp .-148 ; 0xea2a <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less eabe: 80 91 4f 03 lds r24, 0x034F ; 0x80034f eac2: 8f 5f subi r24, 0xFF ; 255 eac4: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f if( slowCounter < pwm ){ eac8: 90 91 50 03 lds r25, 0x0350 ; 0x800350 eacc: 89 17 cp r24, r25 eace: 08 f4 brcc .+2 ; 0xead2 <__vector_23+0x102> ead0: ac cf rjmp .-168 ; 0xea2a <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain ead2: 80 91 17 06 lds r24, 0x0617 ; 0x800617 ead6: 90 e0 ldi r25, 0x00 ; 0 ead8: 8f 37 cpi r24, 0x7F ; 127 eada: 91 05 cpc r25, r1 eadc: 0c f0 brlt .+2 ; 0xeae0 <__vector_23+0x110> eade: a5 cf rjmp .-182 ; 0xea2a <__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; eae0: 86 e0 ldi r24, 0x06 ; 6 eae2: 80 93 51 03 sts 0x0351, r24 ; 0x800351 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE eae6: 8f e0 ldi r24, 0x0F ; 15 eae8: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e TCNT0 = 255; // force overflow on the next clock cycle eaec: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz eaee: 81 e0 ldi r24, 0x01 ; 1 eaf0: 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 eaf2: 84 b5 in r24, 0x24 ; 36 eaf4: 80 61 ori r24, 0x10 ; 16 eaf6: bc cf rjmp .-136 ; 0xea70 <__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 eaf8: 80 91 4e 03 lds r24, 0x034E ; 0x80034e eafc: 82 95 swap r24 eafe: 80 7f andi r24, 0xF0 ; 240 eb00: 81 95 neg r24 eb02: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ eb04: 80 91 4e 03 lds r24, 0x034E ; 0x80034e eb08: 81 11 cpse r24, r1 eb0a: be cf rjmp .-132 ; 0xea88 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; eb0c: 87 e0 ldi r24, 0x07 ; 7 eb0e: 80 93 51 03 sts 0x0351, r24 ; 0x800351 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes eb12: 80 e8 ldi r24, 0x80 ; 128 eb14: 86 bd out 0x26, r24 ; 38 OCR0B = 255; eb16: 8f ef ldi r24, 0xFF ; 255 eb18: 88 bd out 0x28, r24 ; 40 eb1a: 87 cf rjmp .-242 ; 0xea2a <__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 eb1c: 10 92 51 03 sts 0x0351, r1 ; 0x800351 TCNT0 = 128; eb20: 80 e8 ldi r24, 0x80 ; 128 eb22: 86 bd out 0x26, r24 ; 38 OCR0B = 255; eb24: 8f ef ldi r24, 0xFF ; 255 eb26: 88 bd out 0x28, r24 ; 40 eb28: c1 cf rjmp .-126 ; 0xeaac <__vector_23+0xdc> 0000eb2a : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { eb2a: cf 93 push r28 eb2c: df 93 push r29 eb2e: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); eb30: 87 e6 ldi r24, 0x67 ; 103 eb32: 9f e0 ldi r25, 0x0F ; 15 eb34: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c eb38: 91 e0 ldi r25, 0x01 ; 1 eb3a: 81 11 cpse r24, r1 eb3c: 01 c0 rjmp .+2 ; 0xeb40 eb3e: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { eb40: 81 e0 ldi r24, 0x01 ; 1 eb42: 28 81 ld r18, Y eb44: 21 11 cpse r18, r1 eb46: 01 c0 rjmp .+2 ; 0xeb4a eb48: 80 e0 ldi r24, 0x00 ; 0 eb4a: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; eb4c: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); eb4e: 87 e0 ldi r24, 0x07 ; 7 eb50: 9f e0 ldi r25, 0x0F ; 15 eb52: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c eb56: 91 e0 ldi r25, 0x01 ; 1 eb58: 81 11 cpse r24, r1 eb5a: 01 c0 rjmp .+2 ; 0xeb5e eb5c: 90 e0 ldi r25, 0x00 ; 0 eb5e: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); eb60: 85 ed ldi r24, 0xD5 ; 213 eb62: 9e e0 ldi r25, 0x0E ; 14 eb64: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c eb68: 91 e0 ldi r25, 0x01 ; 1 eb6a: 81 11 cpse r24, r1 eb6c: 01 c0 rjmp .+2 ; 0xeb70 eb6e: 90 e0 ldi r25, 0x00 ; 0 eb70: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); eb72: 87 e4 ldi r24, 0x47 ; 71 eb74: 9d e0 ldi r25, 0x0D ; 13 eb76: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c if (sensorActionOnError == SensorActionOnError::_Undef) { eb7a: 8f 3f cpi r24, 0xFF ; 255 eb7c: 21 f0 breq .+8 ; 0xeb86 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); eb7e: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } eb80: df 91 pop r29 eb82: cf 91 pop r28 eb84: 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; eb86: 18 86 std Y+8, r1 ; 0x08 eb88: fb cf rjmp .-10 ; 0xeb80 0000eb8a : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { eb8a: cf 93 push r28 eb8c: c8 2f mov r28, r24 eb8e: 68 2f mov r22, r24 eb90: 87 e6 ldi r24, 0x67 ; 103 eb92: 9f e0 ldi r25, 0x0F ; 15 eb94: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { eb98: cc 23 and r28, r28 eb9a: 19 f0 breq .+6 ; 0xeba2 fsensor.init(); } else { fsensor.deinit(); } } eb9c: 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(); eb9e: 0d 94 29 87 jmp 0x30e52 ; 0x30e52 } else { fsensor.deinit(); } } eba2: 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(); eba4: 0d 94 19 87 jmp 0x30e32 ; 0x30e32 0000eba8 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; eba8: 10 92 33 05 sts 0x0533, r1 ; 0x800533 extruder_autofan_last_check = _millis(); ebac: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 ebb0: 60 93 99 17 sts 0x1799, r22 ; 0x801799 ebb4: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a ebb8: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b ebbc: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c } ebc0: 08 95 ret 0000ebc2 <__vector_7>: EICRB ^= (1 << 6); //change edge } #endif //(defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) #ifdef EXTRUDER_ALTFAN_DETECT ISR(INT6_vect) { ebc2: 1f 92 push r1 ebc4: 0f 92 push r0 ebc6: 0f b6 in r0, 0x3f ; 63 ebc8: 0f 92 push r0 ebca: 11 24 eor r1, r1 ebcc: 0b b6 in r0, 0x3b ; 59 ebce: 0f 92 push r0 ebd0: 8f 93 push r24 ebd2: 9f 93 push r25 ebd4: ef 93 push r30 ebd6: ff 93 push r31 fan_edge_counter[0]++; ebd8: e2 eb ldi r30, 0xB2 ; 178 ebda: f4 e0 ldi r31, 0x04 ; 4 ebdc: 80 81 ld r24, Z ebde: 91 81 ldd r25, Z+1 ; 0x01 ebe0: 01 96 adiw r24, 0x01 ; 1 ebe2: 91 83 std Z+1, r25 ; 0x01 ebe4: 80 83 st Z, r24 } ebe6: ff 91 pop r31 ebe8: ef 91 pop r30 ebea: 9f 91 pop r25 ebec: 8f 91 pop r24 ebee: 0f 90 pop r0 ebf0: 0b be out 0x3b, r0 ; 59 ebf2: 0f 90 pop r0 ebf4: 0f be out 0x3f, r0 ; 63 ebf6: 0f 90 pop r0 ebf8: 1f 90 pop r1 ebfa: 18 95 reti 0000ebfc <__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) { ebfc: 1f 92 push r1 ebfe: 0f 92 push r0 ec00: 0f b6 in r0, 0x3f ; 63 ec02: 0f 92 push r0 ec04: 11 24 eor r1, r1 ec06: 2f 93 push r18 ec08: 4f 93 push r20 ec0a: 5f 93 push r21 ec0c: 6f 93 push r22 ec0e: 7f 93 push r23 ec10: 8f 93 push r24 ec12: 9f 93 push r25 ec14: af 93 push r26 ec16: 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; ec18: 80 91 33 05 lds r24, 0x0533 ; 0x800533 ec1c: 88 23 and r24, r24 ec1e: f1 f0 breq .+60 ; 0xec5c <__vector_8+0x60> ec20: 80 91 9d 04 lds r24, 0x049D ; 0x80049d ec24: 8b 34 cpi r24, 0x4B ; 75 ec26: d0 f0 brcs .+52 ; 0xec5c <__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 ec28: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ec2c: 86 ff sbrs r24, 6 ec2e: 24 c0 rjmp .+72 ; 0xec78 <__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; ec30: 80 91 35 06 lds r24, 0x0635 ; 0x800635 ec34: 90 91 36 06 lds r25, 0x0636 ; 0x800636 ec38: a0 91 37 06 lds r26, 0x0637 ; 0x800637 ec3c: b0 91 38 06 lds r27, 0x0638 ; 0x800638 t_fan_rising_edge = millis_nc(); ec40: 80 93 47 03 sts 0x0347, r24 ; 0x800347 ec44: 90 93 48 03 sts 0x0348, r25 ; 0x800348 ec48: a0 93 49 03 sts 0x0349, r26 ; 0x800349 ec4c: b0 93 4a 03 sts 0x034A, r27 ; 0x80034a else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse } } EICRB ^= (1 << 6); //change edge ec50: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ec54: 90 e4 ldi r25, 0x40 ; 64 ec56: 89 27 eor r24, r25 ec58: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } ec5c: bf 91 pop r27 ec5e: af 91 pop r26 ec60: 9f 91 pop r25 ec62: 8f 91 pop r24 ec64: 7f 91 pop r23 ec66: 6f 91 pop r22 ec68: 5f 91 pop r21 ec6a: 4f 91 pop r20 ec6c: 2f 91 pop r18 ec6e: 0f 90 pop r0 ec70: 0f be out 0x3f, r0 ; 63 ec72: 0f 90 pop r0 ec74: 1f 90 pop r1 ec76: 18 95 reti ec78: 80 91 35 06 lds r24, 0x0635 ; 0x800635 ec7c: 90 91 36 06 lds r25, 0x0636 ; 0x800636 ec80: a0 91 37 06 lds r26, 0x0637 ; 0x800637 ec84: b0 91 38 06 lds r27, 0x0638 ; 0x800638 if ((1 << 6) & EICRB) { //interrupt was triggered by rising edge t_fan_rising_edge = millis_nc(); } else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm ec88: 40 91 47 03 lds r20, 0x0347 ; 0x800347 ec8c: 50 91 48 03 lds r21, 0x0348 ; 0x800348 ec90: 60 91 49 03 lds r22, 0x0349 ; 0x800349 ec94: 70 91 4a 03 lds r23, 0x034A ; 0x80034a ec98: 84 1b sub r24, r20 ec9a: 95 0b sbc r25, r21 ec9c: a6 0b sbc r26, r22 ec9e: b7 0b sbc r27, r23 eca0: 20 91 df 03 lds r18, 0x03DF ; 0x8003df eca4: 44 e0 ldi r20, 0x04 ; 4 eca6: 50 e0 ldi r21, 0x00 ; 0 eca8: 60 e0 ldi r22, 0x00 ; 0 ecaa: 70 e0 ldi r23, 0x00 ; 0 ecac: 25 36 cpi r18, 0x65 ; 101 ecae: 20 f0 brcs .+8 ; 0xecb8 <__vector_8+0xbc> ecb0: 43 e0 ldi r20, 0x03 ; 3 ecb2: 50 e0 ldi r21, 0x00 ; 0 ecb4: 60 e0 ldi r22, 0x00 ; 0 ecb6: 70 e0 ldi r23, 0x00 ; 0 ecb8: 84 17 cp r24, r20 ecba: 95 07 cpc r25, r21 ecbc: a6 07 cpc r26, r22 ecbe: b7 07 cpc r27, r23 ecc0: 38 f2 brcs .-114 ; 0xec50 <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse ecc2: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 ecc6: 90 91 b5 04 lds r25, 0x04B5 ; 0x8004b5 ecca: 02 96 adiw r24, 0x02 ; 2 eccc: 90 93 b5 04 sts 0x04B5, r25 ; 0x8004b5 ecd0: 80 93 b4 04 sts 0x04B4, r24 ; 0x8004b4 ecd4: bd cf rjmp .-134 ; 0xec50 <__vector_8+0x54> 0000ecd6 : } #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) void countFanSpeed() { ecd6: 8f 92 push r8 ecd8: 9f 92 push r9 ecda: af 92 push r10 ecdc: bf 92 push r11 ecde: cf 92 push r12 ece0: df 92 push r13 ece2: ef 92 push r14 ece4: ff 92 push r15 ece6: 0f 93 push r16 ece8: 1f 93 push r17 ecea: cf 93 push r28 ecec: 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))); ecee: c2 eb ldi r28, 0xB2 ; 178 ecf0: d4 e0 ldi r29, 0x04 ; 4 ecf2: 68 81 ld r22, Y ecf4: 79 81 ldd r23, Y+1 ; 0x01 ecf6: 07 2e mov r0, r23 ecf8: 00 0c add r0, r0 ecfa: 88 0b sbc r24, r24 ecfc: 99 0b sbc r25, r25 ecfe: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> ed02: 6b 01 movw r12, r22 ed04: 7c 01 movw r14, r24 ed06: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 ed0a: 0e ea ldi r16, 0xAE ; 174 ed0c: 14 e0 ldi r17, 0x04 ; 4 ed0e: 80 90 99 17 lds r8, 0x1799 ; 0x801799 ed12: 90 90 9a 17 lds r9, 0x179A ; 0x80179a ed16: a0 90 9b 17 lds r10, 0x179B ; 0x80179b ed1a: b0 90 9c 17 lds r11, 0x179C ; 0x80179c ed1e: 68 19 sub r22, r8 ed20: 79 09 sbc r23, r9 ed22: 8a 09 sbc r24, r10 ed24: 9b 09 sbc r25, r11 ed26: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> ed2a: 9b 01 movw r18, r22 ed2c: ac 01 movw r20, r24 ed2e: 60 e0 ldi r22, 0x00 ; 0 ed30: 70 e0 ldi r23, 0x00 ; 0 ed32: 8a e7 ldi r24, 0x7A ; 122 ed34: 93 e4 ldi r25, 0x43 ; 67 ed36: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> ed3a: a7 01 movw r20, r14 ed3c: 96 01 movw r18, r12 ed3e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> ed42: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> ed46: f8 01 movw r30, r16 ed48: 71 83 std Z+1, r23 ; 0x01 ed4a: 60 83 st Z, r22 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); ed4c: 6a 81 ldd r22, Y+2 ; 0x02 ed4e: 7b 81 ldd r23, Y+3 ; 0x03 ed50: 07 2e mov r0, r23 ed52: 00 0c add r0, r0 ed54: 88 0b sbc r24, r24 ed56: 99 0b sbc r25, r25 ed58: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> ed5c: 6b 01 movw r12, r22 ed5e: 7c 01 movw r14, r24 ed60: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 ed64: 80 90 99 17 lds r8, 0x1799 ; 0x801799 ed68: 90 90 9a 17 lds r9, 0x179A ; 0x80179a ed6c: a0 90 9b 17 lds r10, 0x179B ; 0x80179b ed70: b0 90 9c 17 lds r11, 0x179C ; 0x80179c ed74: 68 19 sub r22, r8 ed76: 79 09 sbc r23, r9 ed78: 8a 09 sbc r24, r10 ed7a: 9b 09 sbc r25, r11 ed7c: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> ed80: 9b 01 movw r18, r22 ed82: ac 01 movw r20, r24 ed84: 60 e0 ldi r22, 0x00 ; 0 ed86: 70 e0 ldi r23, 0x00 ; 0 ed88: 8a e7 ldi r24, 0x7A ; 122 ed8a: 93 e4 ldi r25, 0x43 ; 67 ed8c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> ed90: a7 01 movw r20, r14 ed92: 96 01 movw r18, r12 ed94: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> ed98: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> ed9c: f8 01 movw r30, r16 ed9e: 73 83 std Z+3, r23 ; 0x03 eda0: 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; eda2: 19 82 std Y+1, r1 ; 0x01 eda4: 18 82 st Y, r1 fan_edge_counter[1] = 0; eda6: 1b 82 std Y+3, r1 ; 0x03 eda8: 1a 82 std Y+2, r1 ; 0x02 } edaa: df 91 pop r29 edac: cf 91 pop r28 edae: 1f 91 pop r17 edb0: 0f 91 pop r16 edb2: ff 90 pop r15 edb4: ef 90 pop r14 edb6: df 90 pop r13 edb8: cf 90 pop r12 edba: bf 90 pop r11 edbc: af 90 pop r10 edbe: 9f 90 pop r9 edc0: 8f 90 pop r8 edc2: 08 95 ret 0000edc4 : 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; edc4: 80 93 4b 03 sts 0x034B, r24 ; 0x80034b newFanSpeed = 0; edc8: 10 92 69 03 sts 0x0369, r1 ; 0x800369 if (fanState & 0x01) edcc: 80 ff sbrs r24, 0 edce: 08 c0 rjmp .+16 ; 0xede0 { #ifdef EXTRUDER_ALTFAN_DETECT if (altfanStatus.isAltfan && !altfanStatus.altfanOverride) newFanSpeed = EXTRUDER_ALTFAN_SPEED_SILENT; edd0: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> edd4: 83 70 andi r24, 0x03 ; 3 edd6: 81 30 cpi r24, 0x01 ; 1 edd8: e9 f4 brne .+58 ; 0xee14 edda: 80 e8 ldi r24, 0x80 ; 128 else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; eddc: 80 93 69 03 sts 0x0369, r24 ; 0x800369 #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); ede0: 20 91 69 03 lds r18, 0x0369 ; 0x800369 } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) ede4: 8f ef ldi r24, 0xFF ; 255 ede6: 82 0f add r24, r18 ede8: 8e 3f cpi r24, 0xFE ; 254 edea: d8 f0 brcs .+54 ; 0xee22 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); edec: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> edf0: 87 7f andi r24, 0xF7 ; 247 edf2: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; edf6: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> edfa: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); edfe: 9f b7 in r25, 0x3f ; 63 ee00: 22 23 and r18, r18 ee02: 51 f0 breq .+20 ; 0xee18 ee04: f8 94 cli ee06: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ee0a: 80 62 ori r24, 0x20 ; 32 ee0c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ee10: 9f bf out 0x3f, r25 ; 63 ee12: 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; ee14: 8f ef ldi r24, 0xFF ; 255 ee16: e2 cf rjmp .-60 ; 0xeddc ee18: f8 94 cli ee1a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ee1e: 8f 7d andi r24, 0xDF ; 223 ee20: f5 cf rjmp .-22 ; 0xee0c 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; ee22: ef b7 in r30, 0x3f ; 63 ee24: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); ee26: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ee2a: 88 60 ori r24, 0x08 ; 8 ee2c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; ee30: 30 e0 ldi r19, 0x00 ; 0 ee32: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> ee36: 4f ef ldi r20, 0xFF ; 255 ee38: 50 e0 ldi r21, 0x00 ; 0 ee3a: 81 ff sbrs r24, 1 ee3c: 04 c0 rjmp .+8 ; 0xee46 ee3e: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> ee42: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> ee46: 24 9f mul r18, r20 ee48: c0 01 movw r24, r0 ee4a: 25 9f mul r18, r21 ee4c: 90 0d add r25, r0 ee4e: 34 9f mul r19, r20 ee50: 90 0d add r25, r0 ee52: 11 24 eor r1, r1 ee54: 6f ef ldi r22, 0xFF ; 255 ee56: 70 e0 ldi r23, 0x00 ; 0 ee58: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> ee5c: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ee60: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; ee64: ef bf out 0x3f, r30 ; 63 #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } ee66: 08 95 ret 0000ee68 : 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); ee68: 8b e2 ldi r24, 0x2B ; 43 ee6a: 9d e0 ldi r25, 0x0D ; 13 ee6c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c ee70: 90 91 b6 04 lds r25, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> ee74: 80 fb bst r24, 0 ee76: 91 f9 bld r25, 1 ee78: 90 93 b6 04 sts 0x04B6, r25 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> #endif resetFanCheck(); ee7c: 0e 94 d4 75 call 0xeba8 ; 0xeba8 setExtruderAutoFanState(1); ee80: 81 e0 ldi r24, 0x01 ; 1 ee82: 0c 94 e2 76 jmp 0xedc4 ; 0xedc4 0000ee86 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { ee86: 1f 93 push r17 ee88: cf 93 push r28 ee8a: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) ee8c: d0 91 4b 03 lds r29, 0x034B ; 0x80034b ee90: d1 fd sbrc r29, 1 ee92: 1d c0 rjmp .+58 ; 0xeece temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; ee94: 10 91 1b 05 lds r17, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ee98: c1 e0 ldi r28, 0x01 ; 1 ee9a: 20 e0 ldi r18, 0x00 ; 0 ee9c: 30 e0 ldi r19, 0x00 ; 0 ee9e: 48 e4 ldi r20, 0x48 ; 72 eea0: 52 e4 ldi r21, 0x42 ; 66 eea2: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e eea6: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f eeaa: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 eeae: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 eeb2: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> eeb6: 18 16 cp r1, r24 eeb8: 0c f0 brlt .+2 ; 0xeebc eeba: 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; eebc: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; eebe: cd 2b or r28, r29 eec0: 81 e0 ldi r24, 0x01 ; 1 eec2: 11 11 cpse r17, r1 eec4: 01 c0 rjmp .+2 ; 0xeec8 eec6: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); eec8: c8 2b or r28, r24 eeca: c0 93 4b 03 sts 0x034B, r28 ; 0x80034b } setExtruderAutoFanState(fanState); eece: 80 91 4b 03 lds r24, 0x034B ; 0x80034b #endif } eed2: df 91 pop r29 eed4: cf 91 pop r28 eed6: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); eed8: 0c 94 e2 76 jmp 0xedc4 ; 0xedc4 0000eedc : 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) { eedc: ef 92 push r14 eede: ff 92 push r15 eee0: 0f 93 push r16 eee2: 1f 93 push r17 eee4: cf 93 push r28 eee6: df 93 push r29 eee8: ec 01 movw r28, r24 eeea: 8b 01 movw r16, r22 eeec: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) eeee: 0e 94 72 5c call 0xb8e4 ; 0xb8e4 eef2: 81 11 cpse r24, r1 eef4: 0b c0 rjmp .+22 ; 0xef0c #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); eef6: a8 01 movw r20, r16 eef8: be 01 movw r22, r28 eefa: 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); } eefc: df 91 pop r29 eefe: cf 91 pop r28 ef00: 1f 91 pop r17 ef02: 0f 91 pop r16 ef04: ff 90 pop r15 ef06: 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); ef08: 0d 94 5a dd jmp 0x3bab4 ; 0x3bab4 } 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); } ef0c: df 91 pop r29 ef0e: cf 91 pop r28 ef10: 1f 91 pop r17 ef12: 0f 91 pop r16 ef14: ff 90 pop r15 ef16: ef 90 pop r14 ef18: 08 95 ret 0000ef1a : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { ef1a: 0f 93 push r16 ef1c: 1f 93 push r17 ef1e: cf 93 push r28 ef20: df 93 push r29 ef22: 8c 01 movw r16, r24 ef24: d6 2f mov r29, r22 ef26: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); ef28: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 if (val == EEPROM_EMPTY_VALUE16) { ef2c: 8f 3f cpi r24, 0xFF ; 255 ef2e: 98 07 cpc r25, r24 ef30: 39 f4 brne .+14 ; 0xef40 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); ef32: 6d 2f mov r22, r29 ef34: 7c 2f mov r23, r28 ef36: c8 01 movw r24, r16 ef38: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 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; ef3c: 8d 2f mov r24, r29 ef3e: 9c 2f mov r25, r28 } return val; } ef40: df 91 pop r29 ef42: cf 91 pop r28 ef44: 1f 91 pop r17 ef46: 0f 91 pop r16 ef48: 08 95 ret 0000ef4a : 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) { ef4a: 0f 93 push r16 ef4c: 1f 93 push r17 ef4e: cf 93 push r28 ef50: 8c 01 movw r16, r24 ef52: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); ef54: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c if (val == EEPROM_EMPTY_VALUE) { ef58: 8f 3f cpi r24, 0xFF ; 255 ef5a: 29 f4 brne .+10 ; 0xef66 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); ef5c: 6c 2f mov r22, r28 ef5e: c8 01 movw r24, r16 ef60: 0f 94 8e dd call 0x3bb1c ; 0x3bb1c 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; ef64: 8c 2f mov r24, r28 } return val; } ef66: cf 91 pop r28 ef68: 1f 91 pop r17 ef6a: 0f 91 pop r16 ef6c: 08 95 ret 0000ef6e : 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) { ef6e: cf 93 push r28 ef70: df 93 push r29 ef72: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); ef74: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 ef78: bc 01 movw r22, r24 ef7a: 6f 5f subi r22, 0xFF ; 255 ef7c: 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); ef7e: 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); } ef80: df 91 pop r29 ef82: 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); ef84: 0d 94 a4 dd jmp 0x3bb48 ; 0x3bb48 0000ef88 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { ef88: cf 93 push r28 ef8a: df 93 push r29 ef8c: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); ef8e: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c ef92: 61 e0 ldi r22, 0x01 ; 1 ef94: 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); ef96: 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); } ef98: df 91 pop r29 ef9a: 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); ef9c: 0d 94 8e dd jmp 0x3bb1c ; 0x3bb1c 0000efa0 : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { efa0: cf 93 push r28 efa2: df 93 push r29 efa4: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); efa6: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c efaa: 61 e0 ldi r22, 0x01 ; 1 efac: 81 11 cpse r24, r1 efae: 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); efb0: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } efb2: df 91 pop r29 efb4: 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); efb6: 0d 94 8e dd jmp 0x3bb1c ; 0x3bb1c 0000efba : 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); efba: 2b e0 ldi r18, 0x0B ; 11 efbc: 82 9f mul r24, r18 efbe: c0 01 movw r24, r0 efc0: 11 24 eor r1, r1 efc2: 80 5b subi r24, 0xB0 ; 176 efc4: 92 4f sbci r25, 0xF2 ; 242 efc6: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 efca: 21 e0 ldi r18, 0x01 ; 1 efcc: 01 96 adiw r24, 0x01 ; 1 efce: 09 f4 brne .+2 ; 0xefd2 efd0: 20 e0 ldi r18, 0x00 ; 0 } efd2: 82 2f mov r24, r18 efd4: 08 95 ret 0000efd6 : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { efd6: cf 93 push r28 efd8: df 93 push r29 efda: c8 2f mov r28, r24 efdc: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; efde: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; efe0: c8 30 cpi r28, 0x08 ; 8 efe2: 0c f0 brlt .+2 ; 0xefe6 efe4: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; efe6: 8c 2f mov r24, r28 efe8: 0e 94 dd 77 call 0xefba ; 0xefba efec: 81 11 cpse r24, r1 efee: 03 c0 rjmp .+6 ; 0xeff6 eff0: 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) eff2: a9 f7 brne .-22 ; 0xefde { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; eff4: cf ef ldi r28, 0xFF ; 255 } eff6: 8c 2f mov r24, r28 eff8: df 91 pop r29 effa: cf 91 pop r28 effc: 08 95 ret 0000effe : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); effe: 81 ea ldi r24, 0xA1 ; 161 f000: 9d e0 ldi r25, 0x0D ; 13 f002: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c sheet = eeprom_next_initialized_sheet(sheet); f006: 0e 94 eb 77 call 0xefd6 ; 0xefd6 if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); f00a: 87 fd sbrc r24, 7 f00c: 05 c0 rjmp .+10 ; 0xf018 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f00e: 68 2f mov r22, r24 f010: 81 ea ldi r24, 0xA1 ; 161 f012: 9d e0 ldi r25, 0x0D ; 13 f014: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 { 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); } f018: 08 95 ret 0000f01a : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { f01a: 0f 93 push r16 f01c: 1f 93 push r17 f01e: cf 93 push r28 f020: c8 2f mov r28, r24 f022: 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")); f024: 6e ee ldi r22, 0xEE ; 238 f026: 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) f028: 82 30 cpi r24, 0x02 ; 2 f02a: 70 f0 brcs .+28 ; 0xf048 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); f02c: 67 ee ldi r22, 0xE7 ; 231 f02e: 79 e7 ldi r23, 0x79 ; 121 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) f030: 84 30 cpi r24, 0x04 ; 4 f032: 50 f0 brcs .+20 ; 0xf048 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); f034: 6f ed ldi r22, 0xDF ; 223 f036: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) f038: 84 30 cpi r24, 0x04 ; 4 f03a: 31 f0 breq .+12 ; 0xf048 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); f03c: 67 ed ldi r22, 0xD7 ; 215 f03e: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) f040: 85 30 cpi r24, 0x05 ; 5 f042: 11 f0 breq .+4 ; 0xf048 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); f044: 60 ed ldi r22, 0xD0 ; 208 f046: 79 e7 ldi r23, 0x79 ; 121 f048: c8 01 movw r24, r16 f04a: 0f 94 fd da call 0x3b5fa ; 0x3b5fa } if (index <4 || index >5) f04e: 8c ef ldi r24, 0xFC ; 252 f050: 8c 0f add r24, r28 f052: 82 30 cpi r24, 0x02 ; 2 f054: 28 f0 brcs .+10 ; 0xf060 { sheetName.c[6] = '0' + ((index % 2)+1); f056: c1 70 andi r28, 0x01 ; 1 f058: cf 5c subi r28, 0xCF ; 207 f05a: f8 01 movw r30, r16 f05c: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; f05e: 17 82 std Z+7, r1 ; 0x07 } } f060: cf 91 pop r28 f062: 1f 91 pop r17 f064: 0f 91 pop r16 f066: 08 95 ret 0000f068 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f068: 61 e0 ldi r22, 0x01 ; 1 f06a: 80 ec ldi r24, 0xC0 ; 192 f06c: 9f e0 ldi r25, 0x0F ; 15 f06e: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 f072: 60 e0 ldi r22, 0x00 ; 0 f074: 8f eb ldi r24, 0xBF ; 191 f076: 9f e0 ldi r25, 0x0F ; 15 f078: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 f07c: 60 e0 ldi r22, 0x00 ; 0 f07e: 8e eb ldi r24, 0xBE ; 190 f080: 9f e0 ldi r25, 0x0F ; 15 f082: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 f086: 60 e0 ldi r22, 0x00 ; 0 f088: 8d eb ldi r24, 0xBD ; 189 f08a: 9f e0 ldi r25, 0x0F ; 15 f08c: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 f090: 60 e0 ldi r22, 0x00 ; 0 f092: 8c eb ldi r24, 0xBC ; 188 f094: 9f e0 ldi r25, 0x0F ; 15 f096: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0000f09a : } void print_hex_byte(uint8_t val) { f09a: cf 93 push r28 f09c: c8 2f mov r28, r24 print_hex_nibble(val >> 4); f09e: 82 95 swap r24 f0a0: 8f 70 andi r24, 0x0F ; 15 f0a2: 0e 94 9b 64 call 0xc936 ; 0xc936 print_hex_nibble(val & 15); f0a6: 8c 2f mov r24, r28 f0a8: 8f 70 andi r24, 0x0F ; 15 } f0aa: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); f0ac: 0c 94 9b 64 jmp 0xc936 ; 0xc936 0000f0b0 : // 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) { f0b0: 80 91 7e 10 lds r24, 0x107E ; 0x80107e f0b4: 90 91 7f 10 lds r25, 0x107F ; 0x80107f f0b8: 18 16 cp r1, r24 f0ba: 19 06 cpc r1, r25 f0bc: 0c f0 brlt .+2 ; 0xf0c0 f0be: 43 c0 rjmp .+134 ; 0xf146 SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { f0c0: 01 97 sbiw r24, 0x01 ; 1 f0c2: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f f0c6: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e f0ca: 89 2b or r24, r25 f0cc: a1 f4 brne .+40 ; 0xf0f6 // Empty buffer. if (serial_count == 0) f0ce: 80 91 79 10 lds r24, 0x1079 ; 0x801079 f0d2: 90 91 7a 10 lds r25, 0x107A ; 0x80107a f0d6: 89 2b or r24, r25 f0d8: 21 f4 brne .+8 ; 0xf0e2 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; f0da: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> f0de: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.570> bufindr = bufindw; f0e2: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> f0e6: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> f0ea: 90 93 6e 12 sts 0x126E, r25 ; 0x80126e f0ee: 80 93 6d 12 sts 0x126D, r24 ; 0x80126d SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; f0f2: 81 e0 ldi r24, 0x01 ; 1 f0f4: 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) ; f0f6: 80 91 6d 12 lds r24, 0x126D ; 0x80126d f0fa: 90 91 6e 12 lds r25, 0x126E ; 0x80126e f0fe: 03 96 adiw r24, 0x03 ; 3 f100: fc 01 movw r30, r24 f102: e0 58 subi r30, 0x80 ; 128 f104: ff 4e sbci r31, 0xEF ; 239 f106: 20 81 ld r18, Z f108: 01 96 adiw r24, 0x01 ; 1 f10a: 21 11 cpse r18, r1 f10c: f9 cf rjmp .-14 ; 0xf100 f10e: fc 01 movw r30, r24 f110: e0 58 subi r30, 0x80 ; 128 f112: 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) ; f114: 8d 3e cpi r24, 0xED ; 237 f116: 21 e0 ldi r18, 0x01 ; 1 f118: 92 07 cpc r25, r18 f11a: 40 f4 brcc .+16 ; 0xf12c f11c: 41 91 ld r20, Z+ f11e: 9c 01 movw r18, r24 f120: 2f 5f subi r18, 0xFF ; 255 f122: 3f 4f sbci r19, 0xFF ; 255 f124: 41 11 cpse r20, r1 f126: e1 cf rjmp .-62 ; 0xf0ea f128: c9 01 movw r24, r18 f12a: f4 cf rjmp .-24 ; 0xf114 // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { f12c: e0 e8 ldi r30, 0x80 ; 128 f12e: f0 e1 ldi r31, 0x10 ; 16 f130: 8d 3e cpi r24, 0xED ; 237 f132: 21 e0 ldi r18, 0x01 ; 1 f134: 92 07 cpc r25, r18 f136: c9 f6 brne .-78 ; 0xf0ea f138: cf 01 movw r24, r30 f13a: 80 58 subi r24, 0x80 ; 128 f13c: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; f13e: 21 91 ld r18, Z+ f140: 22 23 and r18, r18 f142: d1 f3 breq .-12 ; 0xf138 f144: d2 cf rjmp .-92 ; 0xf0ea SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; f146: 80 e0 ldi r24, 0x00 ; 0 } f148: 08 95 ret 0000f14a : 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; f14a: 80 91 90 04 lds r24, 0x0490 ; 0x800490 f14e: 90 91 91 04 lds r25, 0x0491 ; 0x800491 f152: 20 91 92 04 lds r18, 0x0492 ; 0x800492 f156: 30 91 93 04 lds r19, 0x0493 ; 0x800493 f15a: 82 1b sub r24, r18 f15c: 93 0b sbc r25, r19 } f15e: 8f 77 andi r24, 0x7F ; 127 f160: 99 27 eor r25, r25 f162: 08 95 ret 0000f164 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; f164: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) f166: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; f168: 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; f16a: db 01 movw r26, r22 f16c: 4d 91 ld r20, X+ f16e: bd 01 movw r22, r26 f170: 40 32 cpi r20, 0x20 ; 32 f172: 49 f0 breq .+18 ; 0xf186 if (i == 8) f174: 28 30 cpi r18, 0x08 ; 8 f176: 11 f4 brne .+4 ; 0xf17c { *pos++='.'; f178: 30 83 st Z, r19 f17a: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; f17c: db 01 movw r26, r22 f17e: 11 97 sbiw r26, 0x01 ; 1 f180: 4c 91 ld r20, X f182: 40 83 st Z, r20 f184: 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++) f186: 2f 5f subi r18, 0xFF ; 255 f188: 2b 30 cpi r18, 0x0B ; 11 f18a: 79 f7 brne .-34 ; 0xf16a { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; f18c: 10 82 st Z, r1 return buffer; } f18e: 08 95 ret 0000f190 : 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);} f190: 40 e0 ldi r20, 0x00 ; 0 f192: 50 e0 ldi r21, 0x00 ; 0 f194: ba 01 movw r22, r20 f196: 0d 94 66 6e jmp 0x2dccc ; 0x2dccc 0000f19a : 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();} f19a: fc 01 movw r30, r24 f19c: 23 81 ldd r18, Z+3 ; 0x03 f19e: 21 11 cpse r18, r1 f1a0: 0d 94 29 a4 jmp 0x34852 ; 0x34852 f1a4: 08 95 ret 0000f1a6 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) f1a6: 90 91 1e 05 lds r25, 0x051E ; 0x80051e f1aa: 91 11 cpse r25, r1 f1ac: 07 c0 rjmp .+14 ; 0xf1bc { while (!((M_UCSRxA) & (1 << M_UDREx))); f1ae: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> f1b2: 95 ff sbrs r25, 5 f1b4: fc cf rjmp .-8 ; 0xf1ae M_UDRx = c; f1b6: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> f1ba: 08 95 ret } else if (selectedSerialPort == 1) f1bc: 91 30 cpi r25, 0x01 ; 1 f1be: 31 f4 brne .+12 ; 0xf1cc { while (!((UCSR1A) & (1 << UDRE1))); f1c0: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> f1c4: 95 ff sbrs r25, 5 f1c6: fc cf rjmp .-8 ; 0xf1c0 UDR1 = c; f1c8: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } f1cc: 08 95 ret 0000f1ce : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); f1ce: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 return 0; } f1d2: 90 e0 ldi r25, 0x00 ; 0 f1d4: 80 e0 ldi r24, 0x00 ; 0 f1d6: 08 95 ret 0000f1d8 : 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) { f1d8: cf 93 push r28 f1da: df 93 push r29 f1dc: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { f1de: fe 01 movw r30, r28 f1e0: 84 91 lpm r24, Z f1e2: 88 23 and r24, r24 f1e4: 21 f0 breq .+8 ; 0xf1ee MYSERIAL.write((char)ch); f1e6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 ++str; f1ea: 21 96 adiw r28, 0x01 ; 1 f1ec: f8 cf rjmp .-16 ; 0xf1de } } f1ee: df 91 pop r29 f1f0: cf 91 pop r28 f1f2: 08 95 ret 0000f1f4 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { f1f4: cf 92 push r12 f1f6: df 92 push r13 f1f8: ef 92 push r14 f1fa: 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]; f1fc: c0 90 5e 0e lds r12, 0x0E5E ; 0x800e5e f200: d0 90 5f 0e lds r13, 0x0E5F ; 0x800e5f f204: e0 90 60 0e lds r14, 0x0E60 ; 0x800e60 f208: f0 90 61 0e lds r15, 0x0E61 ; 0x800e61 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); f20c: 87 e6 ldi r24, 0x67 ; 103 f20e: 9f e7 ldi r25, 0x7F ; 127 f210: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f214: 42 e0 ldi r20, 0x02 ; 2 f216: c7 01 movw r24, r14 f218: b6 01 movw r22, r12 f21a: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); f21e: 8f e5 ldi r24, 0x5F ; 95 f220: 9f e7 ldi r25, 0x7F ; 127 f222: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f226: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee f22a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef f22e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 f232: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 f236: 41 e0 ldi r20, 0x01 ; 1 f238: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } f23c: ff 90 pop r15 f23e: ef 90 pop r14 f240: df 90 pop r13 f242: 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(); f244: 0d 94 48 d6 jmp 0x3ac90 ; 0x3ac90 0000f248 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { f248: 4f 92 push r4 f24a: 5f 92 push r5 f24c: 6f 92 push r6 f24e: 7f 92 push r7 f250: 8f 92 push r8 f252: 9f 92 push r9 f254: af 92 push r10 f256: bf 92 push r11 f258: cf 92 push r12 f25a: df 92 push r13 f25c: ef 92 push r14 f25e: ff 92 push r15 f260: 0f 93 push r16 f262: 1f 93 push r17 f264: cf 93 push r28 f266: df 93 push r29 f268: cc 24 eor r12, r12 f26a: ca 94 dec r12 f26c: dc 2c mov r13, r12 f26e: 76 01 movw r14, r12 f270: 0e ea ldi r16, 0xAE ; 174 f272: 1f e0 ldi r17, 0x0F ; 15 f274: 93 e2 ldi r25, 0x23 ; 35 f276: 89 2e mov r8, r25 f278: 91 2c mov r9, r1 f27a: a1 2c mov r10, r1 f27c: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; f27e: 41 2c mov r4, r1 f280: 51 2c mov r5, r1 f282: 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; f284: d0 e0 ldi r29, 0x00 ; 0 f286: 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) { f288: 8f ef ldi r24, 0xFF ; 255 f28a: c8 16 cp r12, r24 f28c: 09 f4 brne .+2 ; 0xf290 f28e: 5d c0 rjmp .+186 ; 0xf34a usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); f290: c8 01 movw r24, r16 f292: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 f296: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; f298: bc 01 movw r22, r24 f29a: 99 0f add r25, r25 f29c: 88 0b sbc r24, r24 f29e: 99 0b sbc r25, r25 f2a0: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f2a4: 20 91 77 06 lds r18, 0x0677 ; 0x800677 f2a8: 30 91 78 06 lds r19, 0x0678 ; 0x800678 f2ac: 40 91 79 06 lds r20, 0x0679 ; 0x800679 f2b0: 50 91 7a 06 lds r21, 0x067A ; 0x80067a f2b4: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> f2b8: 2b 01 movw r4, r22 f2ba: 3c 01 movw r6, r24 f2bc: c7 01 movw r24, r14 f2be: b6 01 movw r22, r12 f2c0: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); f2c4: 89 e5 ldi r24, 0x59 ; 89 f2c6: 9e e7 ldi r25, 0x7E ; 126 f2c8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f2cc: c5 01 movw r24, r10 f2ce: b4 01 movw r22, r8 f2d0: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); f2d4: 89 e5 ldi r24, 0x59 ; 89 f2d6: 9e e7 ldi r25, 0x7E ; 126 f2d8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f2dc: be 01 movw r22, r28 f2de: 0d 2e mov r0, r29 f2e0: 00 0c add r0, r0 f2e2: 88 0b sbc r24, r24 f2e4: 99 0b sbc r25, r25 f2e6: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); f2ea: 89 e5 ldi r24, 0x59 ; 89 f2ec: 9e e7 ldi r25, 0x7E ; 126 f2ee: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLLN(mm * 1000); f2f2: 20 e0 ldi r18, 0x00 ; 0 f2f4: 30 e0 ldi r19, 0x00 ; 0 f2f6: 4a e7 ldi r20, 0x7A ; 122 f2f8: 54 e4 ldi r21, 0x44 ; 68 f2fa: c3 01 movw r24, r6 f2fc: b2 01 movw r22, r4 f2fe: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> f302: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a f306: 85 e0 ldi r24, 0x05 ; 5 f308: 88 0e add r8, r24 f30a: 91 1c adc r9, r1 f30c: a1 1c adc r10, r1 f30e: b1 1c adc r11, r1 f310: 0e 5f subi r16, 0xFE ; 254 f312: 1f 4f sbci r17, 0xFF ; 255 f314: 8f ef ldi r24, 0xFF ; 255 f316: c8 1a sub r12, r24 f318: d8 0a sbc r13, r24 f31a: e8 0a sbc r14, r24 f31c: 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++) { f31e: 0a 3b cpi r16, 0xBA ; 186 f320: 8f e0 ldi r24, 0x0F ; 15 f322: 18 07 cpc r17, r24 f324: 09 f0 breq .+2 ; 0xf328 f326: b0 cf rjmp .-160 ; 0xf288 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f328: df 91 pop r29 f32a: cf 91 pop r28 f32c: 1f 91 pop r17 f32e: 0f 91 pop r16 f330: ff 90 pop r15 f332: ef 90 pop r14 f334: df 90 pop r13 f336: cf 90 pop r12 f338: bf 90 pop r11 f33a: af 90 pop r10 f33c: 9f 90 pop r9 f33e: 8f 90 pop r8 f340: 7f 90 pop r7 f342: 6f 90 pop r6 f344: 5f 90 pop r5 f346: 4f 90 pop r4 f348: 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); f34a: 8b ef ldi r24, 0xFB ; 251 f34c: 9c e3 ldi r25, 0x3C ; 60 f34e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f352: b8 cf rjmp .-144 ; 0xf2c4 0000f354 : /// @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) { f354: 88 23 and r24, r24 f356: 71 f1 breq .+92 ; 0xf3b4 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f358: 8d e4 ldi r24, 0x4D ; 77 f35a: 9e e7 ldi r25, 0x7E ; 126 f35c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f360: 60 91 24 13 lds r22, 0x1324 ; 0x801324 f364: 70 e0 ldi r23, 0x00 ; 0 f366: 90 e0 ldi r25, 0x00 ; 0 f368: 80 e0 ldi r24, 0x00 ; 0 f36a: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; f36e: 80 91 24 13 lds r24, 0x1324 ; 0x801324 f372: 84 30 cpi r24, 0x04 ; 4 f374: d8 f0 brcs .+54 ; 0xf3ac f376: 10 92 24 13 sts 0x1324, r1 ; 0x801324 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f37a: 88 e4 ldi r24, 0x48 ; 72 f37c: 9e e7 ldi r25, 0x7E ; 126 f37e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN((int)currentMMUSlot); f382: 80 91 24 13 lds r24, 0x1324 ; 0x801324 f386: 90 e0 ldi r25, 0x00 ; 0 f388: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c return currentMMUSlot; f38c: 80 91 24 13 lds r24, 0x1324 ; 0x801324 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; f390: 20 91 aa 05 lds r18, 0x05AA ; 0x8005aa f394: 30 91 ab 05 lds r19, 0x05AB ; 0x8005ab f398: 30 93 6b 0e sts 0x0E6B, r19 ; 0x800e6b f39c: 20 93 6a 0e sts 0x0E6A, r18 ; 0x800e6a slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); f3a0: 0f 94 08 1d call 0x23a10 ; 0x23a10 load_filament_final_feed(); // @@TODO verify f3a4: 0e 94 59 65 call 0xcab2 ; 0xcab2 st_synchronize(); f3a8: 0d 94 e1 58 jmp 0x2b1c2 ; 0x2b1c2 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; else currentMMUSlot++; f3ac: 8f 5f subi r24, 0xFF ; 255 f3ae: 80 93 24 13 sts 0x1324, r24 ; 0x801324 f3b2: e3 cf rjmp .-58 ; 0xf37a 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); f3b4: 82 e1 ldi r24, 0x12 ; 18 f3b6: 9f e3 ldi r25, 0x3F ; 63 f3b8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 f3bc: 70 e0 ldi r23, 0x00 ; 0 f3be: 60 e0 ldi r22, 0x00 ; 0 f3c0: 0e 94 ca d9 call 0x1b394 ; 0x1b394 f3c4: e5 cf rjmp .-54 ; 0xf390 0000f3c6 : return final_result; } void gcode_M114() { f3c6: cf 93 push r28 f3c8: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f3ca: 85 e4 ldi r24, 0x45 ; 69 f3cc: 9e e7 ldi r25, 0x7E ; 126 f3ce: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOL(current_position[X_AXIS]); f3d2: c0 e4 ldi r28, 0x40 ; 64 f3d4: d7 e0 ldi r29, 0x07 ; 7 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f3d6: 68 81 ld r22, Y f3d8: 79 81 ldd r23, Y+1 ; 0x01 f3da: 8a 81 ldd r24, Y+2 ; 0x02 f3dc: 9b 81 ldd r25, Y+3 ; 0x03 f3de: 42 e0 ldi r20, 0x02 ; 2 f3e0: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOLPGM(" Y:"); f3e4: 81 e4 ldi r24, 0x41 ; 65 f3e6: 9e e7 ldi r25, 0x7E ; 126 f3e8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f3ec: 6c 81 ldd r22, Y+4 ; 0x04 f3ee: 7d 81 ldd r23, Y+5 ; 0x05 f3f0: 8e 81 ldd r24, Y+6 ; 0x06 f3f2: 9f 81 ldd r25, Y+7 ; 0x07 f3f4: 42 e0 ldi r20, 0x02 ; 2 f3f6: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f3fa: 8d e3 ldi r24, 0x3D ; 61 f3fc: 9e e7 ldi r25, 0x7E ; 126 f3fe: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f402: 68 85 ldd r22, Y+8 ; 0x08 f404: 79 85 ldd r23, Y+9 ; 0x09 f406: 8a 85 ldd r24, Y+10 ; 0x0a f408: 9b 85 ldd r25, Y+11 ; 0x0b f40a: 42 e0 ldi r20, 0x02 ; 2 f40c: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f410: 89 e3 ldi r24, 0x39 ; 57 f412: 9e e7 ldi r25, 0x7E ; 126 f414: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f418: 6c 85 ldd r22, Y+12 ; 0x0c f41a: 7d 85 ldd r23, Y+13 ; 0x0d f41c: 8e 85 ldd r24, Y+14 ; 0x0e f41e: 9f 85 ldd r25, Y+15 ; 0x0f f420: 42 e0 ldi r20, 0x02 ; 2 f422: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f426: 81 ef ldi r24, 0xF1 ; 241 f428: 96 e6 ldi r25, 0x66 ; 102 f42a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f42e: 80 e0 ldi r24, 0x00 ; 0 f430: 0f 94 bf 58 call 0x2b17e ; 0x2b17e f434: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f438: cb e6 ldi r28, 0x6B ; 107 f43a: d6 e0 ldi r29, 0x06 ; 6 f43c: 2c 81 ldd r18, Y+4 ; 0x04 f43e: 3d 81 ldd r19, Y+5 ; 0x05 f440: 4e 81 ldd r20, Y+6 ; 0x06 f442: 5f 81 ldd r21, Y+7 ; 0x07 f444: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> f448: 42 e0 ldi r20, 0x02 ; 2 f44a: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOLPGM(" Y:"); f44e: 85 e3 ldi r24, 0x35 ; 53 f450: 9e e7 ldi r25, 0x7E ; 126 f452: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f456: 81 e0 ldi r24, 0x01 ; 1 f458: 0f 94 bf 58 call 0x2b17e ; 0x2b17e f45c: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f460: 28 85 ldd r18, Y+8 ; 0x08 f462: 39 85 ldd r19, Y+9 ; 0x09 f464: 4a 85 ldd r20, Y+10 ; 0x0a f466: 5b 85 ldd r21, Y+11 ; 0x0b f468: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> f46c: 42 e0 ldi r20, 0x02 ; 2 f46e: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOLPGM(" Z:"); f472: 81 e3 ldi r24, 0x31 ; 49 f474: 9e e7 ldi r25, 0x7E ; 126 f476: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f47a: 82 e0 ldi r24, 0x02 ; 2 f47c: 0f 94 bf 58 call 0x2b17e ; 0x2b17e f480: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f484: 2c 85 ldd r18, Y+12 ; 0x0c f486: 3d 85 ldd r19, Y+13 ; 0x0d f488: 4e 85 ldd r20, Y+14 ; 0x0e f48a: 5f 85 ldd r21, Y+15 ; 0x0f f48c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> f490: 42 e0 ldi r20, 0x02 ; 2 f492: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOLPGM(" E:"); f496: 8d e2 ldi r24, 0x2D ; 45 f498: 9e e7 ldi r25, 0x7E ; 126 f49a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f49e: 83 e0 ldi r24, 0x03 ; 3 f4a0: 0f 94 bf 58 call 0x2b17e ; 0x2b17e f4a4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f4a8: 28 89 ldd r18, Y+16 ; 0x10 f4aa: 39 89 ldd r19, Y+17 ; 0x11 f4ac: 4a 89 ldd r20, Y+18 ; 0x12 f4ae: 5b 89 ldd r21, Y+19 ; 0x13 f4b0: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> } f4b4: df 91 pop r29 f4b6: 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]); f4b8: 0d 94 8d 76 jmp 0x2ed1a ; 0x2ed1a 0000f4bc : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f4bc: 8c e3 ldi r24, 0x3C ; 60 f4be: 9d e7 ldi r25, 0x7D ; 125 f4c0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f4c4: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e f4c8: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f f4cc: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 f4d0: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 f4d4: 41 e0 ldi r20, 0x01 ; 1 f4d6: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f4da: 89 e3 ldi r24, 0x39 ; 57 f4dc: 9d e7 ldi r25, 0x7D ; 125 f4de: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f4e2: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a f4e6: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b f4ea: 07 2e mov r0, r23 f4ec: 00 0c add r0, r0 f4ee: 88 0b sbc r24, r24 f4f0: 99 0b sbc r25, r25 f4f2: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f4f6: 41 e0 ldi r20, 0x01 ; 1 f4f8: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f4fc: 85 e3 ldi r24, 0x35 ; 53 f4fe: 9d e7 ldi r25, 0x7D ; 125 f500: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f504: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee f508: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef f50c: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 f510: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 f514: 41 e0 ldi r20, 0x01 ; 1 f516: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f51a: 82 e3 ldi r24, 0x32 ; 50 f51c: 9d e7 ldi r25, 0x7D ; 125 f51e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f522: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 f526: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 f52a: 07 2e mov r0, r23 f52c: 00 0c add r0, r0 f52e: 88 0b sbc r24, r24 f530: 99 0b sbc r25, r25 f532: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f536: 41 e0 ldi r20, 0x01 ; 1 f538: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f53c: 8d e2 ldi r24, 0x2D ; 45 f53e: 9d e7 ldi r25, 0x7D ; 125 f540: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f544: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e f548: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f f54c: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 f550: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 f554: 41 e0 ldi r20, 0x01 ; 1 f556: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f55a: 8a e2 ldi r24, 0x2A ; 42 f55c: 9d e7 ldi r25, 0x7D ; 125 f55e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f562: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a f566: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b f56a: 07 2e mov r0, r23 f56c: 00 0c add r0, r0 f56e: 88 0b sbc r24, r24 f570: 99 0b sbc r25, r25 f572: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f576: 41 e0 ldi r20, 0x01 ; 1 f578: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f57c: 86 e2 ldi r24, 0x26 ; 38 f57e: 9d e7 ldi r25, 0x7D ; 125 f580: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f584: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> f588: 70 e0 ldi r23, 0x00 ; 0 f58a: 90 e0 ldi r25, 0x00 ; 0 f58c: 80 e0 ldi r24, 0x00 ; 0 f58e: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f592: 81 e2 ldi r24, 0x21 ; 33 f594: 9d e7 ldi r25, 0x7D ; 125 f596: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f59a: 60 91 17 06 lds r22, 0x0617 ; 0x800617 f59e: 70 e0 ldi r23, 0x00 ; 0 f5a0: 90 e0 ldi r25, 0x00 ; 0 f5a2: 80 e0 ldi r24, 0x00 ; 0 f5a4: 0f 94 9a d2 call 0x3a534 ; 0x3a534 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f5a8: 8d e1 ldi r24, 0x1D ; 29 f5aa: 9d e7 ldi r25, 0x7D ; 125 f5ac: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f5b0: 60 91 95 03 lds r22, 0x0395 ; 0x800395 f5b4: 70 91 96 03 lds r23, 0x0396 ; 0x800396 f5b8: 80 91 97 03 lds r24, 0x0397 ; 0x800397 f5bc: 90 91 98 03 lds r25, 0x0398 ; 0x800398 f5c0: 41 e0 ldi r20, 0x01 ; 1 f5c2: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f5c6: 89 e1 ldi r24, 0x19 ; 25 f5c8: 9d e7 ldi r25, 0x7D ; 125 f5ca: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 f5ce: 60 91 50 06 lds r22, 0x0650 ; 0x800650 f5d2: 70 91 51 06 lds r23, 0x0651 ; 0x800651 f5d6: 80 91 52 06 lds r24, 0x0652 ; 0x800652 f5da: 90 91 53 06 lds r25, 0x0653 ; 0x800653 f5de: 41 e0 ldi r20, 0x01 ; 1 f5e0: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f5e4: 0d 94 48 d6 jmp 0x3ac90 ; 0x3ac90 0000f5e8 : } } 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); } f5e8: 20 91 63 14 lds r18, 0x1463 ; 0x801463 f5ec: 30 e0 ldi r19, 0x00 ; 0 f5ee: a8 ee ldi r26, 0xE8 ; 232 f5f0: b3 e0 ldi r27, 0x03 ; 3 f5f2: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> f5f6: ab 01 movw r20, r22 f5f8: bc 01 movw r22, r24 f5fa: 84 e6 ldi r24, 0x64 ; 100 f5fc: 94 e1 ldi r25, 0x14 ; 20 f5fe: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f602: 88 23 and r24, r24 f604: 99 f0 breq .+38 ; 0xf62c f606: 80 91 62 14 lds r24, 0x1462 ; 0x801462 { if(autoReportFeatures.Temp()){ f60a: 80 fd sbrc r24, 0 gcode_M105(); f60c: 0e 94 5e 7a call 0xf4bc ; 0xf4bc f610: 80 91 62 14 lds r24, 0x1462 ; 0x801462 } if(autoReportFeatures.Pos()){ f614: 82 fd sbrc r24, 2 gcode_M114(); f616: 0e 94 e3 79 call 0xf3c6 ; 0xf3c6 f61a: 80 91 62 14 lds r24, 0x1462 ; 0x801462 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f61e: 81 fd sbrc r24, 1 gcode_M123(); f620: 0e 94 4a 67 call 0xce94 ; 0xce94 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f624: 84 e6 ldi r24, 0x64 ; 100 f626: 94 e1 ldi r25, 0x14 ; 20 f628: 0d 94 fe 41 jmp 0x283fc ; 0x283fc ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f62c: 08 95 ret 0000f62e : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f62e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 MYSERIAL.println(); f632: 0d 94 48 d6 jmp 0x3ac90 ; 0x3ac90 0000f636 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f636: 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))); f638: 81 ea ldi r24, 0xA1 ; 161 f63a: 9d e0 ldi r25, 0x0D ; 13 f63c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f640: cb e0 ldi r28, 0x0B ; 11 f642: 8c 9f mul r24, r28 f644: c0 01 movw r24, r0 f646: 11 24 eor r1, r1 f648: 80 5b subi r24, 0xB0 ; 176 f64a: 92 4f sbci r25, 0xF2 ; 242 f64c: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f650: 81 56 subi r24, 0x61 ; 97 f652: 90 4f sbci r25, 0xF0 ; 240 f654: 80 3a cpi r24, 0xA0 ; 160 f656: 9f 40 sbci r25, 0x0F ; 15 f658: c8 f0 brcs .+50 ; 0xf68c 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"); f65a: 86 e3 ldi r24, 0x36 ; 54 f65c: 9f e7 ldi r25, 0x7F ; 127 f65e: 0e 94 17 7b call 0xf62e ; 0xf62e eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f662: 81 ea ldi r24, 0xA1 ; 161 f664: 9d e0 ldi r25, 0x0D ; 13 f666: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 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-> f66a: 8c 9f mul r24, r28 f66c: c0 01 movw r24, r0 f66e: 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); f670: 70 e0 ldi r23, 0x00 ; 0 f672: 60 e0 ldi r22, 0x00 ; 0 f674: 80 5b subi r24, 0xB0 ; 176 f676: 92 4f sbci r25, 0xF2 ; 242 f678: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 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.")); f67c: 89 ef ldi r24, 0xF9 ; 249 f67e: 9e e7 ldi r25, 0x7E ; 126 f680: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 lcd_update_enable(true); f684: 81 e0 ldi r24, 0x01 ; 1 } } f686: 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); f688: 0c 94 eb 6f jmp 0xdfd6 ; 0xdfd6 } } f68c: cf 91 pop r28 f68e: 08 95 ret 0000f690 : // 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) { f690: ff 92 push r15 f692: 0f 93 push r16 f694: 1f 93 push r17 f696: cf 93 push r28 f698: df 93 push r29 if(Stopped == false) { f69a: 90 91 11 05 lds r25, 0x0511 ; 0x800511 f69e: 91 11 cpse r25, r1 f6a0: 4f c0 rjmp .+158 ; 0xf740 f6a2: c8 2f mov r28, r24 Stopped = true; f6a4: 81 e0 ldi r24, 0x01 ; 1 f6a6: 80 93 11 05 sts 0x0511, r24 ; 0x800511 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f6aa: cc 23 and r28, r28 f6ac: 11 f1 breq .+68 ; 0xf6f2 f6ae: 0e 94 56 68 call 0xd0ac ; 0xd0ac f6b2: 88 23 and r24, r24 f6b4: f1 f0 breq .+60 ; 0xf6f2 if (!printingIsPaused()) { f6b6: 0e 94 4b 68 call 0xd096 ; 0xd096 f6ba: 81 11 cpse r24, r1 f6bc: 22 c0 rjmp .+68 ; 0xf702 lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f6be: 81 ea ldi r24, 0xA1 ; 161 f6c0: 96 e3 ldi r25, 0x36 ; 54 f6c2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 f6c6: 63 e0 ldi r22, 0x03 ; 3 f6c8: 0f 94 9b 06 call 0x20d36 ; 0x20d36 // 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; f6cc: f0 90 ac 05 lds r15, 0x05AC ; 0x8005ac uint16_t ext_temp = saved_extruder_temperature; f6d0: 00 91 aa 05 lds r16, 0x05AA ; 0x8005aa f6d4: 10 91 ab 05 lds r17, 0x05AB ; 0x8005ab uint8_t fan_speed = saved_fan_speed; f6d8: d0 91 a9 05 lds r29, 0x05A9 ; 0x8005a9 lcd_pause_print(); f6dc: 0f 94 67 3f call 0x27ece ; 0x27ece saved_bed_temperature = bed_temp; f6e0: f0 92 ac 05 sts 0x05AC, r15 ; 0x8005ac saved_extruder_temperature = ext_temp; f6e4: 10 93 ab 05 sts 0x05AB, r17 ; 0x8005ab f6e8: 00 93 aa 05 sts 0x05AA, r16 ; 0x8005aa saved_fan_speed = fan_speed; f6ec: d0 93 a9 05 sts 0x05A9, r29 ; 0x8005a9 f6f0: 08 c0 rjmp .+16 ; 0xf702 } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f6f2: 61 e0 ldi r22, 0x01 ; 1 f6f4: 80 e0 ldi r24, 0x00 ; 0 f6f6: 0f 94 e7 15 call 0x22bce ; 0x22bce } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f6fa: 8c ee ldi r24, 0xEC ; 236 f6fc: 99 ea ldi r25, 0xA9 ; 169 f6fe: cc 23 and r28, r28 f700: 11 f0 breq .+4 ; 0xf706 f702: 84 e1 ldi r24, 0x14 ; 20 f704: 9a ea ldi r25, 0xAA ; 170 f706: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f70a: 8a e6 ldi r24, 0x6A ; 106 f70c: 97 e6 ldi r25, 0x67 ; 103 f70e: 0e 94 17 7b call 0xf62e ; 0xf62e // 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)); f712: 86 e9 ldi r24, 0x96 ; 150 f714: 96 e3 ldi r25, 0x36 ; 54 f716: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 f71a: 0f 94 be 0b call 0x2177c ; 0x2177c // 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); f71e: 9f b7 in r25, 0x3f ; 63 f720: f8 94 cli f722: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f726: 84 60 ori r24, 0x04 ; 4 f728: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f72c: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f72e: 0f 94 23 27 call 0x24e46 ; 0x24e46 if(!allow_recovery) { f732: c1 11 cpse r28, r1 f734: 05 c0 rjmp .+10 ; 0xf740 // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f736: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce f73a: 81 60 ori r24, 0x01 ; 1 f73c: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce } } } f740: df 91 pop r29 f742: cf 91 pop r28 f744: 1f 91 pop r17 f746: 0f 91 pop r16 f748: ff 90 pop r15 f74a: 08 95 ret 0000f74c : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f74c: ec 01 movw r28, r24 cli(); // Stop interrupts f74e: f8 94 cli disable_heater(); f750: 0f 94 27 45 call 0x28a4e ; 0x28a4e disable_x(); f754: 17 9a sbi 0x02, 7 ; 2 f756: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); f75a: 16 9a sbi 0x02, 6 ; 2 f75c: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e poweroff_z(); disable_e0(); f760: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f762: 8c ee ldi r24, 0xEC ; 236 f764: 99 ea ldi r25, 0xA9 ; 169 f766: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f76a: 8a ed ldi r24, 0xDA ; 218 f76c: 9e e7 ldi r25, 0x7E ; 126 f76e: 0e 94 17 7b call 0xf62e ; 0xf62e if (full_screen_message != NULL) { f772: 20 97 sbiw r28, 0x00 ; 0 f774: 79 f0 breq .+30 ; 0xf794 SERIAL_ERRORLNRPGM(full_screen_message); f776: ce 01 movw r24, r28 f778: 0e 94 17 7b call 0xf62e ; 0xf62e f77c: be 01 movw r22, r28 f77e: 85 e9 ldi r24, 0x95 ; 149 f780: 9c e0 ldi r25, 0x0C ; 12 f782: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 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); f786: 62 e4 ldi r22, 0x42 ; 66 f788: 84 e9 ldi r24, 0x94 ; 148 f78a: 9c e0 ldi r25, 0x0C ; 12 f78c: 0f 94 8e dd call 0x3bb1c ; 0x3bb1c // 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(); f790: 0e 94 12 68 call 0xd024 ; 0xd024 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f794: c2 ed ldi r28, 0xD2 ; 210 f796: de e7 ldi r29, 0x7E ; 126 f798: f1 cf rjmp .-30 ; 0xf77c 0000f79a : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f79a: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f79e: 86 fd sbrc r24, 6 f7a0: 35 c0 rjmp .+106 ; 0xf80c FORCE_HIGH_POWER_END; f7a2: 80 e0 ldi r24, 0x00 ; 0 f7a4: 0e 94 76 67 call 0xceec ; 0xceec current_position[Z_AXIS] = 0; f7a8: 10 92 48 07 sts 0x0748, r1 ; 0x800748 f7ac: 10 92 49 07 sts 0x0749, r1 ; 0x800749 f7b0: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a f7b4: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b plan_set_position_curposXYZE(); f7b8: 0f 94 08 b9 call 0x37210 ; 0x37210 current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f7bc: 20 e0 ldi r18, 0x00 ; 0 f7be: 30 e0 ldi r19, 0x00 ; 0 f7c0: 40 ea ldi r20, 0xA0 ; 160 f7c2: 50 e4 ldi r21, 0x40 ; 64 f7c4: 60 91 48 07 lds r22, 0x0748 ; 0x800748 f7c8: 70 91 49 07 lds r23, 0x0749 ; 0x800749 f7cc: 80 91 4a 07 lds r24, 0x074A ; 0x80074a f7d0: 90 91 4b 07 lds r25, 0x074B ; 0x80074b f7d4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> f7d8: 60 93 48 07 sts 0x0748, r22 ; 0x800748 f7dc: 70 93 49 07 sts 0x0749, r23 ; 0x800749 f7e0: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a f7e4: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f7e8: e0 91 99 02 lds r30, 0x0299 ; 0x800299 f7ec: f0 91 9a 02 lds r31, 0x029A ; 0x80029a f7f0: 60 85 ldd r22, Z+8 ; 0x08 f7f2: 71 85 ldd r23, Z+9 ; 0x09 f7f4: 82 85 ldd r24, Z+10 ; 0x0a f7f6: 93 85 ldd r25, Z+11 ; 0x0b f7f8: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); f7fc: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f800: 8a ef ldi r24, 0xFA ; 250 f802: 94 e6 ldi r25, 0x64 ; 100 f804: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 f808: 0e 94 a6 7b call 0xf74c ; 0xf74c } } f80c: 08 95 ret 0000f80e : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f80e: 2f 92 push r2 f810: 3f 92 push r3 f812: 4f 92 push r4 f814: 5f 92 push r5 f816: 6f 92 push r6 f818: 7f 92 push r7 f81a: 8f 92 push r8 f81c: 9f 92 push r9 f81e: af 92 push r10 f820: bf 92 push r11 f822: cf 92 push r12 f824: df 92 push r13 f826: ef 92 push r14 f828: ff 92 push r15 f82a: 0f 93 push r16 f82c: 1f 93 push r17 f82e: cf 93 push r28 f830: df 93 push r29 f832: cd b7 in r28, 0x3d ; 61 f834: de b7 in r29, 0x3e ; 62 f836: 60 97 sbiw r28, 0x10 ; 16 f838: 0f b6 in r0, 0x3f ; 63 f83a: f8 94 cli f83c: de bf out 0x3e, r29 ; 62 f83e: 0f be out 0x3f, r0 ; 63 f840: cd bf out 0x3d, r28 ; 61 f842: 28 2e mov r2, r24 f844: 6e 87 std Y+14, r22 ; 0x0e f846: 5a 87 std Y+10, r21 ; 0x0a f848: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f84a: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> f84e: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f850: 77 24 eor r7, r7 f852: 73 94 inc r7 f854: 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) f858: 42 e0 ldi r20, 0x02 ; 2 f85a: 84 17 cp r24, r20 f85c: 09 f4 brne .+2 ; 0xf860 f85e: d4 c1 rjmp .+936 ; 0xfc08 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); f860: 08 2f mov r16, r24 f862: 10 e0 ldi r17, 0x00 ; 0 f864: f8 01 movw r30, r16 f866: ea 5e subi r30, 0xEA ; 234 f868: f2 48 sbci r31, 0x82 ; 130 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); DEFINE_PGM_READ_ANY(signed char, byte); f86a: 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); f86c: 83 2d mov r24, r3 f86e: 03 2c mov r0, r3 f870: 00 0c add r0, r0 f872: 99 0b sbc r25, r25 f874: 9c 87 std Y+12, r25 ; 0x0c f876: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f878: d8 01 movw r26, r16 f87a: aa 0f add r26, r26 f87c: bb 1f adc r27, r27 f87e: aa 0f add r26, r26 f880: bb 1f adc r27, r27 f882: ba 83 std Y+2, r27 ; 0x02 f884: a9 83 std Y+1, r26 ; 0x01 f886: fd 01 movw r30, r26 f888: e3 53 subi r30, 0x33 ; 51 f88a: fd 4f sbci r31, 0xFD ; 253 f88c: 80 81 ld r24, Z f88e: 91 81 ldd r25, Z+1 ; 0x01 f890: a2 81 ldd r26, Z+2 ; 0x02 f892: b3 81 ldd r27, Z+3 ; 0x03 f894: 8b 83 std Y+3, r24 ; 0x03 f896: 9c 83 std Y+4, r25 ; 0x04 f898: ad 83 std Y+5, r26 ; 0x05 f89a: be 83 std Y+6, r27 ; 0x06 f89c: 80 93 90 02 sts 0x0290, r24 ; 0x800290 f8a0: 90 93 91 02 sts 0x0291, r25 ; 0x800291 f8a4: a0 93 92 02 sts 0x0292, r26 ; 0x800292 f8a8: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); f8ac: bc 01 movw r22, r24 f8ae: cd 01 movw r24, r26 f8b0: 0e 94 8d 67 call 0xcf1a ; 0xcf1a f8b4: 6b 01 movw r12, r22 f8b6: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f8b8: 81 e0 ldi r24, 0x01 ; 1 f8ba: 02 2c mov r0, r2 f8bc: 01 c0 rjmp .+2 ; 0xf8c0 f8be: 88 0f add r24, r24 f8c0: 0a 94 dec r0 f8c2: ea f7 brpl .-6 ; 0xf8be f8c4: 0f 94 63 3b call 0x276c6 ; 0x276c6 // 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; f8c8: a9 81 ldd r26, Y+1 ; 0x01 f8ca: ba 81 ldd r27, Y+2 ; 0x02 f8cc: a0 5c subi r26, 0xC0 ; 192 f8ce: b8 4f sbci r27, 0xF8 ; 248 f8d0: b8 87 std Y+8, r27 ; 0x08 f8d2: af 83 std Y+7, r26 ; 0x07 f8d4: fd 01 movw r30, r26 f8d6: 10 82 st Z, r1 f8d8: 11 82 std Z+1, r1 ; 0x01 f8da: 12 82 std Z+2, r1 ; 0x02 f8dc: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f8de: 0f 94 08 b9 call 0x37210 ; 0x37210 set_destination_to_current(); f8e2: 0e 94 00 69 call 0xd200 ; 0xd200 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f8e6: 63 2d mov r22, r3 f8e8: 03 2c mov r0, r3 f8ea: 00 0c add r0, r0 f8ec: 77 0b sbc r23, r23 f8ee: 88 0b sbc r24, r24 f8f0: 99 0b sbc r25, r25 f8f2: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> f8f6: 4b 01 movw r8, r22 f8f8: 5c 01 movw r10, r24 f8fa: 49 81 ldd r20, Y+1 ; 0x01 f8fc: 5a 81 ldd r21, Y+2 ; 0x02 f8fe: 4f 5a subi r20, 0xAF ; 175 f900: 5a 4f sbci r21, 0xFA ; 250 f902: 58 8b std Y+16, r21 ; 0x10 f904: 4f 87 std Y+15, r20 ; 0x0f f906: 20 e0 ldi r18, 0x00 ; 0 f908: 30 e0 ldi r19, 0x00 ; 0 f90a: 40 e4 ldi r20, 0x40 ; 64 f90c: 50 ec ldi r21, 0xC0 ; 192 f90e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> f912: af 85 ldd r26, Y+15 ; 0x0f f914: b8 89 ldd r27, Y+16 ; 0x10 f916: 6d 93 st X+, r22 f918: 7d 93 st X+, r23 f91a: 8d 93 st X+, r24 f91c: 9c 93 st X, r25 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 15 ba call 0x3742a ; 0x3742a st_synchronize(); f928: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); f92c: 0f 94 2b 64 call 0x2c856 ; 0x2c856 f930: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; f934: ef 81 ldd r30, Y+7 ; 0x07 f936: f8 85 ldd r31, Y+8 ; 0x08 f938: 10 82 st Z, r1 f93a: 11 82 std Z+1, r1 ; 0x01 f93c: 12 82 std Z+2, r1 ; 0x02 f93e: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f940: 0f 94 08 b9 call 0x37210 ; 0x37210 destination[axis] = 1. * axis_home_dir; f944: af 85 ldd r26, Y+15 ; 0x0f f946: b8 89 ldd r27, Y+16 ; 0x10 f948: 8d 92 st X+, r8 f94a: 9d 92 st X+, r9 f94c: ad 92 st X+, r10 f94e: bc 92 st X, r11 f950: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f952: c7 01 movw r24, r14 f954: b6 01 movw r22, r12 f956: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); f95a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 f95e: 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); f962: e9 81 ldd r30, Y+1 ; 0x01 f964: fa 81 ldd r31, Y+2 ; 0x02 f966: e6 5f subi r30, 0xF6 ; 246 f968: f2 48 sbci r31, 0x82 ; 130 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); f96a: 45 90 lpm r4, Z+ f96c: 55 90 lpm r5, Z+ f96e: 65 90 lpm r6, Z+ f970: 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); f972: 2d ec ldi r18, 0xCD ; 205 f974: 3c ec ldi r19, 0xCC ; 204 f976: 4c e8 ldi r20, 0x8C ; 140 f978: 5f e3 ldi r21, 0x3F ; 63 f97a: c5 01 movw r24, r10 f97c: b4 01 movw r22, r8 f97e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> f982: a3 01 movw r20, r6 f984: 92 01 movw r18, r4 f986: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> f98a: ef 85 ldd r30, Y+15 ; 0x0f f98c: f8 89 ldd r31, Y+16 ; 0x10 f98e: 60 83 st Z, r22 f990: 71 83 std Z+1, r23 ; 0x01 f992: 82 83 std Z+2, r24 ; 0x02 f994: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f996: c7 01 movw r24, r14 f998: b6 01 movw r22, r12 f99a: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); f99e: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 f9a2: 71 2c mov r7, r1 f9a4: 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; f9a6: 4f 80 ldd r4, Y+7 ; 0x07 f9a8: 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(); f9aa: 0f 94 2b 64 call 0x2c856 ; 0x2c856 f9ae: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; f9b2: d2 01 movw r26, r4 f9b4: 1d 92 st X+, r1 f9b6: 1d 92 st X+, r1 f9b8: 1d 92 st X+, r1 f9ba: 1c 92 st X, r1 f9bc: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f9be: 0f 94 08 b9 call 0x37210 ; 0x37210 destination[axis] = -10.f * axis_home_dir; f9c2: 20 e0 ldi r18, 0x00 ; 0 f9c4: 30 e0 ldi r19, 0x00 ; 0 f9c6: 40 e2 ldi r20, 0x20 ; 32 f9c8: 51 ec ldi r21, 0xC1 ; 193 f9ca: c5 01 movw r24, r10 f9cc: b4 01 movw r22, r8 f9ce: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> f9d2: ef 85 ldd r30, Y+15 ; 0x0f f9d4: f8 89 ldd r31, Y+16 ; 0x10 f9d6: 60 83 st Z, r22 f9d8: 71 83 std Z+1, r23 ; 0x01 f9da: 82 83 std Z+2, r24 ; 0x02 f9dc: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f9de: c7 01 movw r24, r14 f9e0: b6 01 movw r22, r12 f9e2: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); f9e6: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 endstops_hit_on_purpose(); f9ea: 0f 94 2b 64 call 0x2c856 ; 0x2c856 f9ee: f1 e0 ldi r31, 0x01 ; 1 f9f0: 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; f9f4: 20 e0 ldi r18, 0x00 ; 0 f9f6: 30 e0 ldi r19, 0x00 ; 0 f9f8: 40 e3 ldi r20, 0x30 ; 48 f9fa: 51 e4 ldi r21, 0x41 ; 65 f9fc: c5 01 movw r24, r10 f9fe: b4 01 movw r22, r8 fa00: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> fa04: af 85 ldd r26, Y+15 ; 0x0f fa06: b8 89 ldd r27, Y+16 ; 0x10 fa08: 6d 93 st X+, r22 fa0a: 7d 93 st X+, r23 fa0c: 8d 93 st X+, r24 fa0e: 9c 93 st X, r25 fa10: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; fa12: 8b 81 ldd r24, Y+3 ; 0x03 fa14: 9c 81 ldd r25, Y+4 ; 0x04 fa16: ad 81 ldd r26, Y+5 ; 0x05 fa18: be 81 ldd r27, Y+6 ; 0x06 fa1a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fa1e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fa22: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fa26: 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); fa2a: c7 01 movw r24, r14 fa2c: b6 01 movw r22, r12 fa2e: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); fa32: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); fa36: 82 2d mov r24, r2 fa38: 0f 94 00 3a call 0x27400 ; 0x27400 fa3c: 9c 01 movw r18, r24 fa3e: 44 e0 ldi r20, 0x04 ; 4 fa40: 36 95 lsr r19 fa42: 27 95 ror r18 fa44: 4a 95 dec r20 fa46: e1 f7 brne .-8 ; 0xfa40 if (pstep) pstep[i] = mscnt >> 4; fa48: a9 85 ldd r26, Y+9 ; 0x09 fa4a: ba 85 ldd r27, Y+10 ; 0x0a fa4c: 10 97 sbiw r26, 0x00 ; 0 fa4e: 21 f0 breq .+8 ; 0xfa58 fa50: fd 01 movw r30, r26 fa52: e6 0d add r30, r6 fa54: f7 1d adc r31, r7 fa56: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); fa58: 9f 93 push r25 fa5a: 8f 93 push r24 fa5c: 3f 93 push r19 fa5e: 2f 93 push r18 fa60: 7f 92 push r7 fa62: 6f 92 push r6 fa64: e2 ef ldi r30, 0xF2 ; 242 fa66: fc e7 ldi r31, 0x7C ; 124 fa68: ff 93 push r31 fa6a: ef 93 push r30 fa6c: 0f 94 08 dc call 0x3b810 ; 0x3b810 fa70: 4f ef ldi r20, 0xFF ; 255 fa72: 64 1a sub r6, r20 fa74: 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++) fa76: 0f b6 in r0, 0x3f ; 63 fa78: f8 94 cli fa7a: de bf out 0x3e, r29 ; 62 fa7c: 0f be out 0x3f, r0 ; 63 fa7e: cd bf out 0x3d, r28 ; 61 fa80: 9e 85 ldd r25, Y+14 ; 0x0e fa82: 69 16 cp r6, r25 fa84: 08 f4 brcc .+2 ; 0xfa88 fa86: 91 cf rjmp .-222 ; 0xf9aa 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(); fa88: 0f 94 2b 64 call 0x2c856 ; 0x2c856 fa8c: 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)) fa90: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 fa94: 88 23 and r24, r24 fa96: 09 f4 brne .+2 ; 0xfa9a fa98: b2 c0 rjmp .+356 ; 0xfbfe } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; fa9a: f8 01 movw r30, r16 fa9c: ed 50 subi r30, 0x0D ; 13 fa9e: fb 4f sbci r31, 0xFB ; 251 faa0: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) faa2: 60 34 cpi r22, 0x40 ; 64 faa4: 08 f0 brcs .+2 ; 0xfaa8 faa6: ab c0 rjmp .+342 ; 0xfbfe endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; faa8: f8 01 movw r30, r16 faaa: e6 5a subi r30, 0xA6 ; 166 faac: fd 4f sbci r31, 0xFD ; 253 faae: a0 81 ld r26, Z fab0: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); fab2: f8 01 movw r30, r16 fab4: eb 50 subi r30, 0x0B ; 11 fab6: fb 4f sbci r31, 0xFB ; 251 fab8: 80 81 ld r24, Z faba: 40 e0 ldi r20, 0x00 ; 0 fabc: 51 e0 ldi r21, 0x01 ; 1 fabe: 02 c0 rjmp .+4 ; 0xfac4 fac0: 56 95 lsr r21 fac2: 47 95 ror r20 fac4: 8a 95 dec r24 fac6: e2 f7 brpl .-8 ; 0xfac0 if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); fac8: 82 2d mov r24, r2 faca: 0f 94 2a 8b call 0x31654 ; 0x31654 if (back > 0) face: bb 81 ldd r27, Y+3 ; 0x03 fad0: bb 23 and r27, r27 fad2: 39 f0 breq .+14 ; 0xfae2 tmc2130_do_steps(axis, back, -axis_home_dir, 1000); fad4: 43 2d mov r20, r3 fad6: 41 95 neg r20 fad8: 6b 2f mov r22, r27 fada: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); fadc: 82 2d mov r24, r2 fade: 0f 94 fb 8a call 0x315f6 ; 0x315f6 tmc2130_home_exit(); fae2: 0f 94 34 3b call 0x27668 ; 0x27668 #endif //TMC2130 axis_is_at_home(axis); fae6: 82 2d mov r24, r2 fae8: 0e 94 61 5b call 0xb6c2 ; 0xb6c2 axis_known_position[axis] = true; faec: f8 01 movw r30, r16 faee: e3 5c subi r30, 0xC3 ; 195 faf0: f8 4f sbci r31, 0xF8 ; 248 faf2: 81 e0 ldi r24, 0x01 ; 1 faf4: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; faf6: 6b 85 ldd r22, Y+11 ; 0x0b faf8: 7c 85 ldd r23, Y+12 ; 0x0c fafa: 71 95 neg r23 fafc: 61 95 neg r22 fafe: 71 09 sbc r23, r1 fb00: 07 2e mov r0, r23 fb02: 00 0c add r0, r0 fb04: 88 0b sbc r24, r24 fb06: 99 0b sbc r25, r25 fb08: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> fb0c: 2a e0 ldi r18, 0x0A ; 10 fb0e: 37 ed ldi r19, 0xD7 ; 215 fb10: 43 e2 ldi r20, 0x23 ; 35 fb12: 5c e3 ldi r21, 0x3C ; 60 fb14: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> fb18: 4b 01 movw r8, r22 fb1a: 5c 01 movw r10, r24 fb1c: f8 01 movw r30, r16 fb1e: e8 5a subi r30, 0xA8 ; 168 fb20: fd 4f sbci r31, 0xFD ; 253 fb22: 60 81 ld r22, Z fb24: 70 e0 ldi r23, 0x00 ; 0 fb26: 90 e0 ldi r25, 0x00 ; 0 fb28: 80 e0 ldi r24, 0x00 ; 0 fb2a: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> fb2e: 9b 01 movw r18, r22 fb30: ac 01 movw r20, r24 fb32: c5 01 movw r24, r10 fb34: b4 01 movw r22, r8 fb36: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> fb3a: 4b 01 movw r8, r22 fb3c: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; fb3e: e9 81 ldd r30, Y+1 ; 0x01 fb40: fa 81 ldd r31, Y+2 ; 0x02 fb42: e0 5c subi r30, 0xC0 ; 192 fb44: f8 4f sbci r31, 0xF8 ; 248 fb46: fc 83 std Y+4, r31 ; 0x04 fb48: eb 83 std Y+3, r30 ; 0x03 fb4a: ac 01 movw r20, r24 fb4c: 9b 01 movw r18, r22 fb4e: 60 81 ld r22, Z fb50: 71 81 ldd r23, Z+1 ; 0x01 fb52: 82 81 ldd r24, Z+2 ; 0x02 fb54: 93 81 ldd r25, Z+3 ; 0x03 fb56: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> fb5a: ab 81 ldd r26, Y+3 ; 0x03 fb5c: bc 81 ldd r27, Y+4 ; 0x04 fb5e: 6d 93 st X+, r22 fb60: 7d 93 st X+, r23 fb62: 8d 93 st X+, r24 fb64: 9c 93 st X, r25 fb66: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); fb68: 0f 94 08 b9 call 0x37210 ; 0x37210 current_position[axis] += dist; fb6c: eb 81 ldd r30, Y+3 ; 0x03 fb6e: fc 81 ldd r31, Y+4 ; 0x04 fb70: 20 81 ld r18, Z fb72: 31 81 ldd r19, Z+1 ; 0x01 fb74: 42 81 ldd r20, Z+2 ; 0x02 fb76: 53 81 ldd r21, Z+3 ; 0x03 fb78: c5 01 movw r24, r10 fb7a: b4 01 movw r22, r8 fb7c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> fb80: ab 81 ldd r26, Y+3 ; 0x03 fb82: bc 81 ldd r27, Y+4 ; 0x04 fb84: 6d 93 st X+, r22 fb86: 7d 93 st X+, r23 fb88: 8d 93 st X+, r24 fb8a: 9c 93 st X, r25 fb8c: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; fb8e: e9 81 ldd r30, Y+1 ; 0x01 fb90: fa 81 ldd r31, Y+2 ; 0x02 fb92: ef 5a subi r30, 0xAF ; 175 fb94: fa 4f sbci r31, 0xFA ; 250 fb96: 60 83 st Z, r22 fb98: 71 83 std Z+1, r23 ; 0x01 fb9a: 82 83 std Z+2, r24 ; 0x02 fb9c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); fb9e: 20 e0 ldi r18, 0x00 ; 0 fba0: 30 e0 ldi r19, 0x00 ; 0 fba2: 40 e0 ldi r20, 0x00 ; 0 fba4: 5f e3 ldi r21, 0x3F ; 63 fba6: c7 01 movw r24, r14 fba8: b6 01 movw r22, r12 fbaa: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> fbae: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); fbb2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 feedrate = 0.0; fbb6: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fbba: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fbbe: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fbc2: 10 92 93 02 sts 0x0293, r1 ; 0x800293 fbc6: fd 85 ldd r31, Y+13 ; 0x0d fbc8: f0 93 8f 02 sts 0x028F, r31 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } fbcc: 60 96 adiw r28, 0x10 ; 16 fbce: 0f b6 in r0, 0x3f ; 63 fbd0: f8 94 cli fbd2: de bf out 0x3e, r29 ; 62 fbd4: 0f be out 0x3f, r0 ; 63 fbd6: cd bf out 0x3d, r28 ; 61 fbd8: df 91 pop r29 fbda: cf 91 pop r28 fbdc: 1f 91 pop r17 fbde: 0f 91 pop r16 fbe0: ff 90 pop r15 fbe2: ef 90 pop r14 fbe4: df 90 pop r13 fbe6: cf 90 pop r12 fbe8: bf 90 pop r11 fbea: af 90 pop r10 fbec: 9f 90 pop r9 fbee: 8f 90 pop r8 fbf0: 7f 90 pop r7 fbf2: 6f 90 pop r6 fbf4: 5f 90 pop r5 fbf6: 4f 90 pop r4 fbf8: 3f 90 pop r3 fbfa: 2f 90 pop r2 fbfc: 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); fbfe: 43 2d mov r20, r3 fc00: 41 95 neg r20 fc02: 68 e0 ldi r22, 0x08 ; 8 fc04: 70 e0 ldi r23, 0x00 ; 0 fc06: 6a cf rjmp .-300 ; 0xfadc feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; fc08: 81 e0 ldi r24, 0x01 ; 1 fc0a: 0e 94 76 67 call 0xceec ; 0xceec #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); fc0e: e8 e1 ldi r30, 0x18 ; 24 fc10: fd e7 ldi r31, 0x7D ; 125 fc12: b4 91 lpm r27, Z fc14: 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; fc16: 10 92 48 07 sts 0x0748, r1 ; 0x800748 fc1a: 10 92 49 07 sts 0x0749, r1 ; 0x800749 fc1e: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a fc22: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b plan_set_position_curposXYZE(); fc26: 0f 94 08 b9 call 0x37210 ; 0x37210 #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); fc2a: e2 e1 ldi r30, 0x12 ; 18 fc2c: fd e7 ldi r31, 0x7D ; 125 fc2e: 85 90 lpm r8, Z+ fc30: 95 90 lpm r9, Z+ fc32: a5 90 lpm r10, Z+ fc34: 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; fc36: e9 81 ldd r30, Y+1 ; 0x01 fc38: 6e 2f mov r22, r30 fc3a: ee 0f add r30, r30 fc3c: 77 0b sbc r23, r23 fc3e: 88 0b sbc r24, r24 fc40: 99 0b sbc r25, r25 fc42: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> fc46: 6b 01 movw r12, r22 fc48: 7c 01 movw r14, r24 fc4a: 20 e0 ldi r18, 0x00 ; 0 fc4c: 30 e0 ldi r19, 0x00 ; 0 fc4e: 40 ec ldi r20, 0xC0 ; 192 fc50: 5f e3 ldi r21, 0x3F ; 63 fc52: c5 01 movw r24, r10 fc54: b4 01 movw r22, r8 fc56: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> fc5a: a7 01 movw r20, r14 fc5c: 96 01 movw r18, r12 fc5e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> fc62: 60 93 59 05 sts 0x0559, r22 ; 0x800559 fc66: 70 93 5a 05 sts 0x055A, r23 ; 0x80055a fc6a: 80 93 5b 05 sts 0x055B, r24 ; 0x80055b fc6e: 90 93 5c 05 sts 0x055C, r25 ; 0x80055c feedrate = homing_feedrate[axis]; fc72: 80 e0 ldi r24, 0x00 ; 0 fc74: 90 e0 ldi r25, 0x00 ; 0 fc76: a8 e4 ldi r26, 0x48 ; 72 fc78: b4 e4 ldi r27, 0x44 ; 68 fc7a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fc7e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fc82: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fc86: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); fc8a: bc 01 movw r22, r24 fc8c: cd 01 movw r24, r26 fc8e: 0e 94 8d 67 call 0xcf1a ; 0xcf1a fc92: 4b 01 movw r8, r22 fc94: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); fc96: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); fc9a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 #ifdef TMC2130 check_Z_crash(); fc9e: 0e 94 cd 7b call 0xf79a ; 0xf79a #endif //TMC2130 current_position[axis] = 0; fca2: 10 92 48 07 sts 0x0748, r1 ; 0x800748 fca6: 10 92 49 07 sts 0x0749, r1 ; 0x800749 fcaa: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a fcae: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b plan_set_position_curposXYZE(); fcb2: 0f 94 08 b9 call 0x37210 ; 0x37210 #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: ee ee ldi r30, 0xEE ; 238 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 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; plan_set_position_curposXYZE(); destination[axis] = -home_retract_mm(axis) * axis_home_dir; fcc2: 90 58 subi r25, 0x80 ; 128 fcc4: a7 01 movw r20, r14 fcc6: 96 01 movw r18, r12 fcc8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> fccc: 60 93 59 05 sts 0x0559, r22 ; 0x800559 fcd0: 70 93 5a 05 sts 0x055A, r23 ; 0x80055a fcd4: 80 93 5b 05 sts 0x055B, r24 ; 0x80055b fcd8: 90 93 5c 05 sts 0x055C, r25 ; 0x80055c plan_buffer_line_destinationXYZE(feedrate_mm_s); fcdc: c5 01 movw r24, r10 fcde: b4 01 movw r22, r8 fce0: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); fce4: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 #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); fce8: ee ee ldi r30, 0xEE ; 238 fcea: fc e7 ldi r31, 0x7C ; 124 fcec: 65 91 lpm r22, Z+ fcee: 75 91 lpm r23, Z+ fcf0: 85 91 lpm r24, Z+ fcf2: 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; fcf4: 9b 01 movw r18, r22 fcf6: ac 01 movw r20, r24 fcf8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> fcfc: a7 01 movw r20, r14 fcfe: 96 01 movw r18, r12 fd00: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> fd04: 60 93 59 05 sts 0x0559, r22 ; 0x800559 fd08: 70 93 5a 05 sts 0x055A, r23 ; 0x80055a fd0c: 80 93 5b 05 sts 0x055B, r24 ; 0x80055b fd10: 90 93 5c 05 sts 0x055C, r25 ; 0x80055c feedrate = homing_feedrate[axis] / 2; fd14: 80 e0 ldi r24, 0x00 ; 0 fd16: 90 e0 ldi r25, 0x00 ; 0 fd18: a8 ec ldi r26, 0xC8 ; 200 fd1a: b3 e4 ldi r27, 0x43 ; 67 fd1c: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fd20: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fd24: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fd28: b0 93 93 02 sts 0x0293, r27 ; 0x800293 feedrate_mm_s = get_feedrate_mm_s(feedrate); fd2c: bc 01 movw r22, r24 fd2e: cd 01 movw r24, r26 fd30: 0e 94 8d 67 call 0xcf1a ; 0xcf1a plan_buffer_line_destinationXYZE(feedrate_mm_s); fd34: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); fd38: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 #ifdef TMC2130 check_Z_crash(); fd3c: 0e 94 cd 7b call 0xf79a ; 0xf79a #endif //TMC2130 axis_is_at_home(axis); fd40: 82 e0 ldi r24, 0x02 ; 2 fd42: 0e 94 61 5b call 0xb6c2 ; 0xb6c2 destination[axis] = current_position[axis]; fd46: 80 91 48 07 lds r24, 0x0748 ; 0x800748 fd4a: 90 91 49 07 lds r25, 0x0749 ; 0x800749 fd4e: a0 91 4a 07 lds r26, 0x074A ; 0x80074a fd52: b0 91 4b 07 lds r27, 0x074B ; 0x80074b fd56: 80 93 59 05 sts 0x0559, r24 ; 0x800559 fd5a: 90 93 5a 05 sts 0x055A, r25 ; 0x80055a fd5e: a0 93 5b 05 sts 0x055B, r26 ; 0x80055b fd62: b0 93 5c 05 sts 0x055C, r27 ; 0x80055c feedrate = 0.0; fd66: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fd6a: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fd6e: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fd72: 10 92 93 02 sts 0x0293, r1 ; 0x800293 endstops_hit_on_purpose(); fd76: 0f 94 2b 64 call 0x2c856 ; 0x2c856 axis_known_position[axis] = true; fd7a: 70 92 3f 07 sts 0x073F, r7 ; 0x80073f #ifdef TMC2130 FORCE_HIGH_POWER_END; fd7e: 80 e0 ldi r24, 0x00 ; 0 fd80: 0e 94 76 67 call 0xceec ; 0xceec fd84: 20 cf rjmp .-448 ; 0xfbc6 0000fd86 : #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 { fd86: 2f 92 push r2 fd88: 3f 92 push r3 fd8a: 4f 92 push r4 fd8c: 5f 92 push r5 fd8e: 6f 92 push r6 fd90: 7f 92 push r7 fd92: 8f 92 push r8 fd94: 9f 92 push r9 fd96: af 92 push r10 fd98: bf 92 push r11 fd9a: cf 92 push r12 fd9c: df 92 push r13 fd9e: ef 92 push r14 fda0: ff 92 push r15 fda2: 0f 93 push r16 fda4: 1f 93 push r17 fda6: cf 93 push r28 fda8: df 93 push r29 fdaa: 00 d0 rcall .+0 ; 0xfdac fdac: 1f 92 push r1 fdae: 1f 92 push r1 fdb0: cd b7 in r28, 0x3d ; 61 fdb2: de b7 in r29, 0x3e ; 62 fdb4: d8 2e mov r13, r24 fdb6: 2a 01 movw r4, r20 fdb8: 3b 01 movw r6, r22 fdba: 32 2e mov r3, r18 fdbc: e9 82 std Y+1, r14 ; 0x01 fdbe: fa 82 std Y+2, r15 ; 0x02 fdc0: 0b 83 std Y+3, r16 ; 0x03 fdc2: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); fdc4: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 homing_flag = true; fdc8: 81 e0 ldi r24, 0x01 ; 1 fdca: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 bool home_x = home_x_axis; bool home_y = home_y_axis; bool home_z = home_z_axis; // Either all X,Y,Z codes are present, or none of them. bool home_all_axes = home_x == home_y && home_x == home_z; fdce: fc 2c mov r15, r12 fdd0: e3 2c mov r14, r3 fdd2: d3 10 cpse r13, r3 fdd4: 10 c0 rjmp .+32 ; 0xfdf6 fdd6: ed 2c mov r14, r13 fdd8: dc 10 cpse r13, r12 fdda: 0d c0 rjmp .+26 ; 0xfdf6 // 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); fddc: 60 e0 ldi r22, 0x00 ; 0 fdde: 70 e0 ldi r23, 0x00 ; 0 fde0: 80 ea ldi r24, 0xA0 ; 160 fde2: 90 e4 ldi r25, 0x40 ; 64 fde4: 0e 94 26 6f call 0xde4c ; 0xde4c // 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; fde8: ff 24 eor r15, r15 fdea: f3 94 inc r15 fdec: ee 24 eor r14, r14 fdee: e3 94 inc r14 fdf0: 22 24 eor r2, r2 fdf2: 23 94 inc r2 fdf4: 01 c0 rjmp .+2 ; 0xfdf8 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; fdf6: 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(); fdf8: 0f 94 65 cb call 0x396ca ; 0x396ca // 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; fdfc: 80 91 9d 13 lds r24, 0x139D ; 0x80139d fe00: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; fe02: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); fe06: 82 e0 ldi r24, 0x02 ; 2 fe08: 0f 94 cd 58 call 0x2b19a ; 0x2b19a fe0c: 60 93 48 07 sts 0x0748, r22 ; 0x800748 fe10: 70 93 49 07 sts 0x0749, r23 ; 0x800749 fe14: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a fe18: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) fe1c: f1 10 cpse r15, r1 babystep_undo(); fe1e: 0f 94 0a c7 call 0x38e14 ; 0x38e14 int l_feedmultiply = setup_for_endstop_move(); fe22: 81 e0 ldi r24, 0x01 ; 1 fe24: 0e 94 ae 67 call 0xcf5c ; 0xcf5c fe28: 8c 01 movw r16, r24 set_destination_to_current(); fe2a: 0e 94 00 69 call 0xd200 ; 0xd200 feedrate = 0.0; fe2e: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fe32: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fe36: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fe3a: 10 92 93 02 sts 0x0293, r1 ; 0x800293 current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) fe3e: 22 20 and r2, r2 fe40: 09 f4 brne .+2 ; 0xfe44 fe42: 77 c1 rjmp .+750 ; 0x10132 { if (!calib) fe44: 9b 8d ldd r25, Y+27 ; 0x1b fe46: 91 11 cpse r25, r1 fe48: 6a c1 rjmp .+724 ; 0x1011e homeaxis(X_AXIS); fe4a: 50 e0 ldi r21, 0x00 ; 0 fe4c: 40 e0 ldi r20, 0x00 ; 0 fe4e: 61 e0 ldi r22, 0x01 ; 1 fe50: 80 e0 ldi r24, 0x00 ; 0 fe52: 0e 94 07 7c call 0xf80e ; 0xf80e else tmc2130_home_calibrate(X_AXIS); } if(home_y) fe56: ee 20 and r14, r14 fe58: 31 f0 breq .+12 ; 0xfe66 { if (!calib) homeaxis(Y_AXIS); fe5a: 50 e0 ldi r21, 0x00 ; 0 fe5c: 40 e0 ldi r20, 0x00 ; 0 fe5e: 61 e0 ldi r22, 0x01 ; 1 fe60: 81 e0 ldi r24, 0x01 ; 1 fe62: 0e 94 07 7c call 0xf80e ; 0xf80e if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) fe66: dd 20 and r13, r13 fe68: e9 f0 breq .+58 ; 0xfea4 fe6a: 41 14 cp r4, r1 fe6c: 51 04 cpc r5, r1 fe6e: 61 04 cpc r6, r1 fe70: 71 04 cpc r7, r1 fe72: c1 f0 breq .+48 ; 0xfea4 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; fe74: c3 01 movw r24, r6 fe76: b2 01 movw r22, r4 fe78: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> fe7c: 9b 01 movw r18, r22 fe7e: ac 01 movw r20, r24 fe80: 60 91 c3 06 lds r22, 0x06C3 ; 0x8006c3 fe84: 70 91 c4 06 lds r23, 0x06C4 ; 0x8006c4 fe88: 80 91 c5 06 lds r24, 0x06C5 ; 0x8006c5 fe8c: 90 91 c6 06 lds r25, 0x06C6 ; 0x8006c6 fe90: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> fe94: 60 93 40 07 sts 0x0740, r22 ; 0x800740 fe98: 70 93 41 07 sts 0x0741, r23 ; 0x800741 fe9c: 80 93 42 07 sts 0x0742, r24 ; 0x800742 fea0: 90 93 43 07 sts 0x0743, r25 ; 0x800743 if(home_y_axis && home_y_value != 0) fea4: 33 20 and r3, r3 fea6: 01 f1 breq .+64 ; 0xfee8 fea8: 89 81 ldd r24, Y+1 ; 0x01 feaa: 9a 81 ldd r25, Y+2 ; 0x02 feac: ab 81 ldd r26, Y+3 ; 0x03 feae: bc 81 ldd r27, Y+4 ; 0x04 feb0: 00 97 sbiw r24, 0x00 ; 0 feb2: a1 05 cpc r26, r1 feb4: b1 05 cpc r27, r1 feb6: c1 f0 breq .+48 ; 0xfee8 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; feb8: bc 01 movw r22, r24 feba: cd 01 movw r24, r26 febc: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> fec0: 9b 01 movw r18, r22 fec2: ac 01 movw r20, r24 fec4: 60 91 c7 06 lds r22, 0x06C7 ; 0x8006c7 fec8: 70 91 c8 06 lds r23, 0x06C8 ; 0x8006c8 fecc: 80 91 c9 06 lds r24, 0x06C9 ; 0x8006c9 fed0: 90 91 ca 06 lds r25, 0x06CA ; 0x8006ca fed4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> fed8: 60 93 44 07 sts 0x0744, r22 ; 0x800744 fedc: 70 93 45 07 sts 0x0745, r23 ; 0x800745 fee0: 80 93 46 07 sts 0x0746, r24 ; 0x800746 fee4: 90 93 47 07 sts 0x0747, r25 ; 0x800747 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { fee8: ff 20 and r15, r15 feea: 09 f4 brne .+2 ; 0xfeee feec: a2 c0 rjmp .+324 ; 0x10032 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); feee: 60 e0 ldi r22, 0x00 ; 0 fef0: 70 e0 ldi r23, 0x00 ; 0 fef2: 80 ea ldi r24, 0xA0 ; 160 fef4: 90 e4 ldi r25, 0x40 ; 64 fef6: 0e 94 26 6f call 0xde4c ; 0xde4c if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); fefa: 80 91 3d 07 lds r24, 0x073D ; 0x80073d fefe: 81 11 cpse r24, r1 ff00: 05 c0 rjmp .+10 ; 0xff0c ff02: 50 e0 ldi r21, 0x00 ; 0 ff04: 40 e0 ldi r20, 0x00 ; 0 ff06: 61 e0 ldi r22, 0x01 ; 1 ff08: 0e 94 07 7c call 0xf80e ; 0xf80e if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); ff0c: 80 91 3e 07 lds r24, 0x073E ; 0x80073e ff10: 81 11 cpse r24, r1 ff12: 06 c0 rjmp .+12 ; 0xff20 ff14: 50 e0 ldi r21, 0x00 ; 0 ff16: 40 e0 ldi r20, 0x00 ; 0 ff18: 61 e0 ldi r22, 0x01 ; 1 ff1a: 81 e0 ldi r24, 0x01 ; 1 ff1c: 0e 94 07 7c call 0xf80e ; 0xf80e // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); ff20: 0f 94 ca cb call 0x39794 ; 0x39794 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); ff24: e4 e5 ldi r30, 0x54 ; 84 ff26: f2 e9 ldi r31, 0x92 ; 146 ff28: 85 91 lpm r24, Z+ ff2a: 95 91 lpm r25, Z+ ff2c: a5 91 lpm r26, Z+ ff2e: b4 91 lpm r27, Z ff30: e0 e5 ldi r30, 0x50 ; 80 ff32: f2 e9 ldi r31, 0x92 ; 146 ff34: 45 91 lpm r20, Z+ ff36: 55 91 lpm r21, Z+ ff38: 65 91 lpm r22, Z+ ff3a: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; ff3c: 40 93 51 05 sts 0x0551, r20 ; 0x800551 ff40: 50 93 52 05 sts 0x0552, r21 ; 0x800552 ff44: 60 93 53 05 sts 0x0553, r22 ; 0x800553 ff48: 70 93 54 05 sts 0x0554, r23 ; 0x800554 out_y = y; ff4c: 80 93 55 05 sts 0x0555, r24 ; 0x800555 ff50: 90 93 56 05 sts 0x0556, r25 ; 0x800556 ff54: a0 93 57 05 sts 0x0557, r26 ; 0x800557 ff58: b0 93 58 05 sts 0x0558, r27 ; 0x800558 world2machine(out_x, out_y); ff5c: 65 e5 ldi r22, 0x55 ; 85 ff5e: 75 e0 ldi r23, 0x05 ; 5 ff60: 81 e5 ldi r24, 0x51 ; 81 ff62: 95 e0 ldi r25, 0x05 ; 5 ff64: 0e 94 c8 6a call 0xd590 ; 0xd590 world2machine_reset(); ff68: 0f 94 2c cb call 0x39658 ; 0x39658 if (destination[Y_AXIS] < Y_MIN_POS) ff6c: 20 e0 ldi r18, 0x00 ; 0 ff6e: 30 e0 ldi r19, 0x00 ; 0 ff70: 40 e8 ldi r20, 0x80 ; 128 ff72: 50 ec ldi r21, 0xC0 ; 192 ff74: 60 91 55 05 lds r22, 0x0555 ; 0x800555 ff78: 70 91 56 05 lds r23, 0x0556 ; 0x800556 ff7c: 80 91 57 05 lds r24, 0x0557 ; 0x800557 ff80: 90 91 58 05 lds r25, 0x0558 ; 0x800558 ff84: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> ff88: 87 ff sbrs r24, 7 ff8a: 0c c0 rjmp .+24 ; 0xffa4 destination[Y_AXIS] = Y_MIN_POS; ff8c: 80 e0 ldi r24, 0x00 ; 0 ff8e: 90 e0 ldi r25, 0x00 ; 0 ff90: a0 e8 ldi r26, 0x80 ; 128 ff92: b0 ec ldi r27, 0xC0 ; 192 ff94: 80 93 55 05 sts 0x0555, r24 ; 0x800555 ff98: 90 93 56 05 sts 0x0556, r25 ; 0x800556 ff9c: a0 93 57 05 sts 0x0557, r26 ; 0x800557 ffa0: b0 93 58 05 sts 0x0558, r27 ; 0x800558 feedrate = homing_feedrate[X_AXIS] / 20; ffa4: 80 e0 ldi r24, 0x00 ; 0 ffa6: 90 e0 ldi r25, 0x00 ; 0 ffa8: a6 e1 ldi r26, 0x16 ; 22 ffaa: b3 e4 ldi r27, 0x43 ; 67 ffac: 80 93 90 02 sts 0x0290, r24 ; 0x800290 ffb0: 90 93 91 02 sts 0x0291, r25 ; 0x800291 ffb4: a0 93 92 02 sts 0x0292, r26 ; 0x800292 ffb8: b0 93 93 02 sts 0x0293, r27 ; 0x800293 ffbc: 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(); ffc0: 0f 94 08 b9 call 0x37210 ; 0x37210 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); ffc4: 60 91 90 02 lds r22, 0x0290 ; 0x800290 ffc8: 70 91 91 02 lds r23, 0x0291 ; 0x800291 ffcc: 80 91 92 02 lds r24, 0x0292 ; 0x800292 ffd0: 90 91 93 02 lds r25, 0x0293 ; 0x800293 ffd4: 0f 94 15 ba call 0x3742a ; 0x3742a st_synchronize(); ffd8: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position[X_AXIS] = destination[X_AXIS]; ffdc: 80 91 51 05 lds r24, 0x0551 ; 0x800551 ffe0: 90 91 52 05 lds r25, 0x0552 ; 0x800552 ffe4: a0 91 53 05 lds r26, 0x0553 ; 0x800553 ffe8: b0 91 54 05 lds r27, 0x0554 ; 0x800554 ffec: 80 93 40 07 sts 0x0740, r24 ; 0x800740 fff0: 90 93 41 07 sts 0x0741, r25 ; 0x800741 fff4: a0 93 42 07 sts 0x0742, r26 ; 0x800742 fff8: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = destination[Y_AXIS]; fffc: 80 91 55 05 lds r24, 0x0555 ; 0x800555 10000: 90 91 56 05 lds r25, 0x0556 ; 0x800556 10004: a0 91 57 05 lds r26, 0x0557 ; 0x800557 10008: b0 91 58 05 lds r27, 0x0558 ; 0x800558 1000c: 80 93 44 07 sts 0x0744, r24 ; 0x800744 10010: 90 93 45 07 sts 0x0745, r25 ; 0x800745 10014: a0 93 46 07 sts 0x0746, r26 ; 0x800746 10018: b0 93 47 07 sts 0x0747, r27 ; 0x800747 1001c: 81 e0 ldi r24, 0x01 ; 1 1001e: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); endstops_hit_on_purpose(); 10022: 0f 94 2b 64 call 0x2c856 ; 0x2c856 homeaxis(Z_AXIS); 10026: 50 e0 ldi r21, 0x00 ; 0 10028: 40 e0 ldi r20, 0x00 ; 0 1002a: 61 e0 ldi r22, 0x01 ; 1 1002c: 82 e0 ldi r24, 0x02 ; 2 1002e: 0e 94 07 7c call 0xf80e ; 0xf80e homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) 10032: cc 20 and r12, r12 10034: e9 f0 breq .+58 ; 0x10070 10036: 81 14 cp r8, r1 10038: 91 04 cpc r9, r1 1003a: a1 04 cpc r10, r1 1003c: b1 04 cpc r11, r1 1003e: c1 f0 breq .+48 ; 0x10070 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; 10040: c5 01 movw r24, r10 10042: b4 01 movw r22, r8 10044: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 10048: 9b 01 movw r18, r22 1004a: ac 01 movw r20, r24 1004c: 60 91 cb 06 lds r22, 0x06CB ; 0x8006cb 10050: 70 91 cc 06 lds r23, 0x06CC ; 0x8006cc 10054: 80 91 cd 06 lds r24, 0x06CD ; 0x8006cd 10058: 90 91 ce 06 lds r25, 0x06CE ; 0x8006ce 1005c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 10060: 60 93 48 07 sts 0x0748, r22 ; 0x800748 10064: 70 93 49 07 sts 0x0749, r23 ; 0x800749 10068: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 1006c: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b // Set the planner and stepper routine positions. // At this point the mesh bed leveling and world2machine corrections are disabled and current_position // contains the machine coordinates. plan_set_position_curposXYZE(); 10070: 0f 94 08 b9 call 0x37210 ; 0x37210 clean_up_after_endstop_move(l_feedmultiply); 10074: c8 01 movw r24, r16 10076: 0e 94 94 67 call 0xcf28 ; 0xcf28 endstops_hit_on_purpose(); 1007a: 0f 94 2b 64 call 0x2c856 ; 0x2c856 // Load the machine correction matrix world2machine_initialize(); 1007e: 0f 94 ca cb call 0x39794 ; 0x39794 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); 10082: 0f 94 68 c9 call 0x392d0 ; 0x392d0 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) 10086: d1 10 cpse r13, r1 10088: 07 c0 rjmp .+14 ; 0x10098 1008a: 31 10 cpse r3, r1 1008c: 05 c0 rjmp .+10 ; 0x10098 1008e: 8c 8d ldd r24, Y+28 ; 0x1c 10090: 81 11 cpse r24, r1 10092: 02 c0 rjmp .+4 ; 0x10098 10094: cc 20 and r12, r12 10096: 39 f1 breq .+78 ; 0x100e6 { if (! home_z && mbl_was_active) { 10098: f1 10 cpse r15, r1 1009a: 25 c0 rjmp .+74 ; 0x100e6 1009c: 9d 81 ldd r25, Y+5 ; 0x05 1009e: 99 23 and r25, r25 100a0: 11 f1 breq .+68 ; 0x100e6 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; 100a2: 81 e0 ldi r24, 0x01 ; 1 100a4: 80 93 9d 13 sts 0x139D, r24 ; 0x80139d // and re-adjust the current logical Z axis with the bed leveling offset applicable at the current XY position. current_position[Z_AXIS] -= mbl.get_z(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS)); 100a8: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 100ac: 6b 01 movw r12, r22 100ae: 7c 01 movw r14, r24 100b0: 80 e0 ldi r24, 0x00 ; 0 100b2: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 100b6: a7 01 movw r20, r14 100b8: 96 01 movw r18, r12 100ba: 0f 94 08 96 call 0x32c10 ; 0x32c10 100be: 9b 01 movw r18, r22 100c0: ac 01 movw r20, r24 100c2: 60 91 48 07 lds r22, 0x0748 ; 0x800748 100c6: 70 91 49 07 lds r23, 0x0749 ; 0x800749 100ca: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 100ce: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 100d2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 100d6: 60 93 48 07 sts 0x0748, r22 ; 0x800748 100da: 70 93 49 07 sts 0x0749, r23 ; 0x800749 100de: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 100e2: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b } #endif prusa_statistics(20); st_synchronize(); 100e6: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 homing_flag = false; 100ea: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 #if 0 SERIAL_ECHOPGM("G28, final "); print_world_coordinates(); SERIAL_ECHOPGM("G28, final "); print_physical_coordinates(); SERIAL_ECHOPGM("G28, final "); print_mesh_bed_leveling_table(); #endif } 100ee: 0f 90 pop r0 100f0: 0f 90 pop r0 100f2: 0f 90 pop r0 100f4: 0f 90 pop r0 100f6: 0f 90 pop r0 100f8: df 91 pop r29 100fa: cf 91 pop r28 100fc: 1f 91 pop r17 100fe: 0f 91 pop r16 10100: ff 90 pop r15 10102: ef 90 pop r14 10104: df 90 pop r13 10106: cf 90 pop r12 10108: bf 90 pop r11 1010a: af 90 pop r10 1010c: 9f 90 pop r9 1010e: 8f 90 pop r8 10110: 7f 90 pop r7 10112: 6f 90 pop r6 10114: 5f 90 pop r5 10116: 4f 90 pop r4 10118: 3f 90 pop r3 1011a: 2f 90 pop r2 1011c: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); 1011e: 80 e0 ldi r24, 0x00 ; 0 10120: 0f 94 26 38 call 0x2704c ; 0x2704c } if(home_y) 10124: ee 20 and r14, r14 10126: 09 f4 brne .+2 ; 0x1012a 10128: 9e ce rjmp .-708 ; 0xfe66 { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); 1012a: 81 e0 ldi r24, 0x01 ; 1 1012c: 0f 94 26 38 call 0x2704c ; 0x2704c 10130: 9a ce rjmp .-716 ; 0xfe66 homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) 10132: ee 20 and r14, r14 10134: 09 f4 brne .+2 ; 0x10138 10136: 97 ce rjmp .-722 ; 0xfe66 { if (!calib) 10138: ab 8d ldd r26, Y+27 ; 0x1b 1013a: aa 23 and r26, r26 1013c: 09 f4 brne .+2 ; 0x10140 1013e: 8d ce rjmp .-742 ; 0xfe5a 10140: f4 cf rjmp .-24 ; 0x1012a 00010142 : 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) { 10142: 8f 92 push r8 10144: 9f 92 push r9 10146: af 92 push r10 10148: bf 92 push r11 1014a: cf 92 push r12 1014c: ef 92 push r14 1014e: ff 92 push r15 10150: 0f 93 push r16 10152: 1f 93 push r17 10154: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); 10156: 91 e0 ldi r25, 0x01 ; 1 10158: 9f 93 push r25 1015a: 1f 92 push r1 1015c: 81 2c mov r8, r1 1015e: 91 2c mov r9, r1 10160: 54 01 movw r10, r8 10162: c4 2e mov r12, r20 10164: e1 2c mov r14, r1 10166: f1 2c mov r15, r1 10168: 87 01 movw r16, r14 1016a: 40 e0 ldi r20, 0x00 ; 0 1016c: 50 e0 ldi r21, 0x00 ; 0 1016e: ba 01 movw r22, r20 10170: 0e 94 c3 7e call 0xfd86 ; 0xfd86 10174: 0f 90 pop r0 10176: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } 10178: 1f 91 pop r17 1017a: 0f 91 pop r16 1017c: ff 90 pop r15 1017e: ef 90 pop r14 10180: cf 90 pop r12 10182: bf 90 pop r11 10184: af 90 pop r10 10186: 9f 90 pop r9 10188: 8f 90 pop r8 1018a: 08 95 ret 0001018c : // 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(); 1018c: 84 e8 ldi r24, 0x84 ; 132 1018e: 93 e0 ldi r25, 0x03 ; 3 10190: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) 10194: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 10198: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 1019c: 89 2b or r24, r25 1019e: 79 f0 breq .+30 ; 0x101be 101a0: e0 91 6d 12 lds r30, 0x126D ; 0x80126d 101a4: f0 91 6e 12 lds r31, 0x126E ; 0x80126e 101a8: e0 58 subi r30, 0x80 ; 128 101aa: ff 4e sbci r31, 0xEF ; 239 101ac: 80 81 ld r24, Z 101ae: 81 30 cpi r24, 0x01 ; 1 101b0: 11 f0 breq .+4 ; 0x101b6 101b2: 86 30 cpi r24, 0x06 ; 6 101b4: 21 f4 brne .+8 ; 0x101be SERIAL_PROTOCOLLNRPGM(MSG_OK); 101b6: 84 e4 ldi r24, 0x44 ; 68 101b8: 9e e6 ldi r25, 0x6E ; 110 101ba: 0c 94 17 7b jmp 0xf62e ; 0xf62e } 101be: 08 95 ret 000101c0 : void cmdqueue_reset() { while (buflen) 101c0: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 101c4: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 101c8: 89 2b or r24, r25 101ca: 29 f0 breq .+10 ; 0x101d6 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); 101cc: 0e 94 c6 80 call 0x1018c ; 0x1018c cmdqueue_pop_front(); 101d0: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 101d4: f5 cf rjmp .-22 ; 0x101c0 } bufindr = 0; 101d6: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 101da: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d bufindw = 0; 101de: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 101e2: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.570> //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; 101e6: 81 e0 ldi r24, 0x01 ; 1 101e8: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d } 101ec: 08 95 ret 000101ee : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { 101ee: ef 92 push r14 101f0: ff 92 push r15 101f2: 0f 93 push r16 101f4: 1f 93 push r17 101f6: cf 93 push r28 101f8: df 93 push r29 if (mbl.active) { 101fa: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 101fe: 88 23 and r24, r24 10200: 89 f1 breq .+98 ; 0x10264 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); 10202: 82 e0 ldi r24, 0x02 ; 2 10204: 9e e7 ldi r25, 0x7E ; 126 10206: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); 1020a: 8c ee ldi r24, 0xEC ; 236 1020c: 9d e7 ldi r25, 0x7D ; 125 1020e: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLLNPGM("Measured points:"); 10212: 8b ed ldi r24, 0xDB ; 219 10214: 9d e7 ldi r25, 0x7D ; 125 10216: 0e 94 17 7b call 0xf62e ; 0xf62e for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { 1021a: c7 e0 ldi r28, 0x07 ; 7 1021c: dc e1 ldi r29, 0x1C ; 28 1021e: c1 50 subi r28, 0x01 ; 1 10220: 58 f1 brcs .+86 ; 0x10278 10222: cd 9f mul r28, r29 10224: 70 01 movw r14, r0 10226: 11 24 eor r1, r1 10228: 01 e0 ldi r16, 0x01 ; 1 1022a: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); 1022c: 88 ed ldi r24, 0xD8 ; 216 1022e: 9d e7 ldi r25, 0x7D ; 125 10230: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOL_F(z_values[y][x], 5); 10234: f8 01 movw r30, r16 10236: ee 0f add r30, r30 10238: ff 1f adc r31, r31 1023a: ee 0f add r30, r30 1023c: ff 1f adc r31, r31 1023e: ee 0d add r30, r14 10240: ff 1d adc r31, r15 10242: e6 56 subi r30, 0x66 ; 102 10244: fc 4e sbci r31, 0xEC ; 236 10246: 60 81 ld r22, Z 10248: 71 81 ldd r23, Z+1 ; 0x01 1024a: 82 81 ldd r24, Z+2 ; 0x02 1024c: 93 81 ldd r25, Z+3 ; 0x03 1024e: 45 e0 ldi r20, 0x05 ; 5 10250: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 10254: 0f 5f subi r16, 0xFF ; 255 10256: 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++) { 10258: 08 30 cpi r16, 0x08 ; 8 1025a: 11 05 cpc r17, r1 1025c: 39 f7 brne .-50 ; 0x1022c SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); 1025e: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 10262: dd cf rjmp .-70 ; 0x1021e mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10264: 8f e0 ldi r24, 0x0F ; 15 10266: 9e e7 ldi r25, 0x7E ; 126 return; } 10268: df 91 pop r29 1026a: cf 91 pop r28 1026c: 1f 91 pop r17 1026e: 0f 91 pop r16 10270: ff 90 pop r15 10272: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10274: 0c 94 17 7b jmp 0xf62e ; 0xf62e return; } 10278: df 91 pop r29 1027a: cf 91 pop r28 1027c: 1f 91 pop r17 1027e: 0f 91 pop r16 10280: ff 90 pop r15 10282: ef 90 pop r14 10284: 08 95 ret 00010286 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { 10286: 8f 92 push r8 10288: 9f 92 push r9 1028a: af 92 push r10 1028c: bf 92 push r11 1028e: cf 92 push r12 10290: df 92 push r13 10292: ef 92 push r14 10294: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); 10296: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 1029a: 6b 01 movw r12, r22 1029c: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { 1029e: 20 91 2f 02 lds r18, 0x022F ; 0x80022f 102a2: 22 23 and r18, r18 102a4: 09 f1 breq .+66 ; 0x102e8 102a6: 40 91 96 02 lds r20, 0x0296 ; 0x800296 102aa: 41 30 cpi r20, 0x01 ; 1 102ac: e9 f0 breq .+58 ; 0x102e8 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; 102ae: 80 91 10 02 lds r24, 0x0210 ; 0x800210 102b2: 90 91 11 02 lds r25, 0x0211 ; 0x800211 102b6: a0 91 12 02 lds r26, 0x0212 ; 0x800212 102ba: b0 91 13 02 lds r27, 0x0213 ; 0x800213 102be: 46 01 movw r8, r12 102c0: 57 01 movw r10, r14 102c2: 88 1a sub r8, r24 102c4: 99 0a sbc r9, r25 102c6: aa 0a sbc r10, r26 102c8: bb 0a sbc r11, r27 102ca: 30 e0 ldi r19, 0x00 ; 0 102cc: a8 ee ldi r26, 0xE8 ; 232 102ce: b3 e0 ldi r27, 0x03 ; 3 102d0: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 102d4: 86 16 cp r8, r22 102d6: 97 06 cpc r9, r23 102d8: a8 06 cpc r10, r24 102da: b9 06 cpc r11, r25 102dc: 6c f0 brlt .+26 ; 0x102f8 switch (busy_state) { 102de: 44 30 cpi r20, 0x04 ; 4 102e0: 31 f1 breq .+76 ; 0x1032e 102e2: 9c f4 brge .+38 ; 0x1030a 102e4: 42 30 cpi r20, 0x02 ; 2 102e6: d4 f4 brge .+52 ; 0x1031c break; default: break; } } prev_busy_signal_ms = ms; 102e8: c0 92 10 02 sts 0x0210, r12 ; 0x800210 102ec: d0 92 11 02 sts 0x0211, r13 ; 0x800211 102f0: e0 92 12 02 sts 0x0212, r14 ; 0x800212 102f4: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } 102f8: ff 90 pop r15 102fa: ef 90 pop r14 102fc: df 90 pop r13 102fe: cf 90 pop r12 10300: bf 90 pop r11 10302: af 90 pop r10 10304: 9f 90 pop r9 10306: 8f 90 pop r8 10308: 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) { 1030a: 45 30 cpi r20, 0x05 ; 5 1030c: 69 f7 brne .-38 ; 0x102e8 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; 1030e: 84 e1 ldi r24, 0x14 ; 20 10310: 9a ea ldi r25, 0xAA ; 170 10312: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM("busy: paused for input"); 10316: 84 e8 ldi r24, 0x84 ; 132 10318: 9c e7 ldi r25, 0x7C ; 124 1031a: 06 c0 rjmp .+12 ; 0x10328 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; 1031c: 84 e1 ldi r24, 0x14 ; 20 1031e: 9a ea ldi r25, 0xAA ; 170 10320: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM("busy: processing"); 10324: 81 eb ldi r24, 0xB1 ; 177 10326: 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"); 10328: 0e 94 17 7b call 0xf62e ; 0xf62e 1032c: dd cf rjmp .-70 ; 0x102e8 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; 1032e: 84 e1 ldi r24, 0x14 ; 20 10330: 9a ea ldi r25, 0xAA ; 170 10332: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM("busy: paused for user"); 10336: 8b e9 ldi r24, 0x9B ; 155 10338: 9c e7 ldi r25, 0x7C ; 124 1033a: f6 cf rjmp .-20 ; 0x10328 0001033c : //} } #endif //TACH_0 void checkFans() { 1033c: cf 92 push r12 1033e: df 92 push r13 10340: ef 92 push r14 10342: ff 92 push r15 10344: 0f 93 push r16 10346: 1f 93 push r17 10348: cf 93 push r28 1034a: df 93 push r29 1034c: 1f 92 push r1 1034e: 1f 92 push r1 10350: cd b7 in r28, 0x3d ; 61 10352: 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)) { 10354: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 10358: 00 91 99 17 lds r16, 0x1799 ; 0x801799 1035c: 10 91 9a 17 lds r17, 0x179A ; 0x80179a 10360: 20 91 9b 17 lds r18, 0x179B ; 0x80179b 10364: 30 91 9c 17 lds r19, 0x179C ; 0x80179c 10368: 60 1b sub r22, r16 1036a: 71 0b sbc r23, r17 1036c: 82 0b sbc r24, r18 1036e: 93 0b sbc r25, r19 10370: 69 38 cpi r22, 0x89 ; 137 10372: 73 41 sbci r23, 0x13 ; 19 10374: 81 05 cpc r24, r1 10376: 91 05 cpc r25, r1 10378: d0 f0 brcs .+52 ; 0x103ae 1037a: 80 91 33 05 lds r24, 0x0533 ; 0x800533 1037e: 81 11 cpse r24, r1 10380: 16 c0 rjmp .+44 ; 0x103ae extruder_autofan_last_check = _millis(); 10382: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 10386: 60 93 99 17 sts 0x1799, r22 ; 0x801799 1038a: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 1038e: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 10392: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c fanSpeedBckp = fanSpeedSoftPwm; 10396: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 1039a: 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 1039e: 8b 34 cpi r24, 0x4B ; 75 103a0: 18 f0 brcs .+6 ; 0x103a8 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 103a2: 8f ef ldi r24, 0xFF ; 255 103a4: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d } fan_measuring = true; 103a8: 81 e0 ldi r24, 0x01 ; 1 103aa: 80 93 33 05 sts 0x0533, r24 ; 0x800533 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 103ae: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 103b2: 00 91 99 17 lds r16, 0x1799 ; 0x801799 103b6: 10 91 9a 17 lds r17, 0x179A ; 0x80179a 103ba: 20 91 9b 17 lds r18, 0x179B ; 0x80179b 103be: 30 91 9c 17 lds r19, 0x179C ; 0x80179c 103c2: 60 1b sub r22, r16 103c4: 71 0b sbc r23, r17 103c6: 82 0b sbc r24, r18 103c8: 93 0b sbc r25, r19 103ca: 65 36 cpi r22, 0x65 ; 101 103cc: 71 05 cpc r23, r1 103ce: 81 05 cpc r24, r1 103d0: 91 05 cpc r25, r1 103d2: 08 f4 brcc .+2 ; 0x103d6 103d4: f7 c0 rjmp .+494 ; 0x105c4 103d6: 80 91 33 05 lds r24, 0x0533 ; 0x800533 103da: 88 23 and r24, r24 103dc: 09 f4 brne .+2 ; 0x103e0 103de: f2 c0 rjmp .+484 ; 0x105c4 countFanSpeed(); 103e0: 0e 94 6b 76 call 0xecd6 ; 0xecd6 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 103e4: 83 e0 ldi r24, 0x03 ; 3 103e6: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 103e8: 82 e0 ldi r24, 0x02 ; 2 103ea: 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) 103ec: 80 91 38 02 lds r24, 0x0238 ; 0x800238 103f0: 88 23 and r24, r24 103f2: 51 f0 breq .+20 ; 0x10408 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 103f4: 87 e8 ldi r24, 0x87 ; 135 103f6: 9f e0 ldi r25, 0x0F ; 15 103f8: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 103fc: 91 e0 ldi r25, 0x01 ; 1 103fe: 81 11 cpse r24, r1 10400: 01 c0 rjmp .+2 ; 0x10404 10402: 90 e0 ldi r25, 0x00 ; 0 10404: 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]++;} 10408: 80 91 ae 04 lds r24, 0x04AE ; 0x8004ae 1040c: 90 91 af 04 lds r25, 0x04AF ; 0x8004af 10410: 44 97 sbiw r24, 0x14 ; 20 10412: 0c f0 brlt .+2 ; 0x10416 10414: a0 c0 rjmp .+320 ; 0x10556 10416: 20 e0 ldi r18, 0x00 ; 0 10418: 30 e0 ldi r19, 0x00 ; 0 1041a: 48 e4 ldi r20, 0x48 ; 72 1041c: 52 e4 ldi r21, 0x42 ; 66 1041e: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 10422: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 10426: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 1042a: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 1042e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 10432: 18 16 cp r1, r24 10434: 0c f0 brlt .+2 ; 0x10438 10436: 8f c0 rjmp .+286 ; 0x10556 10438: 80 91 4c 03 lds r24, 0x034C ; 0x80034c 1043c: 8f 5f subi r24, 0xFF ; 255 1043e: 80 93 4c 03 sts 0x034C, r24 ; 0x80034c else fan_speed_errors[0] = 0; #endif #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; 10442: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 10446: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 1044a: 05 97 sbiw r24, 0x05 ; 5 1044c: 0c f0 brlt .+2 ; 0x10450 1044e: 89 c0 rjmp .+274 ; 0x10562 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); 10450: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 10454: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 10458: 98 17 cp r25, r24 1045a: 09 f4 brne .+2 ; 0x1045e 1045c: 7f c0 rjmp .+254 ; 0x1055c 1045e: e0 91 54 0e lds r30, 0x0E54 ; 0x800e54 10462: 8e e6 ldi r24, 0x6E ; 110 10464: e8 9f mul r30, r24 10466: f0 01 movw r30, r0 10468: 11 24 eor r1, r1 1046a: e7 54 subi r30, 0x47 ; 71 1046c: f8 4f sbci r31, 0xF8 ; 248 1046e: 80 81 ld r24, Z 10470: 8c 34 cpi r24, 0x4C ; 76 10472: 08 f4 brcc .+2 ; 0x10476 10474: 76 c0 rjmp .+236 ; 0x10562 10476: 80 91 4d 03 lds r24, 0x034D ; 0x80034d 1047a: 8f 5f subi r24, 0xFF ; 255 1047c: 80 93 4d 03 sts 0x034D, r24 ; 0x80034d else fan_speed_errors[1] = 0; #endif // drop the fan_check_error flag when both fans are ok if( fan_speed_errors[0] == 0 && fan_speed_errors[1] == 0 && fan_check_error == EFCE_REPORTED){ 10480: 80 91 4c 03 lds r24, 0x034C ; 0x80034c 10484: 81 11 cpse r24, r1 10486: 0b c0 rjmp .+22 ; 0x1049e 10488: 80 91 4d 03 lds r24, 0x034D ; 0x80034d 1048c: 81 11 cpse r24, r1 1048e: 07 c0 rjmp .+14 ; 0x1049e 10490: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 10494: 82 30 cpi r24, 0x02 ; 2 10496: 19 f4 brne .+6 ; 0x1049e // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 10498: 81 e0 ldi r24, 0x01 ; 1 1049a: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 1049e: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 104a2: 81 30 cpi r24, 0x01 ; 1 104a4: 61 f4 brne .+24 ; 0x104be 104a6: 0e 94 a7 68 call 0xd14e ; 0xd14e 104aa: 81 11 cpse r24, r1 104ac: 08 c0 rjmp .+16 ; 0x104be fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 104ae: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 104b2: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> 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 104b6: 8d ea ldi r24, 0xAD ; 173 104b8: 90 e7 ldi r25, 0x70 ; 112 104ba: 0f 94 be 0b call 0x2177c ; 0x2177c } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 104be: 80 91 38 02 lds r24, 0x0238 ; 0x800238 104c2: 88 23 and r24, r24 104c4: 09 f4 brne .+2 ; 0x104c8 104c6: 6e c0 rjmp .+220 ; 0x105a4 104c8: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 104cc: 82 30 cpi r24, 0x02 ; 2 104ce: 09 f4 brne .+2 ; 0x104d2 104d0: 69 c0 rjmp .+210 ; 0x105a4 104d2: 8c e4 ldi r24, 0x4C ; 76 104d4: e8 2e mov r14, r24 104d6: 83 e0 ldi r24, 0x03 ; 3 104d8: f8 2e mov r15, r24 104da: fe 01 movw r30, r28 104dc: 31 96 adiw r30, 0x01 ; 1 104de: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 104e0: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 104e2: 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]) 104e4: f7 01 movw r30, r14 104e6: 91 91 ld r25, Z+ 104e8: 7f 01 movw r14, r30 104ea: f6 01 movw r30, r12 104ec: 81 91 ld r24, Z+ 104ee: 6f 01 movw r12, r30 104f0: 89 17 cp r24, r25 104f2: 68 f5 brcc .+90 ; 0x1054e { fan_speed_errors[fan] = 0; 104f4: f7 01 movw r30, r14 104f6: 31 97 sbiw r30, 0x01 ; 1 104f8: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 104fa: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 104fe: 82 30 cpi r24, 0x02 ; 2 10500: 31 f1 breq .+76 ; 0x1054e fan_check_error = EFCE_REPORTED; 10502: 00 93 de 03 sts 0x03DE, r16 ; 0x8003de if (printJobOngoing()) { 10506: 0e 94 56 68 call 0xd0ac ; 0xd0ac 1050a: 88 23 and r24, r24 1050c: 81 f1 breq .+96 ; 0x1056e // A print is ongoing, pause the print normally if(!printingIsPaused()) { 1050e: 0e 94 4b 68 call 0xd096 ; 0xd096 10512: 81 11 cpse r24, r1 10514: 06 c0 rjmp .+12 ; 0x10522 if (usb_timer.running()) 10516: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1051a: 88 23 and r24, r24 1051c: 29 f1 breq .+74 ; 0x10568 lcd_pause_usb_print(); 1051e: 0f 94 58 2c call 0x258b0 ; 0x258b0 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 10522: 11 30 cpi r17, 0x01 ; 1 10524: 59 f1 breq .+86 ; 0x1057c //! 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); 10526: 85 ef ldi r24, 0xF5 ; 245 10528: 99 e7 ldi r25, 0x79 ; 121 1052a: 0e 94 17 7b call 0xf62e ; 0xf62e if (get_message_level() == 0) { 1052e: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> 10532: 81 11 cpse r24, r1 10534: 0c c0 rjmp .+24 ; 0x1054e Sound_MakeCustom(200,0,true); 10536: 41 e0 ldi r20, 0x01 ; 1 10538: 70 e0 ldi r23, 0x00 ; 0 1053a: 60 e0 ldi r22, 0x00 ; 0 1053c: 88 ec ldi r24, 0xC8 ; 200 1053e: 90 e0 ldi r25, 0x00 ; 0 10540: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac LCD_ALERTMESSAGERPGM(lcdMsg); 10544: 62 e0 ldi r22, 0x02 ; 2 10546: 89 e4 ldi r24, 0x49 ; 73 10548: 9b e6 ldi r25, 0x6B ; 107 1054a: 0f 94 9b 06 call 0x20d36 ; 0x20d36 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++) 1054e: 11 30 cpi r17, 0x01 ; 1 10550: 49 f1 breq .+82 ; 0x105a4 10552: 11 e0 ldi r17, 0x01 ; 1 10554: c7 cf rjmp .-114 ; 0x104e4 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; 10556: 10 92 4c 03 sts 0x034C, r1 ; 0x80034c 1055a: 73 cf rjmp .-282 ; 0x10442 #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]++; 1055c: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 10560: 87 cf rjmp .-242 ; 0x10470 else fan_speed_errors[1] = 0; 10562: 10 92 4d 03 sts 0x034D, r1 ; 0x80034d 10566: 8c cf rjmp .-232 ; 0x10480 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 10568: 0f 94 67 3f call 0x27ece ; 0x27ece 1056c: da cf rjmp .-76 ; 0x10522 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1056e: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 10572: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 10576: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db 1057a: d3 cf rjmp .-90 ; 0x10522 //! 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); 1057c: 8d e1 ldi r24, 0x1D ; 29 1057e: 9a e7 ldi r25, 0x7A ; 122 10580: 0e 94 17 7b call 0xf62e ; 0xf62e if (get_message_level() == 0) { 10584: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> 10588: 81 11 cpse r24, r1 1058a: 0c c0 rjmp .+24 ; 0x105a4 Sound_MakeCustom(200,0,true); 1058c: 41 e0 ldi r20, 0x01 ; 1 1058e: 70 e0 ldi r23, 0x00 ; 0 10590: 60 e0 ldi r22, 0x00 ; 0 10592: 88 ec ldi r24, 0xC8 ; 200 10594: 90 e0 ldi r25, 0x00 ; 0 10596: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac LCD_ALERTMESSAGERPGM(lcdMsg); 1059a: 62 e0 ldi r22, 0x02 ; 2 1059c: 85 e3 ldi r24, 0x35 ; 53 1059e: 9b e6 ldi r25, 0x6B ; 107 105a0: 0f 94 9b 06 call 0x20d36 ; 0x20d36 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 105a4: 80 91 14 02 lds r24, 0x0214 ; 0x800214 105a8: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d //printf_P(PSTR("fan PWM: %d; extr fanSpeed measured: %d; print fan speed measured: %d \n"), fanSpeedBckp, fan_speed[0], fan_speed[1]); extruder_autofan_last_check = _millis(); 105ac: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 105b0: 60 93 99 17 sts 0x1799, r22 ; 0x801799 105b4: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 105b8: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 105bc: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c fan_measuring = false; 105c0: 10 92 33 05 sts 0x0533, r1 ; 0x800533 } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 105c4: 0f 90 pop r0 105c6: 0f 90 pop r0 105c8: df 91 pop r29 105ca: cf 91 pop r28 105cc: 1f 91 pop r17 105ce: 0f 91 pop r16 105d0: ff 90 pop r15 105d2: ef 90 pop r14 105d4: df 90 pop r13 105d6: 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(); 105d8: 0c 94 43 77 jmp 0xee86 ; 0xee86 000105dc : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 105dc: cf 92 push r12 105de: df 92 push r13 105e0: ef 92 push r14 105e2: ff 92 push r15 105e4: 6b 01 movw r12, r22 105e6: 7c 01 movw r14, r24 la10c_orig_jerk = j; 105e8: c0 92 52 03 sts 0x0352, r12 ; 0x800352 105ec: d0 92 53 03 sts 0x0353, r13 ; 0x800353 105f0: e0 92 54 03 sts 0x0354, r14 ; 0x800354 105f4: f0 92 55 03 sts 0x0355, r15 ; 0x800355 if(la10c_mode != LA10C_LA10) 105f8: 80 91 6e 03 lds r24, 0x036E ; 0x80036e 105fc: 82 30 cpi r24, 0x02 ; 2 105fe: b1 f4 brne .+44 ; 0x1062c 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) 10600: 20 e0 ldi r18, 0x00 ; 0 10602: 30 e0 ldi r19, 0x00 ; 0 10604: 40 e9 ldi r20, 0x90 ; 144 10606: 50 e4 ldi r21, 0x40 ; 64 10608: c7 01 movw r24, r14 1060a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1060e: 87 ff sbrs r24, 7 10610: 14 c0 rjmp .+40 ; 0x1063a 10612: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 10616: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 1061a: a0 91 9d 06 lds r26, 0x069D ; 0x80069d 1061e: b0 91 9e 06 lds r27, 0x069E ; 0x80069e 10622: 80 3d cpi r24, 0xD0 ; 208 10624: 97 40 sbci r25, 0x07 ; 7 10626: a1 05 cpc r26, r1 10628: b1 05 cpc r27, r1 1062a: 20 f5 brcc .+72 ; 0x10674 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 1062c: c7 01 movw r24, r14 1062e: b6 01 movw r22, r12 10630: ff 90 pop r15 10632: ef 90 pop r14 10634: df 90 pop r13 10636: cf 90 pop r12 10638: 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: 1063a: 2a e9 ldi r18, 0x9A ; 154 1063c: 39 e9 ldi r19, 0x99 ; 153 1063e: 49 e9 ldi r20, 0x99 ; 153 10640: 5e e3 ldi r21, 0x3E ; 62 10642: c7 01 movw r24, r14 10644: b6 01 movw r22, r12 10646: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1064a: 87 ff sbrs r24, 7 1064c: 0a c0 rjmp .+20 ; 0x10662 1064e: 20 e0 ldi r18, 0x00 ; 0 10650: 30 e0 ldi r19, 0x00 ; 0 10652: 48 e3 ldi r20, 0x38 ; 56 10654: 51 e4 ldi r21, 0x41 ; 65 10656: c7 01 movw r24, r14 10658: b6 01 movw r22, r12 1065a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1065e: 6b 01 movw r12, r22 10660: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 10662: 81 e7 ldi r24, 0x71 ; 113 10664: 9a e7 ldi r25, 0x7A ; 122 10666: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(j); 1066a: c7 01 movw r24, r14 1066c: b6 01 movw r22, r12 1066e: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a 10672: dc cf rjmp .-72 ; 0x1062c // 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: 10674: 2a e9 ldi r18, 0x9A ; 154 10676: 39 e9 ldi r19, 0x99 ; 153 10678: 49 e9 ldi r20, 0x99 ; 153 1067a: 5e e3 ldi r21, 0x3E ; 62 1067c: c7 01 movw r24, r14 1067e: b6 01 movw r22, r12 10680: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 10684: 87 fd sbrc r24, 7 10686: e3 cf rjmp .-58 ; 0x1064e j < 4.5? j * 0.25 + 3.375: 10688: 20 e0 ldi r18, 0x00 ; 0 1068a: 30 e0 ldi r19, 0x00 ; 0 1068c: 40 e8 ldi r20, 0x80 ; 128 1068e: 5e e3 ldi r21, 0x3E ; 62 10690: c7 01 movw r24, r14 10692: b6 01 movw r22, r12 10694: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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: 10698: 20 e0 ldi r18, 0x00 ; 0 1069a: 30 e0 ldi r19, 0x00 ; 0 1069c: 48 e5 ldi r20, 0x58 ; 88 1069e: 50 e4 ldi r21, 0x40 ; 64 106a0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 106a4: dc cf rjmp .-72 ; 0x1065e 000106a6 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 106a6: cf 92 push r12 106a8: df 92 push r13 106aa: ef 92 push r14 106ac: ff 92 push r15 106ae: cf 93 push r28 if(mode == la10c_mode) return; 106b0: 90 91 6e 03 lds r25, 0x036E ; 0x80036e 106b4: 98 17 cp r25, r24 106b6: b9 f1 breq .+110 ; 0x10726 106b8: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 106ba: c0 90 52 03 lds r12, 0x0352 ; 0x800352 106be: d0 90 53 03 lds r13, 0x0353 ; 0x800353 106c2: e0 90 54 03 lds r14, 0x0354 ; 0x800354 106c6: f0 90 55 03 lds r15, 0x0355 ; 0x800355 106ca: 20 e0 ldi r18, 0x00 ; 0 106cc: 30 e0 ldi r19, 0x00 ; 0 106ce: a9 01 movw r20, r18 106d0: c7 01 movw r24, r14 106d2: b6 01 movw r22, r12 106d4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 106d8: 88 23 and r24, r24 106da: 41 f0 breq .+16 ; 0x106ec cs.max_jerk[E_AXIS] = la10c_orig_jerk; 106dc: c0 92 bf 06 sts 0x06BF, r12 ; 0x8006bf 106e0: d0 92 c0 06 sts 0x06C0, r13 ; 0x8006c0 106e4: e0 92 c1 06 sts 0x06C1, r14 ; 0x8006c1 106e8: f0 92 c2 06 sts 0x06C2, r15 ; 0x8006c2 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 106ec: 84 e5 ldi r24, 0x54 ; 84 106ee: 9a e7 ldi r25, 0x7A ; 122 106f0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 switch(mode) 106f4: c1 30 cpi r28, 0x01 ; 1 106f6: 11 f1 breq .+68 ; 0x1073c 106f8: e0 f0 brcs .+56 ; 0x10732 106fa: c2 30 cpi r28, 0x02 ; 2 106fc: 11 f1 breq .+68 ; 0x10742 { 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; 106fe: c0 93 6e 03 sts 0x036E, r28 ; 0x80036e // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 10702: 60 91 bf 06 lds r22, 0x06BF ; 0x8006bf 10706: 70 91 c0 06 lds r23, 0x06C0 ; 0x8006c0 1070a: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 1070e: 90 91 c2 06 lds r25, 0x06C2 ; 0x8006c2 10712: 0e 94 ee 82 call 0x105dc ; 0x105dc 10716: 60 93 bf 06 sts 0x06BF, r22 ; 0x8006bf 1071a: 70 93 c0 06 sts 0x06C0, r23 ; 0x8006c0 1071e: 80 93 c1 06 sts 0x06C1, r24 ; 0x8006c1 10722: 90 93 c2 06 sts 0x06C2, r25 ; 0x8006c2 } 10726: cf 91 pop r28 10728: ff 90 pop r15 1072a: ef 90 pop r14 1072c: df 90 pop r13 1072e: cf 90 pop r12 10730: 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; 10732: 8c e4 ldi r24, 0x4C ; 76 10734: 9a e7 ldi r25, 0x7A ; 122 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10736: 0e 94 17 7b call 0xf62e ; 0xf62e 1073a: e1 cf rjmp .-62 ; 0x106fe SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 1073c: 88 e4 ldi r24, 0x48 ; 72 1073e: 9a e7 ldi r25, 0x7A ; 122 10740: fa cf rjmp .-12 ; 0x10736 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10742: 84 e4 ldi r24, 0x44 ; 68 10744: 9a e7 ldi r25, 0x7A ; 122 10746: f7 cf rjmp .-18 ; 0x10736 00010748 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 10748: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 disable_x(); 1074c: 17 9a sbi 0x02, 7 ; 2 1074e: ed e3 ldi r30, 0x3D ; 61 10750: f7 e0 ldi r31, 0x07 ; 7 10752: 10 82 st Z, r1 disable_y(); 10754: 16 9a sbi 0x02, 6 ; 2 10756: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 10758: 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); } 1075a: 80 e0 ldi r24, 0x00 ; 0 1075c: 0e 94 53 83 call 0x106a6 ; 0x106a6 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 10760: 8f ef ldi r24, 0xFF ; 255 10762: 9f ef ldi r25, 0xFF ; 255 10764: 90 93 8a 02 sts 0x028A, r25 ; 0x80028a 10768: 80 93 89 02 sts 0x0289, r24 ; 0x800289 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 1076c: 2f ef ldi r18, 0xFF ; 255 1076e: 20 93 86 02 sts 0x0286, r18 ; 0x800286 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 10772: 90 93 8e 02 sts 0x028E, r25 ; 0x80028e 10776: 80 93 8d 02 sts 0x028D, r24 ; 0x80028d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 1077a: 20 93 85 02 sts 0x0285, r18 ; 0x800285 print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 1077e: 90 93 88 02 sts 0x0288, r25 ; 0x800288 10782: 80 93 87 02 sts 0x0287, r24 ; 0x800287 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 10786: 90 93 8c 02 sts 0x028C, r25 ; 0x80028c 1078a: 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(); } 1078e: 08 95 ret 00010790 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 10790: 41 ed ldi r20, 0xD1 ; 209 10792: 50 e0 ldi r21, 0x00 ; 0 10794: 6f ef ldi r22, 0xFF ; 255 10796: 78 e7 ldi r23, 0x78 ; 120 10798: 8b e6 ldi r24, 0x6B ; 107 1079a: 96 e0 ldi r25, 0x06 ; 6 1079c: 0f 94 e0 da call 0x3b5c0 ; 0x3b5c0 // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 107a0: 0f 94 3a aa call 0x35474 ; 0x35474 #ifdef PIDTEMP updatePID(); 107a4: 0f 94 e3 50 call 0x2a1c6 ; 0x2a1c6 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 107a8: 0f 94 bc 47 call 0x28f78 ; 0x28f78 #endif calculate_extruder_multipliers(); 107ac: 0e 94 7f 66 call 0xccfe ; 0xccfe SERIAL_ECHO_START; 107b0: 84 e1 ldi r24, 0x14 ; 20 107b2: 9a ea ldi r25, 0xAA ; 170 107b4: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 107b8: 8d ed ldi r24, 0xDD ; 221 107ba: 98 e7 ldi r25, 0x78 ; 120 107bc: 0c 94 17 7b jmp 0xf62e ; 0xf62e 000107c0 : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 107c0: cf 93 push r28 107c2: df 93 push r29 strcpy_P(cs.version, default_conf.version); 107c4: 6f ef ldi r22, 0xFF ; 255 107c6: 78 e7 ldi r23, 0x78 ; 120 107c8: 8b e6 ldi r24, 0x6B ; 107 107ca: 96 e0 ldi r25, 0x06 ; 6 107cc: 0f 94 fd da call 0x3b5fa ; 0x3b5fa #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); 107d0: 41 ed ldi r20, 0xD1 ; 209 107d2: 50 e0 ldi r21, 0x00 ; 0 107d4: 64 e1 ldi r22, 0x14 ; 20 107d6: 70 e0 ldi r23, 0x00 ; 0 107d8: 8b e6 ldi r24, 0x6B ; 107 107da: 96 e0 ldi r25, 0x06 ; 6 107dc: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 107e0: 60 91 1d 05 lds r22, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> 107e4: 82 e0 ldi r24, 0x02 ; 2 107e6: 9d e0 ldi r25, 0x0D ; 13 107e8: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 } 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); 107ec: cb e8 ldi r28, 0x8B ; 139 107ee: 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); 107f0: 4a a5 ldd r20, Y+42 ; 0x2a 107f2: 5b a5 ldd r21, Y+43 ; 0x2b 107f4: 6c a5 ldd r22, Y+44 ; 0x2c 107f6: 7d a5 ldd r23, Y+45 ; 0x2d 107f8: 8e ef ldi r24, 0xFE ; 254 107fa: 9c e0 ldi r25, 0x0C ; 12 107fc: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 10800: 4e a5 ldd r20, Y+46 ; 0x2e 10802: 5f a5 ldd r21, Y+47 ; 0x2f 10804: 68 a9 ldd r22, Y+48 ; 0x30 10806: 79 a9 ldd r23, Y+49 ; 0x31 10808: 82 ea ldi r24, 0xA2 ; 162 1080a: 9c e0 ldi r25, 0x0C ; 12 1080c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 10810: 4a a9 ldd r20, Y+50 ; 0x32 10812: 5b a9 ldd r21, Y+51 ; 0x33 10814: 6c a9 ldd r22, Y+52 ; 0x34 10816: 7d a9 ldd r23, Y+53 ; 0x35 10818: 8e e9 ldi r24, 0x9E ; 158 1081a: 9c e0 ldi r25, 0x0C ; 12 1081c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 10820: 4e a9 ldd r20, Y+54 ; 0x36 10822: 5f a9 ldd r21, Y+55 ; 0x37 10824: 68 ad ldd r22, Y+56 ; 0x38 10826: 79 ad ldd r23, Y+57 ; 0x39 10828: 8a ef ldi r24, 0xFA ; 250 1082a: 9c e0 ldi r25, 0x0C ; 12 1082c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 10830: 4a ad ldd r20, Y+58 ; 0x3a 10832: 5b ad ldd r21, Y+59 ; 0x3b 10834: 6c ad ldd r22, Y+60 ; 0x3c 10836: 7d ad ldd r23, Y+61 ; 0x3d 10838: 8a e9 ldi r24, 0x9A ; 154 1083a: 9c e0 ldi r25, 0x0C ; 12 1083c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 10840: 6e ad ldd r22, Y+62 ; 0x3e 10842: 7f ad ldd r23, Y+63 ; 0x3f 10844: 88 e9 ldi r24, 0x98 ; 152 10846: 9c e0 ldi r25, 0x0C ; 12 10848: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 #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); 1084c: 40 e4 ldi r20, 0x40 ; 64 1084e: 50 e0 ldi r21, 0x00 ; 0 10850: 6a eb ldi r22, 0xBA ; 186 10852: 7c e0 ldi r23, 0x0C ; 12 10854: 8b ec ldi r24, 0xCB ; 203 10856: 92 e1 ldi r25, 0x12 ; 18 10858: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1085c: 40 91 0b 13 lds r20, 0x130B ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 10860: 50 91 0c 13 lds r21, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 10864: 60 91 0d 13 lds r22, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 10868: 70 91 0e 13 lds r23, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1086c: 86 eb ldi r24, 0xB6 ; 182 1086e: 9c e0 ldi r25, 0x0C ; 12 10870: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 10874: 40 91 0f 13 lds r20, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 10878: 50 91 10 13 lds r21, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 1087c: 60 91 11 13 lds r22, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 10880: 70 91 12 13 lds r23, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 10884: 82 eb ldi r24, 0xB2 ; 178 10886: 9c e0 ldi r25, 0x0C ; 12 10888: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 1088c: 40 91 13 13 lds r20, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 10890: 50 91 14 13 lds r21, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 10894: 60 91 15 13 lds r22, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 10898: 70 91 16 13 lds r23, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 1089c: 8e ea ldi r24, 0xAE ; 174 1089e: 9c e0 ldi r25, 0x0C ; 12 108a0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 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; 108a4: 84 e1 ldi r24, 0x14 ; 20 108a6: 9a ea ldi r25, 0xAA ; 170 108a8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM("Settings Stored"); 108ac: 89 e8 ldi r24, 0x89 ; 137 108ae: 98 e7 ldi r25, 0x78 ; 120 } 108b0: df 91 pop r29 108b2: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 108b4: 0c 94 17 7b jmp 0xf62e ; 0xf62e 000108b8 : { cmdbuffer_front_already_processed = true; } void get_command() { 108b8: 2f 92 push r2 108ba: 3f 92 push r3 108bc: 4f 92 push r4 108be: 5f 92 push r5 108c0: 6f 92 push r6 108c2: 7f 92 push r7 108c4: 8f 92 push r8 108c6: 9f 92 push r9 108c8: af 92 push r10 108ca: bf 92 push r11 108cc: cf 92 push r12 108ce: df 92 push r13 108d0: ef 92 push r14 108d2: ff 92 push r15 108d4: 0f 93 push r16 108d6: 1f 93 push r17 108d8: cf 93 push r28 108da: df 93 push r29 108dc: cd b7 in r28, 0x3d ; 61 108de: de b7 in r29, 0x3e ; 62 108e0: a2 97 sbiw r28, 0x22 ; 34 108e2: 0f b6 in r0, 0x3f ; 63 108e4: f8 94 cli 108e6: de bf out 0x3e, r29 ; 62 108e8: 0f be out 0x3f, r0 ; 63 108ea: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 108ec: 8f e5 ldi r24, 0x5F ; 95 108ee: 90 e0 ldi r25, 0x00 ; 0 108f0: 0e 94 08 5d call 0xba10 ; 0xba10 108f4: 88 23 and r24, r24 108f6: 09 f4 brne .+2 ; 0x108fa 108f8: 91 c0 rjmp .+290 ; 0x10a1c return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 108fa: 0e 94 a5 78 call 0xf14a ; 0xf14a 108fe: 8f 37 cpi r24, 0x7F ; 127 10900: 91 05 cpc r25, r1 10902: 61 f4 brne .+24 ; 0x1091c // 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; 10904: 80 91 92 04 lds r24, 0x0492 ; 0x800492 10908: 90 91 93 04 lds r25, 0x0493 ; 0x800493 1090c: 90 93 91 04 sts 0x0491, r25 ; 0x800491 10910: 80 93 90 04 sts 0x0490, r24 ; 0x800490 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 10914: 8a e7 ldi r24, 0x7A ; 122 10916: 98 e7 ldi r25, 0x78 ; 120 10918: 0e 94 17 7b call 0xf62e ; 0xf62e 1091c: 1e 01 movw r2, r28 1091e: 2f e1 ldi r18, 0x1F ; 31 10920: 22 0e add r2, r18 10922: 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; 10924: dd 24 eor r13, r13 10926: 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 10928: 0e 94 a5 78 call 0xf14a ; 0xf14a 1092c: 18 16 cp r1, r24 1092e: 19 06 cpc r1, r25 10930: 0c f0 brlt .+2 ; 0x10934 10932: 68 c0 rjmp .+208 ; 0x10a04 10934: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 10938: 88 23 and r24, r24 1093a: 29 f0 breq .+10 ; 0x10946 1093c: 0e 94 4b 68 call 0xd096 ; 0xd096 10940: 88 23 and r24, r24 10942: 09 f4 brne .+2 ; 0x10946 10944: 5f c0 rjmp .+190 ; 0x10a04 10946: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 1094a: 81 11 cpse r24, r1 1094c: 5b c0 rjmp .+182 ; 0x10a04 #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 1094e: 0f 94 4f d6 call 0x3ac9e ; 0x3ac9e if (rec < 0) continue; 10952: 97 fd sbrc r25, 7 10954: e9 cf rjmp .-46 ; 0x10928 mp_handle_rx_char((uint8_t)rec); 10956: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 10958: 8f 3f cpi r24, 0xFF ; 255 1095a: 09 f0 breq .+2 ; 0x1095e 1095c: 7b c0 rjmp .+246 ; 0x10a54 if (mp_cmd_count > 0) { 1095e: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10962: 88 23 and r24, r24 10964: 09 f4 brne .+2 ; 0x10968 10966: 73 c0 rjmp .+230 ; 0x10a4e mp_cmd_active = 1; 10968: d0 92 3d 03 sts 0x033D, r13 ; 0x80033d mp_cmd_count = 0; 1096c: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e char c_res[2] = {0, 0}; 10970: 1f 8e std Y+31, r1 ; 0x1f 10972: 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) { 10974: c0 90 41 03 lds r12, 0x0341 ; 0x800341 10978: cc 20 and r12, r12 1097a: b1 f2 breq .-84 ; 0x10928 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]; 1097c: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 10980: 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) 10982: 91 e0 ldi r25, 0x01 ; 1 10984: 9c 15 cp r25, r12 10986: 18 f4 brcc .+6 ; 0x1098e out[i] = (char)mp_char_out_buf[i]; 10988: 80 91 40 03 lds r24, 0x0340 ; 0x800340 1098c: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 1098e: 10 92 41 03 sts 0x0341, r1 ; 0x800341 10992: 3a a2 std Y+34, r3 ; 0x22 10994: 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]; 10996: 89 a1 ldd r24, Y+33 ; 0x21 10998: 82 19 sub r24, r2 1099a: 8c 15 cp r24, r12 1099c: 28 f6 brcc .-118 ; 0x10928 1099e: e9 a1 ldd r30, Y+33 ; 0x21 109a0: fa a1 ldd r31, Y+34 ; 0x22 109a2: 11 91 ld r17, Z+ 109a4: fa a3 std Y+34, r31 ; 0x22 109a6: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 109a8: 84 e4 ldi r24, 0x44 ; 68 109aa: 93 e0 ldi r25, 0x03 ; 3 109ac: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> if (serial_char < 0) 109b0: 17 fd sbrc r17, 7 109b2: f1 cf rjmp .-30 ; 0x10996 109b4: 80 91 79 10 lds r24, 0x1079 ; 0x801079 109b8: 90 91 7a 10 lds r25, 0x107A ; 0x80107a // Ignore extended ASCII characters. These characters have no meaning in the G-code apart from the file names // and Marlin does not support such file names anyway. // Serial characters with a highest bit set to 1 are generated when the USB cable is unplugged, leading // to a hang-up of the print process from an SD card. continue; if(serial_char == '\n' || 109bc: 1a 30 cpi r17, 0x0A ; 10 109be: 09 f4 brne .+2 ; 0x109c2 109c0: 4a c1 rjmp .+660 ; 0x10c56 109c2: 1d 30 cpi r17, 0x0D ; 13 109c4: 09 f4 brne .+2 ; 0x109c8 109c6: 47 c1 rjmp .+654 ; 0x10c56 serial_char == '\r' || 109c8: 8f 35 cpi r24, 0x5F ; 95 109ca: 91 05 cpc r25, r1 109cc: 0c f0 brlt .+2 ; 0x109d0 109ce: 48 c1 rjmp .+656 ; 0x10c60 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; 109d0: 1b 33 cpi r17, 0x3B ; 59 109d2: 11 f4 brne .+4 ; 0x109d8 109d4: d0 92 43 03 sts 0x0343, r13 ; 0x800343 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 109d8: 20 91 43 03 lds r18, 0x0343 ; 0x800343 109dc: 21 11 cpse r18, r1 109de: db cf rjmp .-74 ; 0x10996 109e0: 9c 01 movw r18, r24 109e2: 2f 5f subi r18, 0xFF ; 255 109e4: 3f 4f sbci r19, 0xFF ; 255 109e6: 30 93 7a 10 sts 0x107A, r19 ; 0x80107a 109ea: 20 93 79 10 sts 0x1079, r18 ; 0x801079 109ee: 20 91 7b 10 lds r18, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 109f2: 30 91 7c 10 lds r19, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 109f6: 20 58 subi r18, 0x80 ; 128 109f8: 3f 4e sbci r19, 0xEF ; 239 109fa: 82 0f add r24, r18 109fc: 93 1f adc r25, r19 109fe: fc 01 movw r30, r24 10a00: 13 83 std Z+3, r17 ; 0x03 10a02: c9 cf rjmp .-110 ; 0x10996 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10a04: 80 91 79 10 lds r24, 0x1079 ; 0x801079 10a08: 90 91 7a 10 lds r25, 0x107A ; 0x80107a 10a0c: 18 16 cp r1, r24 10a0e: 19 06 cpc r1, r25 10a10: 0c f4 brge .+2 ; 0x10a14 10a12: 56 c2 rjmp .+1196 ; 0x10ec0 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10a14: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 10a18: 81 11 cpse r24, r1 10a1a: 66 c2 rjmp .+1228 ; 0x10ee8 prusa_statistics(6); } } #endif //SDSUPPORT } 10a1c: a2 96 adiw r28, 0x22 ; 34 10a1e: 0f b6 in r0, 0x3f ; 63 10a20: f8 94 cli 10a22: de bf out 0x3e, r29 ; 62 10a24: 0f be out 0x3f, r0 ; 63 10a26: cd bf out 0x3d, r28 ; 61 10a28: df 91 pop r29 10a2a: cf 91 pop r28 10a2c: 1f 91 pop r17 10a2e: 0f 91 pop r16 10a30: ff 90 pop r15 10a32: ef 90 pop r14 10a34: df 90 pop r13 10a36: cf 90 pop r12 10a38: bf 90 pop r11 10a3a: af 90 pop r10 10a3c: 9f 90 pop r9 10a3e: 8f 90 pop r8 10a40: 7f 90 pop r7 10a42: 6f 90 pop r6 10a44: 5f 90 pop r5 10a46: 4f 90 pop r4 10a48: 3f 90 pop r3 10a4a: 2f 90 pop r2 10a4c: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10a4e: d0 92 3e 03 sts 0x033E, r13 ; 0x80033e 10a52: 8e cf rjmp .-228 ; 0x10970 return; } if (mp_cmd_active > 0) { 10a54: 30 91 3d 03 lds r19, 0x033D ; 0x80033d 10a58: 33 23 and r19, r19 10a5a: 09 f4 brne .+2 ; 0x10a5e 10a5c: 57 c0 rjmp .+174 ; 0x10b0c } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10a5e: 89 3f cpi r24, 0xF9 ; 249 10a60: 09 f4 brne .+2 ; 0x10a64 10a62: 3f c0 rjmp .+126 ; 0x10ae2 10a64: 80 f5 brcc .+96 ; 0x10ac6 10a66: 86 3f cpi r24, 0xF6 ; 246 10a68: 09 f4 brne .+2 ; 0x10a6c 10a6a: 48 c0 rjmp .+144 ; 0x10afc #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10a6c: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10a70: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10a72: 27 3f cpi r18, 0xF7 ; 247 10a74: 79 f1 breq .+94 ; 0x10ad4 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. 10a76: 85 e4 ldi r24, 0x45 ; 69 10a78: 98 e7 ldi r25, 0x78 ; 120 10a7a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 // 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); 10a7e: 80 e4 ldi r24, 0x40 ; 64 10a80: 98 e7 ldi r25, 0x78 ; 120 10a82: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 // Echo current state if (mp_config & MPConfig_Active) 10a86: 10 91 3c 03 lds r17, 0x033C ; 0x80033c SERIAL_ECHOPGM(" ON"); 10a8a: 8c e3 ldi r24, 0x3C ; 60 10a8c: 98 e7 ldi r25, 0x78 ; 120 // NOTE: if any configuration vars are added below, the outgoing sync text for host plugin // should not contain the "PV' substring, as this is used to indicate protocol version SERIAL_ECHOPGM(MeatPack_ProtocolVersion); // Echo current state if (mp_config & MPConfig_Active) 10a8e: 10 fd sbrc r17, 0 10a90: 02 c0 rjmp .+4 ; 0x10a96 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10a92: 87 e3 ldi r24, 0x37 ; 55 10a94: 98 e7 ldi r25, 0x78 ; 120 10a96: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if (mp_config & MPConfig_NoSpaces) 10a9a: 01 2f mov r16, r17 10a9c: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10a9e: 82 e3 ldi r24, 0x32 ; 50 10aa0: 98 e7 ldi r25, 0x78 ; 120 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10aa2: 11 fd sbrc r17, 1 10aa4: 02 c0 rjmp .+4 ; 0x10aaa SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 10aa6: 8d e2 ldi r24, 0x2D ; 45 10aa8: 98 e7 ldi r25, 0x78 ; 120 10aaa: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM(""); 10aae: 8c e2 ldi r24, 0x2C ; 44 10ab0: 98 e7 ldi r25, 0x78 ; 120 10ab2: 0e 94 17 7b call 0xf62e ; 0xf62e // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 10ab6: 00 23 and r16, r16 10ab8: 29 f1 breq .+74 ; 0x10b04 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10aba: 45 e4 ldi r20, 0x45 ; 69 10abc: 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; 10ac0: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d 10ac4: 55 cf rjmp .-342 ; 0x10970 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10ac6: 8a 3f cpi r24, 0xFA ; 250 10ac8: 41 f0 breq .+16 ; 0x10ada case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10aca: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10ace: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10ad0: 2b 3f cpi r18, 0xFB ; 251 10ad2: 89 f6 brne .-94 ; 0x10a76 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10ad4: 80 93 3c 03 sts 0x033C, r24 ; 0x80033c 10ad8: ce cf rjmp .-100 ; 0x10a76 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10ada: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10ade: 8e 7f andi r24, 0xFE ; 254 10ae0: f9 cf rjmp .-14 ; 0x10ad4 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10ae2: 10 92 41 03 sts 0x0341, r1 ; 0x800341 mp_cmd_active = MPCommand_None; 10ae6: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d mp_config = MPConfig_None; 10aea: 10 92 3c 03 sts 0x033C, r1 ; 0x80033c mp_char_buf = 0; 10aee: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b mp_cmd_count = 0; 10af2: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e mp_cmd_active = 0; mp_full_char_queue = 0; 10af6: 10 92 3a 03 sts 0x033A, r1 ; 0x80033a 10afa: bd cf rjmp .-134 ; 0x10a76 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10afc: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10b00: 8d 7f andi r24, 0xFD ; 253 10b02: e8 cf rjmp .-48 ; 0x10ad4 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 10b04: 50 e2 ldi r21, 0x20 ; 32 10b06: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10b0a: da cf rjmp .-76 ; 0x10ac0 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10b0c: 20 91 3e 03 lds r18, 0x033E ; 0x80033e 10b10: 40 91 3c 03 lds r20, 0x033C ; 0x80033c 10b14: 22 23 and r18, r18 10b16: 31 f1 breq .+76 ; 0x10b64 10b18: e0 91 41 03 lds r30, 0x0341 ; 0x800341 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 10b1c: 40 ff sbrs r20, 0 10b1e: 49 c0 rjmp .+146 ; 0x10bb2 if (mp_full_char_queue > 0) { 10b20: 30 91 3a 03 lds r19, 0x033A ; 0x80033a 10b24: 33 23 and r19, r19 10b26: 09 f4 brne .+2 ; 0x10b2a 10b28: 40 c0 rjmp .+128 ; 0x10baa #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; 10b2a: 21 e0 ldi r18, 0x01 ; 1 10b2c: 2e 0f add r18, r30 10b2e: 20 93 41 03 sts 0x0341, r18 ; 0x800341 10b32: ae 2f mov r26, r30 10b34: b0 e0 ldi r27, 0x00 ; 0 10b36: a1 5c subi r26, 0xC1 ; 193 10b38: bc 4f sbci r27, 0xFC ; 252 10b3a: ff ef ldi r31, 0xFF ; 255 10b3c: 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) { 10b3e: 50 91 3b 03 lds r21, 0x033B ; 0x80033b 10b42: 55 23 and r21, r21 10b44: 51 f0 breq .+20 ; 0x10b5a #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; 10b46: ee 5f subi r30, 0xFE ; 254 10b48: e0 93 41 03 sts 0x0341, r30 ; 0x800341 10b4c: e2 2f mov r30, r18 10b4e: f0 e0 ldi r31, 0x00 ; 0 10b50: e1 5c subi r30, 0xC1 ; 193 10b52: fc 4f sbci r31, 0xFC ; 252 10b54: 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; 10b56: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b } --mp_full_char_queue; 10b5a: 31 50 subi r19, 0x01 ; 1 10b5c: 30 93 3a 03 sts 0x033A, r19 ; 0x80033a return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 10b60: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e 10b64: e0 91 41 03 lds r30, 0x0341 ; 0x800341 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 10b68: 40 ff sbrs r20, 0 10b6a: 6c c0 rjmp .+216 ; 0x10c44 if (mp_full_char_queue > 0) { 10b6c: 20 91 3a 03 lds r18, 0x033A ; 0x80033a 10b70: 22 23 and r18, r18 10b72: 49 f1 breq .+82 ; 0x10bc6 #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; 10b74: 91 e0 ldi r25, 0x01 ; 1 10b76: 9e 0f add r25, r30 10b78: 90 93 41 03 sts 0x0341, r25 ; 0x800341 10b7c: ae 2f mov r26, r30 10b7e: b0 e0 ldi r27, 0x00 ; 0 10b80: a1 5c subi r26, 0xC1 ; 193 10b82: bc 4f sbci r27, 0xFC ; 252 10b84: 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) { 10b86: 80 91 3b 03 lds r24, 0x033B ; 0x80033b 10b8a: 88 23 and r24, r24 10b8c: 51 f0 breq .+20 ; 0x10ba2 #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; 10b8e: ee 5f subi r30, 0xFE ; 254 10b90: e0 93 41 03 sts 0x0341, r30 ; 0x800341 10b94: e9 2f mov r30, r25 10b96: f0 e0 ldi r31, 0x00 ; 0 10b98: e1 5c subi r30, 0xC1 ; 193 10b9a: fc 4f sbci r31, 0xFC ; 252 10b9c: 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; 10b9e: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b } --mp_full_char_queue; 10ba2: 21 50 subi r18, 0x01 ; 1 10ba4: 20 93 3a 03 sts 0x033A, r18 ; 0x80033a 10ba8: e3 ce rjmp .-570 ; 0x10970 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; 10baa: 22 e0 ldi r18, 0x02 ; 2 10bac: 20 93 3a 03 sts 0x033A, r18 ; 0x80033a 10bb0: d7 cf rjmp .-82 ; 0x10b60 #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; 10bb2: 21 e0 ldi r18, 0x01 ; 1 10bb4: 2e 0f add r18, r30 10bb6: 20 93 41 03 sts 0x0341, r18 ; 0x800341 10bba: f0 e0 ldi r31, 0x00 ; 0 10bbc: e1 5c subi r30, 0xC1 ; 193 10bbe: fc 4f sbci r31, 0xFC ; 252 10bc0: 5f ef ldi r21, 0xFF ; 255 10bc2: 50 83 st Z, r21 10bc4: cd cf rjmp .-102 ; 0x10b60 10bc6: a8 2f mov r26, r24 10bc8: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10bca: 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; 10bcc: 31 e0 ldi r19, 0x01 ; 1 10bce: af 30 cpi r26, 0x0F ; 15 10bd0: 29 f0 breq .+10 ; 0x10bdc 10bd2: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 10bd4: a0 50 subi r26, 0x00 ; 0 10bd6: be 4f sbci r27, 0xFE ; 254 10bd8: 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; 10bda: 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; 10bdc: 58 2f mov r21, r24 10bde: 50 7f andi r21, 0xF0 ; 240 10be0: 50 3f cpi r21, 0xF0 ; 240 10be2: 59 f4 brne .+22 ; 0x10bfa 10be4: 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) { 10be6: 30 ff sbrs r19, 0 10be8: 13 c0 rjmp .+38 ; 0x10c10 ++mp_full_char_queue; 10bea: d0 92 3a 03 sts 0x033A, r13 ; 0x80033a if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10bee: 31 ff sbrs r19, 1 10bf0: 0c c0 rjmp .+24 ; 0x10c0a 10bf2: 82 e0 ldi r24, 0x02 ; 2 10bf4: 80 93 3a 03 sts 0x033A, r24 ; 0x80033a 10bf8: bb ce rjmp .-650 ; 0x10970 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 10bfa: 82 95 swap r24 10bfc: 8f 70 andi r24, 0x0F ; 15 10bfe: a8 2f mov r26, r24 10c00: b0 e0 ldi r27, 0x00 ; 0 10c02: a0 50 subi r26, 0x00 ; 0 10c04: be 4f sbci r27, 0xFE ; 254 10c06: 2c 91 ld r18, X 10c08: ee cf rjmp .-36 ; 0x10be6 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]; 10c0a: 20 93 3b 03 sts 0x033B, r18 ; 0x80033b 10c0e: b0 ce rjmp .-672 ; 0x10970 #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; 10c10: 81 e0 ldi r24, 0x01 ; 1 10c12: 8e 0f add r24, r30 10c14: 80 93 41 03 sts 0x0341, r24 ; 0x800341 10c18: ae 2f mov r26, r30 10c1a: b0 e0 ldi r27, 0x00 ; 0 10c1c: a1 5c subi r26, 0xC1 ; 193 10c1e: bc 4f sbci r27, 0xFC ; 252 10c20: 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') { 10c22: 4a 30 cpi r20, 0x0A ; 10 10c24: 09 f4 brne .+2 ; 0x10c28 10c26: a4 ce rjmp .-696 ; 0x10970 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10c28: 31 ff sbrs r19, 1 10c2a: 03 c0 rjmp .+6 ; 0x10c32 10c2c: d0 92 3a 03 sts 0x033A, r13 ; 0x80033a 10c30: 9f ce rjmp .-706 ; 0x10970 #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; 10c32: ee 5f subi r30, 0xFE ; 254 10c34: e0 93 41 03 sts 0x0341, r30 ; 0x800341 10c38: e8 2f mov r30, r24 10c3a: f0 e0 ldi r31, 0x00 ; 0 10c3c: e1 5c subi r30, 0xC1 ; 193 10c3e: fc 4f sbci r31, 0xFC ; 252 10c40: 20 83 st Z, r18 10c42: 96 ce rjmp .-724 ; 0x10970 10c44: 91 e0 ldi r25, 0x01 ; 1 10c46: 9e 0f add r25, r30 10c48: 90 93 41 03 sts 0x0341, r25 ; 0x800341 10c4c: f0 e0 ldi r31, 0x00 ; 0 10c4e: e1 5c subi r30, 0xC1 ; 193 10c50: fc 4f sbci r31, 0xFC ; 252 10c52: 80 83 st Z, r24 10c54: 8d ce rjmp .-742 ; 0x10970 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 10c56: 00 97 sbiw r24, 0x00 ; 0 10c58: 19 f4 brne .+6 ; 0x10c60 comment_mode = false; //for new command 10c5a: 10 92 43 03 sts 0x0343, r1 ; 0x800343 10c5e: de ce rjmp .-580 ; 0x10a1c 10c60: 00 91 7b 10 lds r16, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 10c64: 10 91 7c 10 lds r17, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 10c68: 0d 57 subi r16, 0x7D ; 125 10c6a: 1f 4e sbci r17, 0xEF ; 239 10c6c: 80 0f add r24, r16 10c6e: 91 1f adc r25, r17 10c70: fc 01 movw r30, r24 10c72: 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) 10c74: 1a 83 std Y+2, r17 ; 0x02 10c76: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10c78: 80 91 43 03 lds r24, 0x0343 ; 0x800343 10c7c: 81 11 cpse r24, r1 10c7e: 03 c1 rjmp .+518 ; 0x10e86 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10c80: f8 01 movw r30, r16 10c82: 80 81 ld r24, Z 10c84: 8e 34 cpi r24, 0x4E ; 78 10c86: 09 f0 breq .+2 ; 0x10c8a 10c88: 8a c0 rjmp .+276 ; 0x10d9e // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10c8a: 4a e0 ldi r20, 0x0A ; 10 10c8c: 50 e0 ldi r21, 0x00 ; 0 10c8e: be 01 movw r22, r28 10c90: 6f 5f subi r22, 0xFF ; 255 10c92: 7f 4f sbci r23, 0xFF ; 255 10c94: c8 01 movw r24, r16 10c96: 01 96 adiw r24, 0x01 ; 1 10c98: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 10c9c: 2b 01 movw r4, r22 10c9e: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10ca0: e9 80 ldd r14, Y+1 ; 0x01 10ca2: fa 80 ldd r15, Y+2 ; 0x02 10ca4: f7 01 movw r30, r14 10ca6: 80 81 ld r24, Z 10ca8: 80 32 cpi r24, 0x20 ; 32 10caa: 31 f4 brne .+12 ; 0x10cb8 10cac: ff ef ldi r31, 0xFF ; 255 10cae: ef 1a sub r14, r31 10cb0: ff 0a sbc r15, r31 10cb2: fa 82 std Y+2, r15 ; 0x02 10cb4: e9 82 std Y+1, r14 ; 0x01 10cb6: f4 cf rjmp .-24 ; 0x10ca0 // 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)) { 10cb8: 80 90 78 03 lds r8, 0x0378 ; 0x800378 10cbc: 90 90 79 03 lds r9, 0x0379 ; 0x800379 10cc0: a0 90 7a 03 lds r10, 0x037A ; 0x80037a 10cc4: b0 90 7b 03 lds r11, 0x037B ; 0x80037b 10cc8: d5 01 movw r26, r10 10cca: c4 01 movw r24, r8 10ccc: 01 96 adiw r24, 0x01 ; 1 10cce: a1 1d adc r26, r1 10cd0: b1 1d adc r27, r1 10cd2: 84 15 cp r24, r4 10cd4: 95 05 cpc r25, r5 10cd6: a6 05 cpc r26, r6 10cd8: b7 05 cpc r27, r7 10cda: 49 f0 breq .+18 ; 0x10cee 10cdc: 44 e0 ldi r20, 0x04 ; 4 10cde: 50 e0 ldi r21, 0x00 ; 0 10ce0: 65 e7 ldi r22, 0x75 ; 117 10ce2: 78 e7 ldi r23, 0x78 ; 120 10ce4: c7 01 movw r24, r14 10ce6: 0f 94 25 db call 0x3b64a ; 0x3b64a 10cea: 89 2b or r24, r25 10cec: a1 f4 brne .+40 ; 0x10d16 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10cee: 6a e2 ldi r22, 0x2A ; 42 10cf0: 70 e0 ldi r23, 0x00 ; 0 10cf2: c7 01 movw r24, r14 10cf4: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 10cf8: 90 93 94 03 sts 0x0394, r25 ; 0x800394 10cfc: 80 93 93 03 sts 0x0393, r24 ; 0x800393 10d00: 00 97 sbiw r24, 0x00 ; 0 10d02: 09 f4 brne .+2 ; 0x10d06 10d04: 45 c0 rjmp .+138 ; 0x10d90 10d06: f8 01 movw r30, r16 { byte checksum = 0; 10d08: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10d0a: e8 17 cp r30, r24 10d0c: f9 07 cpc r31, r25 10d0e: 71 f0 breq .+28 ; 0x10d2c checksum = checksum^(*p++); 10d10: 21 91 ld r18, Z+ 10d12: f2 26 eor r15, r18 10d14: fa cf rjmp .-12 ; 0x10d0a 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; 10d16: 8c ee ldi r24, 0xEC ; 236 10d18: 99 ea ldi r25, 0xA9 ; 169 10d1a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10d1e: 86 e0 ldi r24, 0x06 ; 6 10d20: 96 e6 ldi r25, 0x66 ; 102 *strchr_pointer = 0; } else { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10d22: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 10d26: c5 01 movw r24, r10 10d28: b4 01 movw r22, r8 10d2a: 15 c0 rjmp .+42 ; 0x10d56 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10d2c: 0e 94 2c 5c call 0xb858 ; 0xb858 10d30: f8 16 cp r15, r24 10d32: 19 06 cpc r1, r25 10d34: d9 f0 breq .+54 ; 0x10d6c SERIAL_ERROR_START; 10d36: 8c ee ldi r24, 0xEC ; 236 10d38: 99 ea ldi r25, 0xA9 ; 169 10d3a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10d3e: 87 ee ldi r24, 0xE7 ; 231 10d40: 95 e6 ldi r25, 0x65 ; 101 10d42: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 10d46: 60 91 78 03 lds r22, 0x0378 ; 0x800378 10d4a: 70 91 79 03 lds r23, 0x0379 ; 0x800379 10d4e: 80 91 7a 03 lds r24, 0x037A ; 0x80037a 10d52: 90 91 7b 03 lds r25, 0x037B ; 0x80037b 10d56: 0f 94 9a d2 call 0x3a534 ; 0x3a534 } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10d5a: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10d5e: 0e 94 44 5c call 0xb888 ; 0xb888 serial_count = 0; 10d62: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 10d66: 10 92 79 10 sts 0x1079, r1 ; 0x801079 10d6a: 58 ce rjmp .-848 ; 0x10a1c return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10d6c: e0 91 93 03 lds r30, 0x0393 ; 0x800393 10d70: f0 91 94 03 lds r31, 0x0394 ; 0x800394 10d74: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 10d76: e9 80 ldd r14, Y+1 ; 0x01 10d78: fa 80 ldd r15, Y+2 ; 0x02 10d7a: 60 e7 ldi r22, 0x70 ; 112 10d7c: 78 e7 ldi r23, 0x78 ; 120 10d7e: c7 01 movw r24, r14 10d80: 0f 94 f4 da call 0x3b5e8 ; 0x3b5e8 10d84: 89 2b or r24, r25 10d86: 39 f5 brne .+78 ; 0x10dd6 kill(MSG_M112_KILL); 10d88: 81 e2 ldi r24, 0x21 ; 33 10d8a: 99 e6 ldi r25, 0x69 ; 105 10d8c: 0e 94 a6 7b call 0xf74c ; 0xf74c // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10d90: 8c ee ldi r24, 0xEC ; 236 10d92: 99 ea ldi r25, 0xA9 ; 169 10d94: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10d98: 8d eb ldi r24, 0xBD ; 189 10d9a: 95 e6 ldi r25, 0x65 ; 101 10d9c: c2 cf rjmp .-124 ; 0x10d22 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10d9e: 89 81 ldd r24, Y+1 ; 0x01 10da0: 9a 81 ldd r25, Y+2 ; 0x02 10da2: fc 01 movw r30, r24 10da4: 20 81 ld r18, Z 10da6: 20 32 cpi r18, 0x20 ; 32 10da8: 21 f4 brne .+8 ; 0x10db2 10daa: 01 96 adiw r24, 0x01 ; 1 10dac: 9a 83 std Y+2, r25 ; 0x02 10dae: 89 83 std Y+1, r24 ; 0x01 10db0: f6 cf rjmp .-20 ; 0x10d9e // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10db2: 6a e2 ldi r22, 0x2A ; 42 10db4: 70 e0 ldi r23, 0x00 ; 0 10db6: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 10dba: 89 2b or r24, r25 10dbc: 39 f0 breq .+14 ; 0x10dcc { SERIAL_ERROR_START; 10dbe: 8c ee ldi r24, 0xEC ; 236 10dc0: 99 ea ldi r25, 0xA9 ; 169 10dc2: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10dc6: 83 e9 ldi r24, 0x93 ; 147 10dc8: 95 e6 ldi r25, 0x65 ; 101 10dca: bb cf rjmp .-138 ; 0x10d42 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 10dcc: 44 24 eor r4, r4 10dce: 4a 94 dec r4 10dd0: 54 2c mov r5, r4 10dd2: 32 01 movw r6, r4 10dd4: d0 cf rjmp .-96 ; 0x10d76 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) 10dd6: 44 e0 ldi r20, 0x04 ; 4 10dd8: 50 e0 ldi r21, 0x00 ; 0 10dda: 6b e6 ldi r22, 0x6B ; 107 10ddc: 78 e7 ldi r23, 0x78 ; 120 10dde: c7 01 movw r24, r14 10de0: 0f 94 25 db call 0x3b64a ; 0x3b64a 10de4: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10de6: f7 01 movw r30, r14 10de8: 80 81 ld r24, Z 10dea: 87 34 cpi r24, 0x47 ; 71 10dec: 81 f4 brne .+32 ; 0x10e0e 10dee: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 10df2: 85 30 cpi r24, 0x05 ; 5 10df4: 61 f0 breq .+24 ; 0x10e0e usb_timer.start(); 10df6: 8e e0 ldi r24, 0x0E ; 14 10df8: 95 e0 ldi r25, 0x05 ; 5 10dfa: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10dfe: f6 e0 ldi r31, 0x06 ; 6 10e00: f0 93 64 0e sts 0x0E64, r31 ; 0x800e64 <_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); 10e04: 60 e0 ldi r22, 0x00 ; 0 10e06: 85 ea ldi r24, 0xA5 ; 165 10e08: 9f e0 ldi r25, 0x0F ; 15 10e0a: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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) { 10e0e: ab 28 or r10, r11 10e10: 21 f0 breq .+8 ; 0x10e1a 10e12: 80 91 11 05 lds r24, 0x0511 ; 0x800511 10e16: 81 11 cpse r24, r1 10e18: a4 cf rjmp .-184 ; 0x10d62 } // 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; 10e1a: 26 e0 ldi r18, 0x06 ; 6 10e1c: 77 fc sbrc r7, 7 10e1e: 21 e0 ldi r18, 0x01 ; 1 10e20: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 10e24: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 10e28: fc 01 movw r30, r24 10e2a: e0 58 subi r30, 0x80 ; 128 10e2c: ff 4e sbci r31, 0xEF ; 239 10e2e: 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) 10e30: 49 81 ldd r20, Y+1 ; 0x01 10e32: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10e34: 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) 10e36: da 01 movw r26, r20 10e38: 40 17 cp r20, r16 10e3a: 51 07 cpc r21, r17 10e3c: a1 f5 brne .+104 ; 0x10ea6 cmd_len = strlen(cmd_start) + 1; 10e3e: 01 90 ld r0, Z+ 10e40: 00 20 and r0, r0 10e42: e9 f7 brne .-6 ; 0x10e3e 10e44: 9f 01 movw r18, r30 10e46: 20 1b sub r18, r16 10e48: 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; 10e4a: 03 96 adiw r24, 0x03 ; 3 10e4c: 28 0f add r18, r24 10e4e: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10e50: 2d 3e cpi r18, 0xED ; 237 10e52: f1 e0 ldi r31, 0x01 ; 1 10e54: 3f 07 cpc r19, r31 10e56: 79 f1 breq .+94 ; 0x10eb6 // 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; 10e58: 30 93 7c 10 sts 0x107C, r19 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 10e5c: 20 93 7b 10 sts 0x107B, r18 ; 0x80107b <_ZL7bufindw.lto_priv.570> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10e60: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 10e64: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 10e68: 01 96 adiw r24, 0x01 ; 1 10e6a: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f 10e6e: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e // Update the processed gcode line if (gcode_N >= 0) 10e72: 77 fc sbrc r7, 7 10e74: 08 c0 rjmp .+16 ; 0x10e86 gcode_LastN = gcode_N; 10e76: 40 92 78 03 sts 0x0378, r4 ; 0x800378 10e7a: 50 92 79 03 sts 0x0379, r5 ; 0x800379 10e7e: 60 92 7a 03 sts 0x037A, r6 ; 0x80037a 10e82: 70 92 7b 03 sts 0x037B, r7 ; 0x80037b SERIAL_ECHOPGM("Number of commands in the buffer: "); SERIAL_ECHO(buflen); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } // end of 'not comment mode' serial_count = 0; //clear buffer 10e86: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 10e8a: 10 92 79 10 sts 0x1079, r1 ; 0x801079 // Don't call cmdqueue_could_enqueue_back if there are no characters waiting // in the queue, as this function will reserve the memory. if (MYSERIAL.available() == 0 || ! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 10e8e: 0e 94 a5 78 call 0xf14a ; 0xf14a 10e92: 89 2b or r24, r25 10e94: 09 f4 brne .+2 ; 0x10e98 10e96: c2 cd rjmp .-1148 ; 0x10a1c 10e98: 8f e5 ldi r24, 0x5F ; 95 10e9a: 90 e0 ldi r25, 0x00 ; 0 10e9c: 0e 94 08 5d call 0xba10 ; 0xba10 10ea0: 81 11 cpse r24, r1 10ea2: 79 cd rjmp .-1294 ; 0x10996 10ea4: bb cd rjmp .-1162 ; 0x10a1c 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]; } 10ea6: 6d 91 ld r22, X+ 10ea8: 61 93 st Z+, r22 10eaa: 9d 01 movw r18, r26 10eac: 24 1b sub r18, r20 10eae: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10eb0: 61 11 cpse r22, r1 10eb2: f9 cf rjmp .-14 ; 0x10ea6 10eb4: ca cf rjmp .-108 ; 0x10e4a } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10eb6: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 10eba: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.570> 10ebe: d0 cf rjmp .-96 ; 0x10e60 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10ec0: 60 ed ldi r22, 0xD0 ; 208 10ec2: 77 e0 ldi r23, 0x07 ; 7 10ec4: 84 e4 ldi r24, 0x44 ; 68 10ec6: 93 e0 ldi r25, 0x03 ; 3 10ec8: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 10ecc: 88 23 and r24, r24 10ece: 09 f4 brne .+2 ; 0x10ed2 10ed0: a1 cd rjmp .-1214 ; 0x10a14 comment_mode = false; 10ed2: 10 92 43 03 sts 0x0343, r1 ; 0x800343 serial_count = 0; 10ed6: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 10eda: 10 92 79 10 sts 0x1079, r1 ; 0x801079 SERIAL_ECHOLNPGM("RX timeout"); 10ede: 80 e6 ldi r24, 0x60 ; 96 10ee0: 98 e7 ldi r25, 0x78 ; 120 10ee2: 0e 94 17 7b call 0xf62e ; 0xf62e 10ee6: 9a cd rjmp .-1228 ; 0x10a1c return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10ee8: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 10eec: 88 23 and r24, r24 10eee: 09 f4 brne .+2 ; 0x10ef2 10ef0: 95 cd rjmp .-1238 ; 0x10a1c 10ef2: 80 91 79 10 lds r24, 0x1079 ; 0x801079 10ef6: 90 91 7a 10 lds r25, 0x107A ; 0x80107a 10efa: 89 2b or r24, r25 10efc: 09 f0 breq .+2 ; 0x10f00 10efe: 8e cd rjmp .-1252 ; 0x10a1c //'#' 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; 10f00: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 10f04: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 10f08: 89 2b or r24, r25 10f0a: 11 f4 brne .+4 ; 0x10f10 10f0c: 10 92 42 03 sts 0x0342, r1 ; 0x800342 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10f10: 28 e7 ldi r18, 0x78 ; 120 10f12: e2 2e mov r14, r18 10f14: 20 e1 ldi r18, 0x10 ; 16 10f16: 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; 10f18: 32 e0 ldi r19, 0x02 ; 2 10f1a: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10f1c: cc 24 eor r12, r12 10f1e: 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) { 10f20: 40 91 7f 17 lds r20, 0x177F ; 0x80177f 10f24: 50 91 80 17 lds r21, 0x1780 ; 0x801780 10f28: 60 91 81 17 lds r22, 0x1781 ; 0x801781 10f2c: 70 91 82 17 lds r23, 0x1782 ; 0x801782 10f30: 80 91 78 17 lds r24, 0x1778 ; 0x801778 10f34: 90 91 79 17 lds r25, 0x1779 ; 0x801779 10f38: a0 91 7a 17 lds r26, 0x177A ; 0x80177a 10f3c: b0 91 7b 17 lds r27, 0x177B ; 0x80177b 10f40: 48 17 cp r20, r24 10f42: 59 07 cpc r21, r25 10f44: 6a 07 cpc r22, r26 10f46: 7b 07 cpc r23, r27 10f48: 08 f0 brcs .+2 ; 0x10f4c 10f4a: 2f c1 rjmp .+606 ; 0x111aa 10f4c: 80 91 42 03 lds r24, 0x0342 ; 0x800342 10f50: 81 11 cpse r24, r1 10f52: 2b c1 rjmp .+598 ; 0x111aa : "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() ){ 10f54: 0f 94 5c 7c call 0x2f8b8 ; 0x2f8b8 10f58: 88 23 and r24, r24 10f5a: 49 f1 breq .+82 ; 0x10fae 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; 10f5c: 20 91 16 17 lds r18, 0x1716 ; 0x801716 10f60: 30 91 17 17 lds r19, 0x1717 ; 0x801717 // to gfReadPtr within this method, because it is a class member variable. // The compiler cannot see, if omitting read/write won't have any incorrect side-effects to the rest of the whole FW. // So this trick explicitly states, that rdPtr is a local variable limited to the scope of this method, // therefore the compiler can omit read/write to it (keep it in registers!) as it sees fit. // And it does! Codesize dropped by 68B! const uint8_t *rdPtr = gfReadPtr; 10f64: 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; 10f66: 9b ef ldi r25, 0xFB ; 251 10f68: 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 == ';' ){ 10f6a: f8 01 movw r30, r16 10f6c: 80 81 ld r24, Z 10f6e: 8b 33 cpi r24, 0x3B ; 59 10f70: 51 f5 brne .+84 ; 0x10fc6 // 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); 10f72: f8 01 movw r30, r16 00010f74 : 10f74: 61 91 ld r22, Z+ 10f76: 6a 30 cpi r22, 0x0A ; 10 10f78: e9 f7 brne .-6 ; 0x10f74 10f7a: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 10f7c: cf 01 movw r24, r30 10f7e: 88 57 subi r24, 0x78 ; 120 10f80: 9e 40 sbci r25, 0x0E ; 14 10f82: 81 30 cpi r24, 0x01 ; 1 10f84: 92 40 sbci r25, 0x02 ; 2 10f86: d4 f0 brlt .+52 ; 0x10fbc // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 10f88: c8 01 movw r24, r16 10f8a: 82 1b sub r24, r18 10f8c: 93 0b sbc r25, r19 10f8e: 01 97 sbiw r24, 0x01 ; 1 10f90: 0f 94 4d 7c call 0x2f89a ; 0x2f89a if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10f94: 8b ef ldi r24, 0xFB ; 251 10f96: 96 e1 ldi r25, 0x16 ; 22 10f98: 0f 94 50 6d call 0x2daa0 ; 0x2daa0 10f9c: 88 23 and r24, r24 10f9e: 39 f0 breq .+14 ; 0x10fae if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 10fa0: 0f 94 5c 7c call 0x2f8b8 ; 0x2f8b8 rdPtr = start = blockBuffBegin; 10fa4: 28 e7 ldi r18, 0x78 ; 120 10fa6: 3e e0 ldi r19, 0x0E ; 14 10fa8: 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 10faa: 81 11 cpse r24, r1 10fac: e2 cf rjmp .-60 ; 0x10f72 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10fae: f0 92 17 17 sts 0x1717, r15 ; 0x801717 10fb2: e0 92 16 17 sts 0x1716, r14 ; 0x801716 return -1; 10fb6: 0f ef ldi r16, 0xFF ; 255 10fb8: 1f ef ldi r17, 0xFF ; 255 10fba: 37 c0 rjmp .+110 ; 0x1102a 10fbc: 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){ 10fbe: b1 10 cpse r11, r1 10fc0: d5 c0 rjmp .+426 ; 0x1116c // 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 10fc2: 01 50 subi r16, 0x01 ; 1 10fc4: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 10fc6: c8 01 movw r24, r16 10fc8: 82 1b sub r24, r18 10fca: 93 0b sbc r25, r19 10fcc: 01 96 adiw r24, 0x01 ; 1 10fce: 0f 94 4d 7c call 0x2f89a ; 0x2f89a int16_t rv = *rdPtr++; 10fd2: c8 01 movw r24, r16 10fd4: 01 96 adiw r24, 0x01 ; 1 10fd6: f8 01 movw r30, r16 10fd8: 00 81 ld r16, Z 10fda: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 10fdc: 80 90 03 17 lds r8, 0x1703 ; 0x801703 10fe0: 90 90 04 17 lds r9, 0x1704 ; 0x801704 10fe4: a0 90 05 17 lds r10, 0x1705 ; 0x801705 10fe8: b0 90 06 17 lds r11, 0x1706 ; 0x801706 10fec: 40 91 0c 17 lds r20, 0x170C ; 0x80170c 10ff0: 50 91 0d 17 lds r21, 0x170D ; 0x80170d 10ff4: 60 91 0e 17 lds r22, 0x170E ; 0x80170e 10ff8: 70 91 0f 17 lds r23, 0x170F ; 0x80170f 10ffc: 84 16 cp r8, r20 10ffe: 95 06 cpc r9, r21 11000: a6 06 cpc r10, r22 11002: b7 06 cpc r11, r23 11004: a0 f6 brcc .-88 ; 0x10fae // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 11006: 9c 01 movw r18, r24 11008: 28 57 subi r18, 0x78 ; 120 1100a: 3e 40 sbci r19, 0x0E ; 14 1100c: 21 15 cp r18, r1 1100e: 32 40 sbci r19, 0x02 ; 2 11010: 44 f0 brlt .+16 ; 0x11022 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 11012: 8b ef ldi r24, 0xFB ; 251 11014: 96 e1 ldi r25, 0x16 ; 22 11016: 0f 94 50 6d call 0x2daa0 ; 0x2daa0 1101a: 88 23 and r24, r24 1101c: 41 f2 breq .-112 ; 0x10fae // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 1101e: 88 e7 ldi r24, 0x78 ; 120 11020: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 11022: 90 93 17 17 sts 0x1717, r25 ; 0x801717 11026: 80 93 16 17 sts 0x1716, r24 ; 0x801716 bool createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size); /** \return The current cluster number for a file or directory. */ uint32_t curCluster() const {return curCluster_;} /** \return The current position for a file or directory. */ uint32_t curPosition() const {return curPosition_;} 1102a: 40 91 03 17 lds r20, 0x1703 ; 0x801703 1102e: 50 91 04 17 lds r21, 0x1704 ; 0x801704 11032: 60 91 05 17 lds r22, 0x1705 ; 0x801705 11036: 70 91 06 17 lds r23, 0x1706 ; 0x801706 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); 1103a: 40 93 7f 17 sts 0x177F, r20 ; 0x80177f 1103e: 50 93 80 17 sts 0x1780, r21 ; 0x801780 11042: 60 93 81 17 sts 0x1781, r22 ; 0x801781 11046: 70 93 82 17 sts 0x1782, r23 ; 0x801782 1104a: 80 91 79 10 lds r24, 0x1079 ; 0x801079 1104e: 90 91 7a 10 lds r25, 0x107A ; 0x80107a int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 11052: 0a 30 cpi r16, 0x0A ; 10 11054: 61 f0 breq .+24 ; 0x1106e || serial_char == '\r' 11056: 0d 30 cpi r16, 0x0D ; 13 11058: 51 f0 breq .+20 ; 0x1106e || serial_char == '#' 1105a: 03 32 cpi r16, 0x23 ; 35 1105c: 09 f4 brne .+2 ; 0x11060 1105e: 8c c0 rjmp .+280 ; 0x11178 || serial_count >= (MAX_CMD_SIZE - 1) 11060: 8f 35 cpi r24, 0x5F ; 95 11062: 91 05 cpc r25, r1 11064: 3c f4 brge .+14 ; 0x11074 || n==-1 11066: 0f 3f cpi r16, 0xFF ; 255 11068: 10 07 cpc r17, r16 1106a: 09 f0 breq .+2 ; 0x1106e 1106c: 8c c0 rjmp .+280 ; 0x11186 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 1106e: 00 97 sbiw r24, 0x00 ; 0 11070: 09 f4 brne .+2 ; 0x11074 11072: d4 cc rjmp .-1624 ; 0x10a1c 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); }; 11074: 20 91 fe 16 lds r18, 0x16FE ; 0x8016fe 11078: 21 11 cpse r18, r1 1107a: 03 c0 rjmp .+6 ; 0x11082 1107c: 40 e0 ldi r20, 0x00 ; 0 1107e: 50 e0 ldi r21, 0x00 ; 0 11080: 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; 11082: 20 91 80 03 lds r18, 0x0380 ; 0x800380 11086: 30 91 81 03 lds r19, 0x0381 ; 0x800381 1108a: 42 1b sub r20, r18 1108c: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 1108e: a0 91 7b 10 lds r26, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 11092: b0 91 7c 10 lds r27, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 11096: fd 01 movw r30, r26 11098: e0 58 subi r30, 0x80 ; 128 1109a: ff 4e sbci r31, 0xEF ; 239 1109c: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 1109e: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 110a0: 52 83 std Z+2, r21 ; 0x02 110a2: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 110a4: 80 58 subi r24, 0x80 ; 128 110a6: 9f 4e sbci r25, 0xEF ; 239 110a8: fc 01 movw r30, r24 110aa: ea 0f add r30, r26 110ac: fb 1f adc r31, r27 110ae: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 110b0: a0 58 subi r26, 0x80 ; 128 110b2: bf 4e sbci r27, 0xEF ; 239 110b4: fd 01 movw r30, r26 110b6: 01 90 ld r0, Z+ 110b8: 00 20 and r0, r0 110ba: e9 f7 brne .-6 ; 0x110b6 110bc: 31 97 sbiw r30, 0x01 ; 1 110be: ea 1b sub r30, r26 110c0: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 110c2: 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; 110c4: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 110c8: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 110cc: 01 96 adiw r24, 0x01 ; 1 110ce: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f 110d2: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; cmdbuffer[bufindw+1] = sd_count.lohi.lo; cmdbuffer[bufindw+2] = sd_count.lohi.hi; cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 110d6: 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; 110d8: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 110dc: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 110e0: e8 0f add r30, r24 110e2: f9 2f mov r31, r25 110e4: f1 1d adc r31, r1 110e6: f0 93 7c 10 sts 0x107C, r31 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 110ea: e0 93 7b 10 sts 0x107B, r30 ; 0x80107b <_ZL7bufindw.lto_priv.570> 110ee: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 110f2: 88 23 and r24, r24 110f4: 09 f4 brne .+2 ; 0x110f8 110f6: 43 c0 rjmp .+134 ; 0x1117e 110f8: 80 91 7f 17 lds r24, 0x177F ; 0x80177f 110fc: 90 91 80 17 lds r25, 0x1780 ; 0x801780 11100: a0 91 81 17 lds r26, 0x1781 ; 0x801781 11104: b0 91 82 17 lds r27, 0x1782 ; 0x801782 sdpos_atomic = card.get_sdpos(); 11108: 80 93 80 03 sts 0x0380, r24 ; 0x800380 1110c: 90 93 81 03 sts 0x0381, r25 ; 0x800381 11110: a0 93 82 03 sts 0x0382, r26 ; 0x800382 11114: b0 93 83 03 sts 0x0383, r27 ; 0x800383 if (bufindw == sizeof(cmdbuffer)) 11118: ed 3e cpi r30, 0xED ; 237 1111a: f1 40 sbci r31, 0x01 ; 1 1111c: 21 f4 brne .+8 ; 0x11126 bufindw = 0; 1111e: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 11122: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.570> sei(); 11126: 78 94 sei comment_mode = false; //for new command 11128: 10 92 43 03 sts 0x0343, r1 ; 0x800343 serial_count = 0; //clear buffer 1112c: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 11130: 10 92 79 10 sts 0x1079, r1 ; 0x801079 if(card.eof()) break; 11134: 40 91 7f 17 lds r20, 0x177F ; 0x80177f 11138: 50 91 80 17 lds r21, 0x1780 ; 0x801780 1113c: 60 91 81 17 lds r22, 0x1781 ; 0x801781 11140: 70 91 82 17 lds r23, 0x1782 ; 0x801782 11144: 80 91 78 17 lds r24, 0x1778 ; 0x801778 11148: 90 91 79 17 lds r25, 0x1779 ; 0x801779 1114c: a0 91 7a 17 lds r26, 0x177A ; 0x80177a 11150: b0 91 7b 17 lds r27, 0x177B ; 0x80177b 11154: 48 17 cp r20, r24 11156: 59 07 cpc r21, r25 11158: 6a 07 cpc r22, r26 1115a: 7b 07 cpc r23, r27 1115c: 30 f5 brcc .+76 ; 0x111aa // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 1115e: 8f e5 ldi r24, 0x5F ; 95 11160: 90 e0 ldi r25, 0x00 ; 0 11162: 0e 94 08 5d call 0xba10 ; 0xba10 11166: 81 11 cpse r24, r1 11168: db ce rjmp .-586 ; 0x10f20 1116a: 58 cc rjmp .-1872 ; 0x10a1c 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 == ';' ){ 1116c: f8 01 movw r30, r16 1116e: 80 81 ld r24, Z 11170: 8b 33 cpi r24, 0x3B ; 59 11172: 09 f4 brne .+2 ; 0x11176 11174: fa ce rjmp .-524 ; 0x10f6a 11176: 25 cf rjmp .-438 ; 0x10fc2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 11178: c0 92 42 03 sts 0x0342, r12 ; 0x800342 1117c: 78 cf rjmp .-272 ; 0x1106e 1117e: 80 e0 ldi r24, 0x00 ; 0 11180: 90 e0 ldi r25, 0x00 ; 0 11182: dc 01 movw r26, r24 11184: c1 cf rjmp .-126 ; 0x11108 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 11186: 9c 01 movw r18, r24 11188: 2f 5f subi r18, 0xFF ; 255 1118a: 3f 4f sbci r19, 0xFF ; 255 1118c: 30 93 7a 10 sts 0x107A, r19 ; 0x80107a 11190: 20 93 79 10 sts 0x1079, r18 ; 0x801079 11194: 20 91 7b 10 lds r18, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 11198: 30 91 7c 10 lds r19, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 1119c: 20 58 subi r18, 0x80 ; 128 1119e: 3f 4e sbci r19, 0xEF ; 239 111a0: 82 0f add r24, r18 111a2: 93 1f adc r25, r19 111a4: fc 01 movw r30, r24 111a6: 03 83 std Z+3, r16 ; 0x03 111a8: bb ce rjmp .-650 ; 0x10f20 } } if(card.eof()) 111aa: 40 91 7f 17 lds r20, 0x177F ; 0x80177f 111ae: 50 91 80 17 lds r21, 0x1780 ; 0x801780 111b2: 60 91 81 17 lds r22, 0x1781 ; 0x801781 111b6: 70 91 82 17 lds r23, 0x1782 ; 0x801782 111ba: 80 91 78 17 lds r24, 0x1778 ; 0x801778 111be: 90 91 79 17 lds r25, 0x1779 ; 0x801779 111c2: a0 91 7a 17 lds r26, 0x177A ; 0x80177a 111c6: b0 91 7b 17 lds r27, 0x177B ; 0x80177b 111ca: 48 17 cp r20, r24 111cc: 59 07 cpc r21, r25 111ce: 6a 07 cpc r22, r26 111d0: 7b 07 cpc r23, r27 111d2: 08 f4 brcc .+2 ; 0x111d6 111d4: 23 cc rjmp .-1978 ; 0x10a1c { // 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()) 111d6: 0e 94 ca 5b call 0xb794 ; 0xb794 111da: 89 2b or r24, r25 111dc: 09 f0 breq .+2 ; 0x111e0 111de: 1e cc rjmp .-1988 ; 0x10a1c lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 111e0: 8b ef ldi r24, 0xFB ; 251 111e2: 96 e1 ldi r25, 0x16 ; 22 111e4: 0f 94 31 6e call 0x2dc62 ; 0x2dc62 file.close(); 111e8: 8b ef ldi r24, 0xFB ; 251 111ea: 96 e1 ldi r25, 0x16 ; 22 111ec: 0f 94 29 a4 call 0x34852 ; 0x34852 saving = false; 111f0: 10 92 69 14 sts 0x1469, r1 ; 0x801469 logging = false; 111f4: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED 111f8: 80 e8 ldi r24, 0x80 ; 128 111fa: 95 e6 ldi r25, 0x65 ; 101 111fc: 0e 94 17 7b call 0xf62e ; 0xf62e char time[30]; uint32_t t = print_job_timer.duration() / 60; 11200: 0f 94 b3 54 call 0x2a966 ; 0x2a966 11204: 6b 01 movw r12, r22 11206: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 11208: 0e 94 e5 66 call 0xcdca ; 0xcdca // 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; 1120c: 8c e3 ldi r24, 0x3C ; 60 1120e: 88 2e mov r8, r24 11210: 91 2c mov r9, r1 11212: a1 2c mov r10, r1 11214: b1 2c mov r11, r1 11216: c7 01 movw r24, r14 11218: b6 01 movw r22, r12 1121a: a5 01 movw r20, r10 1121c: 94 01 movw r18, r8 1121e: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> int hours, minutes; minutes = t % 60; 11222: ca 01 movw r24, r20 11224: b9 01 movw r22, r18 11226: a5 01 movw r20, r10 11228: 94 01 movw r18, r8 1122a: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 1122e: 7f 93 push r23 11230: 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; 11232: c7 01 movw r24, r14 11234: b6 01 movw r22, r12 11236: 20 e1 ldi r18, 0x10 ; 16 11238: 3e e0 ldi r19, 0x0E ; 14 1123a: 40 e0 ldi r20, 0x00 ; 0 1123c: 50 e0 ldi r21, 0x00 ; 0 1123e: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 11242: 3f 93 push r19 11244: 2f 93 push r18 11246: 8c e4 ldi r24, 0x4C ; 76 11248: 98 e7 ldi r25, 0x78 ; 120 1124a: 9f 93 push r25 1124c: 8f 93 push r24 1124e: 8e 01 movw r16, r28 11250: 0f 5f subi r16, 0xFF ; 255 11252: 1f 4f sbci r17, 0xFF ; 255 11254: 1f 93 push r17 11256: 0f 93 push r16 11258: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba SERIAL_ECHO_START; 1125c: 84 e1 ldi r24, 0x14 ; 20 1125e: 9a ea ldi r25, 0xAA ; 170 11260: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(time); 11264: c8 01 movw r24, r16 11266: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 #ifndef SHOW_FILENAME_AFTER_FINISH lcd_setstatus(time); 1126a: c8 01 movw r24, r16 1126c: 0f 94 26 15 call 0x22a4c ; 0x22a4c #endif //SHOW_FILENAME_AFTER_FINISH card.printingHasFinished(); 11270: 0f 94 ee 80 call 0x301dc ; 0x301dc if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 11274: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.571> if(!mounted) 11278: 0f b6 in r0, 0x3f ; 63 1127a: f8 94 cli 1127c: de bf out 0x3e, r29 ; 62 1127e: 0f be out 0x3f, r0 ; 63 11280: cd bf out 0x3d, r28 ; 61 11282: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 11286: 88 23 and r24, r24 11288: 19 f0 breq .+6 ; 0x11290 1128a: 0f 94 90 77 call 0x2ef20 ; 0x2ef20 1128e: c6 cb rjmp .-2164 ; 0x10a1c { mount(); 11290: 81 e0 ldi r24, 0x01 ; 1 11292: 0f 94 2d 81 call 0x3025a ; 0x3025a if(!mounted) //fail 11296: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 1129a: 81 11 cpse r24, r1 1129c: f6 cf rjmp .-20 ; 0x1128a 1129e: be cb rjmp .-2180 ; 0x10a1c 000112a0 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 112a0: cf 93 push r28 112a2: df 93 push r29 112a4: ec 01 movw r28, r24 { while (*str) 112a6: 89 91 ld r24, Y+ 112a8: 88 23 and r24, r24 112aa: 19 f0 breq .+6 ; 0x112b2 write(*str++); 112ac: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 112b0: fa cf rjmp .-12 ; 0x112a6 } 112b2: df 91 pop r29 112b4: cf 91 pop r28 112b6: 08 95 ret 000112b8 : //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) { 112b8: ff 92 push r15 112ba: 0f 93 push r16 112bc: 1f 93 push r17 112be: cf 93 push r28 112c0: df 93 push r29 112c2: ec 01 movw r28, r24 112c4: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 112c6: 66 23 and r22, r22 112c8: 09 f4 brne .+2 ; 0x112cc 112ca: 4b c0 rjmp .+150 ; 0x11362 #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); 112cc: 0f 94 04 db call 0x3b608 ; 0x3b608 <__strlen_P> 112d0: 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)) { 112d2: c8 01 movw r24, r16 112d4: 0e 94 08 5d call 0xba10 ; 0xba10 112d8: 88 23 and r24, r24 112da: 09 f4 brne .+2 ; 0x112de 112dc: 53 c0 rjmp .+166 ; 0x11384 // 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; 112de: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 112e2: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 112e6: fc 01 movw r30, r24 112e8: e0 58 subi r30, 0x80 ; 128 112ea: ff 4e sbci r31, 0xEF ; 239 112ec: 23 e0 ldi r18, 0x03 ; 3 112ee: 20 83 st Z, r18 112f0: 8d 57 subi r24, 0x7D ; 125 112f2: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 112f4: 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) 112f6: ff 20 and r15, r15 112f8: e9 f1 breq .+122 ; 0x11374 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 112fa: 0f 94 fd da call 0x3b5fa ; 0x3b5fa else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 112fe: 84 e1 ldi r24, 0x14 ; 20 11300: 9a ea ldi r25, 0xAA ; 170 11302: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(MSG_Enqueing); 11306: 85 e7 ldi r24, 0x75 ; 117 11308: 95 e6 ldi r25, 0x65 ; 101 1130a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 1130e: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 11312: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 11316: 8d 57 subi r24, 0x7D ; 125 11318: 9f 4e sbci r25, 0xEF ; 239 1131a: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_ECHOLNPGM("\""); 1131e: 8a e2 ldi r24, 0x2A ; 42 11320: 98 e7 ldi r25, 0x78 ; 120 11322: 0e 94 17 7b call 0xf62e ; 0xf62e bufindw += len + (CMDHDRSIZE + 1); 11326: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 1132a: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 1132e: 04 96 adiw r24, 0x04 ; 4 11330: 08 0f add r16, r24 11332: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 11334: 0d 3e cpi r16, 0xED ; 237 11336: 81 e0 ldi r24, 0x01 ; 1 11338: 18 07 cpc r17, r24 1133a: f9 f0 breq .+62 ; 0x1137a strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 1133c: 10 93 7c 10 sts 0x107C, r17 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 11340: 00 93 7b 10 sts 0x107B, r16 ; 0x80107b <_ZL7bufindw.lto_priv.570> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11344: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 11348: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 1134c: 01 96 adiw r24, 0x01 ; 1 1134e: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f 11352: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11356: df 91 pop r29 11358: cf 91 pop r28 1135a: 1f 91 pop r17 1135c: 0f 91 pop r16 1135e: ff 90 pop r15 11360: 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); 11362: fc 01 movw r30, r24 11364: 01 90 ld r0, Z+ 11366: 00 20 and r0, r0 11368: e9 f7 brne .-6 ; 0x11364 1136a: 31 97 sbiw r30, 0x01 ; 1 1136c: 8f 01 movw r16, r30 1136e: 08 1b sub r16, r24 11370: 19 0b sbc r17, r25 11372: af cf rjmp .-162 ; 0x112d2 // 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); 11374: 0f 94 b1 e3 call 0x3c762 ; 0x3c762 11378: c2 cf rjmp .-124 ; 0x112fe SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 1137a: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 1137e: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.570> 11382: e0 cf rjmp .-64 ; 0x11344 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 11384: 8c ee ldi r24, 0xEC ; 236 11386: 99 ea ldi r25, 0xA9 ; 169 11388: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(MSG_Enqueing); 1138c: 85 e7 ldi r24, 0x75 ; 117 1138e: 95 e6 ldi r25, 0x65 ; 101 11390: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 11394: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 11396: ff 20 and r15, r15 11398: 59 f0 breq .+22 ; 0x113b0 SERIAL_PROTOCOLRPGM(cmd); 1139a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 1139e: 85 ed ldi r24, 0xD5 ; 213 113a0: 99 ea ldi r25, 0xA9 ; 169 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 113a2: df 91 pop r29 113a4: cf 91 pop r28 113a6: 1f 91 pop r17 113a8: 0f 91 pop r16 113aa: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 113ac: 0c 94 17 7b jmp 0xf62e ; 0xf62e 113b0: 0e 94 50 89 call 0x112a0 ; 0x112a0 113b4: f4 cf rjmp .-24 ; 0x1139e 000113b6 : { 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) { 113b6: 0f 93 push r16 113b8: 1f 93 push r17 113ba: cf 93 push r28 113bc: df 93 push r29 113be: d6 2f mov r29, r22 113c0: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 113c2: c0 e0 ldi r28, 0x00 ; 0 { void * const pgm_ptr = pgm_read_ptr(cmd_sequence + i); 113c4: f8 01 movw r30, r16 113c6: 85 91 lpm r24, Z+ 113c8: 94 91 lpm r25, Z // M702 is currently only used with MMU enabled if (pgm_ptr == MSG_M702 && !MMU2::mmu2.Enabled()) { 113ca: 2c e6 ldi r18, 0x6C ; 108 113cc: 82 35 cpi r24, 0x52 ; 82 113ce: 92 07 cpc r25, r18 113d0: 21 f4 brne .+8 ; 0x113da 113d2: 20 91 95 13 lds r18, 0x1395 ; 0x801395 113d6: 21 30 cpi r18, 0x01 ; 1 113d8: 19 f4 brne .+6 ; 0x113e0 continue; } enquecommand_P(static_cast(pgm_ptr)); 113da: 61 e0 ldi r22, 0x01 ; 1 113dc: 0e 94 5c 89 call 0x112b8 ; 0x112b8 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) 113e0: cf 5f subi r28, 0xFF ; 255 113e2: 0e 5f subi r16, 0xFE ; 254 113e4: 1f 4f sbci r17, 0xFF ; 255 113e6: dc 13 cpse r29, r28 113e8: ed cf rjmp .-38 ; 0x113c4 continue; } enquecommand_P(static_cast(pgm_ptr)); } } 113ea: df 91 pop r29 113ec: cf 91 pop r28 113ee: 1f 91 pop r17 113f0: 0f 91 pop r16 113f2: 08 95 ret 000113f4 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 113f4: cf 93 push r28 113f6: df 93 push r29 113f8: cd b7 in r28, 0x3d ; 61 113fa: de b7 in r29, 0x3e ; 62 113fc: 6e 97 sbiw r28, 0x1e ; 30 113fe: 0f b6 in r0, 0x3f ; 63 11400: f8 94 cli 11402: de bf out 0x3e, r29 ; 62 11404: 0f be out 0x3f, r0 ; 63 11406: cd bf out 0x3d, r28 ; 61 11408: 9e 01 movw r18, r28 1140a: 2c 5d subi r18, 0xDC ; 220 1140c: 3f 4f sbci r19, 0xFF ; 255 1140e: f9 01 movw r30, r18 11410: 41 91 ld r20, Z+ 11412: 51 91 ld r21, Z+ 11414: 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); 11416: 6e e1 ldi r22, 0x1E ; 30 11418: 70 e0 ldi r23, 0x00 ; 0 1141a: ce 01 movw r24, r28 1141c: 01 96 adiw r24, 0x01 ; 1 1141e: 0f 94 9c dc call 0x3b938 ; 0x3b938 va_end(ap); enquecommand(cmd_buffer, false); 11422: 60 e0 ldi r22, 0x00 ; 0 11424: ce 01 movw r24, r28 11426: 01 96 adiw r24, 0x01 ; 1 11428: 0e 94 5c 89 call 0x112b8 ; 0x112b8 } 1142c: 6e 96 adiw r28, 0x1e ; 30 1142e: 0f b6 in r0, 0x3f ; 63 11430: f8 94 cli 11432: de bf out 0x3e, r29 ; 62 11434: 0f be out 0x3f, r0 ; 63 11436: cd bf out 0x3d, r28 ; 61 11438: df 91 pop r29 1143a: cf 91 pop r28 1143c: 08 95 ret 0001143e : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 1143e: ef 92 push r14 11440: ff 92 push r15 11442: 0f 93 push r16 11444: 1f 93 push r17 11446: cf 93 push r28 11448: df 93 push r29 1144a: cd b7 in r28, 0x3d ; 61 1144c: de b7 in r29, 0x3e ; 62 1144e: 6b 97 sbiw r28, 0x1b ; 27 11450: 0f b6 in r0, 0x3f ; 63 11452: f8 94 cli 11454: de bf out 0x3e, r29 ; 62 11456: 0f be out 0x3f, r0 ; 63 11458: 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); 1145a: 8a e5 ldi r24, 0x5A ; 90 1145c: 9f e0 ldi r25, 0x0F ; 15 1145e: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 11462: e8 2e mov r14, r24 11464: 0a e0 ldi r16, 0x0A ; 10 11466: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 11468: 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); 1146a: 48 e0 ldi r20, 0x08 ; 8 1146c: 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++) { 1146e: fe 14 cp r15, r14 11470: 79 f0 breq .+30 ; 0x11490 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 11472: b8 01 movw r22, r16 11474: ce 01 movw r24, r28 11476: 0e 96 adiw r24, 0x0e ; 14 11478: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c dir_name[8] = '\0'; 1147c: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 1147e: 60 e0 ldi r22, 0x00 ; 0 11480: ce 01 movw r24, r28 11482: 0e 96 adiw r24, 0x0e ; 14 11484: 0f 94 7f 7e call 0x2fcfe ; 0x2fcfe 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++) { 11488: f3 94 inc r15 1148a: 08 5f subi r16, 0xF8 ; 248 1148c: 1f 4f sbci r17, 0xFF ; 255 1148e: ed cf rjmp .-38 ; 0x1146a 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); 11490: 65 e9 ldi r22, 0x95 ; 149 11492: 7f e0 ldi r23, 0x0F ; 15 11494: 8e 01 movw r16, r28 11496: 0f 5f subi r16, 0xFF ; 255 11498: 1f 4f sbci r17, 0xFF ; 255 1149a: c8 01 movw r24, r16 1149c: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 114a0: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 114a2: 8e e2 ldi r24, 0x2E ; 46 114a4: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 114a6: 43 e0 ldi r20, 0x03 ; 3 114a8: 50 e0 ldi r21, 0x00 ; 0 114aa: 61 e9 ldi r22, 0x91 ; 145 114ac: 7c e0 ldi r23, 0x0C ; 12 114ae: ce 01 movw r24, r28 114b0: 48 96 adiw r24, 0x18 ; 24 114b2: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c extension_ptr[4] = '\0'; 114b6: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 114b8: be 01 movw r22, r28 114ba: 69 5e subi r22, 0xE9 ; 233 114bc: 7f 4f sbci r23, 0xFF ; 255 114be: c8 01 movw r24, r16 114c0: 0f 94 92 e3 call 0x3c724 ; 0x3c724 enquecommandf_P(MSG_M23, filename); 114c4: 1f 93 push r17 114c6: 0f 93 push r16 114c8: 8d e2 ldi r24, 0x2D ; 45 114ca: 91 e7 ldi r25, 0x71 ; 113 114cc: 9f 93 push r25 114ce: 8f 93 push r24 114d0: 0e 94 fa 89 call 0x113f4 ; 0x113f4 114d4: 0f 90 pop r0 114d6: 0f 90 pop r0 114d8: 0f 90 pop r0 114da: 0f 90 pop r0 } 114dc: 6b 96 adiw r28, 0x1b ; 27 114de: 0f b6 in r0, 0x3f ; 63 114e0: f8 94 cli 114e2: de bf out 0x3e, r29 ; 62 114e4: 0f be out 0x3f, r0 ; 63 114e6: cd bf out 0x3d, r28 ; 61 114e8: df 91 pop r29 114ea: cf 91 pop r28 114ec: 1f 91 pop r17 114ee: 0f 91 pop r16 114f0: ff 90 pop r15 114f2: ef 90 pop r14 114f4: 08 95 ret 000114f6 : //! 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) { 114f6: bf 92 push r11 114f8: cf 92 push r12 114fa: df 92 push r13 114fc: ef 92 push r14 114fe: ff 92 push r15 11500: 0f 93 push r16 11502: 1f 93 push r17 11504: cf 93 push r28 11506: df 93 push r29 if (saved_printing) return; 11508: e0 91 57 0e lds r30, 0x0E57 ; 0x800e57 1150c: e1 11 cpse r30, r1 1150e: b1 c0 rjmp .+354 ; 0x11672 11510: 05 2f mov r16, r21 11512: 14 2f mov r17, r20 11514: e9 01 movw r28, r18 11516: 6b 01 movw r12, r22 11518: 7c 01 movw r14, r24 cli(); 1151a: f8 94 cli save_print_file_state(); 1151c: 0e 94 00 66 call 0xcc00 ; 0xcc00 // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 11520: b0 90 56 0e lds r11, 0x0E56 ; 0x800e56 11524: b1 10 cpse r11, r1 11526: 02 c0 rjmp .+4 ; 0x1152c 11528: b0 90 55 0e lds r11, 0x0E55 ; 0x800e55 save_planner_global_state(); 1152c: 0e 94 b6 65 call 0xcb6c ; 0xcb6c planner_abort_hard(); //abort printing 11530: 0f 94 c2 bb call 0x37784 ; 0x37784 memcpy(saved_pos, current_position, sizeof(saved_pos)); 11534: 80 e1 ldi r24, 0x10 ; 16 11536: e0 e4 ldi r30, 0x40 ; 64 11538: f7 e0 ldi r31, 0x07 ; 7 1153a: ab e9 ldi r26, 0x9B ; 155 1153c: b2 e0 ldi r27, 0x02 ; 2 1153e: 01 90 ld r0, Z+ 11540: 0d 92 st X+, r0 11542: 8a 95 dec r24 11544: e1 f7 brne .-8 ; 0x1153e if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 11546: bb 20 and r11, r11 11548: 61 f0 breq .+24 ; 0x11562 1154a: 80 e0 ldi r24, 0x00 ; 0 1154c: 90 e0 ldi r25, 0x00 ; 0 1154e: a0 e8 ldi r26, 0x80 ; 128 11550: bf eb ldi r27, 0xBF ; 191 11552: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 11556: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 1155a: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 1155e: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_feedmultiply2 = feedmultiply; //save feedmultiply 11562: 80 91 39 02 lds r24, 0x0239 ; 0x800239 11566: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 1156a: 90 93 70 03 sts 0x0370, r25 ; 0x800370 1156e: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 11572: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 11576: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 1157a: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab 1157e: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa saved_bed_temperature = (uint8_t)degTargetBed(); 11582: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 11586: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 1158a: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 1158e: 83 fb bst r24, 3 11590: 88 27 eor r24, r24 11592: 80 f9 bld r24, 0 11594: 80 93 03 18 sts 0x1803, r24 ; 0x801803 saved_fan_speed = fanSpeed; 11598: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 1159c: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 cmdqueue_reset(); //empty cmdqueue 115a0: 0e 94 e0 80 call 0x101c0 ; 0x101c0 card.sdprinting = false; 115a4: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b // card.closefile(); saved_printing = true; 115a8: 81 e0 ldi r24, 0x01 ; 1 115aa: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 115ae: 0f 94 3b 59 call 0x2b276 ; 0x2b276 sei(); 115b2: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 115b4: 20 e0 ldi r18, 0x00 ; 0 115b6: 30 e0 ldi r19, 0x00 ; 0 115b8: a9 01 movw r20, r18 115ba: c7 01 movw r24, r14 115bc: b6 01 movw r22, r12 115be: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__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) 115c2: 20 e0 ldi r18, 0x00 ; 0 115c4: 30 e0 ldi r19, 0x00 ; 0 115c6: a9 01 movw r20, r18 115c8: f8 01 movw r30, r16 115ca: 6c 2f mov r22, r28 115cc: 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 115ce: 81 11 cpse r24, r1 115d0: 5a c0 rjmp .+180 ; 0x11686 115d2: 8f 2f mov r24, r31 115d4: 90 2f mov r25, r16 115d6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 115da: 88 23 and r24, r24 115dc: 09 f4 brne .+2 ; 0x115e0 115de: 49 c0 rjmp .+146 ; 0x11672 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 115e0: 80 91 03 18 lds r24, 0x1803 ; 0x801803 115e4: 81 11 cpse r24, r1 115e6: 05 c0 rjmp .+10 ; 0x115f2 enquecommand_P(MSG_M83); 115e8: 61 e0 ldi r22, 0x01 ; 1 115ea: 87 e5 ldi r24, 0x57 ; 87 115ec: 9c e6 ldi r25, 0x6C ; 108 115ee: 0e 94 5c 89 call 0x112b8 ; 0x112b8 // 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); 115f2: 0f 93 push r16 115f4: 1f 93 push r17 115f6: df 93 push r29 115f8: cf 93 push r28 115fa: 82 e1 ldi r24, 0x12 ; 18 115fc: 92 e7 ldi r25, 0x72 ; 114 115fe: 9f 93 push r25 11600: 8f 93 push r24 11602: 0e 94 fa 89 call 0x113f4 ; 0x113f4 } if(z_move) 11606: 0f 90 pop r0 11608: 0f 90 pop r0 1160a: 0f 90 pop r0 1160c: 0f 90 pop r0 1160e: 0f 90 pop r0 11610: 0f 90 pop r0 11612: 20 e0 ldi r18, 0x00 ; 0 11614: 30 e0 ldi r19, 0x00 ; 0 11616: a9 01 movw r20, r18 11618: c7 01 movw r24, r14 1161a: b6 01 movw r22, r12 1161c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 11620: 88 23 and r24, r24 11622: 21 f1 breq .+72 ; 0x1166c { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 11624: 84 e4 ldi r24, 0x44 ; 68 11626: 8f 93 push r24 11628: 88 e4 ldi r24, 0x48 ; 72 1162a: 8f 93 push r24 1162c: 1f 92 push r1 1162e: 1f 92 push r1 11630: 20 91 a3 02 lds r18, 0x02A3 ; 0x8002a3 11634: 30 91 a4 02 lds r19, 0x02A4 ; 0x8002a4 11638: 40 91 a5 02 lds r20, 0x02A5 ; 0x8002a5 1163c: 50 91 a6 02 lds r21, 0x02A6 ; 0x8002a6 11640: c7 01 movw r24, r14 11642: b6 01 movw r22, r12 11644: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 11648: 9f 93 push r25 1164a: 8f 93 push r24 1164c: 7f 93 push r23 1164e: 6f 93 push r22 11650: 8a e6 ldi r24, 0x6A ; 106 11652: 9f e7 ldi r25, 0x7F ; 127 11654: 9f 93 push r25 11656: 8f 93 push r24 11658: 0e 94 fa 89 call 0x113f4 ; 0x113f4 1165c: 8d b7 in r24, 0x3d ; 61 1165e: 9e b7 in r25, 0x3e ; 62 11660: 0a 96 adiw r24, 0x0a ; 10 11662: 0f b6 in r0, 0x3f ; 63 11664: f8 94 cli 11666: 9e bf out 0x3e, r25 ; 62 11668: 0f be out 0x3f, r0 ; 63 1166a: 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; 1166c: 81 e0 ldi r24, 0x01 ; 1 1166e: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d // If this call is invoked from the main Arduino loop() function, let the caller know that the command // in the command queue is not the original command, but a new one, so it should not be removed from the queue. repeatcommand_front(); } } 11672: df 91 pop r29 11674: cf 91 pop r28 11676: 1f 91 pop r17 11678: 0f 91 pop r16 1167a: ff 90 pop r15 1167c: ef 90 pop r14 1167e: df 90 pop r13 11680: cf 90 pop r12 11682: bf 90 pop r11 11684: 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) 11686: 8f 2f mov r24, r31 11688: 90 2f mov r25, r16 1168a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1168e: 88 23 and r24, r24 11690: 49 f2 breq .-110 ; 0x11624 11692: a6 cf rjmp .-180 ; 0x115e0 00011694 : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 11694: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 11698: 88 23 and r24, r24 1169a: 21 f1 breq .+72 ; 0x116e4 if (backlightMode == BACKLIGHT_MODE_AUTO) 1169c: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 116a0: 82 30 cpi r24, 0x02 ; 2 116a2: e9 f4 brne .+58 ; 0x116de { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 116a4: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 116a8: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 116ac: 28 ee ldi r18, 0xE8 ; 232 116ae: 33 e0 ldi r19, 0x03 ; 3 116b0: 0f 94 66 de call 0x3bccc ; 0x3bccc <__usmulhisi3> 116b4: ab 01 movw r20, r22 116b6: bc 01 movw r22, r24 116b8: 85 e3 ldi r24, 0x35 ; 53 116ba: 93 e0 ldi r25, 0x03 ; 3 116bc: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 116c0: 88 23 and r24, r24 116c2: 31 f0 breq .+12 ; 0x116d0 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); 116c4: 60 91 f9 03 lds r22, 0x03F9 ; 0x8003f9 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 116c8: 70 e0 ldi r23, 0x00 ; 0 116ca: 85 e0 ldi r24, 0x05 ; 5 116cc: 0c 94 a5 df jmp 0x1bf4a ; 0x1bf4a 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); 116d0: 80 91 35 03 lds r24, 0x0335 ; 0x800335 116d4: 88 23 and r24, r24 116d6: 31 f0 breq .+12 ; 0x116e4 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); 116d8: 60 91 fa 03 lds r22, 0x03FA ; 0x8003fa 116dc: f5 cf rjmp .-22 ; 0x116c8 { 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); 116de: 81 11 cpse r24, r1 116e0: fb cf rjmp .-10 ; 0x116d8 116e2: f0 cf rjmp .-32 ; 0x116c4 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 116e4: 08 95 ret 000116e6 : 116e6: 60 91 fa 03 lds r22, 0x03FA ; 0x8003fa 116ea: 84 e3 ldi r24, 0x34 ; 52 116ec: 9d e0 ldi r25, 0x0D ; 13 116ee: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 116f2: 60 91 f9 03 lds r22, 0x03F9 ; 0x8003f9 116f6: 83 e3 ldi r24, 0x33 ; 51 116f8: 9d e0 ldi r25, 0x0D ; 13 116fa: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 116fe: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 11702: 82 e3 ldi r24, 0x32 ; 50 11704: 9d e0 ldi r25, 0x0D ; 13 11706: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1170a: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 1170e: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 11712: 80 e3 ldi r24, 0x30 ; 48 11714: 9d e0 ldi r25, 0x0D ; 13 11716: 0d 94 88 dd jmp 0x3bb10 ; 0x3bb10 0001171a : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 1171a: 88 23 and r24, r24 1171c: 61 f0 breq .+24 ; 0x11736 { backlightMode = BACKLIGHT_MODE_BRIGHT; 1171e: 81 e0 ldi r24, 0x01 ; 1 11720: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < LCD_BACKLIGHT_FORCE_ON) backlightLevel_HIGH = LCD_BACKLIGHT_FORCE_ON; 11724: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 11728: 8e 31 cpi r24, 0x1E ; 30 1172a: 18 f4 brcc .+6 ; 0x11732 1172c: 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); 1172e: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa } backlight_update(); 11732: 0c 94 4a 8b jmp 0x11694 ; 0x11694 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); 11736: 82 e3 ldi r24, 0x32 ; 50 11738: 9d e0 ldi r25, 0x0D ; 13 1173a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1173e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 11742: 84 e3 ldi r24, 0x34 ; 52 11744: 9d e0 ldi r25, 0x0D ; 13 11746: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1174a: f1 cf rjmp .-30 ; 0x1172e 0001174c : 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; 1174c: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 11750: 88 23 and r24, r24 11752: 31 f0 breq .+12 ; 0x11760 backlightTimer.start(); 11754: 85 e3 ldi r24, 0x35 ; 53 11756: 93 e0 ldi r25, 0x03 ; 3 11758: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> backlight_update(); 1175c: 0c 94 4a 8b jmp 0x11694 ; 0x11694 } 11760: 08 95 ret 00011762 : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 11762: ff 92 push r15 11764: 0f 93 push r16 11766: 1f 93 push r17 11768: cf 93 push r28 1176a: df 93 push r29 if (!backlightSupport) return; 1176c: 90 91 fb 03 lds r25, 0x03FB ; 0x8003fb 11770: 99 23 and r25, r25 11772: 99 f1 breq .+102 ; 0x117da if (flashNo) 11774: 88 23 and r24, r24 11776: 51 f1 breq .+84 ; 0x117cc { uint8_t backlightMode_bck = backlightMode; 11778: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 1177c: c8 2f mov r28, r24 1177e: d0 e0 ldi r29, 0x00 ; 0 11780: cc 0f add r28, r28 11782: dd 1f adc r29, r29 11784: 10 e0 ldi r17, 0x00 ; 0 11786: ff 24 eor r15, r15 11788: f3 94 inc r15 1178a: 21 2f mov r18, r17 1178c: 30 e0 ldi r19, 0x00 ; 0 1178e: 80 91 35 03 lds r24, 0x0335 ; 0x800335 11792: 8f 25 eor r24, r15 11794: 02 30 cpi r16, 0x02 ; 2 11796: 09 f0 breq .+2 ; 0x1179a 11798: 80 e0 ldi r24, 0x00 ; 0 1179a: 8c 0f add r24, r28 1179c: 9d 2f mov r25, r29 1179e: 91 1d adc r25, r1 117a0: 28 17 cp r18, r24 117a2: 39 07 cpc r19, r25 117a4: 8c f4 brge .+34 ; 0x117c8 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 117a6: 81 e0 ldi r24, 0x01 ; 1 117a8: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 117ac: 91 11 cpse r25, r1 117ae: 80 e0 ldi r24, 0x00 ; 0 117b0: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 117b4: 0e 94 4a 8b call 0x11694 ; 0x11694 _delay(BL_FLASH_DELAY_MS); 117b8: 69 e1 ldi r22, 0x19 ; 25 117ba: 70 e0 ldi r23, 0x00 ; 0 117bc: 80 e0 ldi r24, 0x00 ; 0 117be: 90 e0 ldi r25, 0x00 ; 0 117c0: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 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++) 117c4: 1f 5f subi r17, 0xFF ; 255 117c6: e1 cf rjmp .-62 ; 0x1178a { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 117c8: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 117cc: df 91 pop r29 117ce: cf 91 pop r28 117d0: 1f 91 pop r17 117d2: 0f 91 pop r16 117d4: ff 90 pop r15 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 117d6: 0c 94 a6 8b jmp 0x1174c ; 0x1174c } 117da: df 91 pop r29 117dc: cf 91 pop r28 117de: 1f 91 pop r17 117e0: 0f 91 pop r16 117e2: ff 90 pop r15 117e4: 08 95 ret 000117e6 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 117e6: 0f 93 push r16 117e8: 1f 93 push r17 117ea: cf 93 push r28 117ec: df 93 push r29 117ee: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { 117f0: 80 91 85 17 lds r24, 0x1785 ; 0x801785 117f4: 81 30 cpi r24, 0x01 ; 1 117f6: 21 f0 breq .+8 ; 0x11800 117f8: 82 30 cpi r24, 0x02 ; 2 117fa: 49 f0 breq .+18 ; 0x1180e return checkFilamentEvents(); } break; case State::disabled: case State::error: default: return false; 117fc: c0 e0 ldi r28, 0x00 ; 0 117fe: 4b c0 rjmp .+150 ; 0x11896 } 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. 11800: 82 e0 ldi r24, 0x02 ; 2 11802: 80 93 85 17 sts 0x1785, r24 ; 0x801785 // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldFilamentPresent = fsensor.getFilamentPresent(); 11806: 0e 94 cc e4 call 0x1c998 ; 0x1c998 1180a: 80 93 88 17 sts 0x1788, r24 ; 0x801788 [[fallthrough]]; case State::ready: { postponedLoadEvent = false; 1180e: 10 92 89 17 sts 0x1789, r1 ; 0x801789 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 11812: 80 91 85 17 lds r24, 0x1785 ; 0x801785 11816: 82 30 cpi r24, 0x02 ; 2 11818: 09 f0 breq .+2 ; 0x1181c 1181a: 92 c0 rjmp .+292 ; 0x11940 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 1181c: 80 91 8a 17 lds r24, 0x178A ; 0x80178a 11820: 81 11 cpse r24, r1 11822: cc c0 rjmp .+408 ; 0x119bc return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); 11824: 0e 94 cc e4 call 0x1c998 ; 0x1c998 11828: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { 1182a: 80 91 88 17 lds r24, 0x1788 ; 0x801788 1182e: c8 17 cp r28, r24 11830: 29 f3 breq .-54 ; 0x117fc oldFilamentPresent = newFilamentPresent; 11832: c0 93 88 17 sts 0x1788, r28 ; 0x801788 eventBlankingTimer.start(); 11836: 8a e8 ldi r24, 0x8A ; 138 11838: 97 e1 ldi r25, 0x17 ; 23 1183a: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> if (newFilamentPresent) { // filament insertion 1183e: cc 23 and r28, r28 11840: 09 f4 brne .+2 ; 0x11844 11842: c5 c0 rjmp .+394 ; 0x119ce } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11844: 80 91 86 17 lds r24, 0x1786 ; 0x801786 11848: 88 23 and r24, r24 1184a: 11 f1 breq .+68 ; 0x11890 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1184c: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 11850: 81 11 cpse r24, r1 11852: 1e c0 rjmp .+60 ; 0x11890 && !( 11854: 80 91 95 13 lds r24, 0x1395 ; 0x801395 11858: 81 30 cpi r24, 0x01 ; 1 1185a: d1 f0 breq .+52 ; 0x11890 } //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); 1185c: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 11860: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 11864: 89 1b sub r24, r25 11866: 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 11868: 99 f4 brne .+38 ; 0x11890 || printJobOngoing() 1186a: 0e 94 56 68 call 0xd0ac ; 0xd0ac 1186e: 81 11 cpse r24, r1 11870: 0f c0 rjmp .+30 ; 0x11890 || (lcd_commands_type == LcdCommands::Layer1Cal) 11872: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 11876: 84 30 cpi r24, 0x04 ; 4 11878: 59 f0 breq .+22 ; 0x11890 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 1187a: 8f e5 ldi r24, 0x5F ; 95 1187c: 9f e0 ldi r25, 0x0F ; 15 1187e: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11882: 81 11 cpse r24, r1 11884: 05 c0 rjmp .+10 ; 0x11890 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 11886: 61 e0 ldi r22, 0x01 ; 1 11888: 82 eb ldi r24, 0xB2 ; 178 1188a: 9a e3 ldi r25, 0x3A ; 58 1188c: 0f 94 32 d0 call 0x3a064 ; 0x3a064 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 11890: 81 e0 ldi r24, 0x01 ; 1 11892: 80 93 89 17 sts 0x1789, r24 ; 0x801789 sensorRevision = (SensorRevision)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_PCB); } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { 11896: 80 91 85 17 lds r24, 0x1785 ; 0x801785 1189a: 82 30 cpi r24, 0x02 ; 2 1189c: 09 f0 breq .+2 ; 0x118a0 1189e: 4b c0 rjmp .+150 ; 0x11936 return true; } bool IR_sensor_analog::getVoltReady() const { bool ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } 118a0: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 118a2: f8 94 cli 118a4: 80 91 8f 17 lds r24, 0x178F ; 0x80178f (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 118a8: 9f bf out 0x3f, r25 ; 63 } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { if (getVoltReady()) { 118aa: 88 23 and r24, r24 118ac: 09 f4 brne .+2 ; 0x118b0 118ae: 43 c0 rjmp .+134 ; 0x11936 ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } return ret; } void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } 118b0: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 118b2: f8 94 cli 118b4: 10 92 8f 17 sts 0x178F, r1 ; 0x80178f (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 118b8: 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(); 118ba: 0f 94 9c 7c call 0x2f938 ; 0x2f938 118be: 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) { 118c0: 80 91 94 17 lds r24, 0x1794 ; 0x801794 118c4: 90 91 95 17 lds r25, 0x1795 ; 0x801795 118c8: 80 17 cp r24, r16 118ca: 91 07 cpc r25, r17 118cc: 08 f0 brcs .+2 ; 0x118d0 118ce: d7 c0 rjmp .+430 ; 0x11a7e maxVolt = volt; 118d0: 10 93 95 17 sts 0x1795, r17 ; 0x801795 118d4: 00 93 94 17 sts 0x1794, r16 ; 0x801794 //! what we want to detect: //! if minvolt gets below ~0.3V, it means there is an old fsensor //! if maxvolt gets above 4.6V, it means we either have an old fsensor or broken cables/fsensor //! So I'm waiting for a situation, when minVolt gets to range <0, 1.5> and maxVolt gets into range <3.0, 5> //! If and only if minVolt is in range <0.3, 1.5> and maxVolt is in range <3.0, 4.6>, I'm considering a situation with the new fsensor if (minVolt >= IRsensor_Ldiode_TRESHOLD && minVolt <= IRsensor_Lmax_TRESHOLD && maxVolt >= IRsensor_Hmin_TRESHOLD && 118d8: 80 91 92 17 lds r24, 0x1792 ; 0x801792 118dc: 90 91 93 17 lds r25, 0x1793 ; 0x801793 118e0: 9c 01 movw r18, r24 118e2: 26 5d subi r18, 0xD6 ; 214 118e4: 33 40 sbci r19, 0x03 ; 3 118e6: 29 35 cpi r18, 0x59 ; 89 118e8: 3f 40 sbci r19, 0x0F ; 15 118ea: 08 f0 brcs .+2 ; 0x118ee 118ec: d5 c0 rjmp .+426 ; 0x11a98 118ee: 80 91 94 17 lds r24, 0x1794 ; 0x801794 118f2: 90 91 95 17 lds r25, 0x1795 ; 0x801795 118f6: 8d 55 subi r24, 0x5D ; 93 118f8: 96 42 sbci r25, 0x26 ; 38 118fa: 87 37 cpi r24, 0x77 ; 119 118fc: 94 41 sbci r25, 0x14 ; 20 118fe: 20 f4 brcc .+8 ; 0x11908 maxVolt <= IRsensor_Hopen_TRESHOLD) { IR_ANALOG_Check(SensorRevision::_Old, SensorRevision::_Rev04); 11900: 61 e0 ldi r22, 0x01 ; 1 11902: 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); 11904: 0f 94 b4 7c call 0x2f968 ; 0x2f968 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) { 11908: c8 01 movw r24, r16 1190a: 8e 52 subi r24, 0x2E ; 46 1190c: 93 41 sbci r25, 0x13 ; 19 1190e: 80 33 cpi r24, 0x30 ; 48 11910: 93 41 sbci r25, 0x13 ; 19 11912: 08 f0 brcs .+2 ; 0x11916 11914: d2 c0 rjmp .+420 ; 0x11aba /// 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) { 11916: 80 91 98 17 lds r24, 0x1798 ; 0x801798 1191a: 91 e0 ldi r25, 0x01 ; 1 1191c: 98 0f add r25, r24 1191e: 90 93 98 17 sts 0x1798, r25 ; 0x801798 11922: 85 30 cpi r24, 0x05 ; 5 11924: 08 f4 brcc .+2 ; 0x11928 11926: cb c0 rjmp .+406 ; 0x11abe puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); 11928: 8d e8 ldi r24, 0x8D ; 141 1192a: 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")); 1192c: 0f 94 2f dc call 0x3b85e ; 0x3b85e eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 11930: 83 e0 ldi r24, 0x03 ; 3 11932: 80 93 85 17 sts 0x1785, r24 ; 0x801785 #ifdef FILAMENT_SENSOR if (fsensor.update()) { 11936: cc 23 and r28, r28 11938: 19 f0 breq .+6 ; 0x11940 lcd_draw_update = 1; //cause lcd update so that fsensor event polling can be done from the lcd draw routine. 1193a: 81 e0 ldi r24, 0x01 ; 1 1193c: 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) 11940: 0e 94 a7 68 call 0xd14e ; 0xd14e 11944: 81 11 cpse r24, r1 11946: c9 c0 rjmp .+402 ; 0x11ada 11948: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 1194c: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 11950: 00 97 sbiw r24, 0x00 ; 0 11952: 39 f4 brne .+14 ; 0x11962 11954: 20 91 68 0e lds r18, 0x0E68 ; 0x800e68 11958: 30 91 69 0e lds r19, 0x0E69 ; 0x800e69 1195c: 23 2b or r18, r19 1195e: 09 f4 brne .+2 ; 0x11962 11960: bc c0 rjmp .+376 ; 0x11ada 11962: 40 91 30 02 lds r20, 0x0230 ; 0x800230 11966: 50 91 31 02 lds r21, 0x0231 ; 0x800231 1196a: 60 91 32 02 lds r22, 0x0232 ; 0x800232 1196e: 70 91 33 02 lds r23, 0x0233 ; 0x800233 11972: 41 15 cp r20, r1 11974: 51 05 cpc r21, r1 11976: 61 05 cpc r22, r1 11978: 71 05 cpc r23, r1 1197a: 09 f4 brne .+2 ; 0x1197e 1197c: ae c0 rjmp .+348 ; 0x11ada { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 1197e: 89 2b or r24, r25 11980: 31 f4 brne .+12 ; 0x1198e 11982: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 11986: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 1198a: 89 2b or r24, r25 1198c: 29 f0 breq .+10 ; 0x11998 1198e: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 11992: 88 23 and r24, r24 11994: 09 f4 brne .+2 ; 0x11998 11996: 09 c1 rjmp .+530 ; 0x11baa { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 11998: 88 ed ldi r24, 0xD8 ; 216 1199a: 95 e0 ldi r25, 0x05 ; 5 1199c: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 119a0: 88 23 and r24, r24 119a2: 09 f4 brne .+2 ; 0x119a6 119a4: 9c c0 rjmp .+312 ; 0x11ade { disable_heater(); 119a6: 0f 94 27 45 call 0x28a4e ; 0x28a4e lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 119aa: 82 e7 ldi r24, 0x72 ; 114 119ac: 96 e3 ldi r25, 0x36 ; 54 119ae: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 119b2: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 lcd_return_to_status(); 119b6: 0f 94 23 27 call 0x24e46 ; 0x24e46 119ba: 91 c0 rjmp .+290 ; 0x11ade } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 119bc: 64 e6 ldi r22, 0x64 ; 100 119be: 70 e0 ldi r23, 0x00 ; 0 119c0: 8a e8 ldi r24, 0x8A ; 138 119c2: 97 e1 ldi r25, 0x17 ; 23 119c4: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 119c8: 81 11 cpse r24, r1 119ca: 2c cf rjmp .-424 ; 0x11824 119cc: 17 cf rjmp .-466 ; 0x117fc } } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled 119ce: c0 91 87 17 lds r28, 0x1787 ; 0x801787 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 119d2: cc 23 and r28, r28 119d4: 09 f4 brne .+2 ; 0x119d8 119d6: 4f c0 rjmp .+158 ; 0x11a76 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 119d8: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 119dc: 81 11 cpse r24, r1 119de: 5b cf rjmp .-330 ; 0x11896 119e0: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 119e4: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 119e8: 89 1b sub r24, r25 119ea: 8f 70 andi r24, 0x0F ; 15 && ( 119ec: 29 f4 brne .+10 ; 0x119f8 moves_planned() != 0 || printJobOngoing() 119ee: 0e 94 56 68 call 0xd0ac ; 0xd0ac 119f2: 88 23 and r24, r24 119f4: 09 f4 brne .+2 ; 0x119f8 119f6: 4f cf rjmp .-354 ; 0x11896 ) && !( saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 119f8: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 119fc: 81 11 cpse r24, r1 119fe: 3d c0 rjmp .+122 ; 0x11a7a saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11a00: 80 91 95 13 lds r24, 0x1395 ; 0x801395 11a04: 81 30 cpi r24, 0x01 ; 1 11a06: 09 f4 brne .+2 ; 0x11a0a 11a08: 46 cf rjmp .-372 ; 0x11896 || (lcd_commands_type == LcdCommands::Layer1Cal) 11a0a: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 11a0e: 84 30 cpi r24, 0x04 ; 4 11a10: 09 f4 brne .+2 ; 0x11a14 11a12: 41 cf rjmp .-382 ; 0x11896 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11a14: 8f e5 ldi r24, 0x5F ; 95 11a16: 9f e0 ldi r25, 0x0F ; 15 11a18: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11a1c: 81 11 cpse r24, r1 11a1e: 3b cf rjmp .-394 ; 0x11896 } //! @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); 11a20: 80 e5 ldi r24, 0x50 ; 80 11a22: 97 e6 ldi r25, 0x67 ; 103 11a24: 9f 93 push r25 11a26: 8f 93 push r24 11a28: 86 e3 ldi r24, 0x36 ; 54 11a2a: 97 e6 ldi r25, 0x67 ; 103 11a2c: 9f 93 push r25 11a2e: 8f 93 push r24 11a30: 0f 94 08 dc call 0x3b810 ; 0x3b810 void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11a34: 10 92 87 17 sts 0x1787, r1 ; 0x801787 autoLoadEnabled = false; 11a38: 10 92 86 17 sts 0x1786, r1 ; 0x801786 stop_and_save_print_to_ram(0, 0); 11a3c: 20 e0 ldi r18, 0x00 ; 0 11a3e: 30 e0 ldi r19, 0x00 ; 0 11a40: a9 01 movw r20, r18 11a42: ca 01 movw r24, r20 11a44: b9 01 movw r22, r18 11a46: 0e 94 7b 8a call 0x114f6 ; 0x114f6 restore_print_from_ram_and_continue(0); 11a4a: 60 e0 ldi r22, 0x00 ; 0 11a4c: 70 e0 ldi r23, 0x00 ; 0 11a4e: cb 01 movw r24, r22 11a50: 0e 94 0a 69 call 0xd214 ; 0xd214 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11a54: 85 e6 ldi r24, 0x65 ; 101 11a56: 9f e0 ldi r25, 0x0F ; 15 11a58: 0e 94 c4 77 call 0xef88 ; 0xef88 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11a5c: 81 e0 ldi r24, 0x01 ; 1 11a5e: 9f e0 ldi r25, 0x0F ; 15 11a60: 0e 94 b7 77 call 0xef6e ; 0xef6e enquecommand_front_P(MSG_M600); 11a64: 8f eb ldi r24, 0xBF ; 191 11a66: 90 e7 ldi r25, 0x70 ; 112 11a68: 0f 94 d6 76 call 0x2edac ; 0x2edac 11a6c: 0f 90 pop r0 11a6e: 0f 90 pop r0 11a70: 0f 90 pop r0 11a72: 0f 90 pop r0 11a74: 10 cf rjmp .-480 ; 0x11896 postponedLoadEvent = true; } else { // filament removal // puts_P(PSTR("filament removed")); triggerFilamentRemoved(); } return true; 11a76: c1 e0 ldi r28, 0x01 ; 1 11a78: 0e cf rjmp .-484 ; 0x11896 11a7a: c8 2f mov r28, r24 11a7c: 0c cf rjmp .-488 ; 0x11896 // 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) { 11a7e: 80 91 92 17 lds r24, 0x1792 ; 0x801792 11a82: 90 91 93 17 lds r25, 0x1793 ; 0x801793 11a86: 08 17 cp r16, r24 11a88: 19 07 cpc r17, r25 11a8a: 08 f0 brcs .+2 ; 0x11a8e 11a8c: 25 cf rjmp .-438 ; 0x118d8 minVolt = volt; 11a8e: 10 93 93 17 sts 0x1793, r17 ; 0x801793 11a92: 00 93 92 17 sts 0x1792, r16 ; 0x801792 11a96: 20 cf rjmp .-448 ; 0x118d8 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) { 11a98: 86 3d cpi r24, 0xD6 ; 214 11a9a: 93 40 sbci r25, 0x03 ; 3 11a9c: 08 f0 brcs .+2 ; 0x11aa0 11a9e: 34 cf rjmp .-408 ; 0x11908 11aa0: 80 91 94 17 lds r24, 0x1794 ; 0x801794 11aa4: 90 91 95 17 lds r25, 0x1795 ; 0x801795 11aa8: 84 5d subi r24, 0xD4 ; 212 11aaa: 9a 43 sbci r25, 0x3A ; 58 11aac: 8d 31 cpi r24, 0x1D ; 29 11aae: 95 40 sbci r25, 0x05 ; 5 11ab0: 08 f0 brcs .+2 ; 0x11ab4 11ab2: 2a cf rjmp .-428 ; 0x11908 IR_ANALOG_Check(SensorRevision::_Rev04, SensorRevision::_Old); 11ab4: 60 e0 ldi r22, 0x00 ; 0 11ab6: 81 e0 ldi r24, 0x01 ; 1 11ab8: 25 cf rjmp .-438 ; 0x11904 if (voltageErrorCnt++ > 4) { puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); return false; } } else { voltageErrorCnt = 0; 11aba: 10 92 98 17 sts 0x1798, r1 ; 0x801798 } if (sensorRevision == SensorRevision::_Rev04) { 11abe: 80 91 8e 17 lds r24, 0x178E ; 0x80178e 11ac2: 81 30 cpi r24, 0x01 ; 1 11ac4: 09 f0 breq .+2 ; 0x11ac8 11ac6: 37 cf rjmp .-402 ; 0x11936 /// 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) { 11ac8: 03 5d subi r16, 0xD3 ; 211 11aca: 1a 43 sbci r17, 0x3A ; 58 11acc: 0e 31 cpi r16, 0x1E ; 30 11ace: 15 40 sbci r17, 0x05 ; 5 11ad0: 08 f0 brcs .+2 ; 0x11ad4 11ad2: 31 cf rjmp .-414 ; 0x11936 puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected")); 11ad4: 8c e5 ldi r24, 0x5C ; 92 11ad6: 9e e7 ldi r25, 0x7E ; 126 11ad8: 29 cf rjmp .-430 ; 0x1192c inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11ada: 10 92 d8 05 sts 0x05D8, r1 ; 0x8005d8 #if defined(KILL_PIN) && KILL_PIN > -1 static int killCount = 0; // make the inactivity button a bit less responsive const int KILL_DELAY = 10000; #endif if(buflen < (BUFSIZE-1)){ 11ade: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 11ae2: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 11ae6: 03 97 sbiw r24, 0x03 ; 3 11ae8: 14 f4 brge .+4 ; 0x11aee get_command(); 11aea: 0e 94 5c 84 call 0x108b8 ; 0x108b8 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); 11aee: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 11af2: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 11af6: 98 17 cp r25, r24 11af8: 81 f0 breq .+32 ; 0x11b1a 11afa: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 11afe: 86 30 cpi r24, 0x06 ; 6 11b00: 61 f4 brne .+24 ; 0x11b1a 11b02: 68 e8 ldi r22, 0x88 ; 136 11b04: 73 e1 ldi r23, 0x13 ; 19 11b06: 8e e0 ldi r24, 0x0E ; 14 11b08: 95 e0 ldi r25, 0x05 ; 5 11b0a: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 11b0e: 88 23 and r24, r24 11b10: 21 f0 breq .+8 ; 0x11b1a { // 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(); 11b12: 8e e0 ldi r24, 0x0E ; 14 11b14: 95 e0 ldi r25, 0x05 ; 5 11b16: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 11b1a: 40 91 7c 03 lds r20, 0x037C ; 0x80037c 11b1e: 50 91 7d 03 lds r21, 0x037D ; 0x80037d 11b22: 60 91 7e 03 lds r22, 0x037E ; 0x80037e 11b26: 70 91 7f 03 lds r23, 0x037F ; 0x80037f 11b2a: 41 15 cp r20, r1 11b2c: 51 05 cpc r21, r1 11b2e: 61 05 cpc r22, r1 11b30: 71 05 cpc r23, r1 11b32: 09 f0 breq .+2 ; 0x11b36 11b34: 3f c0 rjmp .+126 ; 0x11bb4 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 11b36: 40 91 34 02 lds r20, 0x0234 ; 0x800234 11b3a: 50 91 35 02 lds r21, 0x0235 ; 0x800235 11b3e: 60 91 36 02 lds r22, 0x0236 ; 0x800236 11b42: 70 91 37 02 lds r23, 0x0237 ; 0x800237 11b46: 41 15 cp r20, r1 11b48: 51 05 cpc r21, r1 11b4a: 61 05 cpc r22, r1 11b4c: 71 05 cpc r23, r1 11b4e: a9 f0 breq .+42 ; 0x11b7a 11b50: 84 e8 ldi r24, 0x84 ; 132 11b52: 93 e0 ldi r25, 0x03 ; 3 11b54: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 11b58: 88 23 and r24, r24 11b5a: 79 f0 breq .+30 ; 0x11b7a 11b5c: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 11b60: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 if(blocks_queued() == false && ignore_stepper_queue == false) { 11b64: 98 13 cpse r25, r24 11b66: 09 c0 rjmp .+18 ; 0x11b7a 11b68: d1 11 cpse r29, r1 11b6a: 07 c0 rjmp .+14 ; 0x11b7a disable_x(); 11b6c: 17 9a sbi 0x02, 7 ; 2 11b6e: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); 11b72: 16 9a sbi 0x02, 6 ; 2 11b74: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_z(); disable_e0(); 11b78: 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; 11b7a: c0 91 df 03 lds r28, 0x03DF ; 0x8003df block_t *block; if(block_buffer_tail != block_buffer_head) 11b7e: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 11b82: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 11b86: 98 17 cp r25, r24 11b88: 01 f1 breq .+64 ; 0x11bca { uint8_t block_index = block_buffer_tail; 11b8a: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 tail_fan_speed = block_buffer[block_index].fan_speed; 11b8e: 9e e6 ldi r25, 0x6E ; 110 11b90: 89 9f mul r24, r25 11b92: f0 01 movw r30, r0 11b94: 11 24 eor r1, r1 11b96: e7 54 subi r30, 0x47 ; 71 11b98: f8 4f sbci r31, 0xF8 ; 248 11b9a: c0 81 ld r28, Z while(block_index != block_buffer_head) 11b9c: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 11ba0: 98 17 cp r25, r24 11ba2: 99 f0 breq .+38 ; 0x11bca 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); 11ba4: 8f 5f subi r24, 0xFF ; 255 11ba6: 8f 70 andi r24, 0x0F ; 15 11ba8: f9 cf rjmp .-14 ; 0x11b9c { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11baa: 88 ed ldi r24, 0xD8 ; 216 11bac: 95 e0 ldi r25, 0x05 ; 5 11bae: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> 11bb2: 95 cf rjmp .-214 ; 0x11ade // 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)) 11bb4: 84 e8 ldi r24, 0x84 ; 132 11bb6: 93 e0 ldi r25, 0x03 ; 3 11bb8: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 11bbc: 88 23 and r24, r24 11bbe: 09 f4 brne .+2 ; 0x11bc2 11bc0: ba cf rjmp .-140 ; 0x11b36 kill(PSTR("Inactivity Shutdown")); 11bc2: 8e eb ldi r24, 0xBE ; 190 11bc4: 9e e7 ldi r25, 0x7E ; 126 11bc6: 0e 94 a6 7b call 0xf74c ; 0xf74c 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) { 11bca: cc 23 and r28, r28 11bcc: 09 f4 brne .+2 ; 0x11bd0 11bce: 9f c0 rjmp .+318 ; 0x11d0e if (fan_kick_end == 0) { 11bd0: 80 91 6a 03 lds r24, 0x036A ; 0x80036a 11bd4: 90 91 6b 03 lds r25, 0x036B ; 0x80036b 11bd8: a0 91 6c 03 lds r26, 0x036C ; 0x80036c 11bdc: b0 91 6d 03 lds r27, 0x036D ; 0x80036d 11be0: 89 2b or r24, r25 11be2: 8a 2b or r24, r26 11be4: 8b 2b or r24, r27 11be6: 81 f4 brne .+32 ; 0x11c08 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11be8: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 11bec: 60 5e subi r22, 0xE0 ; 224 11bee: 7c 4f sbci r23, 0xFC ; 252 11bf0: 8f 4f sbci r24, 0xFF ; 255 11bf2: 9f 4f sbci r25, 0xFF ; 255 11bf4: 60 93 6a 03 sts 0x036A, r22 ; 0x80036a 11bf8: 70 93 6b 03 sts 0x036B, r23 ; 0x80036b 11bfc: 80 93 6c 03 sts 0x036C, r24 ; 0x80036c 11c00: 90 93 6d 03 sts 0x036D, r25 ; 0x80036d tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 11c04: cf ef ldi r28, 0xFF ; 255 11c06: 0f c0 rjmp .+30 ; 0x11c26 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()) 11c08: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 11c0c: 00 91 6a 03 lds r16, 0x036A ; 0x80036a 11c10: 10 91 6b 03 lds r17, 0x036B ; 0x80036b 11c14: 20 91 6c 03 lds r18, 0x036C ; 0x80036c 11c18: 30 91 6d 03 lds r19, 0x036D ; 0x80036d 11c1c: 60 17 cp r22, r16 11c1e: 71 07 cpc r23, r17 11c20: 82 07 cpc r24, r18 11c22: 93 07 cpc r25, r19 11c24: 78 f3 brcs .-34 ; 0x11c04 } 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 11c26: 80 91 33 05 lds r24, 0x0533 ; 0x800533 11c2a: 88 23 and r24, r24 11c2c: 09 f4 brne .+2 ; 0x11c30 11c2e: 78 c0 rjmp .+240 ; 0x11d20 fanSpeedBckp = tail_fan_speed; 11c30: 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) { 11c34: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.560> 11c38: 81 11 cpse r24, r1 11c3a: 07 c0 rjmp .+14 ; 0x11c4a return; } avoidRecursion = true; 11c3c: 81 e0 ldi r24, 0x01 ; 1 11c3e: 80 93 0c 05 sts 0x050C, r24 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.560> mmu_loop_inner(true); 11c42: 0f 94 e3 99 call 0x333c6 ; 0x333c6 avoidRecursion = false; 11c46: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.560> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 11c4a: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 <_ZL26lcd_backlight_wake_trigger.lto_priv.558> 11c4e: 88 23 and r24, r24 11c50: e1 f1 breq .+120 ; 0x11cca lcd_backlight_wake_trigger = false; 11c52: 10 92 d1 05 sts 0x05D1, r1 ; 0x8005d1 <_ZL26lcd_backlight_wake_trigger.lto_priv.558> backlight_wake(); 11c56: 80 e0 ldi r24, 0x00 ; 0 11c58: 0e 94 b1 8b call 0x11762 ; 0x11762 bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 11c5c: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11c5e: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11c60: 80 91 cf 05 lds r24, 0x05CF ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.559> 11c64: 28 2f mov r18, r24 11c66: 08 2e mov r0, r24 11c68: 00 0c add r0, r0 11c6a: 33 0b sbc r19, r19 11c6c: 37 ff sbrs r19, 7 11c6e: 03 c0 rjmp .+6 ; 0x11c76 11c70: 31 95 neg r19 11c72: 21 95 neg r18 11c74: 31 09 sbc r19, r1 11c76: 24 30 cpi r18, 0x04 ; 4 11c78: 31 05 cpc r19, r1 11c7a: 0c f4 brge .+2 ; 0x11c7e 11c7c: 54 c0 rjmp .+168 ; 0x11d26 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11c7e: 98 2f mov r25, r24 11c80: 87 ff sbrs r24, 7 11c82: 02 c0 rjmp .+4 ; 0x11c88 11c84: 93 e0 ldi r25, 0x03 ; 3 11c86: 98 0f add r25, r24 11c88: 95 95 asr r25 11c8a: 95 95 asr r25 11c8c: 20 91 34 05 lds r18, 0x0534 ; 0x800534 11c90: 30 91 35 05 lds r19, 0x0535 ; 0x800535 11c94: 29 0f add r18, r25 11c96: 31 1d adc r19, r1 11c98: 97 fd sbrc r25, 7 11c9a: 3a 95 dec r19 11c9c: 30 93 35 05 sts 0x0535, r19 ; 0x800535 11ca0: 20 93 34 05 sts 0x0534, r18 ; 0x800534 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 11ca4: 83 78 andi r24, 0x83 ; 131 11ca6: 87 ff sbrs r24, 7 11ca8: 03 c0 rjmp .+6 ; 0x11cb0 11caa: 81 50 subi r24, 0x01 ; 1 11cac: 8c 6f ori r24, 0xFC ; 252 11cae: 8f 5f subi r24, 0xFF ; 255 11cb0: 80 93 cf 05 sts 0x05CF, r24 ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.559> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11cb4: 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); 11cb6: 86 e0 ldi r24, 0x06 ; 6 11cb8: 0f 94 34 64 call 0x2c868 ; 0x2c868 if (lcd_draw_update == 0) { 11cbc: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11cc0: 81 11 cpse r24, r1 11cc2: 03 c0 rjmp .+6 ; 0x11cca // Update LCD rendering at minimum lcd_draw_update = 1; 11cc4: 81 e0 ldi r24, 0x01 ; 1 11cc6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11cca: 0e 94 4a 8b call 0x11694 ; 0x11694 // handle longpress if(lcd_longpress_trigger) 11cce: 80 91 d2 05 lds r24, 0x05D2 ; 0x8005d2 11cd2: 88 23 and r24, r24 11cd4: 61 f0 breq .+24 ; 0x11cee { lcd_consume_click(); // Reset trigger to prevent recursion 11cd6: 0e 94 be 71 call 0xe37c ; 0xe37c // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11cda: e0 91 0e 04 lds r30, 0x040E ; 0x80040e 11cde: f0 91 0f 04 lds r31, 0x040F ; 0x80040f 11ce2: 30 97 sbiw r30, 0x00 ; 0 11ce4: 21 f0 breq .+8 ; 0x11cee 11ce6: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 11cea: 81 11 cpse r24, r1 { lcd_longpress_func(); 11cec: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 11cee: 0e 94 f4 7a call 0xf5e8 ; 0xf5e8 #endif //AUTO_REPORT host_keepalive(); 11cf2: 0e 94 43 81 call 0x10286 ; 0x10286 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 11cf6: 40 e3 ldi r20, 0x30 ; 48 11cf8: 55 e7 ldi r21, 0x75 ; 117 11cfa: 60 e0 ldi r22, 0x00 ; 0 11cfc: 70 e0 ldi r23, 0x00 ; 0 11cfe: 8a e9 ldi r24, 0x9A ; 154 11d00: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 11d02: df 91 pop r29 11d04: cf 91 pop r28 11d06: 1f 91 pop r17 11d08: 0f 91 pop r16 11d0a: 0d 94 3f 40 jmp 0x2807e ; 0x2807e ::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; 11d0e: 10 92 6a 03 sts 0x036A, r1 ; 0x80036a 11d12: 10 92 6b 03 sts 0x036B, r1 ; 0x80036b 11d16: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c 11d1a: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d 11d1e: 83 cf rjmp .-250 ; 0x11c26 #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; 11d20: c0 93 9d 04 sts 0x049D, r28 ; 0x80049d 11d24: 87 cf rjmp .-242 ; 0x11c34 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; 11d26: 10 92 cf 05 sts 0x05CF, r1 ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.559> 11d2a: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 11d2c: 80 e0 ldi r24, 0x00 ; 0 11d2e: c4 cf rjmp .-120 ; 0x11cb8 00011d30 : #endif #endif } void delay_keep_alive(unsigned int ms) { 11d30: cf 93 push r28 11d32: df 93 push r29 11d34: ec 01 movw r28, r24 for (;;) { manage_heater(); 11d36: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11d3a: 81 e0 ldi r24, 0x01 ; 1 11d3c: 0e 94 f3 8b call 0x117e6 ; 0x117e6 lcd_update(0); 11d40: 80 e0 ldi r24, 0x00 ; 0 11d42: 0e 94 6d 6f call 0xdeda ; 0xdeda if (ms == 0) 11d46: 20 97 sbiw r28, 0x00 ; 0 11d48: 99 f0 breq .+38 ; 0x11d70 break; else if (ms >= 50) { 11d4a: c2 33 cpi r28, 0x32 ; 50 11d4c: d1 05 cpc r29, r1 11d4e: 40 f0 brcs .+16 ; 0x11d60 _delay(50); 11d50: 62 e3 ldi r22, 0x32 ; 50 11d52: 70 e0 ldi r23, 0x00 ; 0 11d54: 80 e0 ldi r24, 0x00 ; 0 11d56: 90 e0 ldi r25, 0x00 ; 0 11d58: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 ms -= 50; 11d5c: e2 97 sbiw r28, 0x32 ; 50 11d5e: eb cf rjmp .-42 ; 0x11d36 } else { _delay(ms); 11d60: be 01 movw r22, r28 11d62: 90 e0 ldi r25, 0x00 ; 0 11d64: 80 e0 ldi r24, 0x00 ; 0 11d66: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 ms = 0; 11d6a: d0 e0 ldi r29, 0x00 ; 0 11d6c: c0 e0 ldi r28, 0x00 ; 0 11d6e: e3 cf rjmp .-58 ; 0x11d36 } } } 11d70: df 91 pop r29 11d72: cf 91 pop r28 11d74: 08 95 ret 00011d76 : /// @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) { 11d76: cf 93 push r28 11d78: df 93 push r29 11d7a: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11d7c: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11d7e: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 11d82: 81 e0 ldi r24, 0x01 ; 1 11d84: 0e 94 f3 8b call 0x117e6 ; 0x117e6 11d88: 80 91 93 13 lds r24, 0x1393 ; 0x801393 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11d8c: 8f 3f cpi r24, 0xFF ; 255 11d8e: d9 f4 brne .+54 ; 0x11dc6 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11d90: 80 91 28 13 lds r24, 0x1328 ; 0x801328 11d94: 84 30 cpi r24, 0x04 ; 4 11d96: 21 f4 brne .+8 ; 0x11da0 }; 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 11d98: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 11d9c: 81 11 cpse r24, r1 11d9e: ef cf rjmp .-34 ; 0x11d7e 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 11da0: 80 91 66 13 lds r24, 0x1366 ; 0x801366 11da4: 90 91 67 13 lds r25, 0x1367 ; 0x801367 11da8: 01 97 sbiw r24, 0x01 ; 1 11daa: 49 f7 brne .-46 ; 0x11d7e && lastErrorCode != ec) // The error code is not a duplicate 11dac: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 11db0: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 11db4: 89 32 cpi r24, 0x29 ; 41 11db6: 90 48 sbci r25, 0x80 ; 128 11db8: 11 f3 breq .-60 ; 0x11d7e { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11dba: 60 e0 ldi r22, 0x00 ; 0 11dbc: 89 e2 ldi r24, 0x29 ; 41 11dbe: 90 e8 ldi r25, 0x80 ; 128 11dc0: 0f 94 59 83 call 0x306b2 ; 0x306b2 11dc4: dc cf rjmp .-72 ; 0x11d7e inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11dc6: d0 93 93 13 sts 0x1393, r29 ; 0x801393 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11dca: 85 30 cpi r24, 0x05 ; 5 11dcc: 39 f4 brne .+14 ; 0x11ddc if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11dce: cf 3f cpi r28, 0xFF ; 255 11dd0: f9 f2 breq .-66 ; 0x11d90 MMU2::mmu2.eject_filament(eject_slot, true); 11dd2: 61 e0 ldi r22, 0x01 ; 1 11dd4: 8c 2f mov r24, r28 11dd6: 0f 94 7d a0 call 0x340fa ; 0x340fa 11dda: d1 cf rjmp .-94 ; 0x11d7e // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11ddc: 84 30 cpi r24, 0x04 ; 4 11dde: c1 f6 brne .-80 ; 0x11d90 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11de0: df 91 pop r29 11de2: cf 91 pop r28 11de4: 08 95 ret 00011de6 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 11de6: 1f 92 push r1 11de8: 0f 92 push r0 11dea: 0f b6 in r0, 0x3f ; 63 11dec: 0f 92 push r0 11dee: 11 24 eor r1, r1 11df0: 0b b6 in r0, 0x3b ; 59 11df2: 0f 92 push r0 11df4: 2f 93 push r18 11df6: 3f 93 push r19 11df8: 4f 93 push r20 11dfa: 5f 93 push r21 11dfc: 6f 93 push r22 11dfe: 7f 93 push r23 11e00: 8f 93 push r24 11e02: 9f 93 push r25 11e04: af 93 push r26 11e06: bf 93 push r27 11e08: ef 93 push r30 11e0a: ff 93 push r31 adc_values[adc_channel] += ADC; 11e0c: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 11e10: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 11e14: e0 91 34 03 lds r30, 0x0334 ; 0x800334 11e18: f0 e0 ldi r31, 0x00 ; 0 11e1a: ee 0f add r30, r30 11e1c: ff 1f adc r31, r31 11e1e: ec 5d subi r30, 0xDC ; 220 11e20: fc 4f sbci r31, 0xFC ; 252 11e22: 80 81 ld r24, Z 11e24: 91 81 ldd r25, Z+1 ; 0x01 11e26: 82 0f add r24, r18 11e28: 93 1f adc r25, r19 11e2a: 91 83 std Z+1, r25 ; 0x01 11e2c: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 11e2e: 80 91 23 03 lds r24, 0x0323 ; 0x800323 11e32: 8f 5f subi r24, 0xFF ; 255 11e34: 80 93 23 03 sts 0x0323, r24 ; 0x800323 11e38: 80 31 cpi r24, 0x10 ; 16 11e3a: 09 f0 breq .+2 ; 0x11e3e <__vector_29+0x58> 11e3c: 60 c0 rjmp .+192 ; 0x11efe <__vector_29+0x118> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 11e3e: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11e42: 8f 5f subi r24, 0xFF ; 255 11e44: 80 93 34 03 sts 0x0334, r24 ; 0x800334 11e48: 88 30 cpi r24, 0x08 ; 8 11e4a: 09 f0 breq .+2 ; 0x11e4e <__vector_29+0x68> 11e4c: 50 c0 rjmp .+160 ; 0x11eee <__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 11e4e: 80 91 24 03 lds r24, 0x0324 ; 0x800324 11e52: 90 91 25 03 lds r25, 0x0325 ; 0x800325 11e56: 90 93 06 06 sts 0x0606, r25 ; 0x800606 11e5a: 80 93 05 06 sts 0x0605, r24 ; 0x800605 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11e5e: 80 91 28 03 lds r24, 0x0328 ; 0x800328 11e62: 90 91 29 03 lds r25, 0x0329 ; 0x800329 11e66: 90 93 04 06 sts 0x0604, r25 ; 0x800604 11e6a: 80 93 03 06 sts 0x0603, r24 ; 0x800603 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11e6e: 80 91 2a 03 lds r24, 0x032A ; 0x80032a 11e72: 90 91 2b 03 lds r25, 0x032B ; 0x80032b 11e76: 90 93 02 06 sts 0x0602, r25 ; 0x800602 11e7a: 80 93 01 06 sts 0x0601, r24 ; 0x800601 #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR current_temperature_raw_ambient = adc_values[ADC_PIN_IDX(TEMP_AMBIENT_PIN)]; // 5->6 11e7e: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11e82: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11e86: 90 93 10 06 sts 0x0610, r25 ; 0x800610 11e8a: 80 93 0f 06 sts 0x060F, r24 ; 0x80060f #endif //AMBIENT_THERMISTOR #ifdef VOLT_PWR_PIN current_voltage_raw_pwr = adc_values[ADC_PIN_IDX(VOLT_PWR_PIN)]; 11e8e: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11e92: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11e96: 90 93 57 06 sts 0x0657, r25 ; 0x800657 11e9a: 80 93 56 06 sts 0x0656, r24 ; 0x800656 #endif #ifdef VOLT_BED_PIN current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 11e9e: 80 91 32 03 lds r24, 0x0332 ; 0x800332 11ea2: 90 91 33 03 lds r25, 0x0333 ; 0x800333 11ea6: 90 93 55 06 sts 0x0655, r25 ; 0x800655 11eaa: 80 93 54 06 sts 0x0654, r24 ; 0x800654 #endif #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) fsensor.voltUpdate(adc_values[ADC_PIN_IDX(VOLT_IR_PIN)]); 11eae: 80 91 30 03 lds r24, 0x0330 ; 0x800330 11eb2: 90 91 31 03 lds r25, 0x0331 ; 0x800331 return event; } void IR_sensor_analog::voltUpdate(uint16_t raw) { // to be called from the ADC ISR when a cycle is finished voltRaw = raw; 11eb6: 90 93 91 17 sts 0x1791, r25 ; 0x801791 11eba: 80 93 90 17 sts 0x1790, r24 ; 0x801790 voltReady = true; 11ebe: 81 e0 ldi r24, 0x01 ; 1 11ec0: 80 93 8f 17 sts 0x178F, r24 ; 0x80178f #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) adc_values_ready = true; 11ec4: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16adc_values_ready.lto_priv.471> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11ec8: ff 91 pop r31 11eca: ef 91 pop r30 11ecc: bf 91 pop r27 11ece: af 91 pop r26 11ed0: 9f 91 pop r25 11ed2: 8f 91 pop r24 11ed4: 7f 91 pop r23 11ed6: 6f 91 pop r22 11ed8: 5f 91 pop r21 11eda: 4f 91 pop r20 11edc: 3f 91 pop r19 11ede: 2f 91 pop r18 11ee0: 0f 90 pop r0 11ee2: 0b be out 0x3b, r0 ; 59 11ee4: 0f 90 pop r0 11ee6: 0f be out 0x3f, r0 ; 63 11ee8: 0f 90 pop r0 11eea: 1f 90 pop r1 11eec: 18 95 reti 11eee: 80 91 22 03 lds r24, 0x0322 ; 0x800322 <__data_end> return; // do not start the next measurement since there are no channels remaining } // find the next channel while (++adc_channel_idx) { if (ADC_CHAN_MSK & (1 << adc_channel_idx)) { 11ef2: 4f e5 ldi r20, 0x5F ; 95 11ef4: 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) { 11ef6: 8f 5f subi r24, 0xFF ; 255 11ef8: 41 f4 brne .+16 ; 0x11f0a <__vector_29+0x124> 11efa: 10 92 22 03 sts 0x0322, r1 ; 0x800322 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11efe: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11f02: 80 64 ori r24, 0x40 ; 64 11f04: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11f08: df cf rjmp .-66 ; 0x11ec8 <__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)) { 11f0a: 9a 01 movw r18, r20 11f0c: 08 2e mov r0, r24 11f0e: 02 c0 rjmp .+4 ; 0x11f14 <__vector_29+0x12e> 11f10: 35 95 asr r19 11f12: 27 95 ror r18 11f14: 0a 94 dec r0 11f16: e2 f7 brpl .-8 ; 0x11f10 <__vector_29+0x12a> 11f18: 20 ff sbrs r18, 0 11f1a: ed cf rjmp .-38 ; 0x11ef6 <__vector_29+0x110> 11f1c: 80 93 22 03 sts 0x0322, r24 ; 0x800322 <__data_end> adc_setmux(adc_channel_idx); 11f20: 0e 94 0a 5c call 0xb814 ; 0xb814 adc_count = 0; 11f24: 10 92 23 03 sts 0x0323, r1 ; 0x800323 11f28: ea cf rjmp .-44 ; 0x11efe <__vector_29+0x118> 00011f2a : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 11f2a: cf 93 push r28 11f2c: 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 11f2e: ca e7 ldi r28, 0x7A ; 122 11f30: d0 e0 ldi r29, 0x00 ; 0 11f32: 88 81 ld r24, Y 11f34: 8f 7b andi r24, 0xBF ; 191 11f36: 88 83 st Y, r24 adc_count = 0; 11f38: 10 92 23 03 sts 0x0323, r1 ; 0x800323 adc_channel = 0; 11f3c: 10 92 34 03 sts 0x0334, r1 ; 0x800334 adc_channel_idx = first_channel_idx; 11f40: 10 92 22 03 sts 0x0322, r1 ; 0x800322 <__data_end> adc_setmux(adc_channel_idx); 11f44: 80 e0 ldi r24, 0x00 ; 0 11f46: 0e 94 0a 5c call 0xb814 ; 0xb814 memset((void*)adc_values, 0, sizeof(adc_values)); 11f4a: e4 e2 ldi r30, 0x24 ; 36 11f4c: f3 e0 ldi r31, 0x03 ; 3 11f4e: 80 e1 ldi r24, 0x10 ; 16 11f50: df 01 movw r26, r30 11f52: 1d 92 st X+, r1 11f54: 8a 95 dec r24 11f56: e9 f7 brne .-6 ; 0x11f52 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 11f58: 88 81 ld r24, Y 11f5a: 80 64 ori r24, 0x40 ; 64 11f5c: 88 83 st Y, r24 } 11f5e: df 91 pop r29 11f60: cf 91 pop r28 11f62: 08 95 ret 00011f64 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 11f64: 2f 92 push r2 11f66: 3f 92 push r3 11f68: 4f 92 push r4 11f6a: 5f 92 push r5 11f6c: 6f 92 push r6 11f6e: 7f 92 push r7 11f70: 8f 92 push r8 11f72: 9f 92 push r9 11f74: af 92 push r10 11f76: bf 92 push r11 11f78: cf 92 push r12 11f7a: df 92 push r13 11f7c: ef 92 push r14 11f7e: ff 92 push r15 11f80: 0f 93 push r16 11f82: 1f 93 push r17 11f84: cf 93 push r28 11f86: df 93 push r29 11f88: cd b7 in r28, 0x3d ; 61 11f8a: de b7 in r29, 0x3e ; 62 11f8c: a4 97 sbiw r28, 0x24 ; 36 11f8e: 0f b6 in r0, 0x3f ; 63 11f90: f8 94 cli 11f92: de bf out 0x3e, r29 ; 62 11f94: 0f be out 0x3f, r0 ; 63 11f96: 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(); 11f98: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 if (planner_aborted) 11f9c: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 11fa0: 81 11 cpse r24, r1 11fa2: 17 c0 rjmp .+46 ; 0x11fd2 return; mesh_bed_leveling_flag = true; 11fa4: 81 e0 ldi r24, 0x01 ; 1 11fa6: 80 93 56 0e sts 0x0E56, r24 ; 0x800e56 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { 11faa: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 11fae: 88 23 and r24, r24 11fb0: 49 f0 breq .+18 ; 0x11fc4 11fb2: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 11fb6: 88 23 and r24, r24 11fb8: 29 f0 breq .+10 ; 0x11fc4 11fba: 20 91 3f 07 lds r18, 0x073F ; 0x80073f 11fbe: 2f 83 std Y+7, r18 ; 0x07 11fc0: 21 11 cpse r18, r1 11fc2: 20 c0 rjmp .+64 ; 0x12004 11fc4: 81 e0 ldi r24, 0x01 ; 1 11fc6: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d // We don't know where we are! HOME! // Push the commands to the front of the message queue in the reverse order! // There shall be always enough space reserved for these commands. repeatcommand_front(); // repeat G80 with all its parameters enquecommand_front_P(G28W); 11fca: 8b e5 ldi r24, 0x5B ; 91 11fcc: 9c e6 ldi r25, 0x6C ; 108 11fce: 0f 94 d6 76 call 0x2edac ; 0x2edac custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 11fd2: a4 96 adiw r28, 0x24 ; 36 11fd4: 0f b6 in r0, 0x3f ; 63 11fd6: f8 94 cli 11fd8: de bf out 0x3e, r29 ; 62 11fda: 0f be out 0x3f, r0 ; 63 11fdc: cd bf out 0x3d, r28 ; 61 11fde: df 91 pop r29 11fe0: cf 91 pop r28 11fe2: 1f 91 pop r17 11fe4: 0f 91 pop r16 11fe6: ff 90 pop r15 11fe8: ef 90 pop r14 11fea: df 90 pop r13 11fec: cf 90 pop r12 11fee: bf 90 pop r11 11ff0: af 90 pop r10 11ff2: 9f 90 pop r9 11ff4: 8f 90 pop r8 11ff6: 7f 90 pop r7 11ff8: 6f 90 pop r6 11ffa: 5f 90 pop r5 11ffc: 4f 90 pop r4 11ffe: 3f 90 pop r3 12000: 2f 90 pop r2 12002: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 12004: 8b ea ldi r24, 0xAB ; 171 12006: 9d e0 ldi r25, 0x0D ; 13 12008: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1200c: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 1200e: 8e e4 ldi r24, 0x4E ; 78 12010: 0e 94 8d 5c call 0xb91a ; 0xb91a 12014: 08 2f mov r16, r24 12016: 0e 94 1f 5c call 0xb83e ; 0xb83e 1201a: 8e 83 std Y+6, r24 ; 0x06 1201c: 00 23 and r16, r16 1201e: 29 f0 breq .+10 ; 0x1202a 12020: 87 30 cpi r24, 0x07 ; 7 12022: 09 f4 brne .+2 ; 0x12026 12024: c9 c0 rjmp .+402 ; 0x121b8 12026: 83 30 cpi r24, 0x03 ; 3 12028: 29 f0 breq .+10 ; 0x12034 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; 1202a: 13 30 cpi r17, 0x03 ; 3 1202c: 09 f0 breq .+2 ; 0x12030 1202e: c3 c0 rjmp .+390 ; 0x121b6 12030: 63 e0 ldi r22, 0x03 ; 3 12032: 6e 83 std Y+6, r22 ; 0x06 12034: 80 e0 ldi r24, 0x00 ; 0 12036: 90 e0 ldi r25, 0x00 ; 0 12038: a0 e8 ldi r26, 0x80 ; 128 1203a: bf e3 ldi r27, 0x3F ; 63 1203c: 8a 83 std Y+2, r24 ; 0x02 1203e: 9b 83 std Y+3, r25 ; 0x03 12040: ac 83 std Y+4, r26 ; 0x04 12042: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 12044: 8a ea ldi r24, 0xAA ; 170 12046: 9d e0 ldi r25, 0x0D ; 13 12048: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1204c: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 1204e: 83 e4 ldi r24, 0x43 ; 67 12050: 0e 94 8d 5c call 0xb91a ; 0xb91a 12054: 18 2f mov r17, r24 12056: 0e 94 1f 5c call 0xb83e ; 0xb83e 1205a: 11 23 and r17, r17 1205c: 29 f0 breq .+10 ; 0x12068 1205e: 88 23 and r24, r24 12060: 19 f0 breq .+6 ; 0x12068 12062: 8b 30 cpi r24, 0x0B ; 11 12064: 08 f4 brcc .+2 ; 0x12068 12066: 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; 12068: 88 e5 ldi r24, 0x58 ; 88 1206a: 0e 94 8d 5c call 0xb91a ; 0xb91a 1206e: 88 23 and r24, r24 12070: 09 f4 brne .+2 ; 0x12074 12072: ab c0 rjmp .+342 ; 0x121ca 12074: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 12078: 20 e0 ldi r18, 0x00 ; 0 1207a: 30 e0 ldi r19, 0x00 ; 0 1207c: 48 e0 ldi r20, 0x08 ; 8 1207e: 52 e4 ldi r21, 0x42 ; 66 12080: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 12084: 20 e0 ldi r18, 0x00 ; 0 12086: 30 e0 ldi r19, 0x00 ; 0 12088: 48 eb ldi r20, 0xB8 ; 184 1208a: 51 e4 ldi r21, 0x41 ; 65 1208c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 12090: 6a 87 std Y+10, r22 ; 0x0a 12092: 7b 87 std Y+11, r23 ; 0x0b 12094: 8c 87 std Y+12, r24 ; 0x0c 12096: 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; 12098: 89 e5 ldi r24, 0x59 ; 89 1209a: 0e 94 8d 5c call 0xb91a ; 0xb91a 1209e: 88 23 and r24, r24 120a0: 09 f4 brne .+2 ; 0x120a4 120a2: 9c c0 rjmp .+312 ; 0x121dc 120a4: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 120a8: 20 e0 ldi r18, 0x00 ; 0 120aa: 30 e0 ldi r19, 0x00 ; 0 120ac: 48 e0 ldi r20, 0x08 ; 8 120ae: 52 e4 ldi r21, 0x42 ; 66 120b0: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 120b4: 20 e0 ldi r18, 0x00 ; 0 120b6: 30 e0 ldi r19, 0x00 ; 0 120b8: 40 ea ldi r20, 0xA0 ; 160 120ba: 50 e4 ldi r21, 0x40 ; 64 120bc: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 120c0: 6c 8b std Y+20, r22 ; 0x14 120c2: 7d 8b std Y+21, r23 ; 0x15 120c4: 8e 8b std Y+22, r24 ; 0x16 120c6: 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; 120c8: 87 e5 ldi r24, 0x57 ; 87 120ca: 0e 94 8d 5c call 0xb91a ; 0xb91a 120ce: 88 23 and r24, r24 120d0: 09 f4 brne .+2 ; 0x120d4 120d2: 89 c0 rjmp .+274 ; 0x121e6 120d4: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 120d8: 2a 85 ldd r18, Y+10 ; 0x0a 120da: 3b 85 ldd r19, Y+11 ; 0x0b 120dc: 4c 85 ldd r20, Y+12 ; 0x0c 120de: 5d 85 ldd r21, Y+13 ; 0x0d 120e0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 120e4: 20 e0 ldi r18, 0x00 ; 0 120e6: 30 e0 ldi r19, 0x00 ; 0 120e8: 48 e8 ldi r20, 0x88 ; 136 120ea: 52 e4 ldi r21, 0x42 ; 66 120ec: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 120f0: 69 8f std Y+25, r22 ; 0x19 120f2: 7a 8f std Y+26, r23 ; 0x1a 120f4: 8b 8f std Y+27, r24 ; 0x1b 120f6: 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; 120f8: 88 e4 ldi r24, 0x48 ; 72 120fa: 0e 94 8d 5c call 0xb91a ; 0xb91a 120fe: 88 23 and r24, r24 12100: 09 f4 brne .+2 ; 0x12104 12102: 7a c0 rjmp .+244 ; 0x121f8 12104: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 12108: 2c 89 ldd r18, Y+20 ; 0x14 1210a: 3d 89 ldd r19, Y+21 ; 0x15 1210c: 4e 89 ldd r20, Y+22 ; 0x16 1210e: 5f 89 ldd r21, Y+23 ; 0x17 12110: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 12114: 20 e0 ldi r18, 0x00 ; 0 12116: 30 e0 ldi r19, 0x00 ; 0 12118: 48 e8 ldi r20, 0x88 ; 136 1211a: 52 e4 ldi r21, 0x42 ; 66 1211c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 12120: 6d 8f std Y+29, r22 ; 0x1d 12122: 7e 8f std Y+30, r23 ; 0x1e 12124: 8f 8f std Y+31, r24 ; 0x1f 12126: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 12128: 0f 94 d4 8b call 0x317a8 ; 0x317a8 mbl.z_values[0][0] = min_pos[Z_AXIS]; 1212c: 80 91 29 02 lds r24, 0x0229 ; 0x800229 12130: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 12134: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 12138: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 1213c: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e 12140: 90 93 9f 13 sts 0x139F, r25 ; 0x80139f 12144: a0 93 a0 13 sts 0x13A0, r26 ; 0x8013a0 12148: b0 93 a1 13 sts 0x13A1, r27 ; 0x8013a1 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 1214c: 0f 94 0a c7 call 0x38e14 ; 0x38e14 12150: 05 ec ldi r16, 0xC5 ; 197 12152: 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) 12154: c8 01 movw r24, r16 12156: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 1215a: 01 96 adiw r24, 0x01 ; 1 1215c: 09 f0 breq .+2 ; 0x12160 1215e: 51 c0 rjmp .+162 ; 0x12202 12160: 0e 5f subi r16, 0xFE ; 254 12162: 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) { 12164: 05 3d cpi r16, 0xD5 ; 213 12166: 8f e0 ldi r24, 0x0F ; 15 12168: 18 07 cpc r17, r24 1216a: a1 f7 brne .-24 ; 0x12154 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 1216c: 21 2c mov r2, r1 1216e: ad e9 ldi r26, 0x9D ; 157 12170: b3 e1 ldi r27, 0x13 ; 19 12172: ba a3 std Y+34, r27 ; 0x22 12174: 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; 12176: b9 87 std Y+9, r27 ; 0x09 12178: a8 87 std Y+8, r26 ; 0x08 1217a: 51 2c mov r5, r1 1217c: 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; 1217e: 31 2c mov r3, r1 12180: 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)); 12182: 84 2d mov r24, r4 12184: 63 e0 ldi r22, 0x03 ; 3 12186: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__udivmodqi4> 1218a: 98 8b std Y+16, r25 ; 0x10 1218c: 68 84 ldd r6, Y+8 ; 0x08 1218e: 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++) { 12190: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 12192: f8 89 ldd r31, Y+16 ; 0x10 12194: f1 11 cpse r31, r1 12196: 37 c0 rjmp .+110 ; 0x12206 12198: 81 2f mov r24, r17 1219a: 63 e0 ldi r22, 0x03 ; 3 1219c: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__udivmodqi4> 121a0: 91 11 cpse r25, r1 121a2: 31 c0 rjmp .+98 ; 0x12206 if (isOn3x3Mesh) { if (has_z && (row || col)) { 121a4: 21 10 cpse r2, r1 121a6: 3f c1 rjmp .+638 ; 0x12426 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 121a8: 7e 81 ldd r23, Y+6 ; 0x06 121aa: 73 30 cpi r23, 0x03 ; 3 121ac: 09 f4 brne .+2 ; 0x121b0 121ae: 70 c0 rjmp .+224 ; 0x12290 121b0: 8f 81 ldd r24, Y+7 ; 0x07 121b2: 8e 87 std Y+14, r24 ; 0x0e 121b4: 37 c0 rjmp .+110 ; 0x12224 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; 121b6: 1e 83 std Y+6, r17 ; 0x06 121b8: 6a e9 ldi r22, 0x9A ; 154 121ba: 79 e9 ldi r23, 0x99 ; 153 121bc: 89 e1 ldi r24, 0x19 ; 25 121be: 9f e3 ldi r25, 0x3F ; 63 121c0: 6a 83 std Y+2, r22 ; 0x02 121c2: 7b 83 std Y+3, r23 ; 0x03 121c4: 8c 83 std Y+4, r24 ; 0x04 121c6: 9d 83 std Y+5, r25 ; 0x05 121c8: 3d cf rjmp .-390 ; 0x12044 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; 121ca: 80 e0 ldi r24, 0x00 ; 0 121cc: 90 e0 ldi r25, 0x00 ; 0 121ce: a0 e8 ldi r26, 0x80 ; 128 121d0: bf ef ldi r27, 0xFF ; 255 121d2: 8a 87 std Y+10, r24 ; 0x0a 121d4: 9b 87 std Y+11, r25 ; 0x0b 121d6: ac 87 std Y+12, r26 ; 0x0c 121d8: bd 87 std Y+13, r27 ; 0x0d 121da: 5e cf rjmp .-324 ; 0x12098 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 121dc: 60 e0 ldi r22, 0x00 ; 0 121de: 70 e0 ldi r23, 0x00 ; 0 121e0: 80 e8 ldi r24, 0x80 ; 128 121e2: 9f ef ldi r25, 0xFF ; 255 121e4: 6d cf rjmp .-294 ; 0x120c0 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 121e6: 80 e0 ldi r24, 0x00 ; 0 121e8: 90 e0 ldi r25, 0x00 ; 0 121ea: a0 e8 ldi r26, 0x80 ; 128 121ec: bf e7 ldi r27, 0x7F ; 127 121ee: 89 8f std Y+25, r24 ; 0x19 121f0: 9a 8f std Y+26, r25 ; 0x1a 121f2: ab 8f std Y+27, r26 ; 0x1b 121f4: bc 8f std Y+28, r27 ; 0x1c 121f6: 80 cf rjmp .-256 ; 0x120f8 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 121f8: 60 e0 ldi r22, 0x00 ; 0 121fa: 70 e0 ldi r23, 0x00 ; 0 121fc: 80 e8 ldi r24, 0x80 ; 128 121fe: 9f e7 ldi r25, 0x7F ; 127 12200: 8f cf rjmp .-226 ; 0x12120 12202: 2f 80 ldd r2, Y+7 ; 0x07 12204: b4 cf rjmp .-152 ; 0x1216e 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; } 12206: 60 e0 ldi r22, 0x00 ; 0 12208: 70 e0 ldi r23, 0x00 ; 0 1220a: 80 ec ldi r24, 0xC0 ; 192 1220c: 9f e7 ldi r25, 0x7F ; 127 1220e: d3 01 movw r26, r6 12210: 11 96 adiw r26, 0x01 ; 1 12212: 6d 93 st X+, r22 12214: 7d 93 st X+, r23 12216: 8d 93 st X+, r24 12218: 9c 93 st X, r25 1221a: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 1221c: be 81 ldd r27, Y+6 ; 0x06 1221e: b3 30 cpi r27, 0x03 ; 3 12220: c1 f1 breq .+112 ; 0x12292 12222: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 12224: 81 2f mov r24, r17 12226: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 1222a: 4b 01 movw r8, r22 1222c: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 1222e: 80 2f mov r24, r16 12230: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 12234: 6b 01 movw r12, r22 12236: 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)) { 12238: a5 01 movw r20, r10 1223a: 94 01 movw r18, r8 1223c: 6a 85 ldd r22, Y+10 ; 0x0a 1223e: 7b 85 ldd r23, Y+11 ; 0x0b 12240: 8c 85 ldd r24, Y+12 ; 0x0c 12242: 9d 85 ldd r25, Y+13 ; 0x0d 12244: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 12248: 18 16 cp r1, r24 1224a: 0c f4 brge .+2 ; 0x1224e 1224c: 1c c1 rjmp .+568 ; 0x12486 1224e: 29 8d ldd r18, Y+25 ; 0x19 12250: 3a 8d ldd r19, Y+26 ; 0x1a 12252: 4b 8d ldd r20, Y+27 ; 0x1b 12254: 5c 8d ldd r21, Y+28 ; 0x1c 12256: c5 01 movw r24, r10 12258: b4 01 movw r22, r8 1225a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1225e: 18 16 cp r1, r24 12260: 0c f4 brge .+2 ; 0x12264 12262: 11 c1 rjmp .+546 ; 0x12486 12264: a7 01 movw r20, r14 12266: 96 01 movw r18, r12 12268: 6c 89 ldd r22, Y+20 ; 0x14 1226a: 7d 89 ldd r23, Y+21 ; 0x15 1226c: 8e 89 ldd r24, Y+22 ; 0x16 1226e: 9f 89 ldd r25, Y+23 ; 0x17 12270: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 12274: 18 16 cp r1, r24 12276: 0c f4 brge .+2 ; 0x1227a 12278: 06 c1 rjmp .+524 ; 0x12486 1227a: 2d 8d ldd r18, Y+29 ; 0x1d 1227c: 3e 8d ldd r19, Y+30 ; 0x1e 1227e: 4f 8d ldd r20, Y+31 ; 0x1f 12280: 58 a1 ldd r21, Y+32 ; 0x20 12282: c7 01 movw r24, r14 12284: b6 01 movw r22, r12 12286: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1228a: 18 16 cp r1, r24 1228c: 0c f4 brge .+2 ; 0x12290 1228e: fb c0 rjmp .+502 ; 0x12486 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 12290: 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++) { 12292: 1f 5f subi r17, 0xFF ; 255 12294: 24 e0 ldi r18, 0x04 ; 4 12296: 62 0e add r6, r18 12298: 71 1c adc r7, r1 1229a: 17 30 cpi r17, 0x07 ; 7 1229c: 09 f0 breq .+2 ; 0x122a0 1229e: 79 cf rjmp .-270 ; 0x12192 122a0: 6f ef ldi r22, 0xFF ; 255 122a2: 46 1a sub r4, r22 122a4: 56 0a sbc r5, r22 122a6: 88 85 ldd r24, Y+8 ; 0x08 122a8: 99 85 ldd r25, Y+9 ; 0x09 122aa: 4c 96 adiw r24, 0x1c ; 28 122ac: 99 87 std Y+9, r25 ; 0x09 122ae: 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++) { 122b0: 97 e0 ldi r25, 0x07 ; 7 122b2: 49 16 cp r4, r25 122b4: 51 04 cpc r5, r1 122b6: 09 f0 breq .+2 ; 0x122ba 122b8: 63 cf rjmp .-314 ; 0x12180 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 122ba: 0f 94 57 17 call 0x22eae ; 0x22eae // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 122be: a0 91 72 07 lds r26, 0x0772 ; 0x800772 122c2: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 122c4: b0 91 f0 03 lds r27, 0x03F0 ; 0x8003f0 122c8: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 122ca: 81 e0 ldi r24, 0x01 ; 1 122cc: 80 93 72 07 sts 0x0772, r24 ; 0x800772 custom_message_state = meshPointsToProbe + 10; 122d0: 8a e0 ldi r24, 0x0A ; 10 122d2: 83 0d add r24, r3 122d4: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 lcd_update(1); 122d8: 81 e0 ldi r24, 0x01 ; 1 122da: 0e 94 6d 6f call 0xdeda ; 0xdeda // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 122de: 80 e0 ldi r24, 0x00 ; 0 122e0: 90 e0 ldi r25, 0x00 ; 0 122e2: a0 ea ldi r26, 0xA0 ; 160 122e4: b0 e4 ldi r27, 0x40 ; 64 122e6: 80 93 48 07 sts 0x0748, r24 ; 0x800748 122ea: 90 93 49 07 sts 0x0749, r25 ; 0x800749 122ee: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 122f2: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 122f6: 65 e5 ldi r22, 0x55 ; 85 122f8: 75 e5 ldi r23, 0x55 ; 85 122fa: 85 e5 ldi r24, 0x55 ; 85 122fc: 91 e4 ldi r25, 0x41 ; 65 122fe: 0f 94 48 ba call 0x37490 ; 0x37490 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 12302: 80 e0 ldi r24, 0x00 ; 0 12304: 0e 94 ae 67 call 0xcf5c ; 0xcf5c 12308: 9c a3 std Y+36, r25 ; 0x24 1230a: 8b a3 std Y+35, r24 ; 0x23 1230c: 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 1230e: 83 2d mov r24, r3 12310: 67 e0 ldi r22, 0x07 ; 7 12312: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__udivmodqi4> 12316: f8 2e mov r15, r24 12318: 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 1231a: 68 2f mov r22, r24 1231c: 70 e0 ldi r23, 0x00 ; 0 1231e: 7f 87 std Y+15, r23 ; 0x0f 12320: 6e 87 std Y+14, r22 ; 0x0e 12322: 80 ff sbrs r24, 0 12324: 03 c0 rjmp .+6 ; 0x1232c 12326: 76 e0 ldi r23, 0x06 ; 6 12328: 79 1b sub r23, r25 1232a: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 1232c: 80 2f mov r24, r16 1232e: 63 e0 ldi r22, 0x03 ; 3 12330: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__udivmodqi4> 12334: 91 11 cpse r25, r1 12336: 05 c0 rjmp .+10 ; 0x12342 12338: 8f 2d mov r24, r15 1233a: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__udivmodqi4> 1233e: 11 e0 ldi r17, 0x01 ; 1 12340: 91 11 cpse r25, r1 12342: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 12344: 80 2f mov r24, r16 12346: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 1234a: 68 8b std Y+16, r22 ; 0x10 1234c: 79 8b std Y+17, r23 ; 0x11 1234e: 8a 8b std Y+18, r24 ; 0x12 12350: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 12352: 8f 2d mov r24, r15 12354: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 12358: 4b 01 movw r8, r22 1235a: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 1235c: 8e 81 ldd r24, Y+6 ; 0x06 1235e: 83 30 cpi r24, 0x03 ; 3 12360: 09 f0 breq .+2 ; 0x12364 12362: 99 c0 rjmp .+306 ; 0x12496 if (!isOn3x3Mesh) { 12364: 11 11 cpse r17, r1 12366: c8 c0 rjmp .+400 ; 0x124f8 12368: 27 e0 ldi r18, 0x07 ; 7 1236a: ae 85 ldd r26, Y+14 ; 0x0e 1236c: bf 85 ldd r27, Y+15 ; 0x0f 1236e: 2a 9f mul r18, r26 12370: f0 01 movw r30, r0 12372: 2b 9f mul r18, r27 12374: f0 0d add r31, r0 12376: 11 24 eor r1, r1 12378: e0 0f add r30, r16 1237a: f1 1d adc r31, r1 1237c: ee 0f add r30, r30 1237e: ff 1f adc r31, r31 12380: ee 0f add r30, r30 12382: ff 1f adc r31, r31 12384: e3 56 subi r30, 0x63 ; 99 12386: fc 4e sbci r31, 0xEC ; 236 12388: 60 e0 ldi r22, 0x00 ; 0 1238a: 70 e0 ldi r23, 0x00 ; 0 1238c: 80 ec ldi r24, 0xC0 ; 192 1238e: 9f e7 ldi r25, 0x7F ; 127 12390: 61 83 std Z+1, r22 ; 0x01 12392: 72 83 std Z+2, r23 ; 0x02 12394: 83 83 std Z+3, r24 ; 0x03 12396: 94 83 std Z+4, r25 ; 0x04 12398: 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) { 1239a: e1 e3 ldi r30, 0x31 ; 49 1239c: 3e 12 cpse r3, r30 1239e: b7 cf rjmp .-146 ; 0x1230e custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 123a0: 80 e0 ldi r24, 0x00 ; 0 123a2: 90 e0 ldi r25, 0x00 ; 0 123a4: a0 ea ldi r26, 0xA0 ; 160 123a6: b0 e4 ldi r27, 0x40 ; 64 123a8: 80 93 48 07 sts 0x0748, r24 ; 0x800748 123ac: 90 93 49 07 sts 0x0749, r25 ; 0x800749 123b0: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 123b4: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 123b8: 65 e5 ldi r22, 0x55 ; 85 123ba: 75 e5 ldi r23, 0x55 ; 85 123bc: 85 e5 ldi r24, 0x55 ; 85 123be: 91 e4 ldi r25, 0x41 ; 65 123c0: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 123c4: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 123c8: b1 e3 ldi r27, 0x31 ; 49 123ca: 3b 16 cp r3, r27 123cc: 09 f4 brne .+2 ; 0x123d0 123ce: 33 c2 rjmp .+1126 ; 0x12836 if (g80_fail_cnt++ >= 1) { 123d0: 80 91 68 03 lds r24, 0x0368 ; 0x800368 123d4: 91 e0 ldi r25, 0x01 ; 1 123d6: 98 0f add r25, r24 123d8: 90 93 68 03 sts 0x0368, r25 ; 0x800368 123dc: 88 23 and r24, r24 123de: 09 f4 brne .+2 ; 0x123e2 123e0: d3 c1 rjmp .+934 ; 0x12788 print_stop(); 123e2: 60 e0 ldi r22, 0x00 ; 0 123e4: 80 e0 ldi r24, 0x00 ; 0 123e6: 0f 94 e7 15 call 0x22bce ; 0x22bce lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 123ea: 86 e4 ldi r24, 0x46 ; 70 123ec: 96 e3 ldi r25, 0x36 ; 54 123ee: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 123f2: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 lcd_z_calibration_prompt(false); 123f6: 80 e0 ldi r24, 0x00 ; 0 123f8: 0f 94 8e 67 call 0x2cf1c ; 0x2cf1c current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 123fc: 81 e0 ldi r24, 0x01 ; 1 123fe: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 12402: 8d ea ldi r24, 0xAD ; 173 12404: 90 e7 ldi r25, 0x70 ; 112 12406: 0f 94 be 0b call 0x2177c ; 0x2177c custom_message_type = custom_message_type_old; 1240a: 2f 81 ldd r18, Y+7 ; 0x07 1240c: 20 93 72 07 sts 0x0772, r18 ; 0x800772 custom_message_state = custom_message_state_old; 12410: 68 85 ldd r22, Y+8 ; 0x08 12412: 60 93 f0 03 sts 0x03F0, r22 ; 0x8003f0 lcd_update(2); 12416: 82 e0 ldi r24, 0x02 ; 2 12418: 0e 94 6d 6f call 0xdeda ; 0xdeda st_synchronize(); 1241c: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 mesh_bed_leveling_flag = false; 12420: 10 92 56 0e sts 0x0E56, r1 ; 0x800e56 12424: d6 cd rjmp .-1108 ; 0x11fd2 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)) { 12426: 01 11 cpse r16, r1 12428: 03 c0 rjmp .+6 ; 0x12430 1242a: 11 23 and r17, r17 1242c: 09 f4 brne .+2 ; 0x12430 1242e: bc ce rjmp .-648 ; 0x121a8 // 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))); 12430: 81 2f mov r24, r17 12432: 63 e0 ldi r22, 0x03 ; 3 12434: 0f 94 01 de call 0x3bc02 ; 0x3bc02 <__divmodqi4> 12438: 84 0d add r24, r4 1243a: 95 2d mov r25, r5 1243c: 91 1d adc r25, r1 1243e: 88 0f add r24, r24 12440: 99 1f adc r25, r25 12442: 8d 53 subi r24, 0x3D ; 61 12444: 90 4f sbci r25, 0xF0 ; 240 12446: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 1244a: bc 01 movw r22, r24 1244c: 99 0f add r25, r25 1244e: 88 0b sbc r24, r24 12450: 99 0b sbc r25, r25 12452: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 12456: 2a e0 ldi r18, 0x0A ; 10 12458: 37 ed ldi r19, 0xD7 ; 215 1245a: 43 e2 ldi r20, 0x23 ; 35 1245c: 5c e3 ldi r21, 0x3C ; 60 1245e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 12462: 9b 01 movw r18, r22 12464: ac 01 movw r20, r24 12466: 60 91 9e 13 lds r22, 0x139E ; 0x80139e 1246a: 70 91 9f 13 lds r23, 0x139F ; 0x80139f 1246e: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 12472: 90 91 a1 13 lds r25, 0x13A1 ; 0x8013a1 12476: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1247a: f3 01 movw r30, r6 1247c: 61 83 std Z+1, r22 ; 0x01 1247e: 72 83 std Z+2, r23 ; 0x02 12480: 83 83 std Z+3, r24 ; 0x03 12482: 94 83 std Z+4, r25 ; 0x04 12484: 91 ce rjmp .-734 ; 0x121a8 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)) { 12486: fe 85 ldd r31, Y+14 ; 0x0e 12488: ff 23 and r31, r31 1248a: 09 f4 brne .+2 ; 0x1248e 1248c: 02 cf rjmp .-508 ; 0x12292 1248e: 22 20 and r2, r2 12490: 09 f4 brne .+2 ; 0x12494 12492: fe ce rjmp .-516 ; 0x12290 12494: fe ce rjmp .-516 ; 0x12292 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)) { 12496: 28 89 ldd r18, Y+16 ; 0x10 12498: 39 89 ldd r19, Y+17 ; 0x11 1249a: 4a 89 ldd r20, Y+18 ; 0x12 1249c: 5b 89 ldd r21, Y+19 ; 0x13 1249e: 6a 85 ldd r22, Y+10 ; 0x0a 124a0: 7b 85 ldd r23, Y+11 ; 0x0b 124a2: 8c 85 ldd r24, Y+12 ; 0x0c 124a4: 9d 85 ldd r25, Y+13 ; 0x0d 124a6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 124aa: 18 16 cp r1, r24 124ac: 04 f1 brlt .+64 ; 0x124ee 124ae: 28 89 ldd r18, Y+16 ; 0x10 124b0: 39 89 ldd r19, Y+17 ; 0x11 124b2: 4a 89 ldd r20, Y+18 ; 0x12 124b4: 5b 89 ldd r21, Y+19 ; 0x13 124b6: 69 8d ldd r22, Y+25 ; 0x19 124b8: 7a 8d ldd r23, Y+26 ; 0x1a 124ba: 8b 8d ldd r24, Y+27 ; 0x1b 124bc: 9c 8d ldd r25, Y+28 ; 0x1c 124be: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 124c2: 87 fd sbrc r24, 7 124c4: 14 c0 rjmp .+40 ; 0x124ee 124c6: a5 01 movw r20, r10 124c8: 94 01 movw r18, r8 124ca: 6c 89 ldd r22, Y+20 ; 0x14 124cc: 7d 89 ldd r23, Y+21 ; 0x15 124ce: 8e 89 ldd r24, Y+22 ; 0x16 124d0: 9f 89 ldd r25, Y+23 ; 0x17 124d2: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 124d6: 18 16 cp r1, r24 124d8: 54 f0 brlt .+20 ; 0x124ee 124da: a5 01 movw r20, r10 124dc: 94 01 movw r18, r8 124de: 6d 8d ldd r22, Y+29 ; 0x1d 124e0: 7e 8d ldd r23, Y+30 ; 0x1e 124e2: 8f 8d ldd r24, Y+31 ; 0x1f 124e4: 98 a1 ldd r25, Y+32 ; 0x20 124e6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 124ea: 87 ff sbrs r24, 7 124ec: 05 c0 rjmp .+10 ; 0x124f8 124ee: 11 23 and r17, r17 124f0: 09 f4 brne .+2 ; 0x124f4 124f2: 52 cf rjmp .-348 ; 0x12398 124f4: 21 10 cpse r2, r1 124f6: 50 cf rjmp .-352 ; 0x12398 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 124f8: 10 e0 ldi r17, 0x00 ; 0 124fa: a7 e0 ldi r26, 0x07 ; 7 124fc: 8e 85 ldd r24, Y+14 ; 0x0e 124fe: 9f 85 ldd r25, Y+15 ; 0x0f 12500: a8 9f mul r26, r24 12502: f0 01 movw r30, r0 12504: a9 9f mul r26, r25 12506: f0 0d add r31, r0 12508: 11 24 eor r1, r1 1250a: e0 0f add r30, r16 1250c: f1 1f adc r31, r17 1250e: ee 0f add r30, r30 12510: ff 1f adc r31, r31 12512: ee 0f add r30, r30 12514: ff 1f adc r31, r31 12516: e3 56 subi r30, 0x63 ; 99 12518: fc 4e sbci r31, 0xEC ; 236 1251a: 41 80 ldd r4, Z+1 ; 0x01 1251c: 52 80 ldd r5, Z+2 ; 0x02 1251e: 63 80 ldd r6, Z+3 ; 0x03 12520: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 12522: c1 2c mov r12, r1 12524: d1 2c mov r13, r1 12526: e0 ea ldi r30, 0xA0 ; 160 12528: ee 2e mov r14, r30 1252a: e0 e4 ldi r30, 0x40 ; 64 1252c: fe 2e mov r15, r30 1252e: 22 20 and r2, r2 12530: 51 f0 breq .+20 ; 0x12546 12532: 23 e3 ldi r18, 0x33 ; 51 12534: 33 e3 ldi r19, 0x33 ; 51 12536: 43 eb ldi r20, 0xB3 ; 179 12538: 5e e3 ldi r21, 0x3E ; 62 1253a: c3 01 movw r24, r6 1253c: b2 01 movw r22, r4 1253e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 12542: 6b 01 movw r12, r22 12544: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 12546: a7 01 movw r20, r14 12548: 96 01 movw r18, r12 1254a: 60 91 48 07 lds r22, 0x0748 ; 0x800748 1254e: 70 91 49 07 lds r23, 0x0749 ; 0x800749 12552: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 12556: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 1255a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1255e: 87 ff sbrs r24, 7 12560: 10 c0 rjmp .+32 ; 0x12582 current_position[Z_AXIS] = init_z_bckp; 12562: c0 92 48 07 sts 0x0748, r12 ; 0x800748 12566: d0 92 49 07 sts 0x0749, r13 ; 0x800749 1256a: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 1256e: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12572: 65 e5 ldi r22, 0x55 ; 85 12574: 75 e5 ldi r23, 0x55 ; 85 12576: 85 e5 ldi r24, 0x55 ; 85 12578: 91 e4 ldi r25, 0x41 ; 65 1257a: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1257e: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12582: 68 89 ldd r22, Y+16 ; 0x10 12584: 79 89 ldd r23, Y+17 ; 0x11 12586: 8a 89 ldd r24, Y+18 ; 0x12 12588: 9b 89 ldd r25, Y+19 ; 0x13 1258a: 60 93 40 07 sts 0x0740, r22 ; 0x800740 1258e: 70 93 41 07 sts 0x0741, r23 ; 0x800741 12592: 80 93 42 07 sts 0x0742, r24 ; 0x800742 12596: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] = y_pos; 1259a: 80 92 44 07 sts 0x0744, r8 ; 0x800744 1259e: 90 92 45 07 sts 0x0745, r9 ; 0x800745 125a2: a0 92 46 07 sts 0x0746, r10 ; 0x800746 125a6: b0 92 47 07 sts 0x0747, r11 ; 0x800747 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 125aa: 64 e4 ldi r22, 0x44 ; 68 125ac: 77 e0 ldi r23, 0x07 ; 7 125ae: 80 e4 ldi r24, 0x40 ; 64 125b0: 97 e0 ldi r25, 0x07 ; 7 125b2: 0e 94 70 6b call 0xd6e0 ; 0xd6e0 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 125b6: 60 e0 ldi r22, 0x00 ; 0 125b8: 70 e0 ldi r23, 0x00 ; 0 125ba: 86 e1 ldi r24, 0x16 ; 22 125bc: 93 e4 ldi r25, 0x43 ; 67 125be: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 125c2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 if (planner_aborted) 125c6: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 125ca: 88 23 and r24, r24 125cc: 39 f0 breq .+14 ; 0x125dc { custom_message_type = custom_message_type_old; 125ce: 7f 81 ldd r23, Y+7 ; 0x07 125d0: 70 93 72 07 sts 0x0772, r23 ; 0x800772 custom_message_state = custom_message_state_old; 125d4: 88 85 ldd r24, Y+8 ; 0x08 125d6: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 125da: fb cc rjmp .-1546 ; 0x11fd2 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 125dc: 81 2c mov r8, r1 125de: 91 2c mov r9, r1 125e0: 70 e2 ldi r23, 0x20 ; 32 125e2: a7 2e mov r10, r23 125e4: 71 ec ldi r23, 0xC1 ; 193 125e6: b7 2e mov r11, r23 125e8: 22 20 and r2, r2 125ea: 51 f0 breq .+20 ; 0x12600 125ec: 2a 81 ldd r18, Y+2 ; 0x02 125ee: 3b 81 ldd r19, Y+3 ; 0x03 125f0: 4c 81 ldd r20, Y+4 ; 0x04 125f2: 5d 81 ldd r21, Y+5 ; 0x05 125f4: c3 01 movw r24, r6 125f6: b2 01 movw r22, r4 125f8: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 125fc: 4b 01 movw r8, r22 125fe: 5c 01 movw r10, r24 12600: 48 8d ldd r20, Y+24 ; 0x18 12602: c5 01 movw r24, r10 12604: b4 01 movw r22, r8 12606: 0f 94 de 8b call 0x317bc ; 0x317bc 1260a: 81 11 cpse r24, r1 1260c: 0b c0 rjmp .+22 ; 0x12624 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)); 1260e: 8a ef ldi r24, 0xFA ; 250 12610: 94 e6 ldi r25, 0x64 ; 100 12612: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 12616: 9f 93 push r25 12618: 8f 93 push r24 1261a: 0f 94 08 dc call 0x3b810 ; 0x3b810 1261e: 0f 90 pop r0 12620: 0f 90 pop r0 12622: be ce rjmp .-644 ; 0x123a0 // 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. 12624: 20 91 48 07 lds r18, 0x0748 ; 0x800748 12628: 30 91 49 07 lds r19, 0x0749 ; 0x800749 1262c: 40 91 4a 07 lds r20, 0x074A ; 0x80074a 12630: 50 91 4b 07 lds r21, 0x074B ; 0x80074b 12634: c7 01 movw r24, r14 12636: b6 01 movw r22, r12 12638: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1263c: 20 e0 ldi r18, 0x00 ; 0 1263e: 30 e0 ldi r19, 0x00 ; 0 12640: a9 01 movw r20, r18 12642: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 12646: 87 ff sbrs r24, 7 12648: 36 c0 rjmp .+108 ; 0x126b6 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1264a: 60 e0 ldi r22, 0x00 ; 0 1264c: 70 e0 ldi r23, 0x00 ; 0 1264e: 80 ea ldi r24, 0xA0 ; 160 12650: 90 e4 ldi r25, 0x40 ; 64 12652: 60 93 48 07 sts 0x0748, r22 ; 0x800748 12656: 70 93 49 07 sts 0x0749, r23 ; 0x800749 1265a: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 1265e: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12662: 65 e5 ldi r22, 0x55 ; 85 12664: 75 e5 ldi r23, 0x55 ; 85 12666: 85 e5 ldi r24, 0x55 ; 85 12668: 91 e4 ldi r25, 0x41 ; 65 1266a: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1266e: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 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 12672: 48 8d ldd r20, Y+24 ; 0x18 12674: c5 01 movw r24, r10 12676: b4 01 movw r22, r8 12678: 0f 94 de 8b call 0x317bc ; 0x317bc 1267c: 88 23 and r24, r24 1267e: 39 f2 breq .-114 ; 0x1260e printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 12680: 20 91 48 07 lds r18, 0x0748 ; 0x800748 12684: 30 91 49 07 lds r19, 0x0749 ; 0x800749 12688: 40 91 4a 07 lds r20, 0x074A ; 0x80074a 1268c: 50 91 4b 07 lds r21, 0x074B ; 0x80074b 12690: 60 e0 ldi r22, 0x00 ; 0 12692: 70 e0 ldi r23, 0x00 ; 0 12694: 80 ea ldi r24, 0xA0 ; 160 12696: 90 e4 ldi r25, 0x40 ; 64 12698: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1269c: 2d ec ldi r18, 0xCD ; 205 1269e: 3c ec ldi r19, 0xCC ; 204 126a0: 4c ec ldi r20, 0xCC ; 204 126a2: 5d e3 ldi r21, 0x3D ; 61 126a4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 126a8: 87 ff sbrs r24, 7 126aa: 05 c0 rjmp .+10 ; 0x126b6 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 126ac: 89 ea ldi r24, 0xA9 ; 169 126ae: 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")); 126b0: 0f 94 2f dc call 0x3b85e ; 0x3b85e 126b4: 75 ce rjmp .-790 ; 0x123a0 126b6: c0 90 48 07 lds r12, 0x0748 ; 0x800748 126ba: d0 90 49 07 lds r13, 0x0749 ; 0x800749 126be: e0 90 4a 07 lds r14, 0x074A ; 0x80074a 126c2: f0 90 4b 07 lds r15, 0x074B ; 0x80074b if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); break; } } if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point 126c6: 22 20 and r2, r2 126c8: a1 f0 breq .+40 ; 0x126f2 126ca: a7 01 movw r20, r14 126cc: 96 01 movw r18, r12 126ce: c3 01 movw r24, r6 126d0: b2 01 movw r22, r4 126d2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 126d6: 9b 01 movw r18, r22 126d8: ac 01 movw r20, r24 126da: 5f 77 andi r21, 0x7F ; 127 126dc: 6a 81 ldd r22, Y+2 ; 0x02 126de: 7b 81 ldd r23, Y+3 ; 0x03 126e0: 8c 81 ldd r24, Y+4 ; 0x04 126e2: 9d 81 ldd r25, Y+5 ; 0x05 126e4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 126e8: 87 ff sbrs r24, 7 126ea: 03 c0 rjmp .+6 ; 0x126f2 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 126ec: 80 e7 ldi r24, 0x70 ; 112 126ee: 9d e7 ldi r25, 0x7D ; 125 126f0: df cf rjmp .-66 ; 0x126b0 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 126f2: 8f ea ldi r24, 0xAF ; 175 126f4: 9f e0 ldi r25, 0x0F ; 15 126f6: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 126fa: 88 23 and r24, r24 126fc: 09 f4 brne .+2 ; 0x12700 126fe: 40 c0 rjmp .+128 ; 0x12780 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); } 12700: 86 ea ldi r24, 0xA6 ; 166 12702: 9f e0 ldi r25, 0x0F ; 15 12704: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c if (!calibration_status_pinda()) return 0; 12708: 88 23 and r24, r24 1270a: d1 f1 breq .+116 ; 0x12780 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 1270c: 60 91 95 03 lds r22, 0x0395 ; 0x800395 12710: 70 91 96 03 lds r23, 0x0396 ; 0x800396 12714: 80 91 97 03 lds r24, 0x0397 ; 0x800397 12718: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1271c: 0e 94 50 5d call 0xbaa0 ; 0xbaa0 12720: 20 91 77 06 lds r18, 0x0677 ; 0x800677 12724: 30 91 78 06 lds r19, 0x0678 ; 0x800678 12728: 40 91 79 06 lds r20, 0x0679 ; 0x800679 1272c: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 12730: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 12734: 9b 01 movw r18, r22 12736: ac 01 movw r20, r24 12738: e7 e0 ldi r30, 0x07 ; 7 1273a: ae 85 ldd r26, Y+14 ; 0x0e 1273c: bf 85 ldd r27, Y+15 ; 0x0f 1273e: ea 9f mul r30, r26 12740: c0 01 movw r24, r0 12742: eb 9f mul r30, r27 12744: 90 0d add r25, r0 12746: 11 24 eor r1, r1 12748: 08 0f add r16, r24 1274a: 19 1f adc r17, r25 1274c: 00 0f add r16, r16 1274e: 11 1f adc r17, r17 12750: 00 0f add r16, r16 12752: 11 1f adc r17, r17 12754: 03 56 subi r16, 0x63 ; 99 12756: 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; 12758: c7 01 movw r24, r14 1275a: b6 01 movw r22, r12 1275c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 12760: d8 01 movw r26, r16 12762: 11 96 adiw r26, 0x01 ; 1 12764: 6d 93 st X+, r22 12766: 7d 93 st X+, r23 12768: 8d 93 st X+, r24 1276a: 9c 93 st X, r25 1276c: 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--; 1276e: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 12772: 81 50 subi r24, 0x01 ; 1 12774: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 mesh_point++; lcd_update(1); 12778: 81 e0 ldi r24, 0x01 ; 1 1277a: 0e 94 6d 6f call 0xdeda ; 0xdeda 1277e: 0c ce rjmp .-1000 ; 0x12398 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12780: 20 e0 ldi r18, 0x00 ; 0 12782: 30 e0 ldi r19, 0x00 ; 0 12784: a9 01 movw r20, r18 12786: d8 cf rjmp .-80 ; 0x12738 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); 12788: 85 e0 ldi r24, 0x05 ; 5 1278a: 0f 94 34 64 call 0x2c868 ; 0x2c868 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; 1278e: c1 2c mov r12, r1 12790: d1 2c mov r13, r1 12792: 90 ea ldi r25, 0xA0 ; 160 12794: e9 2e mov r14, r25 12796: 90 e4 ldi r25, 0x40 ; 64 12798: 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)); 1279a: 82 e1 ldi r24, 0x12 ; 18 1279c: 96 e3 ldi r25, 0x36 ; 54 1279e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 127a2: 0f 94 55 35 call 0x26aaa ; 0x26aaa #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 127a6: 8e e1 ldi r24, 0x1E ; 30 127a8: 90 e0 ldi r25, 0x00 ; 0 127aa: 0f 94 3f 50 call 0x2a07e ; 0x2a07e calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 127ae: 0e 94 04 74 call 0xe808 ; 0xe808 #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); 127b2: 80 e0 ldi r24, 0x00 ; 0 127b4: 0f 94 0f 64 call 0x2c81e ; 0x2c81e 127b8: 18 2f mov r17, r24 raise_z(-1); 127ba: 60 e0 ldi r22, 0x00 ; 0 127bc: 70 e0 ldi r23, 0x00 ; 0 127be: 80 e8 ldi r24, 0x80 ; 128 127c0: 9f eb ldi r25, 0xBF ; 191 127c2: 0e 94 a7 6e call 0xdd4e ; 0xdd4e enable_z_endstop(true); 127c6: 81 e0 ldi r24, 0x01 ; 1 127c8: 0f 94 0f 64 call 0x2c81e ; 0x2c81e #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 127cc: 84 e0 ldi r24, 0x04 ; 4 127ce: 0f 94 63 3b call 0x276c6 ; 0x276c6 #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 127d2: c0 92 48 07 sts 0x0748, r12 ; 0x800748 127d6: d0 92 49 07 sts 0x0749, r13 ; 0x800749 127da: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 127de: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 127e2: 65 e5 ldi r22, 0x55 ; 85 127e4: 75 e5 ldi r23, 0x55 ; 85 127e6: 85 e5 ldi r24, 0x55 ; 85 127e8: 91 e4 ldi r25, 0x41 ; 65 127ea: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 127ee: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 #ifdef TMC2130 tmc2130_home_exit(); 127f2: 0f 94 34 3b call 0x27668 ; 0x27668 #endif // TMC2130 enable_z_endstop(bState); 127f6: 81 2f mov r24, r17 127f8: 0f 94 0f 64 call 0x2c81e ; 0x2c81e } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 127fc: 82 e0 ldi r24, 0x02 ; 2 127fe: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 12802: 20 e0 ldi r18, 0x00 ; 0 12804: 30 e0 ldi r19, 0x00 ; 0 12806: 40 ea ldi r20, 0xA0 ; 160 12808: 50 e4 ldi r21, 0x40 ; 64 1280a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1280e: 18 16 cp r1, r24 12810: 24 f2 brlt .-120 ; 0x1279a custom_message_type = custom_message_type_old; 12812: ef 81 ldd r30, Y+7 ; 0x07 12814: e0 93 72 07 sts 0x0772, r30 ; 0x800772 custom_message_state = custom_message_state_old; 12818: f8 85 ldd r31, Y+8 ; 0x08 1281a: f0 93 f0 03 sts 0x03F0, r31 ; 0x8003f0 lcd_update_enable(true); // display / status-line recovery 1281e: 81 e0 ldi r24, 0x01 ; 1 12820: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 12824: 41 e0 ldi r20, 0x01 ; 1 12826: 61 e0 ldi r22, 0x01 ; 1 12828: 81 e0 ldi r24, 0x01 ; 1 1282a: 0e 94 a1 80 call 0x10142 ; 0x10142 1282e: 81 e0 ldi r24, 0x01 ; 1 12830: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d 12834: ce cb rjmp .-2148 ; 0x11fd2 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 12836: 10 92 68 03 sts 0x0368, r1 ; 0x800368 clean_up_after_endstop_move(l_feedmultiply); 1283a: 8b a1 ldd r24, Y+35 ; 0x23 1283c: 9c a1 ldd r25, Y+36 ; 0x24 1283e: 0e 94 94 67 call 0xcf28 ; 0xcf28 } } void babystep_apply() { babystep_load(); 12842: 0f 94 b4 c6 call 0x38d68 ; 0x38d68 shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 12846: 60 91 67 05 lds r22, 0x0567 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.515> 1284a: 70 91 68 05 lds r23, 0x0568 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.515+0x1> 1284e: 07 2e mov r0, r23 12850: 00 0c add r0, r0 12852: 88 0b sbc r24, r24 12854: 99 0b sbc r25, r25 12856: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1285a: 90 58 subi r25, 0x80 ; 128 1285c: 20 91 77 06 lds r18, 0x0677 ; 0x800677 12860: 30 91 78 06 lds r19, 0x0678 ; 0x800678 12864: 40 91 79 06 lds r20, 0x0679 ; 0x800679 12868: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 1286c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 12870: 0f 94 d0 c6 call 0x38da0 ; 0x38da0 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; 12874: 80 ec ldi r24, 0xC0 ; 192 12876: 9f e0 ldi r25, 0x0F ; 15 12878: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1287c: 91 e0 ldi r25, 0x01 ; 1 1287e: 81 30 cpi r24, 0x01 ; 1 12880: 09 f0 breq .+2 ; 0x12884 12882: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12884: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 12886: 4f eb ldi r20, 0xBF ; 191 12888: 5f e0 ldi r21, 0x0F ; 15 1288a: 6c e4 ldi r22, 0x4C ; 76 1288c: ce 01 movw r24, r28 1288e: 01 96 adiw r24, 0x01 ; 1 12890: 0e 94 a2 5c call 0xb944 ; 0xb944 12894: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 12896: 4e eb ldi r20, 0xBE ; 190 12898: 5f e0 ldi r21, 0x0F ; 15 1289a: 62 e5 ldi r22, 0x52 ; 82 1289c: ce 01 movw r24, r28 1289e: 01 96 adiw r24, 0x01 ; 1 128a0: 0e 94 a2 5c call 0xb944 ; 0xb944 128a4: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 128a6: 4d eb ldi r20, 0xBD ; 189 128a8: 5f e0 ldi r21, 0x0F ; 15 128aa: 66 e4 ldi r22, 0x46 ; 70 128ac: ce 01 movw r24, r28 128ae: 01 96 adiw r24, 0x01 ; 1 128b0: 0e 94 a2 5c call 0xb944 ; 0xb944 128b4: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 128b6: 4c eb ldi r20, 0xBC ; 188 128b8: 5f e0 ldi r21, 0x0F ; 15 128ba: 62 e4 ldi r22, 0x42 ; 66 128bc: ce 01 movw r24, r28 128be: 01 96 adiw r24, 0x01 ; 1 128c0: 0e 94 a2 5c call 0xb944 ; 0xb944 128c4: 21 2f mov r18, r17 128c6: 11 0f add r17, r17 128c8: 33 0b sbc r19, r19 128ca: 08 2e mov r0, r24 128cc: 00 0c add r0, r0 128ce: 99 0b sbc r25, r25 128d0: 5c 01 movw r10, r24 128d2: a2 1a sub r10, r18 128d4: b3 0a sbc r11, r19 128d6: 8f 2d mov r24, r15 128d8: ff 0c add r15, r15 128da: 99 0b sbc r25, r25 128dc: 28 0f add r18, r24 128de: 39 1f adc r19, r25 128e0: 46 e0 ldi r20, 0x06 ; 6 128e2: 42 9f mul r20, r18 128e4: 60 01 movw r12, r0 128e6: 43 9f mul r20, r19 128e8: d0 0c add r13, r0 128ea: 11 24 eor r1, r1 128ec: f1 2c mov r15, r1 128ee: e1 2c mov r14, r1 128f0: 00 2e mov r0, r16 128f2: 00 0c add r0, r0 128f4: 11 0b sbc r17, r17 128f6: 08 1b sub r16, r24 128f8: 19 0b sbc r17, r25 128fa: b7 01 movw r22, r14 128fc: 62 56 subi r22, 0x62 ; 98 128fe: 7c 4e sbci r23, 0xEC ; 236 12900: 3b 01 movw r6, r22 12902: 46 01 movw r8, r12 12904: 77 e0 ldi r23, 0x07 ; 7 12906: 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 * ( 12908: d3 01 movw r26, r6 1290a: 2d 90 ld r2, X+ 1290c: 3d 90 ld r3, X+ 1290e: 4d 90 ld r4, X+ 12910: 5d 90 ld r5, X+ 12912: 3d 01 movw r6, r26 12914: fd 01 movw r30, r26 12916: 34 97 sbiw r30, 0x04 ; 4 12918: fb 87 std Y+11, r31 ; 0x0b 1291a: ea 87 std Y+10, r30 ; 0x0a 1291c: b4 01 movw r22, r8 1291e: 09 2c mov r0, r9 12920: 00 0c add r0, r0 12922: 88 0b sbc r24, r24 12924: 99 0b sbc r25, r25 12926: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1292a: 2f e3 ldi r18, 0x3F ; 63 1292c: 33 ec ldi r19, 0xC3 ; 195 1292e: 4e e2 ldi r20, 0x2E ; 46 12930: 59 e3 ldi r21, 0x39 ; 57 12932: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 12936: a2 01 movw r20, r4 12938: 91 01 movw r18, r2 1293a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1293e: aa 85 ldd r26, Y+10 ; 0x0a 12940: bb 85 ldd r27, Y+11 ; 0x0b 12942: 6d 93 st X+, r22 12944: 7d 93 st X+, r23 12946: 8d 93 st X+, r24 12948: 9c 93 st X, r25 1294a: 13 97 sbiw r26, 0x03 ; 3 1294c: ba 81 ldd r27, Y+2 ; 0x02 1294e: b1 50 subi r27, 0x01 ; 1 12950: ba 83 std Y+2, r27 ; 0x02 12952: 80 0e add r8, r16 12954: 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++) { 12956: b1 11 cpse r27, r1 12958: d7 cf rjmp .-82 ; 0x12908 1295a: ca 0c add r12, r10 1295c: db 1c adc r13, r11 1295e: ec e1 ldi r30, 0x1C ; 28 12960: ee 0e add r14, r30 12962: 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++) { 12964: f4 ec ldi r31, 0xC4 ; 196 12966: ef 16 cp r14, r31 12968: f1 04 cpc r15, r1 1296a: 39 f6 brne .-114 ; 0x128fa + 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) 1296c: 0f 94 57 17 call 0x22eae ; 0x22eae { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 12970: 8d e4 ldi r24, 0x4D ; 77 12972: 0e 94 8d 5c call 0xb91a ; 0xb91a 12976: 88 23 and r24, r24 12978: 09 f4 brne .+2 ; 0x1297c 1297a: 84 c0 rjmp .+264 ; 0x12a84 1297c: 0e 94 1f 5c call 0xb83e ; 0xb83e if (nMeasPoints == 7 && useMagnetCompensation) { 12980: 2e 81 ldd r18, Y+6 ; 0x06 12982: 27 30 cpi r18, 0x07 ; 7 12984: 09 f0 breq .+2 ; 0x12988 12986: 94 c0 rjmp .+296 ; 0x12ab0 12988: 88 23 and r24, r24 1298a: 09 f4 brne .+2 ; 0x1298e 1298c: 91 c0 rjmp .+290 ; 0x12ab0 1298e: bb 24 eor r11, r11 12990: b3 94 inc r11 12992: aa 24 eor r10, r10 12994: aa 94 dec r10 12996: ab 0c add r10, r11 12998: 09 a1 ldd r16, Y+33 ; 0x21 1299a: 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++) { 1299c: 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++; } 1299e: 8e ef ldi r24, 0xFE ; 254 129a0: 88 2e mov r8, r24 129a2: 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)) { 129a4: 6a 2d mov r22, r10 129a6: 86 2d mov r24, r6 129a8: 0f 94 7f c6 call 0x38cfe ; 0x38cfe 129ac: 99 24 eor r9, r9 129ae: 93 94 inc r9 129b0: 96 0c add r9, r6 129b2: 81 11 cpse r24, r1 129b4: 6e c0 rjmp .+220 ; 0x12a92 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++; } 129b6: 6b 2d mov r22, r11 129b8: 86 2d mov r24, r6 129ba: 0f 94 7f c6 call 0x38cfe ; 0x38cfe } 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; 129be: c1 2c mov r12, r1 129c0: d1 2c mov r13, r1 129c2: 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; 129c4: 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++; } 129c6: 88 23 and r24, r24 129c8: 81 f0 breq .+32 ; 0x129ea 129ca: 20 e0 ldi r18, 0x00 ; 0 129cc: 30 e0 ldi r19, 0x00 ; 0 129ce: a9 01 movw r20, r18 129d0: d8 01 movw r26, r16 129d2: 5d 96 adiw r26, 0x1d ; 29 129d4: 6d 91 ld r22, X+ 129d6: 7d 91 ld r23, X+ 129d8: 8d 91 ld r24, X+ 129da: 9c 91 ld r25, X 129dc: 90 97 sbiw r26, 0x20 ; 32 129de: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 129e2: 6b 01 movw r12, r22 129e4: 7c 01 movw r14, r24 129e6: 77 24 eor r7, r7 129e8: 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++; } 129ea: 68 2d mov r22, r8 129ec: 86 2d mov r24, r6 129ee: 0f 94 7f c6 call 0x38cfe ; 0x38cfe 129f2: 88 23 and r24, r24 129f4: 69 f0 breq .+26 ; 0x12a10 129f6: f8 01 movw r30, r16 129f8: 7b 97 sbiw r30, 0x1b ; 27 129fa: 20 81 ld r18, Z 129fc: 31 81 ldd r19, Z+1 ; 0x01 129fe: 42 81 ldd r20, Z+2 ; 0x02 12a00: 53 81 ldd r21, Z+3 ; 0x03 12a02: c7 01 movw r24, r14 12a04: b6 01 movw r22, r12 12a06: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 12a0a: 6b 01 movw r12, r22 12a0c: 7c 01 movw r14, r24 12a0e: 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++; } 12a10: 6a 2d mov r22, r10 12a12: 89 2d mov r24, r9 12a14: 0f 94 7f c6 call 0x38cfe ; 0x38cfe 12a18: 88 23 and r24, r24 12a1a: 61 f0 breq .+24 ; 0x12a34 12a1c: f8 01 movw r30, r16 12a1e: 25 81 ldd r18, Z+5 ; 0x05 12a20: 36 81 ldd r19, Z+6 ; 0x06 12a22: 47 81 ldd r20, Z+7 ; 0x07 12a24: 50 85 ldd r21, Z+8 ; 0x08 12a26: c7 01 movw r24, r14 12a28: b6 01 movw r22, r12 12a2a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 12a2e: 6b 01 movw r12, r22 12a30: 7c 01 movw r14, r24 12a32: 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++; } 12a34: 6a 2d mov r22, r10 12a36: 8f ef ldi r24, 0xFF ; 255 12a38: 86 0d add r24, r6 12a3a: 0f 94 7f c6 call 0x38cfe ; 0x38cfe 12a3e: 88 23 and r24, r24 12a40: 31 f1 breq .+76 ; 0x12a8e 12a42: f8 01 movw r30, r16 12a44: 33 97 sbiw r30, 0x03 ; 3 12a46: 20 81 ld r18, Z 12a48: 31 81 ldd r19, Z+1 ; 0x01 12a4a: 42 81 ldd r20, Z+2 ; 0x02 12a4c: 53 81 ldd r21, Z+3 ; 0x03 12a4e: c7 01 movw r24, r14 12a50: b6 01 movw r22, r12 12a52: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 12a56: 6b 01 movw r12, r22 12a58: 7c 01 movw r14, r24 12a5a: 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 12a5c: 67 2d mov r22, r7 12a5e: 70 e0 ldi r23, 0x00 ; 0 12a60: 90 e0 ldi r25, 0x00 ; 0 12a62: 80 e0 ldi r24, 0x00 ; 0 12a64: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 12a68: 9b 01 movw r18, r22 12a6a: ac 01 movw r20, r24 12a6c: c7 01 movw r24, r14 12a6e: b6 01 movw r22, r12 12a70: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 12a74: d8 01 movw r26, r16 12a76: 11 96 adiw r26, 0x01 ; 1 12a78: 6d 93 st X+, r22 12a7a: 7d 93 st X+, r23 12a7c: 8d 93 st X+, r24 12a7e: 9c 93 st X, r25 12a80: 14 97 sbiw r26, 0x04 ; 4 12a82: 07 c0 rjmp .+14 ; 0x12a92 } 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); 12a84: 8c ea ldi r24, 0xAC ; 172 12a86: 9d e0 ldi r25, 0x0D ; 13 12a88: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 12a8c: 79 cf rjmp .-270 ; 0x12980 12a8e: 71 10 cpse r7, r1 12a90: e5 cf rjmp .-54 ; 0x12a5c //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++) { 12a92: 69 2c mov r6, r9 12a94: 0c 5f subi r16, 0xFC ; 252 12a96: 1f 4f sbci r17, 0xFF ; 255 12a98: b7 e0 ldi r27, 0x07 ; 7 12a9a: 9b 12 cpse r9, r27 12a9c: 83 cf rjmp .-250 ; 0x129a4 12a9e: b3 94 inc r11 12aa0: e9 a1 ldd r30, Y+33 ; 0x21 12aa2: fa a1 ldd r31, Y+34 ; 0x22 12aa4: 7c 96 adiw r30, 0x1c ; 28 12aa6: fa a3 std Y+34, r31 ; 0x22 12aa8: 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++) { 12aaa: f8 e0 ldi r31, 0x08 ; 8 12aac: bf 12 cpse r11, r31 12aae: 71 cf rjmp .-286 ; 0x12992 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12ab0: 81 e0 ldi r24, 0x01 ; 1 12ab2: 80 93 9d 13 sts 0x139D, r24 ; 0x80139d if (code_seen('O') && !code_value_uint8()) { 12ab6: 8f e4 ldi r24, 0x4F ; 79 12ab8: 0e 94 8d 5c call 0xb91a ; 0xb91a 12abc: 81 11 cpse r24, r1 12abe: 03 c0 rjmp .+6 ; 0x12ac6 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12ac0: 0f 94 25 c7 call 0x38e4a ; 0x38e4a 12ac4: 9b cc rjmp .-1738 ; 0x123fc } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 12ac6: 0e 94 1f 5c call 0xb83e ; 0xb83e 12aca: 81 11 cpse r24, r1 12acc: f9 cf rjmp .-14 ; 0x12ac0 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12ace: 0e 94 89 67 call 0xcf12 ; 0xcf12 12ad2: 94 cc rjmp .-1752 ; 0x123fc 00012ad4 : //! @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() { 12ad4: 4f 92 push r4 12ad6: 5f 92 push r5 12ad8: 6f 92 push r6 12ada: 7f 92 push r7 12adc: 8f 92 push r8 12ade: 9f 92 push r9 12ae0: af 92 push r10 12ae2: bf 92 push r11 12ae4: ef 92 push r14 12ae6: ff 92 push r15 12ae8: 0f 93 push r16 12aea: 1f 93 push r17 12aec: cf 93 push r28 12aee: df 93 push r29 12af0: 1f 92 push r1 12af2: cd b7 in r28, 0x3d ; 61 12af4: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 12af6: 44 e0 ldi r20, 0x04 ; 4 12af8: 50 e0 ldi r21, 0x00 ; 0 12afa: 64 e1 ldi r22, 0x14 ; 20 12afc: 70 e0 ldi r23, 0x00 ; 0 12afe: 8b e6 ldi r24, 0x6B ; 107 12b00: 96 e0 ldi r25, 0x06 ; 6 12b02: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 12b06: 43 e0 ldi r20, 0x03 ; 3 12b08: 50 e0 ldi r21, 0x00 ; 0 12b0a: 6f ef ldi r22, 0xFF ; 255 12b0c: 78 e7 ldi r23, 0x78 ; 120 12b0e: 8b e6 ldi r24, 0x6B ; 107 12b10: 96 e0 ldi r25, 0x06 ; 6 12b12: 0f 94 25 db call 0x3b64a ; 0x3b64a 12b16: 89 2b or r24, r25 12b18: 09 f0 breq .+2 ; 0x12b1c 12b1a: 9f c1 rjmp .+830 ; 0x12e5a { // 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)); 12b1c: e3 ec ldi r30, 0xC3 ; 195 12b1e: f9 e7 ldi r31, 0x79 ; 121 12b20: 45 91 lpm r20, Z+ 12b22: 55 91 lpm r21, Z+ 12b24: 65 91 lpm r22, Z+ 12b26: 74 91 lpm r23, Z 12b28: 88 ed ldi r24, 0xD8 ; 216 12b2a: 90 e0 ldi r25, 0x00 ; 0 12b2c: 0e 94 ed 64 call 0xc9da ; 0xc9da eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 12b30: e7 ec ldi r30, 0xC7 ; 199 12b32: f9 e7 ldi r31, 0x79 ; 121 12b34: 45 91 lpm r20, Z+ 12b36: 55 91 lpm r21, Z+ 12b38: 65 91 lpm r22, Z+ 12b3a: 74 91 lpm r23, Z 12b3c: 8c ed ldi r24, 0xDC ; 220 12b3e: 90 e0 ldi r25, 0x00 ; 0 12b40: 0e 94 ed 64 call 0xc9da ; 0xc9da eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 12b44: eb ec ldi r30, 0xCB ; 203 12b46: f9 e7 ldi r31, 0x79 ; 121 12b48: 64 91 lpm r22, Z 12b4a: 80 ee ldi r24, 0xE0 ; 224 12b4c: 90 e0 ldi r25, 0x00 ; 0 12b4e: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 12b52: ec ec ldi r30, 0xCC ; 204 12b54: f9 e7 ldi r31, 0x79 ; 121 12b56: 65 91 lpm r22, Z+ 12b58: 74 91 lpm r23, Z 12b5a: 81 ee ldi r24, 0xE1 ; 225 12b5c: 90 e0 ldi r25, 0x00 ; 0 12b5e: 0e 94 8d 77 call 0xef1a ; 0xef1a eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 12b62: ee ec ldi r30, 0xCE ; 206 12b64: f9 e7 ldi r31, 0x79 ; 121 12b66: 65 91 lpm r22, Z+ 12b68: 74 91 lpm r23, Z 12b6a: 83 ee ldi r24, 0xE3 ; 227 12b6c: 90 e0 ldi r25, 0x00 ; 0 12b6e: 0e 94 8d 77 call 0xef1a ; 0xef1a // 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)); 12b72: ef eb ldi r30, 0xBF ; 191 12b74: f9 e7 ldi r31, 0x79 ; 121 12b76: 45 91 lpm r20, Z+ 12b78: 55 91 lpm r21, Z+ 12b7a: 65 91 lpm r22, Z+ 12b7c: 74 91 lpm r23, Z 12b7e: 84 ed ldi r24, 0xD4 ; 212 12b80: 90 e0 ldi r25, 0x00 ; 0 12b82: 0e 94 ed 64 call 0xc9da ; 0xc9da // 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); 12b86: 4b e9 ldi r20, 0x9B ; 155 12b88: 59 e7 ldi r21, 0x79 ; 121 12b8a: 60 e1 ldi r22, 0x10 ; 16 12b8c: 70 e0 ldi r23, 0x00 ; 0 12b8e: 80 eb ldi r24, 0xB0 ; 176 12b90: 90 e0 ldi r25, 0x00 ; 0 12b92: 0e 94 6e 77 call 0xeedc ; 0xeedc 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); 12b96: 4b ea ldi r20, 0xAB ; 171 12b98: 59 e7 ldi r21, 0x79 ; 121 12b9a: 60 e1 ldi r22, 0x10 ; 16 12b9c: 70 e0 ldi r23, 0x00 ; 0 12b9e: 80 ec ldi r24, 0xC0 ; 192 12ba0: 90 e0 ldi r25, 0x00 ; 0 12ba2: 0e 94 6e 77 call 0xeedc ; 0xeedc #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 12ba6: 4b eb ldi r20, 0xBB ; 187 12ba8: 59 e7 ldi r21, 0x79 ; 121 12baa: 64 e0 ldi r22, 0x04 ; 4 12bac: 70 e0 ldi r23, 0x00 ; 0 12bae: 80 ed ldi r24, 0xD0 ; 208 12bb0: 90 e0 ldi r25, 0x00 ; 0 12bb2: 0e 94 6e 77 call 0xeedc ; 0xeedc #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 12bb6: 41 ed ldi r20, 0xD1 ; 209 12bb8: 50 e0 ldi r21, 0x00 ; 0 12bba: 64 e1 ldi r22, 0x14 ; 20 12bbc: 70 e0 ldi r23, 0x00 ; 0 12bbe: 8b e6 ldi r24, 0x6B ; 107 12bc0: 96 e0 ldi r25, 0x06 ; 6 12bc2: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c calculate_extruder_multipliers(); 12bc6: 0e 94 7f 66 call 0xccfe ; 0xccfe 12bca: 0b e6 ldi r16, 0x6B ; 107 12bcc: 16 e0 ldi r17, 0x06 ; 6 12bce: 87 e0 ldi r24, 0x07 ; 7 12bd0: e8 2e mov r14, r24 12bd2: 87 e0 ldi r24, 0x07 ; 7 12bd4: 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; 12bd6: 94 ec ldi r25, 0xC4 ; 196 12bd8: 89 2e mov r8, r25 12bda: 99 e0 ldi r25, 0x09 ; 9 12bdc: 99 2e mov r9, r25 12bde: a1 2c mov r10, r1 12be0: 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; 12be2: 20 ec ldi r18, 0xC0 ; 192 12be4: 42 2e mov r4, r18 12be6: 23 e0 ldi r18, 0x03 ; 3 12be8: 52 2e mov r5, r18 12bea: 61 2c mov r6, r1 12bec: 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) 12bee: 20 e0 ldi r18, 0x00 ; 0 12bf0: 30 e0 ldi r19, 0x00 ; 0 12bf2: 48 e4 ldi r20, 0x48 ; 72 12bf4: 53 e4 ldi r21, 0x43 ; 67 12bf6: f8 01 movw r30, r16 12bf8: 64 89 ldd r22, Z+20 ; 0x14 12bfa: 75 89 ldd r23, Z+21 ; 0x15 12bfc: 86 89 ldd r24, Z+22 ; 0x16 12bfe: 97 89 ldd r25, Z+23 ; 0x17 12c00: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 12c04: 18 16 cp r1, r24 12c06: 4c f4 brge .+18 ; 0x12c1a cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 12c08: 80 e0 ldi r24, 0x00 ; 0 12c0a: 90 e0 ldi r25, 0x00 ; 0 12c0c: a8 e4 ldi r26, 0x48 ; 72 12c0e: b3 e4 ldi r27, 0x43 ; 67 12c10: f8 01 movw r30, r16 12c12: 84 8b std Z+20, r24 ; 0x14 12c14: 95 8b std Z+21, r25 ; 0x15 12c16: a6 8b std Z+22, r26 ; 0x16 12c18: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 12c1a: f7 01 movw r30, r14 12c1c: 61 91 ld r22, Z+ 12c1e: 71 91 ld r23, Z+ 12c20: 81 91 ld r24, Z+ 12c22: 91 91 ld r25, Z+ 12c24: 7f 01 movw r14, r30 12c26: 20 e0 ldi r18, 0x00 ; 0 12c28: 30 e0 ldi r19, 0x00 ; 0 12c2a: 48 ec ldi r20, 0xC8 ; 200 12c2c: 52 e4 ldi r21, 0x42 ; 66 12c2e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 12c32: 18 16 cp r1, r24 12c34: 54 f4 brge .+20 ; 0x12c4a cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 12c36: 80 e0 ldi r24, 0x00 ; 0 12c38: 90 e0 ldi r25, 0x00 ; 0 12c3a: a8 ec ldi r26, 0xC8 ; 200 12c3c: b2 e4 ldi r27, 0x42 ; 66 12c3e: f7 01 movw r30, r14 12c40: 34 97 sbiw r30, 0x04 ; 4 12c42: 80 83 st Z, r24 12c44: 91 83 std Z+1, r25 ; 0x01 12c46: a2 83 std Z+2, r26 ; 0x02 12c48: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 12c4a: f8 01 movw r30, r16 12c4c: 84 a1 ldd r24, Z+36 ; 0x24 12c4e: 95 a1 ldd r25, Z+37 ; 0x25 12c50: a6 a1 ldd r26, Z+38 ; 0x26 12c52: b7 a1 ldd r27, Z+39 ; 0x27 12c54: 85 3c cpi r24, 0xC5 ; 197 12c56: 99 40 sbci r25, 0x09 ; 9 12c58: a1 05 cpc r26, r1 12c5a: b1 05 cpc r27, r1 12c5c: 28 f0 brcs .+10 ; 0x12c68 cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 12c5e: f8 01 movw r30, r16 12c60: 84 a2 std Z+36, r8 ; 0x24 12c62: 95 a2 std Z+37, r9 ; 0x25 12c64: a6 a2 std Z+38, r10 ; 0x26 12c66: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 12c68: f7 01 movw r30, r14 12c6a: 84 85 ldd r24, Z+12 ; 0x0c 12c6c: 95 85 ldd r25, Z+13 ; 0x0d 12c6e: a6 85 ldd r26, Z+14 ; 0x0e 12c70: b7 85 ldd r27, Z+15 ; 0x0f 12c72: 81 3c cpi r24, 0xC1 ; 193 12c74: 93 40 sbci r25, 0x03 ; 3 12c76: a1 05 cpc r26, r1 12c78: b1 05 cpc r27, r1 12c7a: 28 f0 brcs .+10 ; 0x12c86 cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12c7c: f7 01 movw r30, r14 12c7e: 44 86 std Z+12, r4 ; 0x0c 12c80: 55 86 std Z+13, r5 ; 0x0d 12c82: 66 86 std Z+14, r6 ; 0x0e 12c84: 77 86 std Z+15, r7 ; 0x0f 12c86: 0c 5f subi r16, 0xFC ; 252 12c88: 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++) 12c8a: f6 e0 ldi r31, 0x06 ; 6 12c8c: 03 37 cpi r16, 0x73 ; 115 12c8e: 1f 07 cpc r17, r31 12c90: 09 f0 breq .+2 ; 0x12c94 12c92: ad cf rjmp .-166 ; 0x12bee 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]); 12c94: 60 91 27 07 lds r22, 0x0727 ; 0x800727 12c98: 70 e0 ldi r23, 0x00 ; 0 12c9a: 80 e0 ldi r24, 0x00 ; 0 12c9c: 0f 94 85 3a call 0x2750a ; 0x2750a tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12ca0: 60 91 28 07 lds r22, 0x0728 ; 0x800728 12ca4: 70 e0 ldi r23, 0x00 ; 0 12ca6: 81 e0 ldi r24, 0x01 ; 1 12ca8: 0f 94 85 3a call 0x2750a ; 0x2750a tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 12cac: 60 91 29 07 lds r22, 0x0729 ; 0x800729 12cb0: 70 e0 ldi r23, 0x00 ; 0 12cb2: 82 e0 ldi r24, 0x02 ; 2 12cb4: 0f 94 85 3a call 0x2750a ; 0x2750a tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 12cb8: 60 91 2a 07 lds r22, 0x072A ; 0x80072a 12cbc: 70 e0 ldi r23, 0x00 ; 0 12cbe: 83 e0 ldi r24, 0x03 ; 3 12cc0: 0f 94 85 3a call 0x2750a ; 0x2750a #endif //TMC2130 reset_acceleration_rates(); 12cc4: 0f 94 3a aa call 0x35474 ; 0x35474 // Call updatePID (similar to when we have processed M301) updatePID(); 12cc8: 0f 94 e3 50 call 0x2a1c6 ; 0x2a1c6 } 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; 12ccc: ce 01 movw r24, r28 12cce: 01 96 adiw r24, 0x01 ; 1 12cd0: 0f 94 ae 47 call 0x28f5c ; 0x28f5c // 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)); 12cd4: 40 e0 ldi r20, 0x00 ; 0 12cd6: 50 e0 ldi r21, 0x00 ; 0 12cd8: ba 01 movw r22, r20 12cda: 82 ea ldi r24, 0xA2 ; 162 12cdc: 9c e0 ldi r25, 0x0C ; 12 12cde: 0e 94 ed 64 call 0xc9da ; 0xc9da eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12ce2: 40 e0 ldi r20, 0x00 ; 0 12ce4: 50 e0 ldi r21, 0x00 ; 0 12ce6: 60 e8 ldi r22, 0x80 ; 128 12ce8: 7f e3 ldi r23, 0x3F ; 63 12cea: 8e e9 ldi r24, 0x9E ; 158 12cec: 9c e0 ldi r25, 0x0C ; 12 12cee: 0e 94 ed 64 call 0xc9da ; 0xc9da eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 12cf2: 48 eb ldi r20, 0xB8 ; 184 12cf4: 5e e1 ldi r21, 0x1E ; 30 12cf6: 65 e8 ldi r22, 0x85 ; 133 12cf8: 7d e3 ldi r23, 0x3D ; 61 12cfa: 8a e9 ldi r24, 0x9A ; 154 12cfc: 9c e0 ldi r25, 0x0C ; 12 12cfe: 0e 94 ed 64 call 0xc9da ; 0xc9da eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 12d02: 64 e3 ldi r22, 0x34 ; 52 12d04: 78 e0 ldi r23, 0x08 ; 8 12d06: 88 e9 ldi r24, 0x98 ; 152 12d08: 9c e0 ldi r25, 0x0C ; 12 12d0a: 0e 94 8d 77 call 0xef1a ; 0xef1a eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 12d0e: 61 e0 ldi r22, 0x01 ; 1 12d10: 87 e9 ldi r24, 0x97 ; 151 12d12: 9c e0 ldi r25, 0x0C ; 12 12d14: 0e 94 a5 77 call 0xef4a ; 0xef4a thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 12d18: 82 e0 ldi r24, 0x02 ; 2 12d1a: 9d e0 ldi r25, 0x0D ; 13 12d1c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 12d20: 91 e0 ldi r25, 0x01 ; 1 12d22: 81 11 cpse r24, r1 12d24: 01 c0 rjmp .+2 ; 0x12d28 12d26: 90 e0 ldi r25, 0x00 ; 0 12d28: 90 93 1d 05 sts 0x051D, r25 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> thermal_model::data.P = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_P); 12d2c: 8e ef ldi r24, 0xFE ; 254 12d2e: 9c e0 ldi r25, 0x0C ; 12 12d30: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 12d34: 60 93 b5 12 sts 0x12B5, r22 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 12d38: 70 93 b6 12 sts 0x12B6, r23 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 12d3c: 80 93 b7 12 sts 0x12B7, r24 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 12d40: 90 93 b8 12 sts 0x12B8, r25 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> thermal_model::data.U = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_U); 12d44: 82 ea ldi r24, 0xA2 ; 162 12d46: 9c e0 ldi r25, 0x0C ; 12 12d48: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 12d4c: 60 93 b9 12 sts 0x12B9, r22 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 12d50: 70 93 ba 12 sts 0x12BA, r23 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 12d54: 80 93 bb 12 sts 0x12BB, r24 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 12d58: 90 93 bc 12 sts 0x12BC, r25 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> thermal_model::data.V = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_V); 12d5c: 8e e9 ldi r24, 0x9E ; 158 12d5e: 9c e0 ldi r25, 0x0C ; 12 12d60: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 12d64: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 12d68: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 12d6c: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 12d70: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> thermal_model::data.C = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_C); 12d74: 8a ef ldi r24, 0xFA ; 250 12d76: 9c e0 ldi r25, 0x0C ; 12 12d78: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 12d7c: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 12d80: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 12d84: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 12d88: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> thermal_model::data.fS = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_D); 12d8c: 8a e9 ldi r24, 0x9A ; 154 12d8e: 9c e0 ldi r25, 0x0C ; 12 12d90: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 12d94: 60 93 c5 12 sts 0x12C5, r22 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 12d98: 70 93 c6 12 sts 0x12C6, r23 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 12d9c: 80 93 c7 12 sts 0x12C7, r24 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 12da0: 90 93 c8 12 sts 0x12C8, r25 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> thermal_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_THERMAL_MODEL_L)); 12da4: 88 e9 ldi r24, 0x98 ; 152 12da6: 9c e0 ldi r25, 0x0C ; 12 12da8: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 12dac: 0f 94 91 44 call 0x28922 ; 0x28922 eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12db0: 40 e4 ldi r20, 0x40 ; 64 12db2: 50 e0 ldi r21, 0x00 ; 0 12db4: 6a eb ldi r22, 0xBA ; 186 12db6: 7c e0 ldi r23, 0x0C ; 12 12db8: 8b ec ldi r24, 0xCB ; 203 12dba: 92 e1 ldi r25, 0x12 ; 18 12dbc: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12dc0: 86 eb ldi r24, 0xB6 ; 182 12dc2: 9c e0 ldi r25, 0x0C ; 12 12dc4: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 12dc8: 60 93 0b 13 sts 0x130B, r22 ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 12dcc: 70 93 0c 13 sts 0x130C, r23 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 12dd0: 80 93 0d 13 sts 0x130D, r24 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 12dd4: 90 93 0e 13 sts 0x130E, r25 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> thermal_model::data.warn = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_W); 12dd8: 82 eb ldi r24, 0xB2 ; 178 12dda: 9c e0 ldi r25, 0x0C ; 12 12ddc: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 12de0: 60 93 0f 13 sts 0x130F, r22 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 12de4: 70 93 10 13 sts 0x1310, r23 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 12de8: 80 93 11 13 sts 0x1311, r24 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 12dec: 90 93 12 13 sts 0x1312, r25 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::data.err = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_E); 12df0: 8e ea ldi r24, 0xAE ; 174 12df2: 9c e0 ldi r25, 0x0C ; 12 12df4: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 12df8: 60 93 13 13 sts 0x1313, r22 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 12dfc: 70 93 14 13 sts 0x1314, r23 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 12e00: 80 93 15 13 sts 0x1315, r24 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 12e04: 90 93 16 13 sts 0x1316, r25 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> if(!thermal_model::calibrated()) { 12e08: 0f 94 b0 44 call 0x28960 ; 0x28960 12e0c: 81 11 cpse r24, r1 12e0e: 06 c0 rjmp .+12 ; 0x12e1c SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 12e10: 89 e9 ldi r24, 0x99 ; 153 12e12: 98 e7 ldi r25, 0x78 ; 120 12e14: 0e 94 17 7b call 0xf62e ; 0xf62e thermal_model_reset_settings(); 12e18: 0f 94 bc 47 call 0x28f78 ; 0x28f78 } thermal_model::setup(); 12e1c: 0f 94 18 45 call 0x28a30 ; 0x28a30 } 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; 12e20: ce 01 movw r24, r28 12e22: 01 96 adiw r24, 0x01 ; 1 12e24: 0f 94 a1 47 call 0x28f42 ; 0x28f42 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 12e28: 84 e1 ldi r24, 0x14 ; 20 12e2a: 9a ea ldi r25, 0xAA ; 170 12e2c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM("Stored settings retrieved"); 12e30: 83 ec ldi r24, 0xC3 ; 195 12e32: 98 e7 ldi r25, 0x78 ; 120 12e34: 0e 94 17 7b call 0xf62e ; 0xf62e 12e38: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 12e3a: 0f 90 pop r0 12e3c: df 91 pop r29 12e3e: cf 91 pop r28 12e40: 1f 91 pop r17 12e42: 0f 91 pop r16 12e44: ff 90 pop r15 12e46: ef 90 pop r14 12e48: bf 90 pop r11 12e4a: af 90 pop r10 12e4c: 9f 90 pop r9 12e4e: 8f 90 pop r8 12e50: 7f 90 pop r7 12e52: 6f 90 pop r6 12e54: 5f 90 pop r5 12e56: 4f 90 pop r4 12e58: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 12e5a: 0e 94 c8 83 call 0x10790 ; 0x10790 //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))) { 12e5e: 64 e0 ldi r22, 0x04 ; 4 12e60: 70 e0 ldi r23, 0x00 ; 0 12e62: 84 e1 ldi r24, 0x14 ; 20 12e64: 90 e0 ldi r25, 0x00 ; 0 12e66: 0e 94 72 5c call 0xb8e4 ; 0xb8e4 12e6a: 91 e0 ldi r25, 0x01 ; 1 12e6c: 89 27 eor r24, r25 12e6e: e5 cf rjmp .-54 ; 0x12e3a 00012e70 : 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() 12e70: 2f 92 push r2 12e72: 3f 92 push r3 12e74: 4f 92 push r4 12e76: 5f 92 push r5 12e78: 6f 92 push r6 12e7a: 7f 92 push r7 12e7c: 8f 92 push r8 12e7e: 9f 92 push r9 12e80: af 92 push r10 12e82: bf 92 push r11 12e84: cf 92 push r12 12e86: df 92 push r13 12e88: ef 92 push r14 12e8a: ff 92 push r15 12e8c: 0f 93 push r16 12e8e: 1f 93 push r17 12e90: cf 93 push r28 12e92: df 93 push r29 12e94: cd b7 in r28, 0x3d ; 61 12e96: de b7 in r29, 0x3e ; 62 12e98: cf 58 subi r28, 0x8F ; 143 12e9a: d1 09 sbc r29, r1 12e9c: 0f b6 in r0, 0x3f ; 63 12e9e: f8 94 cli 12ea0: de bf out 0x3e, r29 ; 62 12ea2: 0f be out 0x3f, r0 ; 63 12ea4: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12ea6: 82 e0 ldi r24, 0x02 ; 2 12ea8: 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) 12eac: a0 90 6d 12 lds r10, 0x126D ; 0x80126d 12eb0: b0 90 6e 12 lds r11, 0x126E ; 0x80126e 12eb4: 85 01 movw r16, r10 12eb6: 0d 57 subi r16, 0x7D ; 125 12eb8: 1f 4e sbci r17, 0xEF ; 239 12eba: 46 e0 ldi r20, 0x06 ; 6 12ebc: 50 e0 ldi r21, 0x00 ; 0 12ebe: 62 e0 ldi r22, 0x02 ; 2 12ec0: 7a e8 ldi r23, 0x8A ; 138 12ec2: c8 01 movw r24, r16 12ec4: 0f 94 25 db call 0x3b64a ; 0x3b64a 12ec8: 89 2b or r24, r25 12eca: 09 f0 breq .+2 ; 0x12ece 12ecc: b8 c0 rjmp .+368 ; 0x1303e { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12ece: 83 ef ldi r24, 0xF3 ; 243 12ed0: 99 e8 ldi r25, 0x89 ; 137 12ed2: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 12ed6: 88 23 and r24, r24 12ed8: 09 f4 brne .+2 ; 0x12edc 12eda: 91 c0 rjmp .+290 ; 0x12ffe { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12edc: 88 e5 ldi r24, 0x58 ; 88 12ede: 0e 94 8d 5c call 0xb91a ; 0xb91a 12ee2: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12ee4: 89 e5 ldi r24, 0x59 ; 89 12ee6: 0e 94 8d 5c call 0xb91a ; 0xb91a 12eea: 81 11 cpse r24, r1 12eec: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12eee: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12ef2: 1a 82 std Y+2, r1 ; 0x02 12ef4: 19 82 std Y+1, r1 ; 0x01 12ef6: fe 01 movw r30, r28 12ef8: 33 96 adiw r30, 0x03 ; 3 12efa: 83 e1 ldi r24, 0x13 ; 19 12efc: df 01 movw r26, r30 12efe: 1d 92 st X+, r1 12f00: 8a 95 dec r24 12f02: e9 f7 brne .-6 ; 0x12efe if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12f04: 48 ec ldi r20, 0xC8 ; 200 12f06: 5f ea ldi r21, 0xAF ; 175 12f08: 60 e0 ldi r22, 0x00 ; 0 12f0a: 70 e0 ldi r23, 0x00 ; 0 12f0c: 83 e7 ldi r24, 0x73 ; 115 12f0e: 93 e0 ldi r25, 0x03 ; 3 12f10: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 12f14: 81 11 cpse r24, r1 crashDet_counter = 0; 12f16: 10 92 72 03 sts 0x0372, r1 ; 0x800372 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 12f1a: 00 91 72 03 lds r16, 0x0372 ; 0x800372 12f1e: 0f 5f subi r16, 0xFF ; 255 12f20: 00 93 72 03 sts 0x0372, r16 ; 0x800372 automatic_recovery_after_crash = false; } crashDetTimer.start(); 12f24: 83 e7 ldi r24, 0x73 ; 115 12f26: 93 e0 ldi r25, 0x03 ; 3 12f28: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> crashDet_axes |= mask; 12f2c: 80 91 71 03 lds r24, 0x0371 ; 0x800371 12f30: 81 2b or r24, r17 12f32: 80 93 71 03 sts 0x0371, r24 ; 0x800371 if (mask & X_AXIS_MASK) { 12f36: 10 ff sbrs r17, 0 12f38: 08 c0 rjmp .+16 ; 0x12f4a eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 12f3a: 86 e6 ldi r24, 0x66 ; 102 12f3c: 9f e0 ldi r25, 0x0F ; 15 12f3e: 0e 94 c4 77 call 0xef88 ; 0xef88 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 12f42: 85 e0 ldi r24, 0x05 ; 5 12f44: 9f e0 ldi r25, 0x0F ; 15 12f46: 0e 94 b7 77 call 0xef6e ; 0xef6e } if (mask & Y_AXIS_MASK) { 12f4a: 11 ff sbrs r17, 1 12f4c: 08 c0 rjmp .+16 ; 0x12f5e eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 12f4e: 88 e6 ldi r24, 0x68 ; 104 12f50: 9f e0 ldi r25, 0x0F ; 15 12f52: 0e 94 c4 77 call 0xef88 ; 0xef88 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 12f56: 83 e0 ldi r24, 0x03 ; 3 12f58: 9f e0 ldi r25, 0x0F ; 15 12f5a: 0e 94 b7 77 call 0xef6e ; 0xef6e } lcd_update_enable(true); 12f5e: 81 e0 ldi r24, 0x01 ; 1 12f60: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_update(2); 12f64: 82 e0 ldi r24, 0x02 ; 2 12f66: 0e 94 6d 6f call 0xdeda ; 0xdeda // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 12f6a: 61 2f mov r22, r17 12f6c: ce 01 movw r24, r28 12f6e: 01 96 adiw r24, 0x01 ; 1 12f70: 0e 94 cf 74 call 0xe99e ; 0xe99e lcd_setstatus(msg); 12f74: ce 01 movw r24, r28 12f76: 01 96 adiw r24, 0x01 ; 1 12f78: 0f 94 26 15 call 0x22a4c ; 0x22a4c gcode_G28(true, true, false); //home X and Y 12f7c: 40 e0 ldi r20, 0x00 ; 0 12f7e: 61 e0 ldi r22, 0x01 ; 1 12f80: 81 e0 ldi r24, 0x01 ; 1 12f82: 0e 94 a1 80 call 0x10142 ; 0x10142 if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 12f86: 61 e0 ldi r22, 0x01 ; 1 12f88: 84 e8 ldi r24, 0x84 ; 132 12f8a: 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) { 12f8c: 03 30 cpi r16, 0x03 ; 3 12f8e: 60 f1 brcs .+88 ; 0x12fe8 12f90: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 12f94: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a enquecommand_P(PSTR("CRASH_RECOVER")); }else{ setTargetHotend(0); // notify the user of *all* the axes previously affected, not just the last one lcd_update_enable(false); 12f98: 80 e0 ldi r24, 0x00 ; 0 12f9a: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_clear(); 12f9e: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 crashdet_fmt_error(msg, crashDet_axes); 12fa2: 60 91 71 03 lds r22, 0x0371 ; 0x800371 12fa6: ce 01 movw r24, r28 12fa8: 01 96 adiw r24, 0x01 ; 1 12faa: 0e 94 cf 74 call 0xe99e ; 0xe99e crashDet_axes = 0; 12fae: 10 92 71 03 sts 0x0371, r1 ; 0x800371 lcd_print(msg); 12fb2: ce 01 movw r24, r28 12fb4: 01 96 adiw r24, 0x01 ; 1 12fb6: 0e 94 ad 71 call 0xe35a ; 0xe35a // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 12fba: 85 e1 ldi r24, 0x15 ; 21 12fbc: 9c e3 ldi r25, 0x3C ; 60 12fbe: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 12fc2: ac 01 movw r20, r24 12fc4: 61 e0 ldi r22, 0x01 ; 1 12fc6: 80 e0 ldi r24, 0x00 ; 0 12fc8: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_putc('?'); 12fcc: 8f e3 ldi r24, 0x3F ; 63 12fce: 0e 94 95 6f call 0xdf2a ; 0xdf2a //! @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); 12fd2: 40 e0 ldi r20, 0x00 ; 0 12fd4: 60 e0 ldi r22, 0x00 ; 0 12fd6: 90 e0 ldi r25, 0x00 ; 0 12fd8: 80 e0 ldi r24, 0x00 ; 0 12fda: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c 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")); 12fde: 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) 12fe0: 81 11 cpse r24, r1 12fe2: 0a c0 rjmp .+20 ; 0x12ff8 { enquecommand_P(PSTR("CRASH_RECOVER")); 12fe4: 86 e7 ldi r24, 0x76 ; 118 12fe6: 96 e8 ldi r25, 0x86 ; 134 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12fe8: 0e 94 5c 89 call 0x112b8 ; 0x112b8 SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 12fec: 81 e0 ldi r24, 0x01 ; 1 12fee: 80 93 96 02 sts 0x0296, r24 ; 0x800296 ClearToSend(); 12ff2: 0e 94 c6 80 call 0x1018c ; 0x1018c 12ff6: 5e c3 rjmp .+1724 ; 0x136b4 { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12ff8: 89 e6 ldi r24, 0x69 ; 105 12ffa: 96 e8 ldi r25, 0x86 ; 134 12ffc: f5 cf rjmp .-22 ; 0x12fe8 crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 12ffe: 85 ee ldi r24, 0xE5 ; 229 13000: 99 e8 ldi r25, 0x89 ; 137 13002: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 13006: 88 23 and r24, r24 13008: 69 f0 breq .+26 ; 0x13024 } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 1300a: 0e 94 4b 68 call 0xd096 ; 0xd096 1300e: 81 11 cpse r24, r1 13010: 06 c0 rjmp .+12 ; 0x1301e 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 13012: 60 e0 ldi r22, 0x00 ; 0 13014: 70 e0 ldi r23, 0x00 ; 0 13016: 80 e8 ldi r24, 0x80 ; 128 13018: 9f e3 ldi r25, 0x3F ; 63 1301a: 0e 94 0a 69 call 0xd214 ; 0xd214 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 1301e: 0f 94 e0 3b call 0x277c0 ; 0x277c0 13022: e4 cf rjmp .-56 ; 0x12fec else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 13024: 88 ed ldi r24, 0xD8 ; 216 13026: 99 e8 ldi r25, 0x89 ; 137 13028: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 1302c: 88 23 and r24, r24 1302e: f1 f2 breq .-68 ; 0x12fec } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 13030: 0f 94 e0 3b call 0x277c0 ; 0x277c0 // Abort the print print_stop(); 13034: 60 e0 ldi r22, 0x00 ; 0 13036: 80 e0 ldi r24, 0x00 ; 0 13038: 0f 94 e7 15 call 0x22bce ; 0x22bce 1303c: d7 cf rjmp .-82 ; 0x12fec // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 1303e: 44 e0 ldi r20, 0x04 ; 4 13040: 50 e0 ldi r21, 0x00 ; 0 13042: 63 ed ldi r22, 0xD3 ; 211 13044: 79 e8 ldi r23, 0x89 ; 137 13046: c8 01 movw r24, r16 13048: 0f 94 25 db call 0x3b64a ; 0x3b64a 1304c: 89 2b or r24, r25 1304e: 09 f0 breq .+2 ; 0x13052 13050: fc c0 rjmp .+504 ; 0x1324a { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 13052: 85 01 movw r16, r10 13054: 09 57 subi r16, 0x79 ; 121 13056: 1f 4e sbci r17, 0xEF ; 239 13058: 49 e0 ldi r20, 0x09 ; 9 1305a: 50 e0 ldi r21, 0x00 ; 0 1305c: 69 ec ldi r22, 0xC9 ; 201 1305e: 79 e8 ldi r23, 0x89 ; 137 13060: c8 01 movw r24, r16 13062: 0f 94 25 db call 0x3b64a ; 0x3b64a 13066: 89 2b or r24, r25 13068: c9 f4 brne .+50 ; 0x1309c { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1306a: f5 01 movw r30, r10 1306c: e0 57 subi r30, 0x70 ; 112 1306e: ff 4e sbci r31, 0xEF ; 239 13070: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 13072: 15 34 cpi r17, 0x45 ; 69 13074: 89 f0 breq .+34 ; 0x13098 13076: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 13078: 14 30 cpi r17, 0x04 ; 4 1307a: 08 f0 brcs .+2 ; 0x1307e 1307c: b7 cf rjmp .-146 ; 0x12fec { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 1307e: 4a e0 ldi r20, 0x0A ; 10 13080: 50 e0 ldi r21, 0x00 ; 0 13082: 70 e0 ldi r23, 0x00 ; 0 13084: 60 e0 ldi r22, 0x00 ; 0 13086: c5 01 movw r24, r10 13088: 8f 56 subi r24, 0x6F ; 111 1308a: 9f 4e sbci r25, 0xEF ; 239 1308c: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 tmc2130_set_wave(axis, 247, fac); 13090: 81 2f mov r24, r17 13092: 0f 94 13 88 call 0x31026 ; 0x31026 13096: aa cf rjmp .-172 ; 0x12fec // ### 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'); 13098: 13 e0 ldi r17, 0x03 ; 3 1309a: f1 cf rjmp .-30 ; 0x1307e } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 1309c: 49 e0 ldi r20, 0x09 ; 9 1309e: 50 e0 ldi r21, 0x00 ; 0 130a0: 6f eb ldi r22, 0xBF ; 191 130a2: 79 e8 ldi r23, 0x89 ; 137 130a4: c8 01 movw r24, r16 130a6: 0f 94 25 db call 0x3b64a ; 0x3b64a 130aa: 89 2b or r24, r25 130ac: 51 f5 brne .+84 ; 0x13102 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 130ae: f5 01 movw r30, r10 130b0: e0 57 subi r30, 0x70 ; 112 130b2: ff 4e sbci r31, 0xEF ; 239 130b4: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 130b6: 15 34 cpi r17, 0x45 ; 69 130b8: 11 f1 breq .+68 ; 0x130fe 130ba: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 130bc: 14 30 cpi r17, 0x04 ; 4 130be: 08 f0 brcs .+2 ; 0x130c2 130c0: 95 cf rjmp .-214 ; 0x12fec { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 130c2: 4a e0 ldi r20, 0x0A ; 10 130c4: 50 e0 ldi r21, 0x00 ; 0 130c6: 70 e0 ldi r23, 0x00 ; 0 130c8: 60 e0 ldi r22, 0x00 ; 0 130ca: c5 01 movw r24, r10 130cc: 8f 56 subi r24, 0x6F ; 111 130ce: 9f 4e sbci r25, 0xEF ; 239 130d0: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 130d4: e1 2f mov r30, r17 130d6: f0 e0 ldi r31, 0x00 ; 0 130d8: eb 50 subi r30, 0x0B ; 11 130da: fb 4f sbci r31, 0xFB ; 251 130dc: 80 81 ld r24, Z 130de: 40 e0 ldi r20, 0x00 ; 0 130e0: 51 e0 ldi r21, 0x01 ; 1 130e2: 02 c0 rjmp .+4 ; 0x130e8 130e4: 56 95 lsr r21 130e6: 47 95 ror r20 130e8: 8a 95 dec r24 130ea: e2 f7 brpl .-8 ; 0x130e4 uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 130ec: 84 2f mov r24, r20 130ee: 88 0f add r24, r24 130f0: 88 0f add r24, r24 130f2: 81 50 subi r24, 0x01 ; 1 130f4: 68 23 and r22, r24 130f6: 81 2f mov r24, r17 130f8: 0f 94 2a 8b call 0x31654 ; 0x31654 130fc: 77 cf rjmp .-274 ; 0x12fec // ### 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'); 130fe: 13 e0 ldi r17, 0x03 ; 3 13100: e0 cf rjmp .-64 ; 0x130c2 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 13102: 49 e0 ldi r20, 0x09 ; 9 13104: 50 e0 ldi r21, 0x00 ; 0 13106: 65 eb ldi r22, 0xB5 ; 181 13108: 79 e8 ldi r23, 0x89 ; 137 1310a: c8 01 movw r24, r16 1310c: 0f 94 25 db call 0x3b64a ; 0x3b64a 13110: 89 2b or r24, r25 13112: 09 f0 breq .+2 ; 0x13116 13114: 6b cf rjmp .-298 ; 0x12fec { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 13116: f5 01 movw r30, r10 13118: e0 57 subi r30, 0x70 ; 112 1311a: ff 4e sbci r31, 0xEF ; 239 1311c: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 1311e: 85 34 cpi r24, 0x45 ; 69 13120: 09 f4 brne .+2 ; 0x13124 13122: 90 c0 rjmp .+288 ; 0x13244 13124: 18 ea ldi r17, 0xA8 ; 168 13126: c1 2e mov r12, r17 13128: c8 0e add r12, r24 if (axis < 4) 1312a: b3 e0 ldi r27, 0x03 ; 3 1312c: bc 15 cp r27, r12 1312e: 08 f4 brcc .+2 ; 0x13132 13130: 5d cf rjmp .-326 ; 0x12fec { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 13132: ec 2c mov r14, r12 13134: f1 2c mov r15, r1 13136: 47 01 movw r8, r14 13138: 88 0c add r8, r8 1313a: 99 1c adc r9, r9 1313c: f4 01 movw r30, r8 1313e: e3 58 subi r30, 0x83 ; 131 13140: fd 4f sbci r31, 0xFD ; 253 13142: 00 81 ld r16, Z 13144: 20 2f mov r18, r16 13146: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 13148: 10 2f mov r17, r16 1314a: 12 95 swap r17 1314c: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 1314e: 00 1f adc r16, r16 13150: 00 27 eor r16, r16 13152: 00 1f adc r16, r16 13154: 61 81 ldd r22, Z+1 ; 0x01 13156: 67 70 andi r22, 0x07 ; 7 13158: 66 0f add r22, r22 1315a: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 1315c: f4 01 movw r30, r8 1315e: e2 58 subi r30, 0x82 ; 130 13160: fd 4f sbci r31, 0xFD ; 253 13162: d0 80 ld r13, Z 13164: d6 94 lsr r13 13166: d6 94 lsr r13 13168: d6 94 lsr r13 1316a: ed 2d mov r30, r13 1316c: e3 70 andi r30, 0x03 ; 3 1316e: de 2e mov r13, r30 char* str_end = 0; 13170: 1a 82 std Y+2, r1 ; 0x02 13172: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 13174: c5 01 movw r24, r10 13176: 8f 56 subi r24, 0x6F ; 111 13178: 9f 4e sbci r25, 0xEF ; 239 1317a: dc 01 movw r26, r24 1317c: 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; 1317e: 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]) 13180: 33 23 and r19, r19 13182: e1 f1 breq .+120 ; 0x131fc { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 13184: 4a e0 ldi r20, 0x0A ; 10 13186: 50 e0 ldi r21, 0x00 ; 0 13188: be 01 movw r22, r28 1318a: 6f 5f subi r22, 0xFF ; 255 1318c: 7f 4f sbci r23, 0xFF ; 255 1318e: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 13192: 6f 70 andi r22, 0x0F ; 15 13194: b6 2e mov r11, r22 if (str_end && *str_end) 13196: 89 81 ldd r24, Y+1 ; 0x01 13198: 9a 81 ldd r25, Y+2 ; 0x02 1319a: 00 97 sbiw r24, 0x00 ; 0 1319c: 79 f1 breq .+94 ; 0x131fc 1319e: fc 01 movw r30, r24 131a0: 20 81 ld r18, Z 131a2: 22 23 and r18, r18 131a4: 59 f1 breq .+86 ; 0x131fc { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 131a6: 4a e0 ldi r20, 0x0A ; 10 131a8: 50 e0 ldi r21, 0x00 ; 0 131aa: be 01 movw r22, r28 131ac: 6f 5f subi r22, 0xFF ; 255 131ae: 7f 4f sbci r23, 0xFF ; 255 131b0: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 131b4: 16 2f mov r17, r22 131b6: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 131b8: 89 81 ldd r24, Y+1 ; 0x01 131ba: 9a 81 ldd r25, Y+2 ; 0x02 131bc: 00 97 sbiw r24, 0x00 ; 0 131be: f1 f0 breq .+60 ; 0x131fc 131c0: dc 01 movw r26, r24 131c2: 2c 91 ld r18, X 131c4: 22 23 and r18, r18 131c6: d1 f0 breq .+52 ; 0x131fc { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 131c8: 4a e0 ldi r20, 0x0A ; 10 131ca: 50 e0 ldi r21, 0x00 ; 0 131cc: be 01 movw r22, r28 131ce: 6f 5f subi r22, 0xFF ; 255 131d0: 7f 4f sbci r23, 0xFF ; 255 131d2: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 131d6: 06 2f mov r16, r22 131d8: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 131da: 89 81 ldd r24, Y+1 ; 0x01 131dc: 9a 81 ldd r25, Y+2 ; 0x02 131de: 00 97 sbiw r24, 0x00 ; 0 131e0: 69 f0 breq .+26 ; 0x131fc 131e2: fc 01 movw r30, r24 131e4: 20 81 ld r18, Z 131e6: 22 23 and r18, r18 131e8: 49 f0 breq .+18 ; 0x131fc chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 131ea: 4a e0 ldi r20, 0x0A ; 10 131ec: 50 e0 ldi r21, 0x00 ; 0 131ee: be 01 movw r22, r28 131f0: 6f 5f subi r22, 0xFF ; 255 131f2: 7f 4f sbci r23, 0xFF ; 255 131f4: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 131f8: 63 70 andi r22, 0x03 ; 3 131fa: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 131fc: f4 01 movw r30, r8 131fe: e3 58 subi r30, 0x83 ; 131 13200: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 13202: 17 70 andi r17, 0x07 ; 7 13204: 12 95 swap r17 13206: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 13208: 60 2f mov r22, r16 1320a: 67 95 ror r22 1320c: 66 27 eor r22, r22 1320e: 67 95 ror r22 13210: 1b 29 or r17, r11 13212: 16 2b or r17, r22 13214: 10 83 st Z, r17 13216: 60 2f mov r22, r16 13218: 66 95 lsr r22 1321a: 01 81 ldd r16, Z+1 ; 0x01 1321c: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 1321e: 2d 2d mov r18, r13 13220: 23 70 andi r18, 0x03 ; 3 13222: d2 2e mov r13, r18 13224: dd 0c add r13, r13 13226: dd 0c add r13, r13 13228: dd 0c add r13, r13 1322a: 06 2b or r16, r22 1322c: d0 2a or r13, r16 1322e: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 13230: f7 01 movw r30, r14 13232: eb 50 subi r30, 0x0B ; 11 13234: fb 4f sbci r31, 0xFB ; 251 13236: 50 e0 ldi r21, 0x00 ; 0 13238: 40 e0 ldi r20, 0x00 ; 0 1323a: 60 81 ld r22, Z 1323c: 8c 2d mov r24, r12 1323e: 0f 94 1a 3a call 0x27434 ; 0x27434 13242: d4 ce rjmp .-600 ; 0x12fec // ### 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'); 13244: b3 e0 ldi r27, 0x03 ; 3 13246: cb 2e mov r12, r27 13248: 74 cf rjmp .-280 ; 0x13132 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) { 1324a: 45 e0 ldi r20, 0x05 ; 5 1324c: 50 e0 ldi r21, 0x00 ; 0 1324e: 6f ea ldi r22, 0xAF ; 175 13250: 79 e8 ldi r23, 0x89 ; 137 13252: c8 01 movw r24, r16 13254: 0f 94 25 db call 0x3b64a ; 0x3b64a 13258: 89 2b or r24, r25 1325a: 09 f0 breq .+2 ; 0x1325e 1325c: 64 c1 rjmp .+712 ; 0x13526 - `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"))) { 1325e: 85 ea ldi r24, 0xA5 ; 165 13260: 99 e8 ldi r25, 0x89 ; 137 13262: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 13266: 88 23 and r24, r24 13268: 09 f4 brne .+2 ; 0x1326c 1326a: 3c c0 rjmp .+120 ; 0x132e4 //! 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 1326c: 10 92 33 05 sts 0x0533, r1 ; 0x800533 13270: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 13272: c1 2c mov r12, r1 13274: d1 2c mov r13, r1 13276: 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); 13278: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 1327a: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 1327c: 64 e1 ldi r22, 0x14 ; 20 1327e: 70 e0 ldi r23, 0x00 ; 0 13280: 80 e0 ldi r24, 0x00 ; 0 13282: 90 e0 ldi r25, 0x00 ; 0 13284: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 unsigned long tachMeasure = _micros(); 13288: 0f 94 3c 3d call 0x27a78 ; 0x27a78 1328c: 4b 01 movw r8, r22 1328e: 5c 01 movw r10, r24 cli(); 13290: f8 94 cli SET_INPUT(TACH_1); 13292: 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 ) ; 13294: 67 9b sbis 0x0c, 7 ; 12 13296: fe cf rjmp .-4 ; 0x13294 sei(); 13298: 78 94 sei tachMeasure = _micros() - tachMeasure; 1329a: 0f 94 3c 3d call 0x27a78 ; 0x27a78 1329e: dc 01 movw r26, r24 132a0: cb 01 movw r24, r22 132a2: 88 19 sub r24, r8 132a4: 99 09 sbc r25, r9 132a6: aa 09 sbc r26, r10 132a8: bb 09 sbc r27, r11 132aa: c8 16 cp r12, r24 132ac: d9 06 cpc r13, r25 132ae: ea 06 cpc r14, r26 132b0: fb 06 cpc r15, r27 132b2: 10 f4 brcc .+4 ; 0x132b8 132b4: 6c 01 movw r12, r24 132b6: 7d 01 movw r14, r26 132b8: 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){ 132ba: f1 f6 brne .-68 ; 0x13278 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 "); 132bc: 8e e5 ldi r24, 0x5E ; 94 132be: 96 e8 ldi r25, 0x86 ; 134 132c0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 132c4: 8a e5 ldi r24, 0x5A ; 90 132c6: 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 ){ 132c8: 35 ef ldi r19, 0xF5 ; 245 132ca: c3 16 cp r12, r19 132cc: 31 e0 ldi r19, 0x01 ; 1 132ce: d3 06 cpc r13, r19 132d0: e1 04 cpc r14, r1 132d2: f1 04 cpc r15, r1 132d4: 10 f4 brcc .+4 ; 0x132da // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 132d6: 87 e5 ldi r24, 0x57 ; 87 132d8: 96 e8 ldi r25, 0x86 ; 134 132da: 0e 94 17 7b call 0xf62e ; 0xf62e } // cleanup after the test function SET_INPUT(TACH_1); 132de: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 132e0: 77 9a sbi 0x0e, 7 ; 14 132e2: 84 ce rjmp .-760 ; 0x12fec */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 132e4: 81 ea ldi r24, 0xA1 ; 161 132e6: 99 e8 ldi r25, 0x89 ; 137 132e8: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 132ec: 88 23 and r24, r24 132ee: 21 f1 breq .+72 ; 0x13338 printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 132f0: 40 91 b0 04 lds r20, 0x04B0 ; 0x8004b0 132f4: 50 91 b1 04 lds r21, 0x04B1 ; 0x8004b1 132f8: 2c e3 ldi r18, 0x3C ; 60 132fa: 24 9f mul r18, r20 132fc: c0 01 movw r24, r0 132fe: 25 9f mul r18, r21 13300: 90 0d add r25, r0 13302: 11 24 eor r1, r1 13304: 9f 93 push r25 13306: 8f 93 push r24 13308: 40 91 ae 04 lds r20, 0x04AE ; 0x8004ae 1330c: 50 91 af 04 lds r21, 0x04AF ; 0x8004af 13310: 24 9f mul r18, r20 13312: c0 01 movw r24, r0 13314: 25 9f mul r18, r21 13316: 90 0d add r25, r0 13318: 11 24 eor r1, r1 1331a: 9f 93 push r25 1331c: 8f 93 push r24 1331e: 82 e0 ldi r24, 0x02 ; 2 13320: 9b e6 ldi r25, 0x6B ; 107 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 13322: 9f 93 push r25 13324: 8f 93 push r24 13326: 0f 94 08 dc call 0x3b810 ; 0x3b810 1332a: 0f 90 pop r0 1332c: 0f 90 pop r0 1332e: 0f 90 pop r0 13330: 0f 90 pop r0 13332: 0f 90 pop r0 13334: 0f 90 pop r0 13336: 5a ce rjmp .-844 ; 0x12fec 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 13338: 8c e9 ldi r24, 0x9C ; 156 1333a: 99 e8 ldi r25, 0x89 ; 137 1333c: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 13340: 88 23 and r24, r24 13342: 11 f1 breq .+68 ; 0x13388 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 13344: 8c e8 ldi r24, 0x8C ; 140 13346: 9f e0 ldi r25, 0x0F ; 15 13348: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1334c: 81 11 cpse r24, r1 1334e: 10 c0 rjmp .+32 ; 0x13370 // M24 - Start SD print enquecommand_P(MSG_M24); 13350: 61 e0 ldi r22, 0x01 ; 1 13352: 89 e2 ldi r24, 0x29 ; 41 13354: 91 e7 ldi r25, 0x71 ; 113 13356: 0e 94 5c 89 call 0x112b8 ; 0x112b8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1335a: 60 e0 ldi r22, 0x00 ; 0 1335c: 85 ea ldi r24, 0xA5 ; 165 1335e: 9f e0 ldi r25, 0x0F ; 15 13360: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 13364: 60 e0 ldi r22, 0x00 ; 0 13366: 8f e7 ldi r24, 0x7F ; 127 13368: 9c e0 ldi r25, 0x0C ; 12 1336a: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 1336e: 3e ce rjmp .-900 ; 0x12fec // 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) { 13370: 81 30 cpi r24, 0x01 ; 1 13372: 09 f0 breq .+2 ; 0x13376 13374: 3b ce rjmp .-906 ; 0x12fec // 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(); 13376: 0f 94 86 58 call 0x2b10c ; 0x2b10c usb_timer.start(); 1337a: 8e e0 ldi r24, 0x0E ; 14 1337c: 95 e0 ldi r25, 0x05 ; 5 1337e: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::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(); 13382: 0f 94 67 3f call 0x27ece ; 0x27ece 13386: 32 ce rjmp .-924 ; 0x12fec } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 13388: 85 e9 ldi r24, 0x95 ; 149 1338a: 99 e8 ldi r25, 0x89 ; 137 1338c: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 13390: 88 23 and r24, r24 13392: 21 f0 breq .+8 ; 0x1339c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 13394: 80 e0 ldi r24, 0x00 ; 0 13396: 0f 94 8c 1d call 0x23b18 ; 0x23b18 1339a: 28 ce rjmp .-944 ; 0x12fec MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 1339c: 8f e8 ldi r24, 0x8F ; 143 1339e: 99 e8 ldi r25, 0x89 ; 137 133a0: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 133a4: 88 23 and r24, r24 133a6: 51 f0 breq .+20 ; 0x133bc #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 133a8: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e6> 133ac: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e7> 133b0: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e8> 133b4: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e9> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 133b8: 0e 94 12 68 call 0xd024 ; 0xd024 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 133bc: 8c e8 ldi r24, 0x8C ; 140 133be: 99 e8 ldi r25, 0x89 ; 137 133c0: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 133c4: 88 23 and r24, r24 133c6: a9 f0 breq .+42 ; 0x133f2 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 133c8: 44 e1 ldi r20, 0x14 ; 20 133ca: 50 e0 ldi r21, 0x00 ; 0 133cc: 65 e1 ldi r22, 0x15 ; 21 133ce: 7d e0 ldi r23, 0x0D ; 13 133d0: ce 01 movw r24, r28 133d2: 01 96 adiw r24, 0x01 ; 1 133d4: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c if (SN[19]) 133d8: 8c 89 ldd r24, Y+20 ; 0x14 133da: 88 23 and r24, r24 133dc: 29 f0 breq .+10 ; 0x133e8 puts_P(PSTR("SN invalid")); 133de: 81 e8 ldi r24, 0x81 ; 129 133e0: 99 e8 ldi r25, 0x89 ; 137 133e2: 0f 94 2f dc call 0x3b85e ; 0x3b85e 133e6: 02 ce rjmp .-1020 ; 0x12fec else puts(SN); 133e8: ce 01 movw r24, r28 133ea: 01 96 adiw r24, 0x01 ; 1 133ec: 0f 94 d5 e3 call 0x3c7aa ; 0x3c7aa 133f0: fd cd rjmp .-1030 ; 0x12fec } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 133f2: 8d e7 ldi r24, 0x7D ; 125 133f4: 99 e8 ldi r25, 0x89 ; 137 133f6: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 133fa: 88 23 and r24, r24 133fc: 29 f0 breq .+10 ; 0x13408 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 133fe: 81 e7 ldi r24, 0x71 ; 113 13400: 99 e8 ldi r25, 0x89 ; 137 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 13402: 0e 94 17 7b call 0xf62e ; 0xf62e 13406: f2 cd rjmp .-1052 ; 0x12fec 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 13408: 8d e6 ldi r24, 0x6D ; 109 1340a: 99 e8 ldi r25, 0x89 ; 137 1340c: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 13410: 88 23 and r24, r24 13412: 19 f0 breq .+6 ; 0x1341a SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 13414: 8d e4 ldi r24, 0x4D ; 77 13416: 99 e8 ldi r25, 0x89 ; 137 13418: f4 cf rjmp .-24 ; 0x13402 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 1341a: 88 e4 ldi r24, 0x48 ; 72 1341c: 99 e8 ldi r25, 0x89 ; 137 1341e: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 13422: 88 23 and r24, r24 13424: 19 f0 breq .+6 ; 0x1342c lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 13426: 0e 94 f2 71 call 0xe3e4 ; 0xe3e4 1342a: e0 cd rjmp .-1088 ; 0x12fec 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 1342c: 85 e4 ldi r24, 0x45 ; 69 1342e: 99 e8 ldi r25, 0x89 ; 137 13430: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 13434: 88 23 and r24, r24 13436: 79 f0 breq .+30 ; 0x13456 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 13438: 81 ea ldi r24, 0xA1 ; 161 1343a: 9d e0 ldi r25, 0x0D ; 13 1343c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 13440: 4b e0 ldi r20, 0x0B ; 11 13442: 84 9f mul r24, r20 13444: c0 01 movw r24, r0 13446: 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); 13448: 70 e0 ldi r23, 0x00 ; 0 1344a: 60 e0 ldi r22, 0x00 ; 0 1344c: 80 5b subi r24, 0xB0 ; 176 1344e: 92 4f sbci r25, 0xF2 ; 242 13450: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 13454: cb cd rjmp .-1130 ; 0x12fec } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 13456: 82 e4 ldi r24, 0x42 ; 66 13458: 99 e8 ldi r25, 0x89 ; 137 1345a: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 1345e: 88 23 and r24, r24 13460: 51 f0 breq .+20 ; 0x13476 // 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(); 13462: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 Sound_MakeCustom(100,0,false); 13466: 40 e0 ldi r20, 0x00 ; 0 13468: 70 e0 ldi r23, 0x00 ; 0 1346a: 60 e0 ldi r22, 0x00 ; 0 1346c: 84 e6 ldi r24, 0x64 ; 100 1346e: 90 e0 ldi r25, 0x00 ; 0 13470: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac 13474: d8 cf rjmp .-80 ; 0x13426 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 13476: 8e e3 ldi r24, 0x3E ; 62 13478: 99 e8 ldi r25, 0x89 ; 137 1347a: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 1347e: 88 23 and r24, r24 13480: e1 f0 breq .+56 ; 0x134ba // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13482: 86 e5 ldi r24, 0x56 ; 86 13484: 0e 94 8d 5c call 0xb91a ; 0xb91a 13488: 88 23 and r24, r24 1348a: 09 f4 brne .+2 ; 0x1348e 1348c: af cd rjmp .-1186 ; 0x12fec bool value = code_value_short(); 1348e: 0e 94 2c 5c call 0xb858 ; 0xb858 13492: 11 e0 ldi r17, 0x01 ; 1 13494: 89 2b or r24, r25 13496: 09 f4 brne .+2 ; 0x1349a 13498: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 1349a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 if(value != mbl.active) { 1349e: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 134a2: 90 e0 ldi r25, 0x00 ; 0 134a4: 18 17 cp r17, r24 134a6: 19 06 cpc r1, r25 134a8: 09 f4 brne .+2 ; 0x134ac 134aa: a0 cd rjmp .-1216 ; 0x12fec mbl.active = value; 134ac: 10 93 9d 13 sts 0x139D, r17 ; 0x80139d // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 134b0: 88 e4 ldi r24, 0x48 ; 72 134b2: 97 e0 ldi r25, 0x07 ; 7 134b4: 0f 94 cc aa call 0x35598 ; 0x35598 134b8: 99 cd rjmp .-1230 ; 0x12fec } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 134ba: 87 e3 ldi r24, 0x37 ; 55 134bc: 99 e8 ldi r25, 0x89 ; 137 134be: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 134c2: 88 23 and r24, r24 134c4: 09 f4 brne .+2 ; 0x134c8 134c6: 92 cd rjmp .-1244 ; 0x12fec uint16_t nDiameter; if(code_seen('D')) { 134c8: 84 e4 ldi r24, 0x44 ; 68 134ca: 0e 94 8d 5c call 0xb91a ; 0xb91a 134ce: 88 23 and r24, r24 134d0: a1 f0 breq .+40 ; 0x134fa nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 134d2: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 134d6: 20 e0 ldi r18, 0x00 ; 0 134d8: 30 e0 ldi r19, 0x00 ; 0 134da: 4a e7 ldi r20, 0x7A ; 122 134dc: 54 e4 ldi r21, 0x44 ; 68 134de: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 134e2: 20 e0 ldi r18, 0x00 ; 0 134e4: 30 e0 ldi r19, 0x00 ; 0 134e6: 40 e0 ldi r20, 0x00 ; 0 134e8: 5f e3 ldi r21, 0x3F ; 63 134ea: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 134ee: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> nozzle_diameter_check(nDiameter); 134f2: cb 01 movw r24, r22 134f4: 0f 94 7d 16 call 0x22cfa ; 0x22cfa 134f8: 79 cd rjmp .-1294 ; 0x12fec } else if(code_seen_P(PSTR("set")) && farm_mode) { 134fa: 83 e3 ldi r24, 0x33 ; 51 134fc: 99 e8 ldi r25, 0x89 ; 137 134fe: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 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); 13502: 85 ea ldi r24, 0xA5 ; 165 13504: 9d e0 ldi r25, 0x0D ; 13 13506: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 1350a: bc 01 movw r22, r24 1350c: 90 e0 ldi r25, 0x00 ; 0 1350e: 80 e0 ldi r24, 0x00 ; 0 13510: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 13514: 20 e0 ldi r18, 0x00 ; 0 13516: 30 e0 ldi r19, 0x00 ; 0 13518: 4a e7 ldi r20, 0x7A ; 122 1351a: 54 e4 ldi r21, 0x44 ; 68 1351c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 13520: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a 13524: 63 cd rjmp .-1338 ; 0x12fec } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 13526: d8 01 movw r26, r16 13528: 8c 91 ld r24, X 1352a: 87 34 cpi r24, 0x47 ; 71 1352c: 11 f0 breq .+4 ; 0x13532 1352e: 0c 94 2e a6 jmp 0x14c5c ; 0x14c5c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 13532: 10 93 94 03 sts 0x0394, r17 ; 0x800394 13536: 00 93 93 03 sts 0x0393, r16 ; 0x800393 gcode_in_progress = code_value_short(); 1353a: 0e 94 2c 5c call 0xb858 ; 0xb858 1353e: 90 93 92 03 sts 0x0392, r25 ; 0x800392 13542: 80 93 91 03 sts 0x0391, r24 ; 0x800391 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 13546: 8e 31 cpi r24, 0x1E ; 30 13548: 91 05 cpc r25, r1 1354a: 09 f4 brne .+2 ; 0x1354e 1354c: da c6 rjmp .+3508 ; 0x14302 1354e: 0c f0 brlt .+2 ; 0x13552 13550: 45 c1 rjmp .+650 ; 0x137dc 13552: 84 30 cpi r24, 0x04 ; 4 13554: 91 05 cpc r25, r1 13556: 09 f4 brne .+2 ; 0x1355a 13558: 7e c6 rjmp .+3324 ; 0x14256 1355a: 0c f0 brlt .+2 ; 0x1355e 1355c: c5 c0 rjmp .+394 ; 0x136e8 1355e: 97 fd sbrc r25, 7 13560: cb c0 rjmp .+406 ; 0x136f8 13562: 02 97 sbiw r24, 0x02 ; 2 13564: 0c f0 brlt .+2 ; 0x13568 13566: fc c1 rjmp .+1016 ; 0x13960 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 13568: 0e 94 2a 5b call 0xb654 ; 0xb654 1356c: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 1356e: 0e 94 8a 62 call 0xc514 ; 0xc514 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 13572: 60 91 5f 06 lds r22, 0x065F ; 0x80065f 13576: 70 91 60 06 lds r23, 0x0660 ; 0x800660 1357a: 80 91 61 06 lds r24, 0x0661 ; 0x800661 1357e: 90 91 62 06 lds r25, 0x0662 ; 0x800662 13582: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 13586: 6b 01 movw r12, r22 13588: 7c 01 movw r14, r24 1358a: 40 90 4c 07 lds r4, 0x074C ; 0x80074c 1358e: 50 90 4d 07 lds r5, 0x074D ; 0x80074d 13592: 60 90 4e 07 lds r6, 0x074E ; 0x80074e 13596: 70 90 4f 07 lds r7, 0x074F ; 0x80074f 1359a: 80 90 5d 05 lds r8, 0x055D ; 0x80055d 1359e: 90 90 5e 05 lds r9, 0x055E ; 0x80055e 135a2: a0 90 5f 05 lds r10, 0x055F ; 0x80055f 135a6: b0 90 60 05 lds r11, 0x0560 ; 0x800560 135aa: a5 01 movw r20, r10 135ac: 94 01 movw r18, r8 135ae: c3 01 movw r24, r6 135b0: b2 01 movw r22, r4 135b2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 135b6: 20 e0 ldi r18, 0x00 ; 0 135b8: 30 e0 ldi r19, 0x00 ; 0 135ba: 48 ec ldi r20, 0xC8 ; 200 135bc: 52 e4 ldi r21, 0x42 ; 66 135be: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 135c2: 9b 01 movw r18, r22 135c4: ac 01 movw r20, r24 135c6: c7 01 movw r24, r14 135c8: b6 01 movw r22, r12 135ca: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 135ce: 18 16 cp r1, r24 135d0: d4 f4 brge .+52 ; 0x13606 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 135d2: a3 01 movw r20, r6 135d4: 92 01 movw r18, r4 135d6: c5 01 movw r24, r10 135d8: b4 01 movw r22, r8 135da: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 135de: 20 e0 ldi r18, 0x00 ; 0 135e0: 30 e0 ldi r19, 0x00 ; 0 135e2: 48 ec ldi r20, 0xC8 ; 200 135e4: 52 e4 ldi r21, 0x42 ; 66 135e6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 135ea: a7 01 movw r20, r14 135ec: 96 01 movw r18, r12 135ee: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 135f2: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 135f6: 60 93 5f 06 sts 0x065F, r22 ; 0x80065f 135fa: 70 93 60 06 sts 0x0660, r23 ; 0x800660 135fe: 80 93 61 06 sts 0x0661, r24 ; 0x800661 13602: 90 93 62 06 sts 0x0662, r25 ; 0x800662 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 13606: 80 91 ed 06 lds r24, 0x06ED ; 0x8006ed 1360a: 88 23 and r24, r24 1360c: 09 f4 brne .+2 ; 0x13610 1360e: a4 c1 rjmp .+840 ; 0x13958 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 13610: 88 e5 ldi r24, 0x58 ; 88 13612: 0e 94 8d 5c call 0xb91a ; 0xb91a 13616: 81 11 cpse r24, r1 13618: 9f c1 rjmp .+830 ; 0x13958 1361a: 89 e5 ldi r24, 0x59 ; 89 1361c: 0e 94 8d 5c call 0xb91a ; 0xb91a 13620: 81 11 cpse r24, r1 13622: 9a c1 rjmp .+820 ; 0x13958 13624: 8a e5 ldi r24, 0x5A ; 90 13626: 0e 94 8d 5c call 0xb91a ; 0xb91a 1362a: 81 11 cpse r24, r1 1362c: 95 c1 rjmp .+810 ; 0x13958 1362e: 85 e4 ldi r24, 0x45 ; 69 13630: 0e 94 8d 5c call 0xb91a ; 0xb91a 13634: 88 23 and r24, r24 13636: 09 f4 brne .+2 ; 0x1363a 13638: 8f c1 rjmp .+798 ; 0x13958 float echange=destination[E_AXIS]-current_position[E_AXIS]; 1363a: 20 91 4c 07 lds r18, 0x074C ; 0x80074c 1363e: 30 91 4d 07 lds r19, 0x074D ; 0x80074d 13642: 40 91 4e 07 lds r20, 0x074E ; 0x80074e 13646: 50 91 4f 07 lds r21, 0x074F ; 0x80074f 1364a: 60 91 5d 05 lds r22, 0x055D ; 0x80055d 1364e: 70 91 5e 05 lds r23, 0x055E ; 0x80055e 13652: 80 91 5f 05 lds r24, 0x055F ; 0x80055f 13656: 90 91 60 05 lds r25, 0x0560 ; 0x800560 1365a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1365e: 6b 01 movw r12, r22 13660: 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 13662: 2d ec ldi r18, 0xCD ; 205 13664: 3c ec ldi r19, 0xCC ; 204 13666: 4c ec ldi r20, 0xCC ; 204 13668: 5d eb ldi r21, 0xBD ; 189 1366a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1366e: 87 ff sbrs r24, 7 13670: 65 c1 rjmp .+714 ; 0x1393c 13672: 80 91 3c 07 lds r24, 0x073C ; 0x80073c 13676: 81 11 cpse r24, r1 13678: 0c 94 38 cf jmp 0x19e70 ; 0x19e70 st_synchronize(); 1367c: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13680: 80 91 5d 05 lds r24, 0x055D ; 0x80055d 13684: 90 91 5e 05 lds r25, 0x055E ; 0x80055e 13688: a0 91 5f 05 lds r26, 0x055F ; 0x80055f 1368c: b0 91 60 05 lds r27, 0x0560 ; 0x800560 13690: 80 93 4c 07 sts 0x074C, r24 ; 0x80074c 13694: 90 93 4d 07 sts 0x074D, r25 ; 0x80074d 13698: a0 93 4e 07 sts 0x074E, r26 ; 0x80074e 1369c: b0 93 4f 07 sts 0x074F, r27 ; 0x80074f plan_set_e_position(current_position[E_AXIS]); //AND from the planner 136a0: 8c e4 ldi r24, 0x4C ; 76 136a2: 97 e0 ldi r25, 0x07 ; 7 136a4: 0f 94 99 aa call 0x35532 ; 0x35532 retract(!retracted[active_extruder]); 136a8: 90 91 3c 07 lds r25, 0x073C ; 0x80073c 136ac: 81 e0 ldi r24, 0x01 ; 1 136ae: 89 27 eor r24, r25 136b0: 0f 94 af 89 call 0x3135e ; 0x3135e SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 136b4: c1 57 subi r28, 0x71 ; 113 136b6: df 4f sbci r29, 0xFF ; 255 136b8: 0f b6 in r0, 0x3f ; 63 136ba: f8 94 cli 136bc: de bf out 0x3e, r29 ; 62 136be: 0f be out 0x3f, r0 ; 63 136c0: cd bf out 0x3d, r28 ; 61 136c2: df 91 pop r29 136c4: cf 91 pop r28 136c6: 1f 91 pop r17 136c8: 0f 91 pop r16 136ca: ff 90 pop r15 136cc: ef 90 pop r14 136ce: df 90 pop r13 136d0: cf 90 pop r12 136d2: bf 90 pop r11 136d4: af 90 pop r10 136d6: 9f 90 pop r9 136d8: 8f 90 pop r8 136da: 7f 90 pop r7 136dc: 6f 90 pop r6 136de: 5f 90 pop r5 136e0: 4f 90 pop r4 136e2: 3f 90 pop r3 136e4: 2f 90 pop r2 136e6: 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) 136e8: 8b 30 cpi r24, 0x0B ; 11 136ea: 91 05 cpc r25, r1 136ec: 09 f4 brne .+2 ; 0x136f0 136ee: 00 c6 rjmp .+3072 ; 0x142f0 136f0: dc f4 brge .+54 ; 0x13728 136f2: 0a 97 sbiw r24, 0x0a ; 10 136f4: 09 f4 brne .+2 ; 0x136f8 136f6: f8 c5 rjmp .+3056 ; 0x142e8 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 136f8: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 136fc: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 13700: 8d 57 subi r24, 0x7D ; 125 13702: 9f 4e sbci r25, 0xEF ; 239 13704: 9f 93 push r25 13706: 8f 93 push r24 13708: 1f 92 push r1 1370a: 87 e4 ldi r24, 0x47 ; 71 1370c: 8f 93 push r24 1370e: 84 e2 ldi r24, 0x24 ; 36 13710: 9a e6 ldi r25, 0x6A ; 106 13712: 9f 93 push r25 13714: 8f 93 push r24 13716: 0f 94 08 dc call 0x3b810 ; 0x3b810 1371a: 0f 90 pop r0 1371c: 0f 90 pop r0 1371e: 0f 90 pop r0 13720: 0f 90 pop r0 13722: 0f 90 pop r0 13724: 0f 90 pop r0 13726: a5 c0 rjmp .+330 ; 0x13872 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) 13728: 85 31 cpi r24, 0x15 ; 21 1372a: 91 05 cpc r25, r1 1372c: 09 f4 brne .+2 ; 0x13730 1372e: a1 c0 rjmp .+322 ; 0x13872 13730: 4c 97 sbiw r24, 0x1c ; 28 13732: 11 f7 brne .-60 ; 0x136f8 { 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]); 13734: 88 e5 ldi r24, 0x58 ; 88 13736: 0e 94 8d 5c call 0xb91a ; 0xb91a 1373a: 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; 1373c: 41 2c mov r4, r1 1373e: 51 2c mov r5, r1 13740: 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(); 13742: 88 23 and r24, r24 13744: 21 f0 breq .+8 ; 0x1374e 13746: 0e 94 39 5c call 0xb872 ; 0xb872 1374a: 2b 01 movw r4, r22 1374c: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 1374e: 89 e5 ldi r24, 0x59 ; 89 13750: 0e 94 8d 5c call 0xb91a ; 0xb91a 13754: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 13756: 88 23 and r24, r24 13758: 09 f4 brne .+2 ; 0x1375c 1375a: cc c5 rjmp .+2968 ; 0x142f4 1375c: 0e 94 39 5c call 0xb872 ; 0xb872 13760: 6e 96 adiw r28, 0x1e ; 30 13762: 6c af std Y+60, r22 ; 0x3c 13764: 7d af std Y+61, r23 ; 0x3d 13766: 8e af std Y+62, r24 ; 0x3e 13768: 9f af std Y+63, r25 ; 0x3f 1376a: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 1376c: 8a e5 ldi r24, 0x5A ; 90 1376e: 0e 94 8d 5c call 0xb91a ; 0xb91a 13772: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 13774: 81 2c mov r8, r1 13776: 91 2c mov r9, r1 13778: 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(); 1377a: 88 23 and r24, r24 1377c: 21 f0 breq .+8 ; 0x13786 1377e: 0e 94 39 5c call 0xb872 ; 0xb872 13782: 4b 01 movw r8, r22 13784: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 13786: 87 e5 ldi r24, 0x57 ; 87 13788: 0e 94 8d 5c call 0xb91a ; 0xb91a 1378c: 67 96 adiw r28, 0x17 ; 23 1378e: 8f af std Y+63, r24 ; 0x3f 13790: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13792: 83 e4 ldi r24, 0x43 ; 67 13794: 0e 94 8d 5c call 0xb91a ; 0xb91a gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 13798: 67 96 adiw r28, 0x17 ; 23 1379a: ff ad ldd r31, Y+63 ; 0x3f 1379c: 67 97 sbiw r28, 0x17 ; 23 1379e: ff 93 push r31 137a0: 8f 93 push r24 137a2: cd 2c mov r12, r13 137a4: 6e 96 adiw r28, 0x1e ; 30 137a6: ec ac ldd r14, Y+60 ; 0x3c 137a8: fd ac ldd r15, Y+61 ; 0x3d 137aa: 0e ad ldd r16, Y+62 ; 0x3e 137ac: 1f ad ldd r17, Y+63 ; 0x3f 137ae: 6e 97 sbiw r28, 0x1e ; 30 137b0: 22 2d mov r18, r2 137b2: b3 01 movw r22, r6 137b4: a2 01 movw r20, r4 137b6: 83 2d mov r24, r3 137b8: 0e 94 c3 7e call 0xfd86 ; 0xfd86 #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) { 137bc: 0f 90 pop r0 137be: 0f 90 pop r0 137c0: 31 10 cpse r3, r1 137c2: 57 c0 rjmp .+174 ; 0x13872 137c4: 21 10 cpse r2, r1 137c6: 55 c0 rjmp .+170 ; 0x13872 137c8: 67 96 adiw r28, 0x17 ; 23 137ca: 2f ad ldd r18, Y+63 ; 0x3f 137cc: 67 97 sbiw r28, 0x17 ; 23 137ce: 21 11 cpse r18, r1 137d0: 50 c0 rjmp .+160 ; 0x13872 137d2: d1 10 cpse r13, r1 137d4: 4e c0 rjmp .+156 ; 0x13872 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 137d6: 0e 94 b2 8f call 0x11f64 ; 0x11f64 137da: 4b c0 rjmp .+150 ; 0x13872 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) 137dc: 86 35 cpi r24, 0x56 ; 86 137de: 91 05 cpc r25, r1 137e0: 11 f4 brne .+4 ; 0x137e6 137e2: 0c 94 dd a5 jmp 0x14bba ; 0x14bba 137e6: b4 f5 brge .+108 ; 0x13854 137e8: 8c 34 cpi r24, 0x4C ; 76 137ea: 91 05 cpc r25, r1 137ec: 09 f4 brne .+2 ; 0x137f0 137ee: df c5 rjmp .+3006 ; 0x143ae 137f0: 3c f5 brge .+78 ; 0x13840 137f2: 08 e2 ldi r16, 0x28 ; 40 137f4: 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)); 137f6: 24 ed ldi r18, 0xD4 ; 212 137f8: e2 2e mov r14, r18 137fa: 2a e6 ldi r18, 0x6A ; 106 137fc: 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) 137fe: 8b 34 cpi r24, 0x4B ; 75 13800: 91 05 cpc r25, r1 13802: 09 f0 breq .+2 ; 0x13806 13804: 79 cf rjmp .-270 ; 0x136f8 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)); 13806: 60 2f mov r22, r16 13808: 70 e0 ldi r23, 0x00 ; 0 1380a: 90 e0 ldi r25, 0x00 ; 0 1380c: 80 e0 ldi r24, 0x00 ; 0 1380e: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 13812: 0e 94 50 5d call 0xbaa0 ; 0xbaa0 13816: 9f 93 push r25 13818: 8f 93 push r24 1381a: 7f 93 push r23 1381c: 6f 93 push r22 1381e: 1f 93 push r17 13820: 0f 93 push r16 13822: ff 92 push r15 13824: ef 92 push r14 13826: 0f 94 08 dc call 0x3b810 ; 0x3b810 1382a: 0f 5f subi r16, 0xFF ; 255 1382c: 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++) 1382e: 0f b6 in r0, 0x3f ; 63 13830: f8 94 cli 13832: de bf out 0x3e, r29 ; 62 13834: 0f be out 0x3f, r0 ; 63 13836: cd bf out 0x3d, r28 ; 61 13838: 0f 36 cpi r16, 0x6F ; 111 1383a: 11 05 cpc r17, r1 1383c: 21 f7 brne .-56 ; 0x13806 1383e: 19 c0 rjmp .+50 ; 0x13872 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) 13840: 80 35 cpi r24, 0x50 ; 80 13842: 91 05 cpc r25, r1 13844: 41 f2 breq .-112 ; 0x137d6 13846: 81 35 cpi r24, 0x51 ; 81 13848: 91 05 cpc r25, r1 1384a: 09 f0 breq .+2 ; 0x1384e 1384c: 55 cf rjmp .-342 ; 0x136f8 /*! ### 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(); 1384e: 0e 94 f7 80 call 0x101ee ; 0x101ee 13852: 0f c0 rjmp .+30 ; 0x13872 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) 13854: 8a 35 cpi r24, 0x5A ; 90 13856: 91 05 cpc r25, r1 13858: 11 f4 brne .+4 ; 0x1385e 1385a: 0c 94 e7 a5 jmp 0x14bce ; 0x14bce 1385e: 74 f4 brge .+28 ; 0x1387c 13860: 87 35 cpi r24, 0x57 ; 87 13862: 91 05 cpc r25, r1 13864: 11 f4 brne .+4 ; 0x1386a 13866: 0c 94 e2 a5 jmp 0x14bc4 ; 0x14bc4 1386a: 88 35 cpi r24, 0x58 ; 88 1386c: 91 05 cpc r25, r1 1386e: 09 f0 breq .+2 ; 0x13872 13870: 43 cf rjmp .-378 ; 0x136f8 #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; 13872: 10 92 92 03 sts 0x0392, r1 ; 0x800392 13876: 10 92 91 03 sts 0x0391, r1 ; 0x800391 1387a: b8 cb rjmp .-2192 ; 0x12fec 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) 1387c: 8b 35 cpi r24, 0x5B ; 91 1387e: 91 05 cpc r25, r1 13880: 11 f4 brne .+4 ; 0x13886 13882: 0c 94 ee a5 jmp 0x14bdc ; 0x14bdc 13886: 8c 35 cpi r24, 0x5C ; 92 13888: 91 05 cpc r25, r1 1388a: 09 f0 breq .+2 ; 0x1388e 1388c: 35 cf rjmp .-406 ; 0x136f8 1388e: 6d ed ldi r22, 0xDD ; 221 13890: c6 2e mov r12, r22 13892: 62 e0 ldi r22, 0x02 ; 2 13894: d6 2e mov r13, r22 13896: 8e 01 movw r16, r28 13898: 0f 5b subi r16, 0xBF ; 191 1389a: 1f 4f sbci r17, 0xFF ; 255 1389c: 9e 01 movw r18, r28 1389e: 2f 5f subi r18, 0xFF ; 255 138a0: 3f 4f sbci r19, 0xFF ; 255 138a2: 79 01 movw r14, r18 138a4: 71 ee ldi r23, 0xE1 ; 225 138a6: 87 2e mov r8, r23 138a8: 72 e0 ldi r23, 0x02 ; 2 138aa: 97 2e mov r9, r23 138ac: 58 01 movw r10, r16 138ae: 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]); 138b0: d6 01 movw r26, r12 138b2: 8d 91 ld r24, X+ 138b4: 6d 01 movw r12, r26 138b6: 0e 94 8d 5c call 0xb91a ; 0xb91a 138ba: f5 01 movw r30, r10 138bc: 81 93 st Z+, r24 138be: 5f 01 movw r10, r30 if(codes[i]) 138c0: 88 23 and r24, r24 138c2: 41 f0 breq .+16 ; 0x138d4 values[i] = code_value(); 138c4: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 138c8: d7 01 movw r26, r14 138ca: 6d 93 st X+, r22 138cc: 7d 93 st X+, r23 138ce: 8d 93 st X+, r24 138d0: 9c 93 st X, r25 138d2: 13 97 sbiw r26, 0x03 ; 3 138d4: b4 e0 ldi r27, 0x04 ; 4 138d6: eb 0e add r14, r27 138d8: 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) 138da: 8c 14 cp r8, r12 138dc: 9d 04 cpc r9, r13 138de: 41 f7 brne .-48 ; 0x138b0 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 138e0: f8 01 movw r30, r16 138e2: d3 80 ldd r13, Z+3 ; 0x03 138e4: dd 20 and r13, r13 138e6: 11 f4 brne .+4 ; 0x138ec 138e8: 0c 94 f2 a5 jmp 0x14be4 ; 0x14be4 138ec: 20 e0 ldi r18, 0x00 ; 0 138ee: 30 e0 ldi r19, 0x00 ; 0 138f0: a9 01 movw r20, r18 138f2: 6d 85 ldd r22, Y+13 ; 0x0d 138f4: 7e 85 ldd r23, Y+14 ; 0x0e 138f6: 8f 85 ldd r24, Y+15 ; 0x0f 138f8: 98 89 ldd r25, Y+16 ; 0x10 138fa: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 138fe: 81 11 cpse r24, r1 13900: 0c 94 f2 a5 jmp 0x14be4 ; 0x14be4 13904: d8 01 movw r26, r16 13906: 8c 91 ld r24, X 13908: 81 11 cpse r24, r1 1390a: 0c 94 f2 a5 jmp 0x14be4 ; 0x14be4 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 1390e: 11 96 adiw r26, 0x01 ; 1 13910: 8c 91 ld r24, X 13912: 11 97 sbiw r26, 0x01 ; 1 13914: 81 11 cpse r24, r1 13916: 0c 94 f2 a5 jmp 0x14be4 ; 0x14be4 1391a: 12 96 adiw r26, 0x02 ; 2 1391c: 8c 91 ld r24, X 1391e: 81 11 cpse r24, r1 13920: 0c 94 f2 a5 jmp 0x14be4 ; 0x14be4 { // 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; 13924: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c 13928: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d 1392c: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e 13930: 10 92 4f 07 sts 0x074F, r1 ; 0x80074f st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 13934: 81 e0 ldi r24, 0x01 ; 1 13936: 80 93 b8 04 sts 0x04B8, r24 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.504> 1393a: 9b cf rjmp .-202 ; 0x13872 #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 1393c: 2d ec ldi r18, 0xCD ; 205 1393e: 3c ec ldi r19, 0xCC ; 204 13940: 4c ec ldi r20, 0xCC ; 204 13942: 5d e3 ldi r21, 0x3D ; 61 13944: c7 01 movw r24, r14 13946: b6 01 movw r22, r12 13948: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1394c: 18 16 cp r1, r24 1394e: 24 f4 brge .+8 ; 0x13958 13950: 80 91 3c 07 lds r24, 0x073C ; 0x80073c 13954: 81 11 cpse r24, r1 13956: 92 ce rjmp .-732 ; 0x1367c } } } #endif //FWRETRACT prepare_move(start_segment_idx); 13958: c8 01 movw r24, r16 1395a: 0e 94 ce 6c call 0xd99c ; 0xd99c 1395e: 89 cf rjmp .-238 ; 0x13872 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 13960: 0e 94 2a 5b call 0xb654 ; 0xb654 13964: e0 96 adiw r28, 0x30 ; 48 13966: 9f af std Y+63, r25 ; 0x3f 13968: 8e af std Y+62, r24 ; 0x3e 1396a: 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 1396c: 0e 94 8a 62 call 0xc514 ; 0xc514 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 13970: 89 e4 ldi r24, 0x49 ; 73 13972: 0e 94 8d 5c call 0xb91a ; 0xb91a 13976: 88 23 and r24, r24 13978: 09 f4 brne .+2 ; 0x1397c 1397a: 00 c4 rjmp .+2048 ; 0x1417c 1397c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 13980: 60 93 89 03 sts 0x0389, r22 ; 0x800389 13984: 70 93 8a 03 sts 0x038A, r23 ; 0x80038a 13988: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b 1398c: 90 93 8c 03 sts 0x038C, r25 ; 0x80038c offset[1] = code_seen('J') ? code_value() : 0.f; 13990: 8a e4 ldi r24, 0x4A ; 74 13992: 0e 94 8d 5c call 0xb91a ; 0xb91a 13996: c1 2c mov r12, r1 13998: d1 2c mov r13, r1 1399a: 76 01 movw r14, r12 1399c: 88 23 and r24, r24 1399e: 21 f0 breq .+8 ; 0x139a8 139a0: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 139a4: 6b 01 movw r12, r22 139a6: 7c 01 movw r14, r24 139a8: c0 92 8d 03 sts 0x038D, r12 ; 0x80038d 139ac: d0 92 8e 03 sts 0x038E, r13 ; 0x80038e 139b0: e0 92 8f 03 sts 0x038F, r14 ; 0x80038f 139b4: f0 92 90 03 sts 0x0390, r15 ; 0x800390 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 139b8: e0 91 91 03 lds r30, 0x0391 ; 0x800391 139bc: f0 91 92 03 lds r31, 0x0392 ; 0x800392 139c0: c2 57 subi r28, 0x72 ; 114 139c2: df 4f sbci r29, 0xFF ; 255 139c4: f9 83 std Y+1, r31 ; 0x01 139c6: e8 83 st Y, r30 139c8: ce 58 subi r28, 0x8E ; 142 139ca: 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 139cc: 80 90 89 03 lds r8, 0x0389 ; 0x800389 139d0: 90 90 8a 03 lds r9, 0x038A ; 0x80038a 139d4: a0 90 8b 03 lds r10, 0x038B ; 0x80038b 139d8: b0 90 8c 03 lds r11, 0x038C ; 0x80038c 139dc: a7 01 movw r20, r14 139de: 96 01 movw r18, r12 139e0: c5 01 movw r24, r10 139e2: b4 01 movw r22, r8 139e4: 0f 94 0a e1 call 0x3c214 ; 0x3c214 139e8: ae 96 adiw r28, 0x2e ; 46 139ea: 6c af std Y+60, r22 ; 0x3c 139ec: 7d af std Y+61, r23 ; 0x3d 139ee: 8e af std Y+62, r24 ; 0x3e 139f0: 9f af std Y+63, r25 ; 0x3f 139f2: 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); 139f4: 60 91 39 02 lds r22, 0x0239 ; 0x800239 139f8: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 139fc: 07 2e mov r0, r23 139fe: 00 0c add r0, r0 13a00: 88 0b sbc r24, r24 13a02: 99 0b sbc r25, r25 13a04: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 13a08: 20 91 90 02 lds r18, 0x0290 ; 0x800290 13a0c: 30 91 91 02 lds r19, 0x0291 ; 0x800291 13a10: 40 91 92 02 lds r20, 0x0292 ; 0x800292 13a14: 50 91 93 02 lds r21, 0x0293 ; 0x800293 13a18: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13a1c: 2e e3 ldi r18, 0x3E ; 62 13a1e: 33 ec ldi r19, 0xC3 ; 195 13a20: 4e e2 ldi r20, 0x2E ; 46 13a22: 59 e3 ldi r21, 0x39 ; 57 13a24: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13a28: aa 96 adiw r28, 0x2a ; 42 13a2a: 6c af std Y+60, r22 ; 0x3c 13a2c: 7d af std Y+61, r23 ; 0x3d 13a2e: 8e af std Y+62, r24 ; 0x3e 13a30: 9f af std Y+63, r25 ; 0x3f 13a32: 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)); 13a34: 80 e1 ldi r24, 0x10 ; 16 13a36: e0 e4 ldi r30, 0x40 ; 64 13a38: f7 e0 ldi r31, 0x07 ; 7 13a3a: de 01 movw r26, r28 13a3c: 11 96 adiw r26, 0x01 ; 1 13a3e: 01 90 ld r0, Z+ 13a40: 0d 92 st X+, r0 13a42: 8a 95 dec r24 13a44: e1 f7 brne .-8 ; 0x13a3e float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 13a46: a5 01 movw r20, r10 13a48: 94 01 movw r18, r8 13a4a: 50 58 subi r21, 0x80 ; 128 13a4c: 6a 96 adiw r28, 0x1a ; 26 13a4e: 2c af std Y+60, r18 ; 0x3c 13a50: 3d af std Y+61, r19 ; 0x3d 13a52: 4e af std Y+62, r20 ; 0x3e 13a54: 5f af std Y+63, r21 ; 0x3f 13a56: 6a 97 sbiw r28, 0x1a ; 26 float r_axis_y = -offset[Y_AXIS]; 13a58: d7 01 movw r26, r14 13a5a: c6 01 movw r24, r12 13a5c: b0 58 subi r27, 0x80 ; 128 13a5e: 6e 96 adiw r28, 0x1e ; 30 13a60: 8c af std Y+60, r24 ; 0x3c 13a62: 9d af std Y+61, r25 ; 0x3d 13a64: ae af std Y+62, r26 ; 0x3e 13a66: bf af std Y+63, r27 ; 0x3f 13a68: 6e 97 sbiw r28, 0x1e ; 30 float center_axis_x = start_position[X_AXIS] - r_axis_x; 13a6a: 29 81 ldd r18, Y+1 ; 0x01 13a6c: 3a 81 ldd r19, Y+2 ; 0x02 13a6e: 4b 81 ldd r20, Y+3 ; 0x03 13a70: 5c 81 ldd r21, Y+4 ; 0x04 13a72: e6 96 adiw r28, 0x36 ; 54 13a74: 2c af std Y+60, r18 ; 0x3c 13a76: 3d af std Y+61, r19 ; 0x3d 13a78: 4e af std Y+62, r20 ; 0x3e 13a7a: 5f af std Y+63, r21 ; 0x3f 13a7c: e6 97 sbiw r28, 0x36 ; 54 13a7e: c5 01 movw r24, r10 13a80: b4 01 movw r22, r8 13a82: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 13a86: ea 96 adiw r28, 0x3a ; 58 13a88: 6c af std Y+60, r22 ; 0x3c 13a8a: 7d af std Y+61, r23 ; 0x3d 13a8c: 8e af std Y+62, r24 ; 0x3e 13a8e: 9f af std Y+63, r25 ; 0x3f 13a90: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13a92: 8d 81 ldd r24, Y+5 ; 0x05 13a94: 9e 81 ldd r25, Y+6 ; 0x06 13a96: af 81 ldd r26, Y+7 ; 0x07 13a98: b8 85 ldd r27, Y+8 ; 0x08 13a9a: ee 96 adiw r28, 0x3e ; 62 13a9c: 8c af std Y+60, r24 ; 0x3c 13a9e: 9d af std Y+61, r25 ; 0x3d 13aa0: ae af std Y+62, r26 ; 0x3e 13aa2: bf af std Y+63, r27 ; 0x3f 13aa4: ee 97 sbiw r28, 0x3e ; 62 13aa6: 9c 01 movw r18, r24 13aa8: ad 01 movw r20, r26 13aaa: c7 01 movw r24, r14 13aac: b6 01 movw r22, r12 13aae: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 13ab2: ce 57 subi r28, 0x7E ; 126 13ab4: df 4f sbci r29, 0xFF ; 255 13ab6: 68 83 st Y, r22 13ab8: 79 83 std Y+1, r23 ; 0x01 13aba: 8a 83 std Y+2, r24 ; 0x02 13abc: 9b 83 std Y+3, r25 ; 0x03 13abe: c2 58 subi r28, 0x82 ; 130 13ac0: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13ac2: 29 85 ldd r18, Y+9 ; 0x09 13ac4: 3a 85 ldd r19, Y+10 ; 0x0a 13ac6: 4b 85 ldd r20, Y+11 ; 0x0b 13ac8: 5c 85 ldd r21, Y+12 ; 0x0c 13aca: 60 91 59 05 lds r22, 0x0559 ; 0x800559 13ace: 70 91 5a 05 lds r23, 0x055A ; 0x80055a 13ad2: 80 91 5b 05 lds r24, 0x055B ; 0x80055b 13ad6: 90 91 5c 05 lds r25, 0x055C ; 0x80055c 13ada: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13ade: c2 58 subi r28, 0x82 ; 130 13ae0: df 4f sbci r29, 0xFF ; 255 13ae2: 68 83 st Y, r22 13ae4: 79 83 std Y+1, r23 ; 0x01 13ae6: 8a 83 std Y+2, r24 ; 0x02 13ae8: 9b 83 std Y+3, r25 ; 0x03 13aea: ce 57 subi r28, 0x7E ; 126 13aec: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 13aee: 20 91 51 05 lds r18, 0x0551 ; 0x800551 13af2: 30 91 52 05 lds r19, 0x0552 ; 0x800552 13af6: 40 91 53 05 lds r20, 0x0553 ; 0x800553 13afa: 50 91 54 05 lds r21, 0x0554 ; 0x800554 13afe: ca 57 subi r28, 0x7A ; 122 13b00: df 4f sbci r29, 0xFF ; 255 13b02: 28 83 st Y, r18 13b04: 39 83 std Y+1, r19 ; 0x01 13b06: 4a 83 std Y+2, r20 ; 0x02 13b08: 5b 83 std Y+3, r21 ; 0x03 13b0a: c6 58 subi r28, 0x86 ; 134 13b0c: d0 40 sbci r29, 0x00 ; 0 13b0e: ea 96 adiw r28, 0x3a ; 58 13b10: 2c ad ldd r18, Y+60 ; 0x3c 13b12: 3d ad ldd r19, Y+61 ; 0x3d 13b14: 4e ad ldd r20, Y+62 ; 0x3e 13b16: 5f ad ldd r21, Y+63 ; 0x3f 13b18: ea 97 sbiw r28, 0x3a ; 58 13b1a: ca 57 subi r28, 0x7A ; 122 13b1c: df 4f sbci r29, 0xFF ; 255 13b1e: 68 81 ld r22, Y 13b20: 79 81 ldd r23, Y+1 ; 0x01 13b22: 8a 81 ldd r24, Y+2 ; 0x02 13b24: 9b 81 ldd r25, Y+3 ; 0x03 13b26: c6 58 subi r28, 0x86 ; 134 13b28: d0 40 sbci r29, 0x00 ; 0 13b2a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13b2e: 6b 01 movw r12, r22 13b30: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 13b32: 80 91 55 05 lds r24, 0x0555 ; 0x800555 13b36: 90 91 56 05 lds r25, 0x0556 ; 0x800556 13b3a: a0 91 57 05 lds r26, 0x0557 ; 0x800557 13b3e: b0 91 58 05 lds r27, 0x0558 ; 0x800558 13b42: c6 57 subi r28, 0x76 ; 118 13b44: df 4f sbci r29, 0xFF ; 255 13b46: 88 83 st Y, r24 13b48: 99 83 std Y+1, r25 ; 0x01 13b4a: aa 83 std Y+2, r26 ; 0x02 13b4c: bb 83 std Y+3, r27 ; 0x03 13b4e: ca 58 subi r28, 0x8A ; 138 13b50: d0 40 sbci r29, 0x00 ; 0 13b52: ce 57 subi r28, 0x7E ; 126 13b54: df 4f sbci r29, 0xFF ; 255 13b56: 28 81 ld r18, Y 13b58: 39 81 ldd r19, Y+1 ; 0x01 13b5a: 4a 81 ldd r20, Y+2 ; 0x02 13b5c: 5b 81 ldd r21, Y+3 ; 0x03 13b5e: c2 58 subi r28, 0x82 ; 130 13b60: d0 40 sbci r29, 0x00 ; 0 13b62: bc 01 movw r22, r24 13b64: cd 01 movw r24, r26 13b66: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13b6a: 4b 01 movw r8, r22 13b6c: 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; 13b6e: 30 90 2f 07 lds r3, 0x072F ; 0x80072f 13b72: 20 90 30 07 lds r2, 0x0730 ; 0x800730 13b76: 90 91 31 07 lds r25, 0x0731 ; 0x800731 13b7a: 6f 96 adiw r28, 0x1f ; 31 13b7c: 9f af std Y+63, r25 ; 0x3f 13b7e: 6f 97 sbiw r28, 0x1f ; 31 13b80: a0 91 32 07 lds r26, 0x0732 ; 0x800732 13b84: a3 96 adiw r28, 0x23 ; 35 13b86: af af std Y+63, r26 ; 0x3f 13b88: 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); 13b8a: a7 01 movw r20, r14 13b8c: 96 01 movw r18, r12 13b8e: 6a 96 adiw r28, 0x1a ; 26 13b90: 6c ad ldd r22, Y+60 ; 0x3c 13b92: 7d ad ldd r23, Y+61 ; 0x3d 13b94: 8e ad ldd r24, Y+62 ; 0x3e 13b96: 9f ad ldd r25, Y+63 ; 0x3f 13b98: 6a 97 sbiw r28, 0x1a ; 26 13b9a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13b9e: 2b 01 movw r4, r22 13ba0: 3c 01 movw r6, r24 13ba2: a5 01 movw r20, r10 13ba4: 94 01 movw r18, r8 13ba6: 6e 96 adiw r28, 0x1e ; 30 13ba8: 6c ad ldd r22, Y+60 ; 0x3c 13baa: 7d ad ldd r23, Y+61 ; 0x3d 13bac: 8e ad ldd r24, Y+62 ; 0x3e 13bae: 9f ad ldd r25, Y+63 ; 0x3f 13bb0: 6e 97 sbiw r28, 0x1e ; 30 13bb2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13bb6: 9b 01 movw r18, r22 13bb8: ac 01 movw r20, r24 13bba: c3 01 movw r24, r6 13bbc: b2 01 movw r22, r4 13bbe: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 13bc2: 2b 01 movw r4, r22 13bc4: 3c 01 movw r6, r24 13bc6: a5 01 movw r20, r10 13bc8: 94 01 movw r18, r8 13bca: 6a 96 adiw r28, 0x1a ; 26 13bcc: 6c ad ldd r22, Y+60 ; 0x3c 13bce: 7d ad ldd r23, Y+61 ; 0x3d 13bd0: 8e ad ldd r24, Y+62 ; 0x3e 13bd2: 9f ad ldd r25, Y+63 ; 0x3f 13bd4: 6a 97 sbiw r28, 0x1a ; 26 13bd6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13bda: 4b 01 movw r8, r22 13bdc: 5c 01 movw r10, r24 13bde: a7 01 movw r20, r14 13be0: 96 01 movw r18, r12 13be2: 6e 96 adiw r28, 0x1e ; 30 13be4: 6c ad ldd r22, Y+60 ; 0x3c 13be6: 7d ad ldd r23, Y+61 ; 0x3d 13be8: 8e ad ldd r24, Y+62 ; 0x3e 13bea: 9f ad ldd r25, Y+63 ; 0x3f 13bec: 6e 97 sbiw r28, 0x1e ; 30 13bee: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13bf2: 9b 01 movw r18, r22 13bf4: ac 01 movw r20, r24 13bf6: c5 01 movw r24, r10 13bf8: b4 01 movw r22, r8 13bfa: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13bfe: a3 01 movw r20, r6 13c00: 92 01 movw r18, r4 13c02: 0f 94 ed de call 0x3bdda ; 0x3bdda 13c06: 6b 01 movw r12, r22 13c08: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 13c0a: 20 e0 ldi r18, 0x00 ; 0 13c0c: 30 e0 ldi r19, 0x00 ; 0 13c0e: a9 01 movw r20, r18 13c10: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 13c14: 87 ff sbrs r24, 7 13c16: 0a c0 rjmp .+20 ; 0x13c2c 13c18: 2b ed ldi r18, 0xDB ; 219 13c1a: 3f e0 ldi r19, 0x0F ; 15 13c1c: 49 ec ldi r20, 0xC9 ; 201 13c1e: 50 e4 ldi r21, 0x40 ; 64 13c20: c7 01 movw r24, r14 13c22: b6 01 movw r22, r12 13c24: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 13c28: 6b 01 movw r12, r22 13c2a: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 13c2c: 60 91 38 07 lds r22, 0x0738 ; 0x800738 13c30: 70 91 39 07 lds r23, 0x0739 ; 0x800739 13c34: 61 15 cp r22, r1 13c36: 71 05 cpc r23, r1 13c38: 09 f4 brne .+2 ; 0x13c3c 13c3a: a4 c2 rjmp .+1352 ; 0x14184 { // 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); 13c3c: 90 e0 ldi r25, 0x00 ; 0 13c3e: 80 e0 ldi r24, 0x00 ; 0 13c40: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 13c44: 9b 01 movw r18, r22 13c46: ac 01 movw r20, r24 13c48: 6b ed ldi r22, 0xDB ; 219 13c4a: 7f e0 ldi r23, 0x0F ; 15 13c4c: 89 ec ldi r24, 0xC9 ; 201 13c4e: 90 e4 ldi r25, 0x40 ; 64 13c50: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 13c54: ae 96 adiw r28, 0x2e ; 46 13c56: 2c ad ldd r18, Y+60 ; 0x3c 13c58: 3d ad ldd r19, Y+61 ; 0x3d 13c5a: 4e ad ldd r20, Y+62 ; 0x3e 13c5c: 5f ad ldd r21, Y+63 ; 0x3f 13c5e: ae 97 sbiw r28, 0x2e ; 46 13c60: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13c64: 5b 01 movw r10, r22 13c66: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 13c68: 60 91 3a 07 lds r22, 0x073A ; 0x80073a 13c6c: 70 91 3b 07 lds r23, 0x073B ; 0x80073b 13c70: 61 15 cp r22, r1 13c72: 71 05 cpc r23, r1 13c74: f1 f0 breq .+60 ; 0x13cb2 { // 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)); 13c76: 90 e0 ldi r25, 0x00 ; 0 13c78: 80 e0 ldi r24, 0x00 ; 0 13c7a: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 13c7e: 20 e0 ldi r18, 0x00 ; 0 13c80: 30 e0 ldi r19, 0x00 ; 0 13c82: 40 e7 ldi r20, 0x70 ; 112 13c84: 52 e4 ldi r21, 0x42 ; 66 13c86: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13c8a: 9b 01 movw r18, r22 13c8c: ac 01 movw r20, r24 13c8e: aa 96 adiw r28, 0x2a ; 42 13c90: 6c ad ldd r22, Y+60 ; 0x3c 13c92: 7d ad ldd r23, Y+61 ; 0x3d 13c94: 8e ad ldd r24, Y+62 ; 0x3e 13c96: 9f ad ldd r25, Y+63 ; 0x3f 13c98: aa 97 sbiw r28, 0x2a ; 42 13c9a: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 13c9e: 3b 01 movw r6, r22 13ca0: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13ca2: 95 01 movw r18, r10 13ca4: a8 01 movw r20, r16 13ca6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 13caa: 87 ff sbrs r24, 7 13cac: 02 c0 rjmp .+4 ; 0x13cb2 mm_per_arc_segment = mm_per_arc_segment_sec; 13cae: 53 01 movw r10, r6 13cb0: 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) 13cb2: 40 90 33 07 lds r4, 0x0733 ; 0x800733 13cb6: 50 90 34 07 lds r5, 0x0734 ; 0x800734 13cba: 60 90 35 07 lds r6, 0x0735 ; 0x800735 13cbe: 70 90 36 07 lds r7, 0x0736 ; 0x800736 13cc2: 95 01 movw r18, r10 13cc4: a8 01 movw r20, r16 13cc6: b2 01 movw r22, r4 13cc8: c3 01 movw r24, r6 13cca: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 13cce: 18 16 cp r1, r24 13cd0: c4 f0 brlt .+48 ; 0x13d02 { // 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) { 13cd2: 95 01 movw r18, r10 13cd4: a8 01 movw r20, r16 13cd6: 63 2d mov r22, r3 13cd8: 72 2d mov r23, r2 13cda: 6f 96 adiw r28, 0x1f ; 31 13cdc: 8f ad ldd r24, Y+63 ; 0x3f 13cde: 6f 97 sbiw r28, 0x1f ; 31 13ce0: a3 96 adiw r28, 0x23 ; 35 13ce2: 9f ad ldd r25, Y+63 ; 0x3f 13ce4: a3 97 sbiw r28, 0x23 ; 35 13ce6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 13cea: 25 01 movw r4, r10 13cec: 38 01 movw r6, r16 13cee: 87 ff sbrs r24, 7 13cf0: 08 c0 rjmp .+16 ; 0x13d02 // 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; 13cf2: 43 2c mov r4, r3 13cf4: 52 2c mov r5, r2 13cf6: 6f 96 adiw r28, 0x1f ; 31 13cf8: 6f ac ldd r6, Y+63 ; 0x3f 13cfa: 6f 97 sbiw r28, 0x1f ; 31 13cfc: a3 96 adiw r28, 0x23 ; 35 13cfe: 7f ac ldd r7, Y+63 ; 0x3f 13d00: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 13d02: c2 57 subi r28, 0x72 ; 114 13d04: df 4f sbci r29, 0xFF ; 255 13d06: e8 81 ld r30, Y 13d08: f9 81 ldd r31, Y+1 ; 0x01 13d0a: ce 58 subi r28, 0x8E ; 142 13d0c: d0 40 sbci r29, 0x00 ; 0 13d0e: 32 97 sbiw r30, 0x02 ; 2 13d10: 51 f4 brne .+20 ; 0x13d26 13d12: 2b ed ldi r18, 0xDB ; 219 13d14: 3f e0 ldi r19, 0x0F ; 15 13d16: 49 ec ldi r20, 0xC9 ; 201 13d18: 50 e4 ldi r21, 0x40 ; 64 13d1a: c7 01 movw r24, r14 13d1c: b6 01 movw r22, r12 13d1e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13d22: 6b 01 movw r12, r22 13d24: 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) 13d26: ca 57 subi r28, 0x7A ; 122 13d28: df 4f sbci r29, 0xFF ; 255 13d2a: 28 81 ld r18, Y 13d2c: 39 81 ldd r19, Y+1 ; 0x01 13d2e: 4a 81 ldd r20, Y+2 ; 0x02 13d30: 5b 81 ldd r21, Y+3 ; 0x03 13d32: c6 58 subi r28, 0x86 ; 134 13d34: d0 40 sbci r29, 0x00 ; 0 13d36: e6 96 adiw r28, 0x36 ; 54 13d38: 6c ad ldd r22, Y+60 ; 0x3c 13d3a: 7d ad ldd r23, Y+61 ; 0x3d 13d3c: 8e ad ldd r24, Y+62 ; 0x3e 13d3e: 9f ad ldd r25, Y+63 ; 0x3f 13d40: e6 97 sbiw r28, 0x36 ; 54 13d42: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 13d46: 81 11 cpse r24, r1 13d48: 25 c0 rjmp .+74 ; 0x13d94 13d4a: c6 57 subi r28, 0x76 ; 118 13d4c: df 4f sbci r29, 0xFF ; 255 13d4e: 28 81 ld r18, Y 13d50: 39 81 ldd r19, Y+1 ; 0x01 13d52: 4a 81 ldd r20, Y+2 ; 0x02 13d54: 5b 81 ldd r21, Y+3 ; 0x03 13d56: ca 58 subi r28, 0x8A ; 138 13d58: d0 40 sbci r29, 0x00 ; 0 13d5a: ee 96 adiw r28, 0x3e ; 62 13d5c: 6c ad ldd r22, Y+60 ; 0x3c 13d5e: 7d ad ldd r23, Y+61 ; 0x3d 13d60: 8e ad ldd r24, Y+62 ; 0x3e 13d62: 9f ad ldd r25, Y+63 ; 0x3f 13d64: ee 97 sbiw r28, 0x3e ; 62 13d66: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 13d6a: 81 11 cpse r24, r1 13d6c: 13 c0 rjmp .+38 ; 0x13d94 13d6e: 20 e0 ldi r18, 0x00 ; 0 13d70: 30 e0 ldi r19, 0x00 ; 0 13d72: a9 01 movw r20, r18 13d74: c7 01 movw r24, r14 13d76: b6 01 movw r22, r12 13d78: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 13d7c: 81 11 cpse r24, r1 13d7e: 0a c0 rjmp .+20 ; 0x13d94 { angular_travel_total += 2 * M_PI; 13d80: 2b ed ldi r18, 0xDB ; 219 13d82: 3f e0 ldi r19, 0x0F ; 15 13d84: 49 ec ldi r20, 0xC9 ; 201 13d86: 50 e4 ldi r21, 0x40 ; 64 13d88: c7 01 movw r24, r14 13d8a: b6 01 movw r22, r12 13d8c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 13d90: 6b 01 movw r12, r22 13d92: 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)); 13d94: a7 01 movw r20, r14 13d96: 96 01 movw r18, r12 13d98: ae 96 adiw r28, 0x2e ; 46 13d9a: 6c ad ldd r22, Y+60 ; 0x3c 13d9c: 7d ad ldd r23, Y+61 ; 0x3d 13d9e: 8e ad ldd r24, Y+62 ; 0x3e 13da0: 9f ad ldd r25, Y+63 ; 0x3f 13da2: ae 97 sbiw r28, 0x2e ; 46 13da4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13da8: c2 58 subi r28, 0x82 ; 130 13daa: df 4f sbci r29, 0xFF ; 255 13dac: 28 81 ld r18, Y 13dae: 39 81 ldd r19, Y+1 ; 0x01 13db0: 4a 81 ldd r20, Y+2 ; 0x02 13db2: 5b 81 ldd r21, Y+3 ; 0x03 13db4: ce 57 subi r28, 0x7E ; 126 13db6: d0 40 sbci r29, 0x00 ; 0 13db8: 0f 94 0a e1 call 0x3c214 ; 0x3c214 13dbc: 4b 01 movw r8, r22 13dbe: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13dc0: 2f e6 ldi r18, 0x6F ; 111 13dc2: 32 e1 ldi r19, 0x12 ; 18 13dc4: 43 e8 ldi r20, 0x83 ; 131 13dc6: 5a e3 ldi r21, 0x3A ; 58 13dc8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 13dcc: 87 fd sbrc r24, 7 13dce: cf c1 rjmp .+926 ; 0x1416e // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13dd0: 92 01 movw r18, r4 13dd2: a3 01 movw r20, r6 13dd4: c5 01 movw r24, r10 13dd6: b4 01 movw r22, r8 13dd8: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 13ddc: 0f 94 4c df call 0x3be98 ; 0x3be98 13de0: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 13de4: a4 96 adiw r28, 0x24 ; 36 13de6: 7f af std Y+63, r23 ; 0x3f 13de8: 6e af std Y+62, r22 ; 0x3e 13dea: 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) 13dec: 62 30 cpi r22, 0x02 ; 2 13dee: 71 05 cpc r23, r1 13df0: 08 f4 brcc .+2 ; 0x13df4 13df2: 8b c1 rjmp .+790 ; 0x1410a 13df4: e0 96 adiw r28, 0x30 ; 48 13df6: 4e ad ldd r20, Y+62 ; 0x3e 13df8: 5f ad ldd r21, Y+63 ; 0x3f 13dfa: e0 97 sbiw r28, 0x30 ; 48 13dfc: 45 2b or r20, r21 13dfe: 09 f4 brne .+2 ; 0x13e02 13e00: 84 c1 rjmp .+776 ; 0x1410a 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; 13e02: 50 91 37 07 lds r21, 0x0737 ; 0x800737 13e06: 6f 96 adiw r28, 0x1f ; 31 13e08: 5f af std Y+63, r21 ; 0x3f 13e0a: 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, 13e0c: 90 e0 ldi r25, 0x00 ; 0 13e0e: 80 e0 ldi r24, 0x00 ; 0 13e10: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 13e14: 4b 01 movw r8, r22 13e16: 5c 01 movw r10, r24 13e18: ac 01 movw r20, r24 13e1a: 9b 01 movw r18, r22 13e1c: c7 01 movw r24, r14 13e1e: b6 01 movw r22, r12 13e20: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 13e24: 2b 01 movw r4, r22 13e26: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 13e28: a5 01 movw r20, r10 13e2a: 94 01 movw r18, r8 13e2c: c2 58 subi r28, 0x82 ; 130 13e2e: df 4f sbci r29, 0xFF ; 255 13e30: 68 81 ld r22, Y 13e32: 79 81 ldd r23, Y+1 ; 0x01 13e34: 8a 81 ldd r24, Y+2 ; 0x02 13e36: 9b 81 ldd r25, Y+3 ; 0x03 13e38: ce 57 subi r28, 0x7E ; 126 13e3a: d0 40 sbci r29, 0x00 ; 0 13e3c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 13e40: ee 96 adiw r28, 0x3e ; 62 13e42: 6c af std Y+60, r22 ; 0x3c 13e44: 7d af std Y+61, r23 ; 0x3d 13e46: 8e af std Y+62, r24 ; 0x3e 13e48: 9f af std Y+63, r25 ; 0x3f 13e4a: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 13e4c: 2d 85 ldd r18, Y+13 ; 0x0d 13e4e: 3e 85 ldd r19, Y+14 ; 0x0e 13e50: 4f 85 ldd r20, Y+15 ; 0x0f 13e52: 58 89 ldd r21, Y+16 ; 0x10 13e54: 60 91 5d 05 lds r22, 0x055D ; 0x80055d 13e58: 70 91 5e 05 lds r23, 0x055E ; 0x80055e 13e5c: 80 91 5f 05 lds r24, 0x055F ; 0x80055f 13e60: 90 91 60 05 lds r25, 0x0560 ; 0x800560 13e64: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13e68: a5 01 movw r20, r10 13e6a: 94 01 movw r18, r8 13e6c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 13e70: c2 58 subi r28, 0x82 ; 130 13e72: df 4f sbci r29, 0xFF ; 255 13e74: 68 83 st Y, r22 13e76: 79 83 std Y+1, r23 ; 0x01 13e78: 8a 83 std Y+2, r24 ; 0x02 13e7a: 9b 83 std Y+3, r25 ; 0x03 13e7c: ce 57 subi r28, 0x7E ; 126 13e7e: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13e80: a3 01 movw r20, r6 13e82: 92 01 movw r18, r4 13e84: c3 01 movw r24, r6 13e86: b2 01 movw r22, r4 13e88: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13e8c: 6b 01 movw r12, r22 13e8e: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13e90: ac 01 movw r20, r24 13e92: 9b 01 movw r18, r22 13e94: c3 01 movw r24, r6 13e96: b2 01 movw r22, r4 13e98: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13e9c: 20 e0 ldi r18, 0x00 ; 0 13e9e: 30 e0 ldi r19, 0x00 ; 0 13ea0: 40 ec ldi r20, 0xC0 ; 192 13ea2: 50 e4 ldi r21, 0x40 ; 64 13ea4: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 13ea8: 9b 01 movw r18, r22 13eaa: ac 01 movw r20, r24 13eac: c3 01 movw r24, r6 13eae: b2 01 movw r22, r4 13eb0: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13eb4: ae 96 adiw r28, 0x2e ; 46 13eb6: 6c af std Y+60, r22 ; 0x3c 13eb8: 7d af std Y+61, r23 ; 0x3d 13eba: 8e af std Y+62, r24 ; 0x3e 13ebc: 9f af std Y+63, r25 ; 0x3f 13ebe: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13ec0: 20 e0 ldi r18, 0x00 ; 0 13ec2: 30 e0 ldi r19, 0x00 ; 0 13ec4: 40 e0 ldi r20, 0x00 ; 0 13ec6: 5f e3 ldi r21, 0x3F ; 63 13ec8: c7 01 movw r24, r14 13eca: b6 01 movw r22, r12 13ecc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13ed0: 9b 01 movw r18, r22 13ed2: ac 01 movw r20, r24 13ed4: 60 e0 ldi r22, 0x00 ; 0 13ed6: 70 e0 ldi r23, 0x00 ; 0 13ed8: 80 e8 ldi r24, 0x80 ; 128 13eda: 9f e3 ldi r25, 0x3F ; 63 13edc: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13ee0: e6 96 adiw r28, 0x36 ; 54 13ee2: 6c af std Y+60, r22 ; 0x3c 13ee4: 7d af std Y+61, r23 ; 0x3d 13ee6: 8e af std Y+62, r24 ; 0x3e 13ee8: 9f af std Y+63, r25 ; 0x3f 13eea: 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++) { 13eec: 22 24 eor r2, r2 13eee: 23 94 inc r2 13ef0: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13ef2: 6f 96 adiw r28, 0x1f ; 31 13ef4: 8f ad ldd r24, Y+63 ; 0x3f 13ef6: 6f 97 sbiw r28, 0x1f ; 31 13ef8: 81 11 cpse r24, r1 13efa: 4d c1 rjmp .+666 ; 0x14196 // 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); 13efc: b1 01 movw r22, r2 13efe: 90 e0 ldi r25, 0x00 ; 0 13f00: 80 e0 ldi r24, 0x00 ; 0 13f02: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 13f06: a3 01 movw r20, r6 13f08: 92 01 movw r18, r4 13f0a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13f0e: 6b 01 movw r12, r22 13f10: 7c 01 movw r14, r24 13f12: 0f 94 68 df call 0x3bed0 ; 0x3bed0 13f16: 6e 96 adiw r28, 0x1e ; 30 13f18: 6c af std Y+60, r22 ; 0x3c 13f1a: 7d af std Y+61, r23 ; 0x3d 13f1c: 8e af std Y+62, r24 ; 0x3e 13f1e: 9f af std Y+63, r25 ; 0x3f 13f20: 6e 97 sbiw r28, 0x1e ; 30 13f22: c7 01 movw r24, r14 13f24: b6 01 movw r22, r12 13f26: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 13f2a: 4b 01 movw r8, r22 13f2c: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 13f2e: c0 90 89 03 lds r12, 0x0389 ; 0x800389 13f32: d0 90 8a 03 lds r13, 0x038A ; 0x80038a 13f36: e0 90 8b 03 lds r14, 0x038B ; 0x80038b 13f3a: f0 90 8c 03 lds r15, 0x038C ; 0x80038c 13f3e: f7 fa bst r15, 7 13f40: f0 94 com r15 13f42: f7 f8 bld r15, 7 13f44: f0 94 com r15 13f46: 20 91 8d 03 lds r18, 0x038D ; 0x80038d 13f4a: 30 91 8e 03 lds r19, 0x038E ; 0x80038e 13f4e: 40 91 8f 03 lds r20, 0x038F ; 0x80038f 13f52: 50 91 90 03 lds r21, 0x0390 ; 0x800390 13f56: a2 96 adiw r28, 0x22 ; 34 13f58: 2c af std Y+60, r18 ; 0x3c 13f5a: 3d af std Y+61, r19 ; 0x3d 13f5c: 4e af std Y+62, r20 ; 0x3e 13f5e: 5f af std Y+63, r21 ; 0x3f 13f60: a2 97 sbiw r28, 0x22 ; 34 13f62: a7 01 movw r20, r14 13f64: 96 01 movw r18, r12 13f66: 6e 96 adiw r28, 0x1e ; 30 13f68: 6c ad ldd r22, Y+60 ; 0x3c 13f6a: 7d ad ldd r23, Y+61 ; 0x3d 13f6c: 8e ad ldd r24, Y+62 ; 0x3e 13f6e: 9f ad ldd r25, Y+63 ; 0x3f 13f70: 6e 97 sbiw r28, 0x1e ; 30 13f72: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13f76: 6a 96 adiw r28, 0x1a ; 26 13f78: 6c af std Y+60, r22 ; 0x3c 13f7a: 7d af std Y+61, r23 ; 0x3d 13f7c: 8e af std Y+62, r24 ; 0x3e 13f7e: 9f af std Y+63, r25 ; 0x3f 13f80: 6a 97 sbiw r28, 0x1a ; 26 13f82: a2 96 adiw r28, 0x22 ; 34 13f84: 2c ad ldd r18, Y+60 ; 0x3c 13f86: 3d ad ldd r19, Y+61 ; 0x3d 13f88: 4e ad ldd r20, Y+62 ; 0x3e 13f8a: 5f ad ldd r21, Y+63 ; 0x3f 13f8c: a2 97 sbiw r28, 0x22 ; 34 13f8e: c5 01 movw r24, r10 13f90: b4 01 movw r22, r8 13f92: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13f96: 9b 01 movw r18, r22 13f98: ac 01 movw r20, r24 13f9a: 6a 96 adiw r28, 0x1a ; 26 13f9c: 6c ad ldd r22, Y+60 ; 0x3c 13f9e: 7d ad ldd r23, Y+61 ; 0x3d 13fa0: 8e ad ldd r24, Y+62 ; 0x3e 13fa2: 9f ad ldd r25, Y+63 ; 0x3f 13fa4: 6a 97 sbiw r28, 0x1a ; 26 13fa6: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 13faa: 6a 96 adiw r28, 0x1a ; 26 13fac: 6c af std Y+60, r22 ; 0x3c 13fae: 7d af std Y+61, r23 ; 0x3d 13fb0: 8e af std Y+62, r24 ; 0x3e 13fb2: 9f af std Y+63, r25 ; 0x3f 13fb4: 6a 97 sbiw r28, 0x1a ; 26 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 13fb6: a7 01 movw r20, r14 13fb8: 96 01 movw r18, r12 13fba: c5 01 movw r24, r10 13fbc: b4 01 movw r22, r8 13fbe: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13fc2: 6b 01 movw r12, r22 13fc4: 7c 01 movw r14, r24 13fc6: a2 96 adiw r28, 0x22 ; 34 13fc8: 2c ad ldd r18, Y+60 ; 0x3c 13fca: 3d ad ldd r19, Y+61 ; 0x3d 13fcc: 4e ad ldd r20, Y+62 ; 0x3e 13fce: 5f ad ldd r21, Y+63 ; 0x3f 13fd0: a2 97 sbiw r28, 0x22 ; 34 13fd2: 6e 96 adiw r28, 0x1e ; 30 13fd4: 6c ad ldd r22, Y+60 ; 0x3c 13fd6: 7d ad ldd r23, Y+61 ; 0x3d 13fd8: 8e ad ldd r24, Y+62 ; 0x3e 13fda: 9f ad ldd r25, Y+63 ; 0x3f 13fdc: 6e 97 sbiw r28, 0x1e ; 30 13fde: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 13fe2: 9b 01 movw r18, r22 13fe4: ac 01 movw r20, r24 13fe6: c7 01 movw r24, r14 13fe8: b6 01 movw r22, r12 13fea: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 13fee: 6e 96 adiw r28, 0x1e ; 30 13ff0: 6c af std Y+60, r22 ; 0x3c 13ff2: 7d af std Y+61, r23 ; 0x3d 13ff4: 8e af std Y+62, r24 ; 0x3e 13ff6: 9f af std Y+63, r25 ; 0x3f 13ff8: 6e 97 sbiw r28, 0x1e ; 30 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 13ffa: 30 91 37 07 lds r19, 0x0737 ; 0x800737 13ffe: 6f 96 adiw r28, 0x1f ; 31 14000: 3f af std Y+63, r19 ; 0x3f 14002: 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; 14004: 6a 96 adiw r28, 0x1a ; 26 14006: 2c ad ldd r18, Y+60 ; 0x3c 14008: 3d ad ldd r19, Y+61 ; 0x3d 1400a: 4e ad ldd r20, Y+62 ; 0x3e 1400c: 5f ad ldd r21, Y+63 ; 0x3f 1400e: 6a 97 sbiw r28, 0x1a ; 26 14010: ea 96 adiw r28, 0x3a ; 58 14012: 6c ad ldd r22, Y+60 ; 0x3c 14014: 7d ad ldd r23, Y+61 ; 0x3d 14016: 8e ad ldd r24, Y+62 ; 0x3e 14018: 9f ad ldd r25, Y+63 ; 0x3f 1401a: ea 97 sbiw r28, 0x3a ; 58 1401c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 14020: 69 83 std Y+1, r22 ; 0x01 14022: 7a 83 std Y+2, r23 ; 0x02 14024: 8b 83 std Y+3, r24 ; 0x03 14026: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 14028: 6e 96 adiw r28, 0x1e ; 30 1402a: 2c ad ldd r18, Y+60 ; 0x3c 1402c: 3d ad ldd r19, Y+61 ; 0x3d 1402e: 4e ad ldd r20, Y+62 ; 0x3e 14030: 5f ad ldd r21, Y+63 ; 0x3f 14032: 6e 97 sbiw r28, 0x1e ; 30 14034: ce 57 subi r28, 0x7E ; 126 14036: df 4f sbci r29, 0xFF ; 255 14038: 68 81 ld r22, Y 1403a: 79 81 ldd r23, Y+1 ; 0x01 1403c: 8a 81 ldd r24, Y+2 ; 0x02 1403e: 9b 81 ldd r25, Y+3 ; 0x03 14040: c2 58 subi r28, 0x82 ; 130 14042: d0 40 sbci r29, 0x00 ; 0 14044: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 14048: 6d 83 std Y+5, r22 ; 0x05 1404a: 7e 83 std Y+6, r23 ; 0x06 1404c: 8f 83 std Y+7, r24 ; 0x07 1404e: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 14050: ee 96 adiw r28, 0x3e ; 62 14052: 2c ad ldd r18, Y+60 ; 0x3c 14054: 3d ad ldd r19, Y+61 ; 0x3d 14056: 4e ad ldd r20, Y+62 ; 0x3e 14058: 5f ad ldd r21, Y+63 ; 0x3f 1405a: ee 97 sbiw r28, 0x3e ; 62 1405c: 69 85 ldd r22, Y+9 ; 0x09 1405e: 7a 85 ldd r23, Y+10 ; 0x0a 14060: 8b 85 ldd r24, Y+11 ; 0x0b 14062: 9c 85 ldd r25, Y+12 ; 0x0c 14064: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 14068: 69 87 std Y+9, r22 ; 0x09 1406a: 7a 87 std Y+10, r23 ; 0x0a 1406c: 8b 87 std Y+11, r24 ; 0x0b 1406e: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 14070: c2 58 subi r28, 0x82 ; 130 14072: df 4f sbci r29, 0xFF ; 255 14074: 28 81 ld r18, Y 14076: 39 81 ldd r19, Y+1 ; 0x01 14078: 4a 81 ldd r20, Y+2 ; 0x02 1407a: 5b 81 ldd r21, Y+3 ; 0x03 1407c: ce 57 subi r28, 0x7E ; 126 1407e: d0 40 sbci r29, 0x00 ; 0 14080: 6d 85 ldd r22, Y+13 ; 0x0d 14082: 7e 85 ldd r23, Y+14 ; 0x0e 14084: 8f 85 ldd r24, Y+15 ; 0x0f 14086: 98 89 ldd r25, Y+16 ; 0x10 14088: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1408c: 6d 87 std Y+13, r22 ; 0x0d 1408e: 7e 87 std Y+14, r23 ; 0x0e 14090: 8f 87 std Y+15, r24 ; 0x0f 14092: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 14094: ce 01 movw r24, r28 14096: 01 96 adiw r24, 0x01 ; 1 14098: 0e 94 8f 6c call 0xd91e ; 0xd91e // Insert the segment into the buffer if (i >= start_segment_idx) 1409c: e0 96 adiw r28, 0x30 ; 48 1409e: 8e ad ldd r24, Y+62 ; 0x3e 140a0: 9f ad ldd r25, Y+63 ; 0x3f 140a2: e0 97 sbiw r28, 0x30 ; 48 140a4: 28 16 cp r2, r24 140a6: 39 06 cpc r3, r25 140a8: 08 f1 brcs .+66 ; 0x140ec plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 140aa: e9 84 ldd r14, Y+9 ; 0x09 140ac: fa 84 ldd r15, Y+10 ; 0x0a 140ae: 0b 85 ldd r16, Y+11 ; 0x0b 140b0: 1c 85 ldd r17, Y+12 ; 0x0c 140b2: 2d 81 ldd r18, Y+5 ; 0x05 140b4: 3e 81 ldd r19, Y+6 ; 0x06 140b6: 4f 81 ldd r20, Y+7 ; 0x07 140b8: 58 85 ldd r21, Y+8 ; 0x08 140ba: 69 81 ldd r22, Y+1 ; 0x01 140bc: 7a 81 ldd r23, Y+2 ; 0x02 140be: 8b 81 ldd r24, Y+3 ; 0x03 140c0: 9c 81 ldd r25, Y+4 ; 0x04 140c2: 3f 92 push r3 140c4: 2f 92 push r2 140c6: a0 e4 ldi r26, 0x40 ; 64 140c8: b7 e0 ldi r27, 0x07 ; 7 140ca: bf 93 push r27 140cc: af 93 push r26 140ce: aa 96 adiw r28, 0x2a ; 42 140d0: 8c ac ldd r8, Y+60 ; 0x3c 140d2: 9d ac ldd r9, Y+61 ; 0x3d 140d4: ae ac ldd r10, Y+62 ; 0x3e 140d6: bf ac ldd r11, Y+63 ; 0x3f 140d8: aa 97 sbiw r28, 0x2a ; 42 140da: de 01 movw r26, r28 140dc: 1d 96 adiw r26, 0x0d ; 13 140de: 6d 01 movw r12, r26 140e0: 0f 94 f3 aa call 0x355e6 ; 0x355e6 140e4: 0f 90 pop r0 140e6: 0f 90 pop r0 140e8: 0f 90 pop r0 140ea: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 140ec: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 140f0: 81 11 cpse r24, r1 140f2: 3d c0 rjmp .+122 ; 0x1416e 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++) { 140f4: bf ef ldi r27, 0xFF ; 255 140f6: 2b 1a sub r2, r27 140f8: 3b 0a sbc r3, r27 140fa: a4 96 adiw r28, 0x24 ; 36 140fc: ee ad ldd r30, Y+62 ; 0x3e 140fe: ff ad ldd r31, Y+63 ; 0x3f 14100: a4 97 sbiw r28, 0x24 ; 36 14102: e2 15 cp r30, r2 14104: f3 05 cpc r31, r3 14106: 09 f0 breq .+2 ; 0x1410a 14108: f4 ce rjmp .-536 ; 0x13ef2 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 1410a: 81 e5 ldi r24, 0x51 ; 81 1410c: 95 e0 ldi r25, 0x05 ; 5 1410e: 0e 94 8f 6c call 0xd91e ; 0xd91e // 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); 14112: e0 90 59 05 lds r14, 0x0559 ; 0x800559 14116: f0 90 5a 05 lds r15, 0x055A ; 0x80055a 1411a: 00 91 5b 05 lds r16, 0x055B ; 0x80055b 1411e: 10 91 5c 05 lds r17, 0x055C ; 0x80055c 14122: 20 91 55 05 lds r18, 0x0555 ; 0x800555 14126: 30 91 56 05 lds r19, 0x0556 ; 0x800556 1412a: 40 91 57 05 lds r20, 0x0557 ; 0x800557 1412e: 50 91 58 05 lds r21, 0x0558 ; 0x800558 14132: 60 91 51 05 lds r22, 0x0551 ; 0x800551 14136: 70 91 52 05 lds r23, 0x0552 ; 0x800552 1413a: 80 91 53 05 lds r24, 0x0553 ; 0x800553 1413e: 90 91 54 05 lds r25, 0x0554 ; 0x800554 14142: 1f 92 push r1 14144: 1f 92 push r1 14146: e0 e4 ldi r30, 0x40 ; 64 14148: f7 e0 ldi r31, 0x07 ; 7 1414a: ff 93 push r31 1414c: ef 93 push r30 1414e: aa 96 adiw r28, 0x2a ; 42 14150: 8c ac ldd r8, Y+60 ; 0x3c 14152: 9d ac ldd r9, Y+61 ; 0x3d 14154: ae ac ldd r10, Y+62 ; 0x3e 14156: bf ac ldd r11, Y+63 ; 0x3f 14158: aa 97 sbiw r28, 0x2a ; 42 1415a: ed e5 ldi r30, 0x5D ; 93 1415c: ce 2e mov r12, r30 1415e: e5 e0 ldi r30, 0x05 ; 5 14160: de 2e mov r13, r30 14162: 0f 94 f3 aa call 0x355e6 ; 0x355e6 14166: 0f 90 pop r0 14168: 0f 90 pop r0 1416a: 0f 90 pop r0 1416c: 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(); 1416e: 0e 94 b6 5b call 0xb76c ; 0xb76c previous_millis_cmd.start(); 14172: 84 e8 ldi r24, 0x84 ; 132 14174: 93 e0 ldi r25, 0x03 ; 3 14176: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> 1417a: 7b cb rjmp .-2314 ; 0x13872 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; 1417c: 60 e0 ldi r22, 0x00 ; 0 1417e: 70 e0 ldi r23, 0x00 ; 0 14180: cb 01 movw r24, r22 14182: fe cb rjmp .-2052 ; 0x13980 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; 14184: a3 2c mov r10, r3 14186: b2 2c mov r11, r2 14188: 6f 96 adiw r28, 0x1f ; 31 1418a: 0f ad ldd r16, Y+63 ; 0x3f 1418c: 6f 97 sbiw r28, 0x1f ; 31 1418e: a3 96 adiw r28, 0x23 ; 35 14190: 1f ad ldd r17, Y+63 ; 0x3f 14192: a3 97 sbiw r28, 0x23 ; 35 14194: 69 cd rjmp .-1326 ; 0x13c68 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) { 14196: 6f 96 adiw r28, 0x1f ; 31 14198: 4f ad ldd r20, Y+63 ; 0x3f 1419a: 6f 97 sbiw r28, 0x1f ; 31 1419c: 41 50 subi r20, 0x01 ; 1 1419e: 6f 96 adiw r28, 0x1f ; 31 141a0: 4f af std Y+63, r20 ; 0x3f 141a2: 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; 141a4: ae 96 adiw r28, 0x2e ; 46 141a6: 2c ad ldd r18, Y+60 ; 0x3c 141a8: 3d ad ldd r19, Y+61 ; 0x3d 141aa: 4e ad ldd r20, Y+62 ; 0x3e 141ac: 5f ad ldd r21, Y+63 ; 0x3f 141ae: ae 97 sbiw r28, 0x2e ; 46 141b0: 6a 96 adiw r28, 0x1a ; 26 141b2: 6c ad ldd r22, Y+60 ; 0x3c 141b4: 7d ad ldd r23, Y+61 ; 0x3d 141b6: 8e ad ldd r24, Y+62 ; 0x3e 141b8: 9f ad ldd r25, Y+63 ; 0x3f 141ba: 6a 97 sbiw r28, 0x1a ; 26 141bc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 141c0: 6b 01 movw r12, r22 141c2: 7c 01 movw r14, r24 141c4: e6 96 adiw r28, 0x36 ; 54 141c6: 2c ad ldd r18, Y+60 ; 0x3c 141c8: 3d ad ldd r19, Y+61 ; 0x3d 141ca: 4e ad ldd r20, Y+62 ; 0x3e 141cc: 5f ad ldd r21, Y+63 ; 0x3f 141ce: e6 97 sbiw r28, 0x36 ; 54 141d0: 6e 96 adiw r28, 0x1e ; 30 141d2: 6c ad ldd r22, Y+60 ; 0x3c 141d4: 7d ad ldd r23, Y+61 ; 0x3d 141d6: 8e ad ldd r24, Y+62 ; 0x3e 141d8: 9f ad ldd r25, Y+63 ; 0x3f 141da: 6e 97 sbiw r28, 0x1e ; 30 141dc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 141e0: 9b 01 movw r18, r22 141e2: ac 01 movw r20, r24 141e4: c7 01 movw r24, r14 141e6: b6 01 movw r22, r12 141e8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 141ec: 7b 01 movw r14, r22 141ee: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 141f0: e6 96 adiw r28, 0x36 ; 54 141f2: 2c ad ldd r18, Y+60 ; 0x3c 141f4: 3d ad ldd r19, Y+61 ; 0x3d 141f6: 4e ad ldd r20, Y+62 ; 0x3e 141f8: 5f ad ldd r21, Y+63 ; 0x3f 141fa: e6 97 sbiw r28, 0x36 ; 54 141fc: 6a 96 adiw r28, 0x1a ; 26 141fe: 6c ad ldd r22, Y+60 ; 0x3c 14200: 7d ad ldd r23, Y+61 ; 0x3d 14202: 8e ad ldd r24, Y+62 ; 0x3e 14204: 9f ad ldd r25, Y+63 ; 0x3f 14206: 6a 97 sbiw r28, 0x1a ; 26 14208: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1420c: 4b 01 movw r8, r22 1420e: 5c 01 movw r10, r24 14210: ae 96 adiw r28, 0x2e ; 46 14212: 2c ad ldd r18, Y+60 ; 0x3c 14214: 3d ad ldd r19, Y+61 ; 0x3d 14216: 4e ad ldd r20, Y+62 ; 0x3e 14218: 5f ad ldd r21, Y+63 ; 0x3f 1421a: ae 97 sbiw r28, 0x2e ; 46 1421c: 6e 96 adiw r28, 0x1e ; 30 1421e: 6c ad ldd r22, Y+60 ; 0x3c 14220: 7d ad ldd r23, Y+61 ; 0x3d 14222: 8e ad ldd r24, Y+62 ; 0x3e 14224: 9f ad ldd r25, Y+63 ; 0x3f 14226: 6e 97 sbiw r28, 0x1e ; 30 14228: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1422c: 9b 01 movw r18, r22 1422e: ac 01 movw r20, r24 14230: c5 01 movw r24, r10 14232: b4 01 movw r22, r8 14234: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 14238: 6a 96 adiw r28, 0x1a ; 26 1423a: 6c af std Y+60, r22 ; 0x3c 1423c: 7d af std Y+61, r23 ; 0x3d 1423e: 8e af std Y+62, r24 ; 0x3e 14240: 9f af std Y+63, r25 ; 0x3f 14242: 6a 97 sbiw r28, 0x1a ; 26 r_axis_y = r_axisi; 14244: c7 01 movw r24, r14 14246: d8 01 movw r26, r16 14248: 6e 96 adiw r28, 0x1e ; 30 1424a: 8c af std Y+60, r24 ; 0x3c 1424c: 9d af std Y+61, r25 ; 0x3d 1424e: ae af std Y+62, r26 ; 0x3e 14250: bf af std Y+63, r27 ; 0x3f 14252: 6e 97 sbiw r28, 0x1e ; 30 14254: d7 ce rjmp .-594 ; 0x14004 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14256: 80 e5 ldi r24, 0x50 ; 80 14258: 0e 94 8d 5c call 0xb91a ; 0xb91a - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 1425c: c1 2c mov r12, r1 1425e: d1 2c mov r13, r1 14260: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14262: 88 23 and r24, r24 14264: 31 f0 breq .+12 ; 0x14272 14266: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1426a: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 1426e: 6b 01 movw r12, r22 14270: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 14272: 83 e5 ldi r24, 0x53 ; 83 14274: 0e 94 8d 5c call 0xb91a ; 0xb91a 14278: 88 23 and r24, r24 1427a: 61 f0 breq .+24 ; 0x14294 1427c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 14280: 20 e0 ldi r18, 0x00 ; 0 14282: 30 e0 ldi r19, 0x00 ; 0 14284: 4a e7 ldi r20, 0x7A ; 122 14286: 54 e4 ldi r21, 0x44 ; 68 14288: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1428c: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 14290: 6b 01 movw r12, r22 14292: 7c 01 movw r14, r24 if(codenum != 0) 14294: c1 14 cp r12, r1 14296: d1 04 cpc r13, r1 14298: e1 04 cpc r14, r1 1429a: f1 04 cpc r15, r1 1429c: 41 f0 breq .+16 ; 0x142ae { if(custom_message_type != CustomMsg::M117) 1429e: 80 91 72 07 lds r24, 0x0772 ; 0x800772 142a2: 87 30 cpi r24, 0x07 ; 7 142a4: 21 f0 breq .+8 ; 0x142ae { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 142a6: 89 ef ldi r24, 0xF9 ; 249 142a8: 9a e6 ldi r25, 0x6A ; 106 142aa: 0f 94 be 0b call 0x2177c ; 0x2177c } } st_synchronize(); 142ae: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 codenum += _millis(); // keep track of when we started waiting 142b2: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 142b6: c6 0e add r12, r22 142b8: d7 1e adc r13, r23 142ba: e8 1e adc r14, r24 142bc: f9 1e adc r15, r25 previous_millis_cmd.start(); 142be: 84 e8 ldi r24, 0x84 ; 132 142c0: 93 e0 ldi r25, 0x03 ; 3 142c2: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> while(_millis() < codenum) { 142c6: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 142ca: 6c 15 cp r22, r12 142cc: 7d 05 cpc r23, r13 142ce: 8e 05 cpc r24, r14 142d0: 9f 05 cpc r25, r15 142d2: 08 f0 brcs .+2 ; 0x142d6 142d4: ce ca rjmp .-2660 ; 0x13872 manage_heater(); 142d6: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(); 142da: 80 e0 ldi r24, 0x00 ; 0 142dc: 0e 94 f3 8b call 0x117e6 ; 0x117e6 lcd_update(0); 142e0: 80 e0 ldi r24, 0x00 ; 0 142e2: 0e 94 6d 6f call 0xdeda ; 0xdeda 142e6: ef cf rjmp .-34 ; 0x142c6 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); 142e8: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 142ea: 0f 94 af 89 call 0x3135e ; 0x3135e 142ee: c1 ca rjmp .-2686 ; 0x13872 142f0: 80 e0 ldi r24, 0x00 ; 0 142f2: fb cf rjmp .-10 ; 0x142ea - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 142f4: 6e 96 adiw r28, 0x1e ; 30 142f6: 1c ae std Y+60, r1 ; 0x3c 142f8: 1d ae std Y+61, r1 ; 0x3d 142fa: 1e ae std Y+62, r1 ; 0x3e 142fc: 1f ae std Y+63, r1 ; 0x3f 142fe: 6e 97 sbiw r28, 0x1e ; 30 14300: 35 ca rjmp .-2966 ; 0x1376c Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 14302: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 homing_flag = true; 14306: 81 e0 ldi r24, 0x01 ; 1 14308: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 1430c: 0e 94 ae 67 call 0xcf5c ; 0xcf5c 14310: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 14312: 80 e0 ldi r24, 0x00 ; 0 14314: 90 e0 ldi r25, 0x00 ; 0 14316: a8 e4 ldi r26, 0x48 ; 72 14318: b4 e4 ldi r27, 0x44 ; 68 1431a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 1431e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 14322: a0 93 92 02 sts 0x0292, r26 ; 0x800292 14326: b0 93 93 02 sts 0x0293, r27 ; 0x800293 find_bed_induction_sensor_point_z(-10.f, 3); 1432a: 43 e0 ldi r20, 0x03 ; 3 1432c: 60 e0 ldi r22, 0x00 ; 0 1432e: 70 e0 ldi r23, 0x00 ; 0 14330: 80 e2 ldi r24, 0x20 ; 32 14332: 91 ec ldi r25, 0xC1 ; 193 14334: 0f 94 de 8b call 0x317bc ; 0x317bc printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 14338: 70 90 48 07 lds r7, 0x0748 ; 0x800748 1433c: 60 90 49 07 lds r6, 0x0749 ; 0x800749 14340: 50 90 4a 07 lds r5, 0x074A ; 0x80074a 14344: 40 90 4b 07 lds r4, 0x074B ; 0x80074b 14348: b0 90 44 07 lds r11, 0x0744 ; 0x800744 1434c: a0 90 45 07 lds r10, 0x0745 ; 0x800745 14350: 90 90 46 07 lds r9, 0x0746 ; 0x800746 14354: 80 90 47 07 lds r8, 0x0747 ; 0x800747 14358: f0 90 40 07 lds r15, 0x0740 ; 0x800740 1435c: e0 90 41 07 lds r14, 0x0741 ; 0x800741 14360: d0 90 42 07 lds r13, 0x0742 ; 0x800742 14364: c0 90 43 07 lds r12, 0x0743 ; 0x800743 14368: 84 e5 ldi r24, 0x54 ; 84 1436a: 97 e5 ldi r25, 0x57 ; 87 1436c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 14370: 4f 92 push r4 14372: 5f 92 push r5 14374: 6f 92 push r6 14376: 7f 92 push r7 14378: 8f 92 push r8 1437a: 9f 92 push r9 1437c: af 92 push r10 1437e: bf 92 push r11 14380: cf 92 push r12 14382: df 92 push r13 14384: ef 92 push r14 14386: ff 92 push r15 14388: 9f 93 push r25 1438a: 8f 93 push r24 1438c: 8d ed ldi r24, 0xDD ; 221 1438e: 9a e6 ldi r25, 0x6A ; 106 14390: 9f 93 push r25 14392: 8f 93 push r24 14394: 0f 94 08 dc call 0x3b810 ; 0x3b810 clean_up_after_endstop_move(l_feedmultiply); 14398: c8 01 movw r24, r16 1439a: 0e 94 94 67 call 0xcf28 ; 0xcf28 homing_flag = false; 1439e: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 143a2: 0f b6 in r0, 0x3f ; 63 143a4: f8 94 cli 143a6: de bf out 0x3e, r29 ; 62 143a8: 0f be out 0x3f, r0 ; 63 143aa: cd bf out 0x3d, r28 ; 61 143ac: 62 ca rjmp .-2876 ; 0x13872 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 143ae: 20 e0 ldi r18, 0x00 ; 0 143b0: 30 e0 ldi r19, 0x00 ; 0 143b2: 40 e2 ldi r20, 0x20 ; 32 143b4: 51 e4 ldi r21, 0x41 ; 65 143b6: 60 91 95 03 lds r22, 0x0395 ; 0x800395 143ba: 70 91 96 03 lds r23, 0x0396 ; 0x800396 143be: 80 91 97 03 lds r24, 0x0397 ; 0x800397 143c2: 90 91 98 03 lds r25, 0x0398 ; 0x800398 143c6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 143ca: 87 ff sbrs r24, 7 143cc: 05 c0 rjmp .+10 ; 0x143d8 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 143ce: 8f e1 ldi r24, 0x1F ; 31 143d0: 99 e8 ldi r25, 0x89 ; 137 143d2: 0e 94 17 7b call 0xf62e ; 0xf62e 143d6: 4d ca rjmp .-2918 ; 0x13872 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 143d8: 82 e0 ldi r24, 0x02 ; 2 143da: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 143de: 81 11 cpse r24, r1 143e0: 07 c0 rjmp .+14 ; 0x143f0 //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)); 143e2: 8e e0 ldi r24, 0x0E ; 14 143e4: 9a e3 ldi r25, 0x3A ; 58 143e6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 143ea: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 143ee: 41 ca rjmp .-2942 ; 0x13872 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 143f0: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 143f4: 88 23 and r24, r24 143f6: 41 f0 breq .+16 ; 0x14408 143f8: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 143fc: 88 23 and r24, r24 143fe: 21 f0 breq .+8 ; 0x14408 14400: 10 91 3f 07 lds r17, 0x073F ; 0x80073f 14404: 11 11 cpse r17, r1 14406: 08 c0 rjmp .+16 ; 0x14418 14408: 81 e0 ldi r24, 0x01 ; 1 1440a: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d { // We don't know where we are! HOME! // Push the commands to the front of the message queue in the reverse order! // There shall be always enough space reserved for these commands. repeatcommand_front(); // repeat G76 with all its parameters enquecommand_front_P(G28W); 1440e: 8b e5 ldi r24, 0x5B ; 91 14410: 9c e6 ldi r25, 0x6C ; 108 14412: 0f 94 d6 76 call 0x2edac ; 0x2edac 14416: 2d ca rjmp .-2982 ; 0x13872 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 14418: 85 ec ldi r24, 0xC5 ; 197 1441a: 99 e3 ldi r25, 0x39 ; 57 1441c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 14420: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 14424: 8e e2 ldi r24, 0x2E ; 46 14426: 92 e5 ldi r25, 0x52 ; 82 14428: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1442c: 41 e0 ldi r20, 0x01 ; 1 1442e: 60 e0 ldi r22, 0x00 ; 0 14430: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c if (result == LCD_LEFT_BUTTON_CHOICE) 14434: 81 11 cpse r24, r1 14436: 61 c0 rjmp .+194 ; 0x144fa { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14438: 80 e0 ldi r24, 0x00 ; 0 1443a: 90 e0 ldi r25, 0x00 ; 0 1443c: a0 ea ldi r26, 0xA0 ; 160 1443e: b0 e4 ldi r27, 0x40 ; 64 14440: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14444: 90 93 49 07 sts 0x0749, r25 ; 0x800749 14448: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 1444c: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14450: 60 e0 ldi r22, 0x00 ; 0 14452: 70 e0 ldi r23, 0x00 ; 0 14454: 88 e4 ldi r24, 0x48 ; 72 14456: 92 e4 ldi r25, 0x42 ; 66 14458: 0f 94 48 ba call 0x37490 ; 0x37490 current_position[Z_AXIS] = 50; 1445c: 80 e0 ldi r24, 0x00 ; 0 1445e: 90 e0 ldi r25, 0x00 ; 0 14460: a8 e4 ldi r26, 0x48 ; 72 14462: b2 e4 ldi r27, 0x42 ; 66 14464: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14468: 90 93 49 07 sts 0x0749, r25 ; 0x800749 1446c: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 14470: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b current_position[Y_AXIS] = 180; 14474: 80 e0 ldi r24, 0x00 ; 0 14476: 90 e0 ldi r25, 0x00 ; 0 14478: a4 e3 ldi r26, 0x34 ; 52 1447a: b3 e4 ldi r27, 0x43 ; 67 1447c: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14480: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14484: a0 93 46 07 sts 0x0746, r26 ; 0x800746 14488: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 1448c: 60 e0 ldi r22, 0x00 ; 0 1448e: 70 e0 ldi r23, 0x00 ; 0 14490: 88 e4 ldi r24, 0x48 ; 72 14492: 92 e4 ldi r25, 0x42 ; 66 14494: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 14498: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 1449c: 84 e0 ldi r24, 0x04 ; 4 1449e: 92 e5 ldi r25, 0x52 ; 82 144a0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 144a4: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 144a8: e4 e5 ldi r30, 0x54 ; 84 144aa: f2 e9 ldi r31, 0x92 ; 146 144ac: 85 91 lpm r24, Z+ 144ae: 95 91 lpm r25, Z+ 144b0: a5 91 lpm r26, Z+ 144b2: b4 91 lpm r27, Z 144b4: 80 93 44 07 sts 0x0744, r24 ; 0x800744 144b8: 90 93 45 07 sts 0x0745, r25 ; 0x800745 144bc: a0 93 46 07 sts 0x0746, r26 ; 0x800746 144c0: b0 93 47 07 sts 0x0747, r27 ; 0x800747 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 144c4: e0 e5 ldi r30, 0x50 ; 80 144c6: f2 e9 ldi r31, 0x92 ; 146 144c8: 85 91 lpm r24, Z+ 144ca: 95 91 lpm r25, Z+ 144cc: a5 91 lpm r26, Z+ 144ce: b4 91 lpm r27, Z 144d0: 80 93 40 07 sts 0x0740, r24 ; 0x800740 144d4: 90 93 41 07 sts 0x0741, r25 ; 0x800741 144d8: a0 93 42 07 sts 0x0742, r26 ; 0x800742 144dc: b0 93 43 07 sts 0x0743, r27 ; 0x800743 plan_buffer_line_curposXYZE(3000 / 60); 144e0: 60 e0 ldi r22, 0x00 ; 0 144e2: 70 e0 ldi r23, 0x00 ; 0 144e4: 88 e4 ldi r24, 0x48 ; 72 144e6: 92 e4 ldi r25, 0x42 ; 66 144e8: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 144ec: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 gcode_G28(false, false, true); 144f0: 41 e0 ldi r20, 0x01 ; 1 144f2: 60 e0 ldi r22, 0x00 ; 0 144f4: 80 e0 ldi r24, 0x00 ; 0 144f6: 0e 94 a1 80 call 0x10142 ; 0x10142 } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 144fa: 20 e0 ldi r18, 0x00 ; 0 144fc: 30 e0 ldi r19, 0x00 ; 0 144fe: 4c e0 ldi r20, 0x0C ; 12 14500: 52 e4 ldi r21, 0x42 ; 66 14502: 60 91 95 03 lds r22, 0x0395 ; 0x800395 14506: 70 91 96 03 lds r23, 0x0396 ; 0x800396 1450a: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1450e: 90 91 98 03 lds r25, 0x0398 ; 0x800398 14512: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 14516: 18 16 cp r1, r24 14518: 0c f0 brlt .+2 ; 0x1451c 1451a: 73 c0 rjmp .+230 ; 0x14602 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 1451c: 80 e0 ldi r24, 0x00 ; 0 1451e: 90 e0 ldi r25, 0x00 ; 0 14520: a8 ec ldi r26, 0xC8 ; 200 14522: b2 e4 ldi r27, 0x42 ; 66 14524: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14528: 90 93 49 07 sts 0x0749, r25 ; 0x800749 1452c: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 14530: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14534: 60 e0 ldi r22, 0x00 ; 0 14536: 70 e0 ldi r23, 0x00 ; 0 14538: 88 e4 ldi r24, 0x48 ; 72 1453a: 92 e4 ldi r25, 0x42 ; 66 1453c: 0f 94 48 ba call 0x37490 ; 0x37490 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 14540: 0f 94 27 45 call 0x28a4e ; 0x28a4e LongTimer pinda_timeout; 14544: 19 82 std Y+1, r1 ; 0x01 14546: 1a 82 std Y+2, r1 ; 0x02 14548: 1b 82 std Y+3, r1 ; 0x03 1454a: 1c 82 std Y+4, r1 ; 0x04 1454c: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 1454e: ce 01 movw r24, r28 14550: 01 96 adiw r24, 0x01 ; 1 14552: 0f 94 fe 41 call 0x283fc ; 0x283fc ::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); 14556: 03 e2 ldi r16, 0x23 ; 35 14558: 9f e4 ldi r25, 0x4F ; 79 1455a: e9 2e mov r14, r25 1455c: 96 e8 ldi r25, 0x86 ; 134 1455e: f9 2e mov r15, r25 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 14560: 20 e0 ldi r18, 0x00 ; 0 14562: 30 e0 ldi r19, 0x00 ; 0 14564: 4c e0 ldi r20, 0x0C ; 12 14566: 52 e4 ldi r21, 0x42 ; 66 14568: 60 91 95 03 lds r22, 0x0395 ; 0x800395 1456c: 70 91 96 03 lds r23, 0x0396 ; 0x800396 14570: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14574: 90 91 98 03 lds r25, 0x0398 ; 0x800398 14578: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1457c: 18 16 cp r1, r24 1457e: c4 f5 brge .+112 ; 0x145f0 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14580: 87 e7 ldi r24, 0x77 ; 119 14582: 99 e3 ldi r25, 0x39 ; 57 14584: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 14588: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1458c: 42 e8 ldi r20, 0x82 ; 130 1458e: 64 e0 ldi r22, 0x04 ; 4 14590: 80 e0 ldi r24, 0x00 ; 0 14592: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 14596: 1f 92 push r1 14598: 0f 93 push r16 1459a: 60 91 95 03 lds r22, 0x0395 ; 0x800395 1459e: 70 91 96 03 lds r23, 0x0396 ; 0x800396 145a2: 80 91 97 03 lds r24, 0x0397 ; 0x800397 145a6: 90 91 98 03 lds r25, 0x0398 ; 0x800398 145aa: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 145ae: 7f 93 push r23 145b0: 6f 93 push r22 145b2: ff 92 push r15 145b4: ef 92 push r14 145b6: 0e 94 7f 6f call 0xdefe ; 0xdefe lcd_putc(LCD_STR_DEGREE[0]); 145ba: 81 e8 ldi r24, 0x81 ; 129 145bc: 0e 94 95 6f call 0xdf2a ; 0xdf2a delay_keep_alive(1000); 145c0: 88 ee ldi r24, 0xE8 ; 232 145c2: 93 e0 ldi r25, 0x03 ; 3 145c4: 0e 94 98 8e call 0x11d30 ; 0x11d30 serialecho_temperatures(); 145c8: 0e 94 fa 78 call 0xf1f4 ; 0xf1f4 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 145cc: 40 e0 ldi r20, 0x00 ; 0 145ce: 53 e5 ldi r21, 0x53 ; 83 145d0: 67 e0 ldi r22, 0x07 ; 7 145d2: 70 e0 ldi r23, 0x00 ; 0 145d4: ce 01 movw r24, r28 145d6: 01 96 adiw r24, 0x01 ; 1 145d8: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 145dc: 0f 90 pop r0 145de: 0f 90 pop r0 145e0: 0f 90 pop r0 145e2: 0f 90 pop r0 145e4: 0f 90 pop r0 145e6: 0f 90 pop r0 145e8: 88 23 and r24, r24 145ea: 09 f4 brne .+2 ; 0x145ee 145ec: b9 cf rjmp .-142 ; 0x14560 target_temp_reached = false; 145ee: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 145f0: 81 e0 ldi r24, 0x01 ; 1 145f2: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 145f6: 11 11 cpse r17, r1 145f8: 04 c0 rjmp .+8 ; 0x14602 lcd_temp_cal_show_result(false); 145fa: 80 e0 ldi r24, 0x00 ; 0 145fc: 0f 94 6d 36 call 0x26cda ; 0x26cda 14600: 38 c9 rjmp .-3472 ; 0x13872 break; } } st_synchronize(); 14602: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 14606: 81 e0 ldi r24, 0x01 ; 1 14608: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 lcd_update_enable(true); 1460c: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 14610: 81 e0 ldi r24, 0x01 ; 1 14612: 99 e8 ldi r25, 0x89 ; 137 14614: 0e 94 17 7b call 0xf62e ; 0xf62e float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 14618: 80 90 95 03 lds r8, 0x0395 ; 0x800395 1461c: 90 90 96 03 lds r9, 0x0396 ; 0x800396 14620: a0 90 97 03 lds r10, 0x0397 ; 0x800397 14624: b0 90 98 03 lds r11, 0x0398 ; 0x800398 14628: 20 e0 ldi r18, 0x00 ; 0 1462a: 30 e0 ldi r19, 0x00 ; 0 1462c: 40 ea ldi r20, 0xA0 ; 160 1462e: 50 e4 ldi r21, 0x40 ; 64 14630: c5 01 movw r24, r10 14632: b4 01 movw r22, r8 14634: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 14638: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 1463c: 25 e0 ldi r18, 0x05 ; 5 1463e: 26 9f mul r18, r22 14640: a0 01 movw r20, r0 14642: 27 9f mul r18, r23 14644: 50 0d add r21, r0 14646: 11 24 eor r1, r1 14648: ba 01 movw r22, r20 1464a: 55 0f add r21, r21 1464c: 88 0b sbc r24, r24 1464e: 99 0b sbc r25, r25 14650: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 14654: 1b 01 movw r2, r22 14656: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 14658: 20 e0 ldi r18, 0x00 ; 0 1465a: 30 e0 ldi r19, 0x00 ; 0 1465c: 4c e0 ldi r20, 0x0C ; 12 1465e: 52 e4 ldi r21, 0x42 ; 66 14660: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 14664: 87 ff sbrs r24, 7 14666: 06 c0 rjmp .+12 ; 0x14674 14668: 21 2c mov r2, r1 1466a: 31 2c mov r3, r1 1466c: 0c e0 ldi r16, 0x0C ; 12 1466e: e0 2e mov r14, r16 14670: 82 e4 ldi r24, 0x42 ; 66 14672: f8 2e mov r15, r24 if (start_temp < current_temperature_pinda) start_temp += 5; 14674: 22 2d mov r18, r2 14676: 33 2d mov r19, r3 14678: 4e 2d mov r20, r14 1467a: 5f 2d mov r21, r15 1467c: c5 01 movw r24, r10 1467e: b4 01 movw r22, r8 14680: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 14684: 18 16 cp r1, r24 14686: 64 f4 brge .+24 ; 0x146a0 14688: 20 e0 ldi r18, 0x00 ; 0 1468a: 30 e0 ldi r19, 0x00 ; 0 1468c: 40 ea ldi r20, 0xA0 ; 160 1468e: 50 e4 ldi r21, 0x40 ; 64 14690: 62 2d mov r22, r2 14692: 73 2d mov r23, r3 14694: 8e 2d mov r24, r14 14696: 9f 2d mov r25, r15 14698: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1469c: 1b 01 movw r2, r22 1469e: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 146a0: ff 92 push r15 146a2: ef 92 push r14 146a4: 3f 92 push r3 146a6: 2f 92 push r2 146a8: 8b eb ldi r24, 0xBB ; 187 146aa: 9a e6 ldi r25, 0x6A ; 106 146ac: 9f 93 push r25 146ae: 8f 93 push r24 146b0: 0f 94 08 dc call 0x3b810 ; 0x3b810 setTargetBed(70 + (start_temp - 30)); 146b4: 20 e0 ldi r18, 0x00 ; 0 146b6: 30 e0 ldi r19, 0x00 ; 0 146b8: 40 ef ldi r20, 0xF0 ; 240 146ba: 51 e4 ldi r21, 0x41 ; 65 146bc: 62 2d mov r22, r2 146be: 73 2d mov r23, r3 146c0: 8e 2d mov r24, r14 146c2: 9f 2d mov r25, r15 146c4: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 146c8: 20 e0 ldi r18, 0x00 ; 0 146ca: 30 e0 ldi r19, 0x00 ; 0 146cc: 4c e8 ldi r20, 0x8C ; 140 146ce: 52 e4 ldi r21, 0x42 ; 66 146d0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 146d4: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 146d8: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 146dc: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 custom_message_type = CustomMsg::TempCal; 146e0: 84 e0 ldi r24, 0x04 ; 4 146e2: 80 93 72 07 sts 0x0772, r24 ; 0x800772 custom_message_state = 1; 146e6: 81 e0 ldi r24, 0x01 ; 1 146e8: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 146ec: 82 e3 ldi r24, 0x32 ; 50 146ee: 9a e3 ldi r25, 0x3A ; 58 146f0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 146f4: 0f 94 be 0b call 0x2177c ; 0x2177c current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 146f8: 80 e0 ldi r24, 0x00 ; 0 146fa: 90 e0 ldi r25, 0x00 ; 0 146fc: a0 ea ldi r26, 0xA0 ; 160 146fe: b0 e4 ldi r27, 0x40 ; 64 14700: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14704: 90 93 49 07 sts 0x0749, r25 ; 0x800749 14708: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 1470c: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14710: 60 e0 ldi r22, 0x00 ; 0 14712: 70 e0 ldi r23, 0x00 ; 0 14714: 88 e4 ldi r24, 0x48 ; 72 14716: 92 e4 ldi r25, 0x42 ; 66 14718: 0f 94 48 ba call 0x37490 ; 0x37490 current_position[X_AXIS] = PINDA_PREHEAT_X; 1471c: 80 e0 ldi r24, 0x00 ; 0 1471e: 90 e0 ldi r25, 0x00 ; 0 14720: a0 ea ldi r26, 0xA0 ; 160 14722: b1 e4 ldi r27, 0x41 ; 65 14724: 80 93 40 07 sts 0x0740, r24 ; 0x800740 14728: 90 93 41 07 sts 0x0741, r25 ; 0x800741 1472c: a0 93 42 07 sts 0x0742, r26 ; 0x800742 14730: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14734: 80 e0 ldi r24, 0x00 ; 0 14736: 90 e0 ldi r25, 0x00 ; 0 14738: a0 e7 ldi r26, 0x70 ; 112 1473a: b2 e4 ldi r27, 0x42 ; 66 1473c: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14740: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14744: a0 93 46 07 sts 0x0746, r26 ; 0x800746 14748: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 1474c: 60 e0 ldi r22, 0x00 ; 0 1474e: 70 e0 ldi r23, 0x00 ; 0 14750: 88 e4 ldi r24, 0x48 ; 72 14752: 92 e4 ldi r25, 0x42 ; 66 14754: 0f 94 48 ba call 0x37490 ; 0x37490 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14758: 8a e9 ldi r24, 0x9A ; 154 1475a: 99 e9 ldi r25, 0x99 ; 153 1475c: a9 e1 ldi r26, 0x19 ; 25 1475e: be e3 ldi r27, 0x3E ; 62 14760: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14764: 90 93 49 07 sts 0x0749, r25 ; 0x800749 14768: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 1476c: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14770: 60 e0 ldi r22, 0x00 ; 0 14772: 70 e0 ldi r23, 0x00 ; 0 14774: 88 e4 ldi r24, 0x48 ; 72 14776: 92 e4 ldi r25, 0x42 ; 66 14778: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1477c: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 14780: 0f 90 pop r0 14782: 0f 90 pop r0 14784: 0f 90 pop r0 14786: 0f 90 pop r0 14788: 0f 90 pop r0 1478a: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 1478c: 20 91 95 03 lds r18, 0x0395 ; 0x800395 14790: 30 91 96 03 lds r19, 0x0396 ; 0x800396 14794: 40 91 97 03 lds r20, 0x0397 ; 0x800397 14798: 50 91 98 03 lds r21, 0x0398 ; 0x800398 1479c: 62 2d mov r22, r2 1479e: 73 2d mov r23, r3 147a0: 8e 2d mov r24, r14 147a2: 9f 2d mov r25, r15 147a4: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 147a8: 18 16 cp r1, r24 147aa: 3c f4 brge .+14 ; 0x147ba { delay_keep_alive(1000); 147ac: 88 ee ldi r24, 0xE8 ; 232 147ae: 93 e0 ldi r25, 0x03 ; 3 147b0: 0e 94 98 8e call 0x11d30 ; 0x11d30 serialecho_temperatures(); 147b4: 0e 94 fa 78 call 0xf1f4 ; 0xf1f4 147b8: e9 cf rjmp .-46 ; 0x1478c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 147ba: 60 e0 ldi r22, 0x00 ; 0 147bc: 86 ea ldi r24, 0xA6 ; 166 147be: 9f e0 ldi r25, 0x0F ; 15 147c0: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 } 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; 147c4: 80 e0 ldi r24, 0x00 ; 0 147c6: 90 e0 ldi r25, 0x00 ; 0 147c8: a0 ea ldi r26, 0xA0 ; 160 147ca: b0 e4 ldi r27, 0x40 ; 64 147cc: 80 93 48 07 sts 0x0748, r24 ; 0x800748 147d0: 90 93 49 07 sts 0x0749, r25 ; 0x800749 147d4: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 147d8: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 147dc: 60 e0 ldi r22, 0x00 ; 0 147de: 70 e0 ldi r23, 0x00 ; 0 147e0: 88 e4 ldi r24, 0x48 ; 72 147e2: 92 e4 ldi r25, 0x42 ; 66 147e4: 0f 94 48 ba call 0x37490 ; 0x37490 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 147e8: e0 e5 ldi r30, 0x50 ; 80 147ea: f2 e9 ldi r31, 0x92 ; 146 147ec: 85 91 lpm r24, Z+ 147ee: 95 91 lpm r25, Z+ 147f0: a5 91 lpm r26, Z+ 147f2: b4 91 lpm r27, Z 147f4: 80 93 40 07 sts 0x0740, r24 ; 0x800740 147f8: 90 93 41 07 sts 0x0741, r25 ; 0x800741 147fc: a0 93 42 07 sts 0x0742, r26 ; 0x800742 14800: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14804: e4 e5 ldi r30, 0x54 ; 84 14806: f2 e9 ldi r31, 0x92 ; 146 14808: 85 91 lpm r24, Z+ 1480a: 95 91 lpm r25, Z+ 1480c: a5 91 lpm r26, Z+ 1480e: b4 91 lpm r27, Z 14810: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14814: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14818: a0 93 46 07 sts 0x0746, r26 ; 0x800746 1481c: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 14820: 60 e0 ldi r22, 0x00 ; 0 14822: 70 e0 ldi r23, 0x00 ; 0 14824: 88 e4 ldi r24, 0x48 ; 72 14826: 92 e4 ldi r25, 0x42 ; 66 14828: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1482c: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 14830: 43 e0 ldi r20, 0x03 ; 3 14832: 60 e0 ldi r22, 0x00 ; 0 14834: 70 e0 ldi r23, 0x00 ; 0 14836: 80 e8 ldi r24, 0x80 ; 128 14838: 9f eb ldi r25, 0xBF ; 191 1483a: 0f 94 de 8b call 0x317bc ; 0x317bc if (find_z_result == false) { 1483e: 81 11 cpse r24, r1 14840: 06 c0 rjmp .+12 ; 0x1484e 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); 14842: 0f 94 6d 36 call 0x26cda ; 0x26cda homing_flag = false; 14846: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 1484a: 0c 94 39 9c jmp 0x13872 ; 0x13872 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 1484e: 90 91 48 07 lds r25, 0x0748 ; 0x800748 14852: 67 96 adiw r28, 0x17 ; 23 14854: 9f af std Y+63, r25 ; 0x3f 14856: 67 97 sbiw r28, 0x17 ; 23 14858: a0 91 49 07 lds r26, 0x0749 ; 0x800749 1485c: 6b 96 adiw r28, 0x1b ; 27 1485e: af af std Y+63, r26 ; 0x3f 14860: 6b 97 sbiw r28, 0x1b ; 27 14862: b0 91 4a 07 lds r27, 0x074A ; 0x80074a 14866: 6f 96 adiw r28, 0x1f ; 31 14868: bf af std Y+63, r27 ; 0x3f 1486a: 6f 97 sbiw r28, 0x1f ; 31 1486c: e0 91 4b 07 lds r30, 0x074B ; 0x80074b 14870: a7 96 adiw r28, 0x27 ; 39 14872: ef af std Y+63, r30 ; 0x3f 14874: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 14876: ef 93 push r30 14878: bf 93 push r27 1487a: af 93 push r26 1487c: 9f 93 push r25 1487e: 8e ea ldi r24, 0xAE ; 174 14880: 9a e6 ldi r25, 0x6A ; 106 14882: 9f 93 push r25 14884: 8f 93 push r24 14886: 0f 94 08 dc call 0x3b810 ; 0x3b810 1488a: 0f 90 pop r0 1488c: 0f 90 pop r0 1488e: 0f 90 pop r0 14890: 0f 90 pop r0 14892: 0f 90 pop r0 14894: 0f 90 pop r0 14896: be ea ldi r27, 0xAE ; 174 14898: 8b 2e mov r8, r27 1489a: bf e0 ldi r27, 0x0F ; 15 1489c: 9b 2e mov r9, r27 1489e: 13 e2 ldi r17, 0x23 ; 35 148a0: c1 2e mov r12, r17 148a2: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 148a4: 0f ef ldi r16, 0xFF ; 255 148a6: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 148a8: b6 01 movw r22, r12 148aa: 0d 2c mov r0, r13 148ac: 00 0c add r0, r0 148ae: 88 0b sbc r24, r24 148b0: 99 0b sbc r25, r25 148b2: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 148b6: 2b 01 movw r4, r22 148b8: 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)); 148ba: df 92 push r13 148bc: cf 92 push r12 148be: c8 01 movw r24, r16 148c0: 02 96 adiw r24, 0x02 ; 2 148c2: 9f 93 push r25 148c4: 8f 93 push r24 148c6: 22 e7 ldi r18, 0x72 ; 114 148c8: 3a e6 ldi r19, 0x6A ; 106 148ca: 3f 93 push r19 148cc: 2f 93 push r18 148ce: 0f 94 08 dc call 0x3b810 ; 0x3b810 148d2: 58 01 movw r10, r16 148d4: 5f ef ldi r21, 0xFF ; 255 148d6: a5 1a sub r10, r21 148d8: b5 0a sbc r11, r21 if (i >= 0) { 148da: 0f 90 pop r0 148dc: 0f 90 pop r0 148de: 0f 90 pop r0 148e0: 0f 90 pop r0 148e2: 0f 90 pop r0 148e4: 0f 90 pop r0 148e6: 11 f4 brne .+4 ; 0x148ec 148e8: 0c 94 46 cf jmp 0x19e8c ; 0x19e8c if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 148ec: 70 e0 ldi r23, 0x00 ; 0 148ee: 60 e0 ldi r22, 0x00 ; 0 148f0: c4 01 movw r24, r8 148f2: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 148f6: a3 01 movw r20, r6 148f8: 92 01 movw r18, r4 148fa: 62 2d mov r22, r2 148fc: 73 2d mov r23, r3 148fe: 8e 2d mov r24, r14 14900: 9f 2d mov r25, r15 14902: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 14906: 18 16 cp r1, r24 14908: 44 f4 brge .+16 ; 0x1491a } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 1490a: 85 e0 ldi r24, 0x05 ; 5 1490c: a8 16 cp r10, r24 1490e: b1 04 cpc r11, r1 14910: 11 f0 breq .+4 ; 0x14916 14912: 0c 94 52 cf jmp 0x19ea4 ; 0x19ea4 14916: 05 e0 ldi r16, 0x05 ; 5 14918: 10 e0 ldi r17, 0x00 ; 0 1491a: 58 01 movw r10, r16 1491c: 97 e2 ldi r25, 0x27 ; 39 1491e: a9 1a sub r10, r25 14920: 98 ef ldi r25, 0xF8 ; 248 14922: b9 0a sbc r11, r25 14924: aa 0c add r10, r10 14926: bb 1c adc r11, r11 14928: 85 e0 ldi r24, 0x05 ; 5 1492a: 80 9f mul r24, r16 1492c: 10 01 movw r2, r0 1492e: 81 9f mul r24, r17 14930: 30 0c add r3, r0 14932: 11 24 eor r1, r1 14934: 0d 5f subi r16, 0xFD ; 253 14936: 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; 14938: fa e9 ldi r31, 0x9A ; 154 1493a: 4f 2e mov r4, r31 1493c: f9 e9 ldi r31, 0x99 ; 153 1493e: 5f 2e mov r5, r31 14940: f9 e1 ldi r31, 0x19 ; 25 14942: 6f 2e mov r6, r31 14944: fe e3 ldi r31, 0x3E ; 62 14946: 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); 14948: a9 e3 ldi r26, 0x39 ; 57 1494a: 8a 2e mov r8, r26 1494c: aa e6 ldi r26, 0x6A ; 106 1494e: 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++) 14950: c8 01 movw r24, r16 14952: 02 97 sbiw r24, 0x02 ; 2 14954: 05 97 sbiw r24, 0x05 ; 5 14956: 0c f0 brlt .+2 ; 0x1495a 14958: d4 c0 rjmp .+424 ; 0x14b02 { float temp = (40 + i * 5); 1495a: b1 01 movw r22, r2 1495c: 63 5d subi r22, 0xD3 ; 211 1495e: 7f 4f sbci r23, 0xFF ; 255 14960: 07 2e mov r0, r23 14962: 00 0c add r0, r0 14964: 88 0b sbc r24, r24 14966: 99 0b sbc r25, r25 14968: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1496c: 6b 01 movw r12, r22 1496e: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 14970: 1f 93 push r17 14972: 0f 93 push r16 14974: a5 e6 ldi r26, 0x65 ; 101 14976: ba e6 ldi r27, 0x6A ; 106 14978: bf 93 push r27 1497a: af 93 push r26 1497c: 0f 94 08 dc call 0x3b810 ; 0x3b810 custom_message_state = i + 2; 14980: 00 93 f0 03 sts 0x03F0, r16 ; 0x8003f0 setTargetBed(50 + 10 * (temp - 30) / 5); 14984: 20 e0 ldi r18, 0x00 ; 0 14986: 30 e0 ldi r19, 0x00 ; 0 14988: 40 ef ldi r20, 0xF0 ; 240 1498a: 51 e4 ldi r21, 0x41 ; 65 1498c: c7 01 movw r24, r14 1498e: b6 01 movw r22, r12 14990: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 14994: 20 e0 ldi r18, 0x00 ; 0 14996: 30 e0 ldi r19, 0x00 ; 0 14998: 40 e2 ldi r20, 0x20 ; 32 1499a: 51 e4 ldi r21, 0x41 ; 65 1499c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 149a0: 20 e0 ldi r18, 0x00 ; 0 149a2: 30 e0 ldi r19, 0x00 ; 0 149a4: 40 ea ldi r20, 0xA0 ; 160 149a6: 50 e4 ldi r21, 0x40 ; 64 149a8: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 149ac: 20 e0 ldi r18, 0x00 ; 0 149ae: 30 e0 ldi r19, 0x00 ; 0 149b0: 48 e4 ldi r20, 0x48 ; 72 149b2: 52 e4 ldi r21, 0x42 ; 66 149b4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 149b8: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 149bc: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 149c0: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 149c4: 80 e0 ldi r24, 0x00 ; 0 149c6: 90 e0 ldi r25, 0x00 ; 0 149c8: a0 ea ldi r26, 0xA0 ; 160 149ca: b0 e4 ldi r27, 0x40 ; 64 149cc: 80 93 48 07 sts 0x0748, r24 ; 0x800748 149d0: 90 93 49 07 sts 0x0749, r25 ; 0x800749 149d4: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 149d8: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 149dc: 60 e0 ldi r22, 0x00 ; 0 149de: 70 e0 ldi r23, 0x00 ; 0 149e0: 88 e4 ldi r24, 0x48 ; 72 149e2: 92 e4 ldi r25, 0x42 ; 66 149e4: 0f 94 48 ba call 0x37490 ; 0x37490 current_position[X_AXIS] = PINDA_PREHEAT_X; 149e8: 20 e0 ldi r18, 0x00 ; 0 149ea: 30 e0 ldi r19, 0x00 ; 0 149ec: 40 ea ldi r20, 0xA0 ; 160 149ee: 51 e4 ldi r21, 0x41 ; 65 149f0: 20 93 40 07 sts 0x0740, r18 ; 0x800740 149f4: 30 93 41 07 sts 0x0741, r19 ; 0x800741 149f8: 40 93 42 07 sts 0x0742, r20 ; 0x800742 149fc: 50 93 43 07 sts 0x0743, r21 ; 0x800743 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14a00: 80 e0 ldi r24, 0x00 ; 0 14a02: 90 e0 ldi r25, 0x00 ; 0 14a04: a0 e7 ldi r26, 0x70 ; 112 14a06: b2 e4 ldi r27, 0x42 ; 66 14a08: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14a0c: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14a10: a0 93 46 07 sts 0x0746, r26 ; 0x800746 14a14: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 14a18: 60 e0 ldi r22, 0x00 ; 0 14a1a: 70 e0 ldi r23, 0x00 ; 0 14a1c: 88 e4 ldi r24, 0x48 ; 72 14a1e: 92 e4 ldi r25, 0x42 ; 66 14a20: 0f 94 48 ba call 0x37490 ; 0x37490 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14a24: 40 92 48 07 sts 0x0748, r4 ; 0x800748 14a28: 50 92 49 07 sts 0x0749, r5 ; 0x800749 14a2c: 60 92 4a 07 sts 0x074A, r6 ; 0x80074a 14a30: 70 92 4b 07 sts 0x074B, r7 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14a34: 60 e0 ldi r22, 0x00 ; 0 14a36: 70 e0 ldi r23, 0x00 ; 0 14a38: 88 e4 ldi r24, 0x48 ; 72 14a3a: 92 e4 ldi r25, 0x42 ; 66 14a3c: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 14a40: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 14a44: 0f 90 pop r0 14a46: 0f 90 pop r0 14a48: 0f 90 pop r0 14a4a: 0f 90 pop r0 while (current_temperature_pinda < temp) 14a4c: 20 91 95 03 lds r18, 0x0395 ; 0x800395 14a50: 30 91 96 03 lds r19, 0x0396 ; 0x800396 14a54: 40 91 97 03 lds r20, 0x0397 ; 0x800397 14a58: 50 91 98 03 lds r21, 0x0398 ; 0x800398 14a5c: c7 01 movw r24, r14 14a5e: b6 01 movw r22, r12 14a60: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 14a64: 18 16 cp r1, r24 14a66: 3c f4 brge .+14 ; 0x14a76 { delay_keep_alive(1000); 14a68: 88 ee ldi r24, 0xE8 ; 232 14a6a: 93 e0 ldi r25, 0x03 ; 3 14a6c: 0e 94 98 8e call 0x11d30 ; 0x11d30 serialecho_temperatures(); 14a70: 0e 94 fa 78 call 0xf1f4 ; 0xf1f4 14a74: eb cf rjmp .-42 ; 0x14a4c } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14a76: 80 e0 ldi r24, 0x00 ; 0 14a78: 90 e0 ldi r25, 0x00 ; 0 14a7a: a0 ea ldi r26, 0xA0 ; 160 14a7c: b0 e4 ldi r27, 0x40 ; 64 14a7e: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14a82: 90 93 49 07 sts 0x0749, r25 ; 0x800749 14a86: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 14a8a: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14a8e: 60 e0 ldi r22, 0x00 ; 0 14a90: 70 e0 ldi r23, 0x00 ; 0 14a92: 88 e4 ldi r24, 0x48 ; 72 14a94: 92 e4 ldi r25, 0x42 ; 66 14a96: 0f 94 48 ba call 0x37490 ; 0x37490 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14a9a: e0 e5 ldi r30, 0x50 ; 80 14a9c: f2 e9 ldi r31, 0x92 ; 146 14a9e: 85 91 lpm r24, Z+ 14aa0: 95 91 lpm r25, Z+ 14aa2: a5 91 lpm r26, Z+ 14aa4: b4 91 lpm r27, Z 14aa6: 80 93 40 07 sts 0x0740, r24 ; 0x800740 14aaa: 90 93 41 07 sts 0x0741, r25 ; 0x800741 14aae: a0 93 42 07 sts 0x0742, r26 ; 0x800742 14ab2: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14ab6: e4 e5 ldi r30, 0x54 ; 84 14ab8: f2 e9 ldi r31, 0x92 ; 146 14aba: 85 91 lpm r24, Z+ 14abc: 95 91 lpm r25, Z+ 14abe: a5 91 lpm r26, Z+ 14ac0: b4 91 lpm r27, Z 14ac2: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14ac6: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14aca: a0 93 46 07 sts 0x0746, r26 ; 0x800746 14ace: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 14ad2: 60 e0 ldi r22, 0x00 ; 0 14ad4: 70 e0 ldi r23, 0x00 ; 0 14ad6: 88 e4 ldi r24, 0x48 ; 72 14ad8: 92 e4 ldi r25, 0x42 ; 66 14ada: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 14ade: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 find_z_result = find_bed_induction_sensor_point_z(-1.f); 14ae2: 43 e0 ldi r20, 0x03 ; 3 14ae4: 60 e0 ldi r22, 0x00 ; 0 14ae6: 70 e0 ldi r23, 0x00 ; 0 14ae8: 80 e8 ldi r24, 0x80 ; 128 14aea: 9f eb ldi r25, 0xBF ; 191 14aec: 0f 94 de 8b call 0x317bc ; 0x317bc 14af0: 95 e0 ldi r25, 0x05 ; 5 14af2: 29 0e add r2, r25 14af4: 31 1c adc r3, r1 14af6: 0f 5f subi r16, 0xFF ; 255 14af8: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 14afa: 81 11 cpse r24, r1 14afc: 04 c0 rjmp .+8 ; 0x14b06 lcd_temp_cal_show_result(find_z_result); 14afe: 0f 94 6d 36 call 0x26cda ; 0x26cda 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); 14b02: 81 e0 ldi r24, 0x01 ; 1 14b04: 9e ce rjmp .-708 ; 0x14842 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]); 14b06: 67 96 adiw r28, 0x17 ; 23 14b08: 7f ad ldd r23, Y+63 ; 0x3f 14b0a: 67 97 sbiw r28, 0x17 ; 23 14b0c: 6b 96 adiw r28, 0x1b ; 27 14b0e: 6f ad ldd r22, Y+63 ; 0x3f 14b10: 6b 97 sbiw r28, 0x1b ; 27 14b12: 6f 96 adiw r28, 0x1f ; 31 14b14: 9f ad ldd r25, Y+63 ; 0x3f 14b16: 6f 97 sbiw r28, 0x1f ; 31 14b18: a7 96 adiw r28, 0x27 ; 39 14b1a: 8f ad ldd r24, Y+63 ; 0x3f 14b1c: a7 97 sbiw r28, 0x27 ; 39 14b1e: 27 2f mov r18, r23 14b20: 36 2f mov r19, r22 14b22: 49 2f mov r20, r25 14b24: 58 2f mov r21, r24 14b26: 60 91 48 07 lds r22, 0x0748 ; 0x800748 14b2a: 70 91 49 07 lds r23, 0x0749 ; 0x800749 14b2e: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 14b32: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 14b36: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 14b3a: f6 2e mov r15, r22 14b3c: e7 2e mov r14, r23 14b3e: d8 2e mov r13, r24 14b40: c9 2e mov r12, r25 14b42: 20 91 77 06 lds r18, 0x0677 ; 0x800677 14b46: 30 91 78 06 lds r19, 0x0678 ; 0x800678 14b4a: 40 91 79 06 lds r20, 0x0679 ; 0x800679 14b4e: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 14b52: d7 01 movw r26, r14 14b54: f6 01 movw r30, r12 14b56: 6b 2f mov r22, r27 14b58: 7a 2f mov r23, r26 14b5a: 8f 2f mov r24, r31 14b5c: 9e 2f mov r25, r30 14b5e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 14b62: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 14b66: a6 96 adiw r28, 0x26 ; 38 14b68: 6c af std Y+60, r22 ; 0x3c 14b6a: 7d af std Y+61, r23 ; 0x3d 14b6c: 8e af std Y+62, r24 ; 0x3e 14b6e: 9f af std Y+63, r25 ; 0x3f 14b70: 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); 14b72: cf 92 push r12 14b74: df 92 push r13 14b76: ef 92 push r14 14b78: ff 92 push r15 14b7a: 80 91 98 03 lds r24, 0x0398 ; 0x800398 14b7e: 8f 93 push r24 14b80: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14b84: 8f 93 push r24 14b86: 80 91 96 03 lds r24, 0x0396 ; 0x800396 14b8a: 8f 93 push r24 14b8c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14b90: 8f 93 push r24 14b92: 9f 92 push r9 14b94: 8f 92 push r8 14b96: 0f 94 08 dc call 0x3b810 ; 0x3b810 14b9a: a4 96 adiw r28, 0x24 ; 36 14b9c: 6e ad ldd r22, Y+62 ; 0x3e 14b9e: 7f ad ldd r23, Y+63 ; 0x3f 14ba0: a4 97 sbiw r28, 0x24 ; 36 14ba2: c5 01 movw r24, r10 14ba4: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 14ba8: a2 e0 ldi r26, 0x02 ; 2 14baa: aa 0e add r10, r26 14bac: b1 1c adc r11, r1 14bae: 0f b6 in r0, 0x3f ; 63 14bb0: f8 94 cli 14bb2: de bf out 0x3e, r29 ; 62 14bb4: 0f be out 0x3f, r0 ; 63 14bb6: cd bf out 0x3d, r28 ; 61 14bb8: cb ce rjmp .-618 ; 0x14950 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 14bba: 80 e1 ldi r24, 0x10 ; 16 14bbc: 0e 94 e5 e6 call 0x1cdca ; 0x1cdca 14bc0: 0c 94 39 9c jmp 0x13872 ; 0x13872 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 14bc4: 80 e1 ldi r24, 0x10 ; 16 14bc6: 0e 94 3a e7 call 0x1ce74 ; 0x1ce74 14bca: 0c 94 39 9c jmp 0x13872 ; 0x13872 /*! ### 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); 14bce: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 14bd2: 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; 14bd4: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd 14bd8: 0c 94 39 9c jmp 0x13872 ; 0x13872 14bdc: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 14be0: 87 60 ori r24, 0x07 ; 7 14be2: f8 cf rjmp .-16 ; 0x14bd4 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 14be4: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 14be8: f1 2c mov r15, r1 14bea: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 14bec: f8 01 movw r30, r16 14bee: 81 91 ld r24, Z+ 14bf0: 8f 01 movw r16, r30 14bf2: 88 23 and r24, r24 14bf4: d1 f0 breq .+52 ; 0x14c2a current_position[i] = values[i] + cs.add_homing[i]; 14bf6: 97 01 movw r18, r14 14bf8: 20 5c subi r18, 0xC0 ; 192 14bfa: 38 4f sbci r19, 0xF8 ; 248 14bfc: 59 01 movw r10, r18 14bfe: f3 01 movw r30, r6 14c00: ee 0d add r30, r14 14c02: ff 1d adc r31, r15 14c04: 20 81 ld r18, Z 14c06: 31 81 ldd r19, Z+1 ; 0x01 14c08: 42 81 ldd r20, Z+2 ; 0x02 14c0a: 53 81 ldd r21, Z+3 ; 0x03 14c0c: f7 01 movw r30, r14 14c0e: ed 53 subi r30, 0x3D ; 61 14c10: f9 4f sbci r31, 0xF9 ; 249 14c12: 60 81 ld r22, Z 14c14: 71 81 ldd r23, Z+1 ; 0x01 14c16: 82 81 ldd r24, Z+2 ; 0x02 14c18: 93 81 ldd r25, Z+3 ; 0x03 14c1a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 14c1e: d5 01 movw r26, r10 14c20: 6d 93 st X+, r22 14c22: 7d 93 st X+, r23 14c24: 8d 93 st X+, r24 14c26: 9c 93 st X, r25 14c28: 13 97 sbiw r26, 0x03 ; 3 14c2a: b4 e0 ldi r27, 0x04 ; 4 14c2c: eb 0e add r14, r27 14c2e: 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) 14c30: ec e0 ldi r30, 0x0C ; 12 14c32: ee 16 cp r14, r30 14c34: f1 04 cpc r15, r1 14c36: d1 f6 brne .-76 ; 0x14bec { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 14c38: dd 20 and r13, r13 14c3a: 61 f0 breq .+24 ; 0x14c54 current_position[E_AXIS] = values[E_AXIS]; 14c3c: 8d 85 ldd r24, Y+13 ; 0x0d 14c3e: 9e 85 ldd r25, Y+14 ; 0x0e 14c40: af 85 ldd r26, Y+15 ; 0x0f 14c42: b8 89 ldd r27, Y+16 ; 0x10 14c44: 80 93 4c 07 sts 0x074C, r24 ; 0x80074c 14c48: 90 93 4d 07 sts 0x074D, r25 ; 0x80074d 14c4c: a0 93 4e 07 sts 0x074E, r26 ; 0x80074e 14c50: b0 93 4f 07 sts 0x074F, r27 ; 0x80074f // Set all at once plan_set_position_curposXYZE(); 14c54: 0f 94 08 b9 call 0x37210 ; 0x37210 14c58: 0c 94 39 9c jmp 0x13872 ; 0x13872 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 14c5c: 8d 34 cpi r24, 0x4D ; 77 14c5e: 11 f0 breq .+4 ; 0x14c64 14c60: 0c 94 b7 cd jmp 0x19b6e ; 0x19b6e { strchr_pointer = CMDBUFFER_CURRENT_STRING; 14c64: 10 93 94 03 sts 0x0394, r17 ; 0x800394 14c68: 00 93 93 03 sts 0x0393, r16 ; 0x800393 14c6c: f8 01 movw r30, r16 14c6e: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 14c70: 81 91 ld r24, Z+ 14c72: 80 32 cpi r24, 0x20 ; 32 14c74: e9 f3 breq .-6 ; 0x14c70 14c76: 89 30 cpi r24, 0x09 ; 9 14c78: d9 f3 breq .-10 ; 0x14c70 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 14c7a: 80 53 subi r24, 0x30 ; 48 14c7c: 8a 30 cpi r24, 0x0A ; 10 14c7e: 70 f0 brcs .+28 ; 0x14c9c printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14c80: 1f 93 push r17 14c82: 0f 93 push r16 14c84: 8d ee ldi r24, 0xED ; 237 14c86: 98 e8 ldi r25, 0x88 ; 136 14c88: 9f 93 push r25 14c8a: 8f 93 push r24 14c8c: 0f 94 08 dc call 0x3b810 ; 0x3b810 14c90: 0f 90 pop r0 14c92: 0f 90 pop r0 14c94: 0f 90 pop r0 14c96: 0f 90 pop r0 14c98: 0c 94 f6 97 jmp 0x12fec ; 0x12fec } else { mcode_in_progress = code_value_short(); 14c9c: 0e 94 2c 5c call 0xb858 ; 0xb858 14ca0: 90 93 59 0e sts 0x0E59, r25 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.550+0x1> 14ca4: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 <_ZL17mcode_in_progress.lto_priv.550> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14ca8: 89 3c cpi r24, 0xC9 ; 201 14caa: 91 05 cpc r25, r1 14cac: 11 f4 brne .+4 ; 0x14cb2 14cae: 0c 94 7a ba jmp 0x174f4 ; 0x174f4 14cb2: 0c f0 brlt .+2 ; 0x14cb6 14cb4: 40 c3 rjmp .+1664 ; 0x15336 14cb6: 8e 34 cpi r24, 0x4E ; 78 14cb8: 91 05 cpc r25, r1 14cba: 11 f4 brne .+4 ; 0x14cc0 14cbc: 0c 94 e0 b5 jmp 0x16bc0 ; 0x16bc0 14cc0: 0c f0 brlt .+2 ; 0x14cc4 14cc2: 35 c2 rjmp .+1130 ; 0x1512e 14cc4: 8c 31 cpi r24, 0x1C ; 28 14cc6: 91 05 cpc r25, r1 14cc8: 11 f4 brne .+4 ; 0x14cce 14cca: 0c 94 3f b4 jmp 0x1687e ; 0x1687e 14cce: 0c f0 brlt .+2 ; 0x14cd2 14cd0: 00 c1 rjmp .+512 ; 0x14ed2 14cd2: 85 31 cpi r24, 0x15 ; 21 14cd4: 91 05 cpc r25, r1 14cd6: 11 f4 brne .+4 ; 0x14cdc 14cd8: 0c 94 58 b3 jmp 0x166b0 ; 0x166b0 14cdc: 0c f0 brlt .+2 ; 0x14ce0 14cde: 5e c0 rjmp .+188 ; 0x14d9c 14ce0: 81 31 cpi r24, 0x11 ; 17 14ce2: 91 05 cpc r25, r1 14ce4: 11 f4 brne .+4 ; 0x14cea 14ce6: 0c 94 4d b3 jmp 0x1669a ; 0x1669a 14cea: ec f4 brge .+58 ; 0x14d26 14cec: 02 97 sbiw r24, 0x02 ; 2 14cee: 10 f4 brcc .+4 ; 0x14cf4 14cf0: 0c 94 c1 b2 jmp 0x16582 ; 0x16582 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 14cf4: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 14cf8: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 14cfc: 8d 57 subi r24, 0x7D ; 125 14cfe: 9f 4e sbci r25, 0xEF ; 239 14d00: 9f 93 push r25 14d02: 8f 93 push r24 14d04: 1f 92 push r1 14d06: 8d e4 ldi r24, 0x4D ; 77 14d08: 8f 93 push r24 14d0a: 84 e2 ldi r24, 0x24 ; 36 14d0c: 9a e6 ldi r25, 0x6A ; 106 14d0e: 9f 93 push r25 14d10: 8f 93 push r24 14d12: 0f 94 08 dc call 0x3b810 ; 0x3b810 14d16: 0f 90 pop r0 14d18: 0f 90 pop r0 14d1a: 0f 90 pop r0 14d1c: 0f 90 pop r0 14d1e: 0f 90 pop r0 14d20: 0f 90 pop r0 14d22: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d26: 82 31 cpi r24, 0x12 ; 18 14d28: 91 05 cpc r25, r1 14d2a: 11 f4 brne .+4 ; 0x14d30 14d2c: 0c 94 95 b7 jmp 0x16f2a ; 0x16f2a 14d30: 44 97 sbiw r24, 0x14 ; 20 14d32: 01 f7 brne .-64 ; 0x14cf4 #### 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() 14d34: 81 e0 ldi r24, 0x01 ; 1 14d36: 80 93 96 02 sts 0x0296, r24 ; 0x800296 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 14d3a: 84 e1 ldi r24, 0x14 ; 20 14d3c: 9a e6 ldi r25, 0x6A ; 106 14d3e: 0e 94 17 7b call 0xf62e ; 0xf62e card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 14d42: 84 e5 ldi r24, 0x54 ; 84 14d44: 0e 94 8d 5c call 0xb91a ; 0xb91a 14d48: 18 2f mov r17, r24 14d4a: 8c e4 ldi r24, 0x4C ; 76 14d4c: 0e 94 8d 5c call 0xb91a ; 0xb91a 14d50: 00 e0 ldi r16, 0x00 ; 0 14d52: 80 fb bst r24, 0 14d54: 00 f9 bld r16, 0 14d56: 10 fb bst r17, 0 14d58: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 14d5a: 81 ef ldi r24, 0xF1 ; 241 14d5c: 94 e1 ldi r25, 0x14 ; 20 14d5e: 0e 94 c8 78 call 0xf190 ; 0xf190 lsDive("",root, NULL, LS_SerialPrint, params); 14d62: 83 e2 ldi r24, 0x23 ; 35 14d64: e1 ef ldi r30, 0xF1 ; 241 14d66: f4 e1 ldi r31, 0x14 ; 20 14d68: de 01 movw r26, r28 14d6a: 11 96 adiw r26, 0x01 ; 1 14d6c: 01 90 ld r0, Z+ 14d6e: 0d 92 st X+, r0 14d70: 8a 95 dec r24 14d72: e1 f7 brne .-8 ; 0x14d6c 14d74: 20 e0 ldi r18, 0x00 ; 0 14d76: 50 e0 ldi r21, 0x00 ; 0 14d78: 40 e0 ldi r20, 0x00 ; 0 14d7a: be 01 movw r22, r28 14d7c: 6f 5f subi r22, 0xFF ; 255 14d7e: 7f 4f sbci r23, 0xFF ; 255 14d80: 81 ef ldi r24, 0xF1 ; 241 14d82: 92 e0 ldi r25, 0x02 ; 2 14d84: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 14d88: ce 01 movw r24, r28 14d8a: 01 96 adiw r24, 0x01 ; 1 14d8c: 0e 94 cd 78 call 0xf19a ; 0xf19a SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14d90: 86 e0 ldi r24, 0x06 ; 6 14d92: 9a e6 ldi r25, 0x6A ; 106 14d94: 0e 94 17 7b call 0xf62e ; 0xf62e 14d98: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d9c: 88 31 cpi r24, 0x18 ; 24 14d9e: 91 05 cpc r25, r1 14da0: 11 f4 brne .+4 ; 0x14da6 14da2: 0c 94 69 b3 jmp 0x166d2 ; 0x166d2 14da6: 94 f4 brge .+36 ; 0x14dcc 14da8: 86 31 cpi r24, 0x16 ; 22 14daa: 91 05 cpc r25, r1 14dac: 11 f4 brne .+4 ; 0x14db2 14dae: 0c 94 5c b3 jmp 0x166b8 ; 0x166b8 14db2: 47 97 sbiw r24, 0x17 ; 23 14db4: 09 f0 breq .+2 ; 0x14db8 14db6: 9e cf rjmp .-196 ; 0x14cf4 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 14db8: 80 91 93 03 lds r24, 0x0393 ; 0x800393 14dbc: 90 91 94 03 lds r25, 0x0394 ; 0x800394 14dc0: 61 e0 ldi r22, 0x01 ; 1 14dc2: 04 96 adiw r24, 0x04 ; 4 14dc4: 0f 94 b6 7f call 0x2ff6c ; 0x2ff6c 14dc8: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14dcc: 8a 31 cpi r24, 0x1A ; 26 14dce: 91 05 cpc r25, r1 14dd0: 11 f4 brne .+4 ; 0x14dd6 14dd2: 0c 94 af b3 jmp 0x1675e ; 0x1675e 14dd6: 14 f0 brlt .+4 ; 0x14ddc 14dd8: 0c 94 d1 b3 jmp 0x167a2 ; 0x167a2 14ddc: 0d ed ldi r16, 0xDD ; 221 14dde: 12 e0 ldi r17, 0x02 ; 2 14de0: ff e3 ldi r31, 0x3F ; 63 14de2: af 2e mov r10, r31 14de4: f2 e0 ldi r31, 0x02 ; 2 14de6: bf 2e mov r11, r31 14de8: a1 e2 ldi r26, 0x21 ; 33 14dea: ca 2e mov r12, r26 14dec: a2 e0 ldi r26, 0x02 ; 2 14dee: da 2e mov r13, r26 14df0: b5 e1 ldi r27, 0x15 ; 21 14df2: eb 2e mov r14, r27 14df4: b2 e0 ldi r27, 0x02 ; 2 14df6: fb 2e mov r15, r27 14df8: 80 ee ldi r24, 0xE0 ; 224 14dfa: 88 2e mov r8, r24 14dfc: 82 e0 ldi r24, 0x02 ; 2 14dfe: 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])) { 14e00: f8 01 movw r30, r16 14e02: 81 91 ld r24, Z+ 14e04: 8f 01 movw r16, r30 14e06: 0e 94 8d 5c call 0xb91a ; 0xb91a 14e0a: 88 23 and r24, r24 14e0c: 21 f1 breq .+72 ; 0x14e56 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 14e0e: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 14e12: d6 01 movw r26, r12 14e14: 4d 90 ld r4, X+ 14e16: 5d 90 ld r5, X+ 14e18: 6d 90 ld r6, X+ 14e1a: 7c 90 ld r7, X 14e1c: a3 01 movw r20, r6 14e1e: 92 01 movw r18, r4 14e20: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 14e24: 87 fd sbrc r24, 7 14e26: 11 c0 rjmp .+34 ; 0x14e4a 14e28: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 14e2c: f7 01 movw r30, r14 14e2e: 40 80 ld r4, Z 14e30: 51 80 ldd r5, Z+1 ; 0x01 14e32: 62 80 ldd r6, Z+2 ; 0x02 14e34: 73 80 ldd r7, Z+3 ; 0x03 14e36: a3 01 movw r20, r6 14e38: 92 01 movw r18, r4 14e3a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 14e3e: 18 16 cp r1, r24 14e40: 24 f0 brlt .+8 ; 0x14e4a 14e42: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 14e46: 2b 01 movw r4, r22 14e48: 3c 01 movw r6, r24 14e4a: d5 01 movw r26, r10 14e4c: 4d 92 st X+, r4 14e4e: 5d 92 st X+, r5 14e50: 6d 92 st X+, r6 14e52: 7c 92 st X, r7 14e54: 13 97 sbiw r26, 0x03 ; 3 14e56: b4 e0 ldi r27, 0x04 ; 4 14e58: ab 0e add r10, r27 14e5a: b1 1c adc r11, r1 14e5c: e4 e0 ldi r30, 0x04 ; 4 14e5e: ce 0e add r12, r30 14e60: d1 1c adc r13, r1 14e62: f4 e0 ldi r31, 0x04 ; 4 14e64: ef 0e add r14, r31 14e66: 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++) { 14e68: 80 16 cp r8, r16 14e6a: 91 06 cpc r9, r17 14e6c: 49 f6 brne .-110 ; 0x14e00 //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')) { 14e6e: 83 e5 ldi r24, 0x53 ; 83 14e70: 0e 94 8d 5c call 0xb91a ; 0xb91a 14e74: 88 23 and r24, r24 14e76: 11 f4 brne .+4 ; 0x14e7c 14e78: 0c 94 3c c6 jmp 0x18c78 ; 0x18c78 if ( code_value_uint8() == 0 ) { 14e7c: 0e 94 1f 5c call 0xb83e ; 0xb83e 14e80: 81 11 cpse r24, r1 14e82: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a pause_position[X_AXIS] = X_PAUSE_POS; 14e86: 80 e0 ldi r24, 0x00 ; 0 14e88: 90 e0 ldi r25, 0x00 ; 0 14e8a: a8 e4 ldi r26, 0x48 ; 72 14e8c: b2 e4 ldi r27, 0x42 ; 66 14e8e: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.496> 14e92: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.496+0x1> 14e96: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.496+0x2> 14e9a: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.496+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14e9e: 80 e0 ldi r24, 0x00 ; 0 14ea0: 90 e0 ldi r25, 0x00 ; 0 14ea2: ae e3 ldi r26, 0x3E ; 62 14ea4: b3 e4 ldi r27, 0x43 ; 67 14ea6: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.496+0x4> 14eaa: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.496+0x5> 14eae: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.496+0x6> 14eb2: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.496+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14eb6: 80 e0 ldi r24, 0x00 ; 0 14eb8: 90 e0 ldi r25, 0x00 ; 0 14eba: a0 ea ldi r26, 0xA0 ; 160 14ebc: b1 e4 ldi r27, 0x41 ; 65 14ebe: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.496+0x8> 14ec2: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.496+0x9> 14ec6: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.496+0xa> 14eca: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.496+0xb> 14ece: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14ed2: 8d 32 cpi r24, 0x2D ; 45 14ed4: 91 05 cpc r25, r1 14ed6: 11 f4 brne .+4 ; 0x14edc 14ed8: 0c 94 e4 b4 jmp 0x169c8 ; 0x169c8 14edc: 0c f0 brlt .+2 ; 0x14ee0 14ede: f0 c0 rjmp .+480 ; 0x150c0 14ee0: 8f 31 cpi r24, 0x1F ; 31 14ee2: 91 05 cpc r25, r1 14ee4: 11 f4 brne .+4 ; 0x14eea 14ee6: 0c 94 71 b4 jmp 0x168e2 ; 0x168e2 14eea: 0c f0 brlt .+2 ; 0x14eee 14eec: 6a c0 rjmp .+212 ; 0x14fc2 14eee: 8d 31 cpi r24, 0x1D ; 29 14ef0: 91 05 cpc r25, r1 14ef2: 11 f4 brne .+4 ; 0x14ef8 14ef4: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 14ef8: 4e 97 sbiw r24, 0x1e ; 30 14efa: 09 f0 breq .+2 ; 0x14efe 14efc: fb ce rjmp .-522 ; 0x14cf4 M30 [filename] */ case 30: if (card.mounted){ 14efe: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 14f02: 88 23 and r24, r24 14f04: 11 f4 brne .+4 ; 0x14f0a 14f06: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14f0a: 8b ef ldi r24, 0xFB ; 251 14f0c: 96 e1 ldi r25, 0x16 ; 22 14f0e: 0f 94 31 6e call 0x2dc62 ; 0x2dc62 file.close(); 14f12: 8b ef ldi r24, 0xFB ; 251 14f14: 96 e1 ldi r25, 0x16 ; 22 14f16: 0f 94 29 a4 call 0x34852 ; 0x34852 saving = false; 14f1a: 10 92 69 14 sts 0x1469, r1 ; 0x801469 logging = false; 14f1e: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a card.closefile(); card.removeFile(strchr_pointer + 4); 14f22: 00 91 93 03 lds r16, 0x0393 ; 0x800393 14f26: 10 91 94 03 lds r17, 0x0394 ; 0x800394 14f2a: 0c 5f subi r16, 0xFC ; 252 14f2c: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14f2e: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 14f32: 88 23 and r24, r24 14f34: 11 f4 brne .+4 ; 0x14f3a 14f36: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a file.close(); 14f3a: 8b ef ldi r24, 0xFB ; 251 14f3c: 96 e1 ldi r25, 0x16 ; 22 14f3e: 0f 94 29 a4 call 0x34852 ; 0x34852 sdprinting = false; 14f42: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b const char *fname=name; 14f46: 23 96 adiw r28, 0x03 ; 3 14f48: 1f af std Y+63, r17 ; 0x3f 14f4a: 0e af std Y+62, r16 ; 0x3e 14f4c: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 14f4e: ce 01 movw r24, r28 14f50: 8f 5b subi r24, 0xBF ; 191 14f52: 9f 4f sbci r25, 0xFF ; 255 14f54: 0f 94 31 7f call 0x2fe62 ; 0x2fe62 14f58: 88 23 and r24, r24 14f5a: 11 f4 brne .+4 ; 0x14f60 14f5c: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a return; if (file.remove(curDir, fname)) 14f60: 23 96 adiw r28, 0x03 ; 3 14f62: 4e ad ldd r20, Y+62 ; 0x3e 14f64: 5f ad ldd r21, Y+63 ; 0x3f 14f66: 23 97 sbiw r28, 0x03 ; 3 14f68: 60 91 14 15 lds r22, 0x1514 ; 0x801514 14f6c: 70 91 15 15 lds r23, 0x1515 ; 0x801515 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 14f70: 19 82 std Y+1, r1 ; 0x01 14f72: 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; 14f74: 22 e0 ldi r18, 0x02 ; 2 14f76: ce 01 movw r24, r28 14f78: 01 96 adiw r24, 0x01 ; 1 14f7a: 0f 94 f3 d6 call 0x3ade6 ; 0x3ade6 14f7e: 81 11 cpse r24, r1 14f80: 0c 94 47 b4 jmp 0x1688e ; 0x1688e return file.remove(); fail: // can't set iostate - static function return false; 14f84: 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; 14f86: ce 01 movw r24, r28 14f88: 01 96 adiw r24, 0x01 ; 1 14f8a: 0e 94 cd 78 call 0xf19a ; 0xf19a 14f8e: 11 23 and r17, r17 14f90: 11 f4 brne .+4 ; 0x14f96 14f92: 0c 94 61 b4 jmp 0x168c2 ; 0x168c2 { SERIAL_PROTOCOLPGM("File deleted:"); 14f96: 85 e1 ldi r24, 0x15 ; 21 14f98: 96 e8 ldi r25, 0x86 ; 134 14f9a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLLN(fname); 14f9e: 23 96 adiw r28, 0x03 ; 3 14fa0: 8e ad ldd r24, Y+62 ; 0x3e 14fa2: 9f ad ldd r25, Y+63 ; 0x3f 14fa4: 23 97 sbiw r28, 0x03 ; 3 14fa6: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 sdpos = 0; 14faa: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 14fae: 10 92 80 17 sts 0x1780, r1 ; 0x801780 14fb2: 10 92 81 17 sts 0x1781, r1 ; 0x801781 14fb6: 10 92 82 17 sts 0x1782, r1 ; 0x801782 #ifdef SDCARD_SORT_ALPHA presort(); 14fba: 0f 94 fd 7c call 0x2f9fa ; 0x2f9fa 14fbe: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14fc2: 8a 32 cpi r24, 0x2A ; 42 14fc4: 91 05 cpc r25, r1 14fc6: 11 f4 brne .+4 ; 0x14fcc 14fc8: 0c 94 98 b4 jmp 0x16930 ; 0x16930 14fcc: 8c 32 cpi r24, 0x2C ; 44 14fce: 91 05 cpc r25, r1 14fd0: 11 f4 brne .+4 ; 0x14fd6 14fd2: 0c 94 cb b4 jmp 0x16996 ; 0x16996 14fd6: 80 97 sbiw r24, 0x20 ; 32 14fd8: 09 f0 breq .+2 ; 0x14fdc 14fda: 8c ce rjmp .-744 ; 0x14cf4 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14fdc: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 14fe0: 81 11 cpse r24, r1 st_synchronize(); 14fe2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 14fe6: 00 91 93 03 lds r16, 0x0393 ; 0x800393 14fea: 10 91 94 03 lds r17, 0x0394 ; 0x800394 14fee: 0c 5f subi r16, 0xFC ; 252 14ff0: 1f 4f sbci r17, 0xFF ; 255 14ff2: 61 e2 ldi r22, 0x21 ; 33 14ff4: 70 e0 ldi r23, 0x00 ; 0 14ff6: c8 01 movw r24, r16 14ff8: 0f 94 9d e3 call 0x3c73a ; 0x3c73a if(namestartpos==NULL) 14ffc: 00 97 sbiw r24, 0x00 ; 0 14ffe: 19 f0 breq .+6 ; 0x15006 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 15000: 8c 01 movw r16, r24 15002: 0f 5f subi r16, 0xFF ; 255 15004: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 15006: 80 e5 ldi r24, 0x50 ; 80 15008: 0e 94 8d 5c call 0xb91a ; 0xb91a 1500c: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 1500e: 80 91 93 03 lds r24, 0x0393 ; 0x800393 15012: 90 91 94 03 lds r25, 0x0394 ; 0x800394 15016: 08 17 cp r16, r24 15018: 19 07 cpc r17, r25 1501a: 08 f4 brcc .+2 ; 0x1501e call_procedure=false; //false alert, 'P' found within filename 1501c: f1 2c mov r15, r1 if( card.mounted ) 1501e: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 15022: 88 23 and r24, r24 15024: 11 f4 brne .+4 ; 0x1502a 15026: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 1502a: 61 e0 ldi r22, 0x01 ; 1 1502c: 6f 25 eor r22, r15 1502e: c8 01 movw r24, r16 15030: 0f 94 b6 7f call 0x2ff6c ; 0x2ff6c if(code_seen('S')) 15034: 83 e5 ldi r24, 0x53 ; 83 15036: 0e 94 8d 5c call 0xb91a ; 0xb91a 1503a: 88 23 and r24, r24 1503c: 99 f0 breq .+38 ; 0x15064 if(strchr_pointer 15042: 90 91 94 03 lds r25, 0x0394 ; 0x800394 15046: 80 17 cp r24, r16 15048: 91 07 cpc r25, r17 1504a: 60 f4 brcc .+24 ; 0x15064 card.setIndex(code_value_long()); 1504c: 0e 94 39 5c call 0xb872 ; 0xb872 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 15050: 60 93 7f 17 sts 0x177F, r22 ; 0x80177f 15054: 70 93 80 17 sts 0x1780, r23 ; 0x801780 15058: 80 93 81 17 sts 0x1781, r24 ; 0x801781 1505c: 90 93 82 17 sts 0x1782, r25 ; 0x801782 15060: 0f 94 75 77 call 0x2eeea ; 0x2eeea SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 15064: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 15068: 88 23 and r24, r24 1506a: 31 f0 breq .+12 ; 0x15078 { sdprinting = true; 1506c: 81 e0 ldi r24, 0x01 ; 1 1506e: 80 93 6b 14 sts 0x146B, r24 ; 0x80146b 15072: 85 e0 ldi r24, 0x05 ; 5 15074: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> card.startFileprint(); if(!call_procedure) 15078: f1 10 cpse r15, r1 1507a: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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); }; 1507e: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 15082: 88 23 and r24, r24 15084: 61 f0 breq .+24 ; 0x1509e { if(!card.get_sdpos()) 15086: 80 91 7f 17 lds r24, 0x177F ; 0x80177f 1508a: 90 91 80 17 lds r25, 0x1780 ; 0x801780 1508e: a0 91 81 17 lds r26, 0x1781 ; 0x801781 15092: b0 91 82 17 lds r27, 0x1782 ; 0x801782 15096: 89 2b or r24, r25 15098: 8a 2b or r24, r26 1509a: 8b 2b or r24, r27 1509c: 69 f4 brne .+26 ; 0x150b8 { // A new print has started from scratch, reset stats failstats_reset_print(); 1509e: 0e 94 db 5c call 0xb9b6 ; 0xb9b6 sdpos_atomic = 0; 150a2: 10 92 80 03 sts 0x0380, r1 ; 0x800380 150a6: 10 92 81 03 sts 0x0381, r1 ; 0x800381 150aa: 10 92 82 03 sts 0x0382, r1 ; 0x800382 150ae: 10 92 83 03 sts 0x0383, r1 ; 0x800383 150b2: 80 e0 ldi r24, 0x00 ; 0 150b4: 0e 94 53 83 call 0x106a6 ; 0x106a6 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 150b8: 0f 94 86 58 call 0x2b10c ; 0x2b10c 150bc: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 150c0: 89 34 cpi r24, 0x49 ; 73 150c2: 91 05 cpc r25, r1 150c4: 11 f4 brne .+4 ; 0x150ca 150c6: 0c 94 28 b5 jmp 0x16a50 ; 0x16a50 150ca: f4 f4 brge .+60 ; 0x15108 150cc: 8e 32 cpi r24, 0x2E ; 46 150ce: 91 05 cpc r25, r1 150d0: 11 f4 brne .+4 ; 0x150d6 150d2: 0c 94 ea b4 jmp 0x169d4 ; 0x169d4 150d6: 88 34 cpi r24, 0x48 ; 72 150d8: 91 05 cpc r25, r1 150da: 09 f0 breq .+2 ; 0x150de 150dc: 0b ce rjmp .-1002 ; 0x14cf4 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 150de: 83 e5 ldi r24, 0x53 ; 83 150e0: 0e 94 8d 5c call 0xb91a ; 0xb91a 150e4: 88 23 and r24, r24 150e6: 11 f4 brne .+4 ; 0x150ec 150e8: 0c 94 19 b5 jmp 0x16a32 ; 0x16a32 switch (code_value_uint8()){ 150ec: 0e 94 1f 5c call 0xb83e ; 0xb83e 150f0: 88 23 and r24, r24 150f2: 11 f4 brne .+4 ; 0x150f8 150f4: 0c 94 16 b5 jmp 0x16a2c ; 0x16a2c 150f8: 81 30 cpi r24, 0x01 ; 1 150fa: 11 f0 breq .+4 ; 0x15100 150fc: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 15100: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 15104: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15108: 8c 34 cpi r24, 0x4C ; 76 1510a: 91 05 cpc r25, r1 1510c: 11 f4 brne .+4 ; 0x15112 1510e: 0c 94 c8 b5 jmp 0x16b90 ; 0x16b90 15112: 14 f0 brlt .+4 ; 0x15118 15114: 0c 94 db b5 jmp 0x16bb6 ; 0x16bb6 15118: 8b 34 cpi r24, 0x4B ; 75 1511a: 91 05 cpc r25, r1 1511c: 09 f0 breq .+2 ; 0x15120 1511e: ea cd rjmp .-1068 ; 0x14cf4 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 15120: 0f 94 4f 16 call 0x22c9e ; 0x22c9e 15124: 88 23 and r24, r24 15126: 11 f4 brne .+4 ; 0x1512c 15128: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 1512c: c5 cf rjmp .-118 ; 0x150b8 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1512e: 8e 36 cpi r24, 0x6E ; 110 15130: 91 05 cpc r25, r1 15132: 11 f4 brne .+4 ; 0x15138 15134: 0c 94 8a b8 jmp 0x17114 ; 0x17114 15138: 0c f0 brlt .+2 ; 0x1513c 1513a: 86 c0 rjmp .+268 ; 0x15248 1513c: 86 35 cpi r24, 0x56 ; 86 1513e: 91 05 cpc r25, r1 15140: 11 f4 brne .+4 ; 0x15146 15142: 0c 94 e5 b7 jmp 0x16fca ; 0x16fca 15146: d4 f5 brge .+116 ; 0x151bc 15148: 83 35 cpi r24, 0x53 ; 83 1514a: 91 05 cpc r25, r1 1514c: 11 f4 brne .+4 ; 0x15152 1514e: 0c 94 8f b7 jmp 0x16f1e ; 0x16f1e 15152: 84 f4 brge .+32 ; 0x15174 15154: 8f 34 cpi r24, 0x4F ; 79 15156: 91 05 cpc r25, r1 15158: 11 f4 brne .+4 ; 0x1515e 1515a: 0c 94 4b b6 jmp 0x16c96 ; 0x16c96 1515e: 82 35 cpi r24, 0x52 ; 82 15160: 91 05 cpc r25, r1 15162: 09 f0 breq .+2 ; 0x15166 15164: c7 cd rjmp .-1138 ; 0x14cf4 /*! ### 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; 15166: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 1516a: 87 7f andi r24, 0xF7 ; 247 1516c: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd 15170: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15174: 84 35 cpi r24, 0x54 ; 84 15176: 91 05 cpc r25, r1 15178: 11 f4 brne .+4 ; 0x1517e 1517a: 0c 94 95 b7 jmp 0x16f2a ; 0x16f2a 1517e: 85 35 cpi r24, 0x55 ; 85 15180: 91 05 cpc r25, r1 15182: 09 f0 breq .+2 ; 0x15186 15184: b7 cd rjmp .-1170 ; 0x14cf4 #### 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')) { 15186: 83 e5 ldi r24, 0x53 ; 83 15188: 0e 94 8d 5c call 0xb91a ; 0xb91a 1518c: 88 23 and r24, r24 1518e: 11 f4 brne .+4 ; 0x15194 15190: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a max_inactive_time = code_value() * 1000; 15194: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15198: 20 e0 ldi r18, 0x00 ; 0 1519a: 30 e0 ldi r19, 0x00 ; 0 1519c: 4a e7 ldi r20, 0x7A ; 122 1519e: 54 e4 ldi r21, 0x44 ; 68 151a0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 151a4: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 151a8: 60 93 7c 03 sts 0x037C, r22 ; 0x80037c 151ac: 70 93 7d 03 sts 0x037D, r23 ; 0x80037d 151b0: 80 93 7e 03 sts 0x037E, r24 ; 0x80037e 151b4: 90 93 7f 03 sts 0x037F, r25 ; 0x80037f 151b8: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151bc: 89 36 cpi r24, 0x69 ; 105 151be: 91 05 cpc r25, r1 151c0: 11 f4 brne .+4 ; 0x151c6 151c2: 0c 94 a7 b6 jmp 0x16d4e ; 0x16d4e 151c6: d4 f4 brge .+52 ; 0x151fc 151c8: 8c 35 cpi r24, 0x5C ; 92 151ca: 91 05 cpc r25, r1 151cc: 11 f4 brne .+4 ; 0x151d2 151ce: 0c 94 02 b8 jmp 0x17004 ; 0x17004 151d2: 88 36 cpi r24, 0x68 ; 104 151d4: 91 05 cpc r25, r1 151d6: 09 f0 breq .+2 ; 0x151da 151d8: 8d cd rjmp .-1254 ; 0x14cf4 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 151da: 83 e5 ldi r24, 0x53 ; 83 151dc: 0e 94 8d 5c call 0xb91a ; 0xb91a 151e0: 88 23 and r24, r24 151e2: 11 f4 brne .+4 ; 0x151e8 151e4: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { setTargetHotend(code_value()); 151e8: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 151ec: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 151f0: 70 93 6b 0e sts 0x0E6B, r23 ; 0x800e6b 151f4: 60 93 6a 0e sts 0x0E6A, r22 ; 0x800e6a 151f8: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151fc: 8b 36 cpi r24, 0x6B ; 107 151fe: 91 05 cpc r25, r1 15200: 11 f4 brne .+4 ; 0x15206 15202: 0c 94 8c b7 jmp 0x16f18 ; 0x16f18 15206: 14 f4 brge .+4 ; 0x1520c 15208: 0c 94 7e b7 jmp 0x16efc ; 0x16efc 1520c: 8d 36 cpi r24, 0x6D ; 109 1520e: 91 05 cpc r25, r1 15210: 09 f0 breq .+2 ; 0x15214 15212: 70 cd rjmp .-1312 ; 0x14cf4 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)); 15214: 8c e0 ldi r24, 0x0C ; 12 15216: 9a e4 ldi r25, 0x4A ; 74 15218: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1521c: 0f 94 be 0b call 0x2177c ; 0x2177c heating_status = HeatingStatus::EXTRUDER_HEATING; 15220: 81 e0 ldi r24, 0x01 ; 1 15222: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 15226: 83 e5 ldi r24, 0x53 ; 83 15228: 0e 94 8d 5c call 0xb91a ; 0xb91a 1522c: 88 23 and r24, r24 1522e: 11 f4 brne .+4 ; 0x15234 15230: 0c 94 bb b6 jmp 0x16d76 ; 0x16d76 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 15234: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15238: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 1523c: 70 93 6b 0e sts 0x0E6B, r23 ; 0x800e6b 15240: 60 93 6a 0e sts 0x0E6A, r22 ; 0x800e6a 15244: 0c 94 c1 b6 jmp 0x16d82 ; 0x16d82 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15248: 87 37 cpi r24, 0x77 ; 119 1524a: 91 05 cpc r25, r1 1524c: 11 f4 brne .+4 ; 0x15252 1524e: 0c 94 cf b9 jmp 0x1739e ; 0x1739e 15252: ac f5 brge .+106 ; 0x152be 15254: 82 37 cpi r24, 0x72 ; 114 15256: 91 05 cpc r25, r1 15258: 11 f4 brne .+4 ; 0x1525e 1525a: 0c 94 84 b9 jmp 0x17308 ; 0x17308 1525e: b4 f4 brge .+44 ; 0x1528c 15260: 80 37 cpi r24, 0x70 ; 112 15262: 91 05 cpc r25, r1 15264: 11 f4 brne .+4 ; 0x1526a 15266: 0c 94 94 b6 jmp 0x16d28 ; 0x16d28 1526a: 81 37 cpi r24, 0x71 ; 113 1526c: 91 05 cpc r25, r1 1526e: 09 f0 breq .+2 ; 0x15272 15270: 41 cd rjmp .-1406 ; 0x14cf4 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 15272: 83 e5 ldi r24, 0x53 ; 83 15274: 0e 94 8d 5c call 0xb91a ; 0xb91a 15278: 88 23 and r24, r24 1527a: 11 f4 brne .+4 ; 0x15280 1527c: 0c 94 9b b8 jmp 0x17136 ; 0x17136 host_keepalive_interval = code_value_uint8(); 15280: 0e 94 1f 5c call 0xb83e ; 0xb83e 15284: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 15288: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1528c: 85 37 cpi r24, 0x75 ; 117 1528e: 91 05 cpc r25, r1 15290: 11 f4 brne .+4 ; 0x15296 15292: 0c 94 87 b9 jmp 0x1730e ; 0x1730e 15296: 14 f0 brlt .+4 ; 0x1529c 15298: 0c 94 97 b9 jmp 0x1732e ; 0x1732e 1529c: 83 37 cpi r24, 0x73 ; 115 1529e: 91 05 cpc r25, r1 152a0: 09 f0 breq .+2 ; 0x152a4 152a2: 28 cd rjmp .-1456 ; 0x14cf4 #### 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')) { 152a4: 86 e5 ldi r24, 0x56 ; 86 152a6: 0e 94 8d 5c call 0xb91a ; 0xb91a 152aa: 88 23 and r24, r24 152ac: 11 f4 brne .+4 ; 0x152b2 152ae: 0c 94 b0 b8 jmp 0x17160 ; 0x17160 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 152b2: 86 ef ldi r24, 0xF6 ; 246 152b4: 95 e8 ldi r25, 0x85 ; 133 152b6: 0e 94 17 7b call 0xf62e ; 0xf62e 152ba: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 152be: 8c 38 cpi r24, 0x8C ; 140 152c0: 91 05 cpc r25, r1 152c2: 11 f4 brne .+4 ; 0x152c8 152c4: 0c 94 98 b6 jmp 0x16d30 ; 0x16d30 152c8: 54 f4 brge .+20 ; 0x152de 152ca: 8b 37 cpi r24, 0x7B ; 123 152cc: 91 05 cpc r25, r1 152ce: 11 f4 brne .+4 ; 0x152d4 152d0: 0c 94 34 ba jmp 0x17468 ; 0x17468 152d4: 8d 37 cpi r24, 0x7D ; 125 152d6: 91 05 cpc r25, r1 152d8: 09 f4 brne .+2 ; 0x152dc 152da: 80 cd rjmp .-1280 ; 0x14ddc 152dc: 0b cd rjmp .-1514 ; 0x14cf4 152de: 8e 3b cpi r24, 0xBE ; 190 152e0: 91 05 cpc r25, r1 152e2: 11 f4 brne .+4 ; 0x152e8 152e4: 0c 94 f1 b6 jmp 0x16de2 ; 0x16de2 152e8: 88 3c cpi r24, 0xC8 ; 200 152ea: 91 05 cpc r25, r1 152ec: 11 f4 brne .+4 ; 0x152f2 152ee: 0c 94 37 ba jmp 0x1746e ; 0x1746e 152f2: 8b 39 cpi r24, 0x9B ; 155 152f4: 91 05 cpc r25, r1 152f6: 09 f0 breq .+2 ; 0x152fa 152f8: fd cc rjmp .-1542 ; 0x14cf4 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 152fa: 83 e5 ldi r24, 0x53 ; 83 152fc: 0e 94 8d 5c call 0xb91a ; 0xb91a 15300: 88 23 and r24, r24 15302: 61 f0 breq .+24 ; 0x1531c autoReportFeatures.SetPeriod( code_value_uint8() ); 15304: 0e 94 1f 5c call 0xb83e ; 0xb83e 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; 15308: 80 93 63 14 sts 0x1463, r24 ; 0x801463 if (auto_report_period != 0){ 1530c: 88 23 and r24, r24 1530e: 11 f4 brne .+4 ; 0x15314 15310: 0c 94 b3 b6 jmp 0x16d66 ; 0x16d66 auto_report_timer.start(); 15314: 84 e6 ldi r24, 0x64 ; 100 15316: 94 e1 ldi r25, 0x14 ; 20 15318: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 1531c: 83 e4 ldi r24, 0x43 ; 67 1531e: 0e 94 8d 5c call 0xb91a ; 0xb91a 15322: 88 23 and r24, r24 15324: 11 f4 brne .+4 ; 0x1532a 15326: 0c 94 b7 b6 jmp 0x16d6e ; 0x16d6e autoReportFeatures.SetMask(code_value_uint8()); 1532a: 0e 94 1f 5c call 0xb83e ; 0xb83e 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; } 1532e: 80 93 62 14 sts 0x1462, r24 ; 0x801462 15332: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15336: 85 3f cpi r24, 0xF5 ; 245 15338: f1 e0 ldi r31, 0x01 ; 1 1533a: 9f 07 cpc r25, r31 1533c: 11 f4 brne .+4 ; 0x15342 1533e: 0c 94 21 c2 jmp 0x18442 ; 0x18442 15342: 0c f0 brlt .+2 ; 0x15346 15344: 60 c4 rjmp .+2240 ; 0x15c06 15346: 81 15 cp r24, r1 15348: 31 e0 ldi r19, 0x01 ; 1 1534a: 93 07 cpc r25, r19 1534c: 11 f4 brne .+4 ; 0x15352 1534e: 0c 94 a3 bd jmp 0x17b46 ; 0x17b46 15352: 0c f0 brlt .+2 ; 0x15356 15354: 24 c1 rjmp .+584 ; 0x1559e 15356: 80 3d cpi r24, 0xD0 ; 208 15358: 91 05 cpc r25, r1 1535a: 11 f4 brne .+4 ; 0x15360 1535c: 0c 94 e6 bb jmp 0x177cc ; 0x177cc 15360: 0c f0 brlt .+2 ; 0x15364 15362: 77 c0 rjmp .+238 ; 0x15452 15364: 8d 3c cpi r24, 0xCD ; 205 15366: 91 05 cpc r25, r1 15368: 11 f4 brne .+4 ; 0x1536e 1536a: 0c 94 50 bb jmp 0x176a0 ; 0x176a0 1536e: ac f5 brge .+106 ; 0x153da 15370: 8b 3c cpi r24, 0xCB ; 203 15372: 91 05 cpc r25, r1 15374: 11 f4 brne .+4 ; 0x1537a 15376: 0c 94 c7 ba jmp 0x1758e ; 0x1758e 1537a: 8c 3c cpi r24, 0xCC ; 204 1537c: 91 05 cpc r25, r1 1537e: 09 f0 breq .+2 ; 0x15382 15380: b9 cc rjmp .-1678 ; 0x14cf4 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 15382: 83 e5 ldi r24, 0x53 ; 83 15384: 0e 94 8d 5c call 0xb91a ; 0xb91a 15388: 88 23 and r24, r24 1538a: 11 f4 brne .+4 ; 0x15390 1538c: 0c 94 1f bb jmp 0x1763e ; 0x1763e // 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(); 15390: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15394: 60 93 2b 07 sts 0x072B, r22 ; 0x80072b 15398: 70 93 2c 07 sts 0x072C, r23 ; 0x80072c 1539c: 80 93 2d 07 sts 0x072D, r24 ; 0x80072d 153a0: 90 93 2e 07 sts 0x072E, r25 ; 0x80072e 153a4: 60 93 9f 06 sts 0x069F, r22 ; 0x80069f 153a8: 70 93 a0 06 sts 0x06A0, r23 ; 0x8006a0 153ac: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 153b0: 90 93 a2 06 sts 0x06A2, r25 ; 0x8006a2 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 153b4: 84 e5 ldi r24, 0x54 ; 84 153b6: 0e 94 8d 5c call 0xb91a ; 0xb91a 153ba: 88 23 and r24, r24 153bc: 11 f4 brne .+4 ; 0x153c2 153be: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a cs.retract_acceleration = code_value(); 153c2: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 153c6: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 153ca: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 153ce: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 153d2: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 153d6: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 153da: 8e 3c cpi r24, 0xCE ; 206 153dc: 91 05 cpc r25, r1 153de: 11 f4 brne .+4 ; 0x153e4 153e0: 0c 94 c9 bb jmp 0x17792 ; 0x17792 153e4: 8f 3c cpi r24, 0xCF ; 207 153e6: 91 05 cpc r25, r1 153e8: 09 f0 breq .+2 ; 0x153ec 153ea: 84 cc rjmp .-1784 ; 0x14cf4 - `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')) 153ec: 83 e5 ldi r24, 0x53 ; 83 153ee: 0e 94 8d 5c call 0xb91a ; 0xb91a 153f2: 88 23 and r24, r24 153f4: 51 f0 breq .+20 ; 0x1540a { cs.retract_length = code_value() ; 153f6: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 153fa: 60 93 ee 06 sts 0x06EE, r22 ; 0x8006ee 153fe: 70 93 ef 06 sts 0x06EF, r23 ; 0x8006ef 15402: 80 93 f0 06 sts 0x06F0, r24 ; 0x8006f0 15406: 90 93 f1 06 sts 0x06F1, r25 ; 0x8006f1 } if(code_seen('F')) 1540a: 86 e4 ldi r24, 0x46 ; 70 1540c: 0e 94 8d 5c call 0xb91a ; 0xb91a 15410: 88 23 and r24, r24 15412: 61 f0 breq .+24 ; 0x1542c { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 15414: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15418: 0e 94 8d 67 call 0xcf1a ; 0xcf1a 1541c: 60 93 f2 06 sts 0x06F2, r22 ; 0x8006f2 15420: 70 93 f3 06 sts 0x06F3, r23 ; 0x8006f3 15424: 80 93 f4 06 sts 0x06F4, r24 ; 0x8006f4 15428: 90 93 f5 06 sts 0x06F5, r25 ; 0x8006f5 } if(code_seen('Z')) 1542c: 8a e5 ldi r24, 0x5A ; 90 1542e: 0e 94 8d 5c call 0xb91a ; 0xb91a 15432: 88 23 and r24, r24 15434: 11 f4 brne .+4 ; 0x1543a 15436: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { cs.retract_zlift = code_value() ; 1543a: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1543e: 60 93 f6 06 sts 0x06F6, r22 ; 0x8006f6 15442: 70 93 f7 06 sts 0x06F7, r23 ; 0x8006f7 15446: 80 93 f8 06 sts 0x06F8, r24 ; 0x8006f8 1544a: 90 93 f9 06 sts 0x06F9, r25 ; 0x8006f9 1544e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15452: 8c 3d cpi r24, 0xDC ; 220 15454: 91 05 cpc r25, r1 15456: 11 f4 brne .+4 ; 0x1545c 15458: 0c 94 4d bc jmp 0x1789a ; 0x1789a 1545c: 0c f0 brlt .+2 ; 0x15460 1545e: 82 c0 rjmp .+260 ; 0x15564 15460: 81 3d cpi r24, 0xD1 ; 209 15462: 91 05 cpc r25, r1 15464: 11 f4 brne .+4 ; 0x1546a 15466: 0c 94 0a bc jmp 0x17814 ; 0x17814 1546a: 86 3d cpi r24, 0xD6 ; 214 1546c: 91 05 cpc r25, r1 1546e: 09 f0 breq .+2 ; 0x15472 15470: 41 cc rjmp .-1918 ; 0x14cf4 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; 15472: 80 e5 ldi r24, 0x50 ; 80 15474: 0e 94 8d 5c call 0xb91a ; 0xb91a 15478: 88 23 and r24, r24 1547a: 11 f4 brne .+4 ; 0x15480 1547c: 0c 94 39 bc jmp 0x17872 ; 0x17872 15480: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15484: 2b 01 movw r4, r22 15486: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 15488: 83 e5 ldi r24, 0x53 ; 83 1548a: 0e 94 8d 5c call 0xb91a ; 0xb91a 1548e: 88 23 and r24, r24 15490: 11 f4 brne .+4 ; 0x15496 15492: 0c 94 43 bc jmp 0x17886 ; 0x17886 15496: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1549a: 4b 01 movw r8, r22 1549c: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 1549e: 8e e4 ldi r24, 0x4E ; 78 154a0: 0e 94 8d 5c call 0xb91a ; 0xb91a 154a4: d0 90 37 07 lds r13, 0x0737 ; 0x800737 154a8: 88 23 and r24, r24 154aa: 29 f0 breq .+10 ; 0x154b6 154ac: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 154b0: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 154b4: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 154b6: 82 e5 ldi r24, 0x52 ; 82 154b8: 0e 94 8d 5c call 0xb91a ; 0xb91a 154bc: e0 90 38 07 lds r14, 0x0738 ; 0x800738 154c0: f0 90 39 07 lds r15, 0x0739 ; 0x800739 154c4: 88 23 and r24, r24 154c6: 29 f0 breq .+10 ; 0x154d2 154c8: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 154cc: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 154d0: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 154d2: 86 e4 ldi r24, 0x46 ; 70 154d4: 0e 94 8d 5c call 0xb91a ; 0xb91a 154d8: 00 91 3a 07 lds r16, 0x073A ; 0x80073a 154dc: 10 91 3b 07 lds r17, 0x073B ; 0x80073b 154e0: 88 23 and r24, r24 154e2: 29 f0 breq .+10 ; 0x154ee 154e4: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 154e8: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 154ec: 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) 154ee: 20 e0 ldi r18, 0x00 ; 0 154f0: 30 e0 ldi r19, 0x00 ; 0 154f2: a9 01 movw r20, r18 154f4: c3 01 movw r24, r6 154f6: b2 01 movw r22, r4 154f8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 154fc: 18 16 cp r1, r24 154fe: 14 f0 brlt .+4 ; 0x15504 15500: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 15504: 20 e0 ldi r18, 0x00 ; 0 15506: 30 e0 ldi r19, 0x00 ; 0 15508: a9 01 movw r20, r18 1550a: c5 01 movw r24, r10 1550c: b4 01 movw r22, r8 1550e: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 15512: 87 ff sbrs r24, 7 15514: 02 c0 rjmp .+4 ; 0x1551a 15516: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 1551a: a5 01 movw r20, r10 1551c: 94 01 movw r18, r8 1551e: c3 01 movw r24, r6 15520: b2 01 movw r22, r4 15522: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 15526: 87 ff sbrs r24, 7 15528: 02 c0 rjmp .+4 ; 0x1552e 1552a: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 1552e: 40 92 2f 07 sts 0x072F, r4 ; 0x80072f 15532: 50 92 30 07 sts 0x0730, r5 ; 0x800730 15536: 60 92 31 07 sts 0x0731, r6 ; 0x800731 1553a: 70 92 32 07 sts 0x0732, r7 ; 0x800732 cs.min_mm_per_arc_segment = s; 1553e: 80 92 33 07 sts 0x0733, r8 ; 0x800733 15542: 90 92 34 07 sts 0x0734, r9 ; 0x800734 15546: a0 92 35 07 sts 0x0735, r10 ; 0x800735 1554a: b0 92 36 07 sts 0x0736, r11 ; 0x800736 cs.n_arc_correction = n; 1554e: d0 92 37 07 sts 0x0737, r13 ; 0x800737 cs.min_arc_segments = r; 15552: f0 92 39 07 sts 0x0739, r15 ; 0x800739 15556: e0 92 38 07 sts 0x0738, r14 ; 0x800738 cs.arc_segments_per_sec = f; 1555a: 10 93 3b 07 sts 0x073B, r17 ; 0x80073b 1555e: 00 93 3a 07 sts 0x073A, r16 ; 0x80073a 15562: f3 c7 rjmp .+4070 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15564: 82 3e cpi r24, 0xE2 ; 226 15566: 91 05 cpc r25, r1 15568: 11 f4 brne .+4 ; 0x1556e 1556a: 0c 94 9e bc jmp 0x1793c ; 0x1793c 1556e: 80 3f cpi r24, 0xF0 ; 240 15570: 91 05 cpc r25, r1 15572: 09 f4 brne .+2 ; 0x15576 15574: ea c7 rjmp .+4052 ; 0x1654a 15576: 8d 3d cpi r24, 0xDD ; 221 15578: 91 05 cpc r25, r1 1557a: 09 f0 breq .+2 ; 0x1557e 1557c: bb cb rjmp .-2186 ; 0x14cf4 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 1557e: 83 e5 ldi r24, 0x53 ; 83 15580: 0e 94 8d 5c call 0xb91a ; 0xb91a 15584: 88 23 and r24, r24 15586: 11 f4 brne .+4 ; 0x1558c 15588: 0c 94 8c bc jmp 0x17918 ; 0x17918 { extrudemultiply = code_value_short(); 1558c: 0e 94 2c 5c call 0xb858 ; 0xb858 15590: 90 93 95 02 sts 0x0295, r25 ; 0x800295 15594: 80 93 94 02 sts 0x0294, r24 ; 0x800294 calculate_extruder_multipliers(); 15598: 0e 94 7f 66 call 0xccfe ; 0xccfe 1559c: d6 c7 rjmp .+4012 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1559e: 8e 35 cpi r24, 0x5E ; 94 155a0: 51 e0 ldi r21, 0x01 ; 1 155a2: 95 07 cpc r25, r21 155a4: 11 f4 brne .+4 ; 0x155aa 155a6: 0c 94 d0 cb jmp 0x197a0 ; 0x197a0 155aa: 0c f0 brlt .+2 ; 0x155ae 155ac: ec c2 rjmp .+1496 ; 0x15b86 155ae: 8e 32 cpi r24, 0x2E ; 46 155b0: b1 e0 ldi r27, 0x01 ; 1 155b2: 9b 07 cpc r25, r27 155b4: 11 f4 brne .+4 ; 0x155ba 155b6: 0c 94 01 be jmp 0x17c02 ; 0x17c02 155ba: 0c f0 brlt .+2 ; 0x155be 155bc: 82 c0 rjmp .+260 ; 0x156c2 155be: 8c 32 cpi r24, 0x2C ; 44 155c0: f1 e0 ldi r31, 0x01 ; 1 155c2: 9f 07 cpc r25, r31 155c4: 11 f4 brne .+4 ; 0x155ca 155c6: 0c 94 f7 bc jmp 0x179ee ; 0x179ee 155ca: 8d 32 cpi r24, 0x2D ; 45 155cc: 91 40 sbci r25, 0x01 ; 1 155ce: 09 f0 breq .+2 ; 0x155d2 155d0: 91 cb rjmp .-2270 ; 0x14cf4 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 155d2: 80 e5 ldi r24, 0x50 ; 80 155d4: 0e 94 8d 5c call 0xb91a ; 0xb91a 155d8: 88 23 and r24, r24 155da: 51 f0 breq .+20 ; 0x155f0 155dc: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 155e0: 60 93 d3 06 sts 0x06D3, r22 ; 0x8006d3 155e4: 70 93 d4 06 sts 0x06D4, r23 ; 0x8006d4 155e8: 80 93 d5 06 sts 0x06D5, r24 ; 0x8006d5 155ec: 90 93 d6 06 sts 0x06D6, r25 ; 0x8006d6 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 155f0: 89 e4 ldi r24, 0x49 ; 73 155f2: 0e 94 8d 5c call 0xb91a ; 0xb91a 155f6: 88 23 and r24, r24 155f8: 81 f0 breq .+32 ; 0x1561a 155fa: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 155fe: 2c ea ldi r18, 0xAC ; 172 15600: 35 ec ldi r19, 0xC5 ; 197 15602: 47 e2 ldi r20, 0x27 ; 39 15604: 5e e3 ldi r21, 0x3E ; 62 15606: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1560a: 60 93 d7 06 sts 0x06D7, r22 ; 0x8006d7 1560e: 70 93 d8 06 sts 0x06D8, r23 ; 0x8006d8 15612: 80 93 d9 06 sts 0x06D9, r24 ; 0x8006d9 15616: 90 93 da 06 sts 0x06DA, r25 ; 0x8006da if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 1561a: 84 e4 ldi r24, 0x44 ; 68 1561c: 0e 94 8d 5c call 0xb91a ; 0xb91a 15620: 88 23 and r24, r24 15622: 81 f0 breq .+32 ; 0x15644 15624: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 } float unscalePID_i(float i) { return i/PID_dT; 15628: 2c ea ldi r18, 0xAC ; 172 1562a: 35 ec ldi r19, 0xC5 ; 197 1562c: 47 e2 ldi r20, 0x27 ; 39 1562e: 5e e3 ldi r21, 0x3E ; 62 15630: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 15634: 60 93 db 06 sts 0x06DB, r22 ; 0x8006db 15638: 70 93 dc 06 sts 0x06DC, r23 ; 0x8006dc 1563c: 80 93 dd 06 sts 0x06DD, r24 ; 0x8006dd 15640: 90 93 de 06 sts 0x06DE, r25 ; 0x8006de updatePID(); 15644: 0f 94 e3 50 call 0x2a1c6 ; 0x2a1c6 SERIAL_PROTOCOLRPGM(MSG_OK); 15648: 84 e4 ldi r24, 0x44 ; 68 1564a: 9e e6 ldi r25, 0x6E ; 110 1564c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLPGM(" p:"); 15650: 8a ec ldi r24, 0xCA ; 202 15652: 97 e8 ldi r25, 0x87 ; 135 15654: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15658: 60 91 d3 06 lds r22, 0x06D3 ; 0x8006d3 1565c: 70 91 d4 06 lds r23, 0x06D4 ; 0x8006d4 15660: 80 91 d5 06 lds r24, 0x06D5 ; 0x8006d5 15664: 90 91 d6 06 lds r25, 0x06D6 ; 0x8006d6 15668: 42 e0 ldi r20, 0x02 ; 2 1566a: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 1566e: 86 ec ldi r24, 0xC6 ; 198 15670: 97 e8 ldi r25, 0x87 ; 135 15672: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 15676: 2c ea ldi r18, 0xAC ; 172 15678: 35 ec ldi r19, 0xC5 ; 197 1567a: 47 e2 ldi r20, 0x27 ; 39 1567c: 5e e3 ldi r21, 0x3E ; 62 1567e: 60 91 d7 06 lds r22, 0x06D7 ; 0x8006d7 15682: 70 91 d8 06 lds r23, 0x06D8 ; 0x8006d8 15686: 80 91 d9 06 lds r24, 0x06D9 ; 0x8006d9 1568a: 90 91 da 06 lds r25, 0x06DA ; 0x8006da 1568e: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 15692: 42 e0 ldi r20, 0x02 ; 2 15694: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 15698: 82 ec ldi r24, 0xC2 ; 194 1569a: 97 e8 ldi r25, 0x87 ; 135 1569c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 156a0: 2c ea ldi r18, 0xAC ; 172 156a2: 35 ec ldi r19, 0xC5 ; 197 156a4: 47 e2 ldi r20, 0x27 ; 39 156a6: 5e e3 ldi r21, 0x3E ; 62 156a8: 60 91 db 06 lds r22, 0x06DB ; 0x8006db 156ac: 70 91 dc 06 lds r23, 0x06DC ; 0x8006dc 156b0: 80 91 dd 06 lds r24, 0x06DD ; 0x8006dd 156b4: 90 91 de 06 lds r25, 0x06DE ; 0x8006de 156b8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 156bc: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a 156c0: 44 c7 rjmp .+3720 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 156c2: 80 33 cpi r24, 0x30 ; 48 156c4: 31 e0 ldi r19, 0x01 ; 1 156c6: 93 07 cpc r25, r19 156c8: 11 f4 brne .+4 ; 0x156ce 156ca: 0c 94 2a bd jmp 0x17a54 ; 0x17a54 156ce: 14 f4 brge .+4 ; 0x156d4 156d0: 0c 94 11 be jmp 0x17c22 ; 0x17c22 156d4: 86 33 cpi r24, 0x36 ; 54 156d6: 91 40 sbci r25, 0x01 ; 1 156d8: 09 f0 breq .+2 ; 0x156dc 156da: 0c cb rjmp .-2536 ; 0x14cf4 { // 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(); 156dc: 89 e4 ldi r24, 0x49 ; 73 156de: 0e 94 8d 5c call 0xb91a ; 0xb91a 156e2: 88 23 and r24, r24 156e4: 11 f4 brne .+4 ; 0x156ea 156e6: 0c 94 44 be jmp 0x17c88 ; 0x17c88 156ea: 0e 94 2c 5c call 0xb858 ; 0xb858 156ee: ab 96 adiw r28, 0x2b ; 43 156f0: 8f af std Y+63, r24 ; 0x3f 156f2: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 156f4: 82 e5 ldi r24, 0x52 ; 82 156f6: 0e 94 8d 5c call 0xb91a ; 0xb91a 156fa: 88 23 and r24, r24 156fc: 11 f4 brne .+4 ; 0x15702 156fe: 0c 94 4a be jmp 0x17c94 ; 0x17c94 15702: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15706: e2 96 adiw r28, 0x32 ; 50 15708: 6c af std Y+60, r22 ; 0x3c 1570a: 7d af std Y+61, r23 ; 0x3d 1570c: 8e af std Y+62, r24 ; 0x3e 1570e: 9f af std Y+63, r25 ; 0x3f 15710: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 15712: 80 e5 ldi r24, 0x50 ; 80 15714: 0e 94 8d 5c call 0xb91a ; 0xb91a - `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; 15718: c1 2c mov r12, r1 1571a: d1 2c mov r13, r1 1571c: 60 ec ldi r22, 0xC0 ; 192 1571e: e6 2e mov r14, r22 15720: 6f e7 ldi r22, 0x7F ; 127 15722: 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(); 15724: 88 23 and r24, r24 15726: 21 f0 breq .+8 ; 0x15730 15728: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1572c: 6b 01 movw r12, r22 1572e: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 15730: 85 e5 ldi r24, 0x55 ; 85 15732: 0e 94 8d 5c call 0xb91a ; 0xb91a 15736: 88 23 and r24, r24 15738: 11 f4 brne .+4 ; 0x1573e 1573a: 0c 94 56 be jmp 0x17cac ; 0x17cac 1573e: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15742: 6e 96 adiw r28, 0x1e ; 30 15744: 6c af std Y+60, r22 ; 0x3c 15746: 7d af std Y+61, r23 ; 0x3d 15748: 8e af std Y+62, r24 ; 0x3e 1574a: 9f af std Y+63, r25 ; 0x3f 1574c: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 1574e: 86 e5 ldi r24, 0x56 ; 86 15750: 0e 94 8d 5c call 0xb91a ; 0xb91a 15754: 88 23 and r24, r24 15756: 11 f4 brne .+4 ; 0x1575c 15758: 0c 94 62 be jmp 0x17cc4 ; 0x17cc4 1575c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15760: a2 96 adiw r28, 0x22 ; 34 15762: 6c af std Y+60, r22 ; 0x3c 15764: 7d af std Y+61, r23 ; 0x3d 15766: 8e af std Y+62, r24 ; 0x3e 15768: 9f af std Y+63, r25 ; 0x3f 1576a: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 1576c: 83 e4 ldi r24, 0x43 ; 67 1576e: 0e 94 8d 5c call 0xb91a ; 0xb91a 15772: 88 23 and r24, r24 15774: 11 f4 brne .+4 ; 0x1577a 15776: 0c 94 6e be jmp 0x17cdc ; 0x17cdc 1577a: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1577e: 6a 96 adiw r28, 0x1a ; 26 15780: 6c af std Y+60, r22 ; 0x3c 15782: 7d af std Y+61, r23 ; 0x3d 15784: 8e af std Y+62, r24 ; 0x3e 15786: 9f af std Y+63, r25 ; 0x3f 15788: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 1578a: 84 e4 ldi r24, 0x44 ; 68 1578c: 0e 94 8d 5c call 0xb91a ; 0xb91a 15790: 88 23 and r24, r24 15792: 11 f4 brne .+4 ; 0x15798 15794: 0c 94 7a be jmp 0x17cf4 ; 0x17cf4 15798: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1579c: aa 96 adiw r28, 0x2a ; 42 1579e: 6c af std Y+60, r22 ; 0x3c 157a0: 7d af std Y+61, r23 ; 0x3d 157a2: 8e af std Y+62, r24 ; 0x3e 157a4: 9f af std Y+63, r25 ; 0x3f 157a6: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 157a8: 8c e4 ldi r24, 0x4C ; 76 157aa: 0e 94 8d 5c call 0xb91a ; 0xb91a 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; 157ae: 0f ef ldi r16, 0xFF ; 255 157b0: 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(); 157b2: 88 23 and r24, r24 157b4: 19 f0 breq .+6 ; 0x157bc 157b6: 0e 94 2c 5c call 0xb858 ; 0xb858 157ba: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 157bc: 83 e5 ldi r24, 0x53 ; 83 157be: 0e 94 8d 5c call 0xb91a ; 0xb91a 157c2: 88 23 and r24, r24 157c4: 11 f4 brne .+4 ; 0x157ca 157c6: 0c 94 86 be jmp 0x17d0c ; 0x17d0c 157ca: 0e 94 2c 5c call 0xb858 ; 0xb858 157ce: e3 96 adiw r28, 0x33 ; 51 157d0: 8f af std Y+63, r24 ; 0x3f 157d2: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 157d4: 82 e4 ldi r24, 0x42 ; 66 157d6: 0e 94 8d 5c call 0xb91a ; 0xb91a 157da: 88 23 and r24, r24 157dc: 11 f4 brne .+4 ; 0x157e2 157de: 0c 94 8c be jmp 0x17d18 ; 0x17d18 157e2: 0e 94 2c 5c call 0xb858 ; 0xb858 157e6: e7 96 adiw r28, 0x37 ; 55 157e8: 8f af std Y+63, r24 ; 0x3f 157ea: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 157ec: 84 e5 ldi r24, 0x54 ; 84 157ee: 0e 94 8d 5c call 0xb91a ; 0xb91a 157f2: 88 23 and r24, r24 157f4: 11 f4 brne .+4 ; 0x157fa 157f6: 0c 94 92 be jmp 0x17d24 ; 0x17d24 157fa: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 157fe: a6 96 adiw r28, 0x26 ; 38 15800: 6c af std Y+60, r22 ; 0x3c 15802: 7d af std Y+61, r23 ; 0x3d 15804: 8e af std Y+62, r24 ; 0x3e 15806: 9f af std Y+63, r25 ; 0x3f 15808: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 1580a: 85 e4 ldi r24, 0x45 ; 69 1580c: 0e 94 8d 5c call 0xb91a ; 0xb91a - `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; 15810: 41 2c mov r4, r1 15812: 51 2c mov r5, r1 15814: 50 ec ldi r21, 0xC0 ; 192 15816: 65 2e mov r6, r21 15818: 5f e7 ldi r21, 0x7F ; 127 1581a: 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(); 1581c: 88 23 and r24, r24 1581e: 21 f0 breq .+8 ; 0x15828 15820: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15824: 2b 01 movw r4, r22 15826: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 15828: 87 e5 ldi r24, 0x57 ; 87 1582a: 0e 94 8d 5c call 0xb91a ; 0xb91a - `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; 1582e: 81 2c mov r8, r1 15830: 91 2c mov r9, r1 15832: 40 ec ldi r20, 0xC0 ; 192 15834: a4 2e mov r10, r20 15836: 4f e7 ldi r20, 0x7F ; 127 15838: 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(); 1583a: 88 23 and r24, r24 1583c: 21 f0 breq .+8 ; 0x15846 1583e: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 15842: 4b 01 movw r8, r22 15844: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 15846: 81 e4 ldi r24, 0x41 ; 65 15848: 0e 94 8d 5c call 0xb91a ; 0xb91a 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; 1584c: 22 24 eor r2, r2 1584e: 2a 94 dec r2 15850: 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(); 15852: 88 23 and r24, r24 15854: 19 f0 breq .+6 ; 0x1585c 15856: 0e 94 2c 5c call 0xb858 ; 0xb858 1585a: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 1585c: 86 e4 ldi r24, 0x46 ; 70 1585e: 0e 94 8d 5c call 0xb91a ; 0xb91a 15862: 88 23 and r24, r24 15864: 11 f4 brne .+4 ; 0x1586a 15866: 0c 94 9e be jmp 0x17d3c ; 0x17d3c 1586a: 0e 94 2c 5c call 0xb858 ; 0xb858 1586e: eb 96 adiw r28, 0x3b ; 59 15870: 8f af std Y+63, r24 ; 0x3f 15872: 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) 15874: e2 96 adiw r28, 0x32 ; 50 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: e2 97 sbiw r28, 0x32 ; 50 15880: ca 01 movw r24, r20 15882: b9 01 movw r22, r18 15884: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 15888: 88 23 and r24, r24 1588a: 11 f4 brne .+4 ; 0x15890 1588c: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 15890: a7 01 movw r20, r14 15892: 96 01 movw r18, r12 15894: c7 01 movw r24, r14 15896: b6 01 movw r22, r12 15898: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 1589c: 88 23 and r24, r24 1589e: 11 f4 brne .+4 ; 0x158a4 158a0: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 158a4: 6e 96 adiw r28, 0x1e ; 30 158a6: 2c ad ldd r18, Y+60 ; 0x3c 158a8: 3d ad ldd r19, Y+61 ; 0x3d 158aa: 4e ad ldd r20, Y+62 ; 0x3e 158ac: 5f ad ldd r21, Y+63 ; 0x3f 158ae: 6e 97 sbiw r28, 0x1e ; 30 158b0: ca 01 movw r24, r20 158b2: b9 01 movw r22, r18 158b4: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 158b8: 88 23 and r24, r24 158ba: 11 f4 brne .+4 ; 0x158c0 158bc: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 158c0: a2 96 adiw r28, 0x22 ; 34 158c2: 2c ad ldd r18, Y+60 ; 0x3c 158c4: 3d ad ldd r19, Y+61 ; 0x3d 158c6: 4e ad ldd r20, Y+62 ; 0x3e 158c8: 5f ad ldd r21, Y+63 ; 0x3f 158ca: a2 97 sbiw r28, 0x22 ; 34 158cc: ca 01 movw r24, r20 158ce: b9 01 movw r22, r18 158d0: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 158d4: 88 23 and r24, r24 158d6: 11 f4 brne .+4 ; 0x158dc 158d8: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 158dc: 6a 96 adiw r28, 0x1a ; 26 158de: 2c ad ldd r18, Y+60 ; 0x3c 158e0: 3d ad ldd r19, Y+61 ; 0x3d 158e2: 4e ad ldd r20, Y+62 ; 0x3e 158e4: 5f ad ldd r21, Y+63 ; 0x3f 158e6: 6a 97 sbiw r28, 0x1a ; 26 158e8: ca 01 movw r24, r20 158ea: b9 01 movw r22, r18 158ec: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 158f0: 88 23 and r24, r24 158f2: 11 f4 brne .+4 ; 0x158f8 158f4: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 158f8: aa 96 adiw r28, 0x2a ; 42 158fa: 2c ad ldd r18, Y+60 ; 0x3c 158fc: 3d ad ldd r19, Y+61 ; 0x3d 158fe: 4e ad ldd r20, Y+62 ; 0x3e 15900: 5f ad ldd r21, Y+63 ; 0x3f 15902: aa 97 sbiw r28, 0x2a ; 42 15904: ca 01 movw r24, r20 15906: b9 01 movw r22, r18 15908: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 1590c: 88 23 and r24, r24 1590e: 11 f4 brne .+4 ; 0x15914 15910: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 15914: a6 96 adiw r28, 0x26 ; 38 15916: 2c ad ldd r18, Y+60 ; 0x3c 15918: 3d ad ldd r19, Y+61 ; 0x3d 1591a: 4e ad ldd r20, Y+62 ; 0x3e 1591c: 5f ad ldd r21, Y+63 ; 0x3f 1591e: a6 97 sbiw r28, 0x26 ; 38 15920: ca 01 movw r24, r20 15922: b9 01 movw r22, r18 15924: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 15928: 88 23 and r24, r24 1592a: 11 f4 brne .+4 ; 0x15930 1592c: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 15930: a5 01 movw r20, r10 15932: 94 01 movw r18, r8 15934: c5 01 movw r24, r10 15936: b4 01 movw r22, r8 15938: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 1593c: 88 23 and r24, r24 1593e: 11 f4 brne .+4 ; 0x15944 15940: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 15944: a3 01 movw r20, r6 15946: 92 01 movw r18, r4 15948: c3 01 movw r24, r6 1594a: b2 01 movw r22, r4 1594c: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 15950: 88 23 and r24, r24 15952: 11 f4 brne .+4 ; 0x15958 15954: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 15958: ab 96 adiw r28, 0x2b ; 43 1595a: af ad ldd r26, Y+63 ; 0x3f 1595c: ab 97 sbiw r28, 0x2b ; 43 1595e: a7 fd sbrc r26, 7 15960: 02 c0 rjmp .+4 ; 0x15966 15962: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 15966: e3 96 adiw r28, 0x33 ; 51 15968: bf ad ldd r27, Y+63 ; 0x3f 1596a: e3 97 sbiw r28, 0x33 ; 51 1596c: b7 fd sbrc r27, 7 1596e: 02 c0 rjmp .+4 ; 0x15974 15970: 0c 94 a8 be jmp 0x17d50 ; 0x17d50 15974: e7 96 adiw r28, 0x37 ; 55 15976: ef ad ldd r30, Y+63 ; 0x3f 15978: e7 97 sbiw r28, 0x37 ; 55 1597a: e7 fd sbrc r30, 7 1597c: 02 c0 rjmp .+4 ; 0x15982 1597e: 0c 94 ad be jmp 0x17d5a ; 0x17d5a 15982: 37 fc sbrc r3, 7 15984: 02 c0 rjmp .+4 ; 0x1598a 15986: 0c 94 f8 be jmp 0x17df0 ; 0x17df0 1598a: 17 ff sbrs r17, 7 1598c: 02 c0 rjmp .+4 ; 0x15992 1598e: 0c 94 a4 be jmp 0x17d48 ; 0x17d48 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; 15992: ce 01 movw r24, r28 15994: 01 96 adiw r24, 0x01 ; 1 15996: 0f 94 ae 47 call 0x28f5c ; 0x28f5c if(!isnan(P) && P > 0) thermal_model::data.P = P; 1599a: a7 01 movw r20, r14 1599c: 96 01 movw r18, r12 1599e: c7 01 movw r24, r14 159a0: b6 01 movw r22, r12 159a2: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 159a6: 88 23 and r24, r24 159a8: 11 f4 brne .+4 ; 0x159ae 159aa: 0c 94 9c bf jmp 0x17f38 ; 0x17f38 if(!isnan(U)) thermal_model::data.U = U; 159ae: 6e 96 adiw r28, 0x1e ; 30 159b0: 2c ad ldd r18, Y+60 ; 0x3c 159b2: 3d ad ldd r19, Y+61 ; 0x3d 159b4: 4e ad ldd r20, Y+62 ; 0x3e 159b6: 5f ad ldd r21, Y+63 ; 0x3f 159b8: 6e 97 sbiw r28, 0x1e ; 30 159ba: ca 01 movw r24, r20 159bc: b9 01 movw r22, r18 159be: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 159c2: 81 11 cpse r24, r1 159c4: 0e c0 rjmp .+28 ; 0x159e2 159c6: 6e 96 adiw r28, 0x1e ; 30 159c8: 8c ad ldd r24, Y+60 ; 0x3c 159ca: 9d ad ldd r25, Y+61 ; 0x3d 159cc: ae ad ldd r26, Y+62 ; 0x3e 159ce: bf ad ldd r27, Y+63 ; 0x3f 159d0: 6e 97 sbiw r28, 0x1e ; 30 159d2: 80 93 b9 12 sts 0x12B9, r24 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 159d6: 90 93 ba 12 sts 0x12BA, r25 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 159da: a0 93 bb 12 sts 0x12BB, r26 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 159de: b0 93 bc 12 sts 0x12BC, r27 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> if(!isnan(V)) thermal_model::data.V = V; 159e2: a2 96 adiw r28, 0x22 ; 34 159e4: 2c ad ldd r18, Y+60 ; 0x3c 159e6: 3d ad ldd r19, Y+61 ; 0x3d 159e8: 4e ad ldd r20, Y+62 ; 0x3e 159ea: 5f ad ldd r21, Y+63 ; 0x3f 159ec: a2 97 sbiw r28, 0x22 ; 34 159ee: ca 01 movw r24, r20 159f0: b9 01 movw r22, r18 159f2: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 159f6: 81 11 cpse r24, r1 159f8: 0e c0 rjmp .+28 ; 0x15a16 159fa: a2 96 adiw r28, 0x22 ; 34 159fc: 2c ad ldd r18, Y+60 ; 0x3c 159fe: 3d ad ldd r19, Y+61 ; 0x3d 15a00: 4e ad ldd r20, Y+62 ; 0x3e 15a02: 5f ad ldd r21, Y+63 ; 0x3f 15a04: a2 97 sbiw r28, 0x22 ; 34 15a06: 20 93 bd 12 sts 0x12BD, r18 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 15a0a: 30 93 be 12 sts 0x12BE, r19 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 15a0e: 40 93 bf 12 sts 0x12BF, r20 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 15a12: 50 93 c0 12 sts 0x12C0, r21 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 15a16: 6a 96 adiw r28, 0x1a ; 26 15a18: 2c ad ldd r18, Y+60 ; 0x3c 15a1a: 3d ad ldd r19, Y+61 ; 0x3d 15a1c: 4e ad ldd r20, Y+62 ; 0x3e 15a1e: 5f ad ldd r21, Y+63 ; 0x3f 15a20: 6a 97 sbiw r28, 0x1a ; 26 15a22: ca 01 movw r24, r20 15a24: b9 01 movw r22, r18 15a26: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 15a2a: 81 11 cpse r24, r1 15a2c: 1b c0 rjmp .+54 ; 0x15a64 15a2e: 20 e0 ldi r18, 0x00 ; 0 15a30: 30 e0 ldi r19, 0x00 ; 0 15a32: a9 01 movw r20, r18 15a34: 6a 96 adiw r28, 0x1a ; 26 15a36: 6c ad ldd r22, Y+60 ; 0x3c 15a38: 7d ad ldd r23, Y+61 ; 0x3d 15a3a: 8e ad ldd r24, Y+62 ; 0x3e 15a3c: 9f ad ldd r25, Y+63 ; 0x3f 15a3e: 6a 97 sbiw r28, 0x1a ; 26 15a40: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 15a44: 18 16 cp r1, r24 15a46: 74 f4 brge .+28 ; 0x15a64 15a48: 6a 96 adiw r28, 0x1a ; 26 15a4a: 8c ad ldd r24, Y+60 ; 0x3c 15a4c: 9d ad ldd r25, Y+61 ; 0x3d 15a4e: ae ad ldd r26, Y+62 ; 0x3e 15a50: bf ad ldd r27, Y+63 ; 0x3f 15a52: 6a 97 sbiw r28, 0x1a ; 26 15a54: 80 93 c1 12 sts 0x12C1, r24 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 15a58: 90 93 c2 12 sts 0x12C2, r25 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 15a5c: a0 93 c3 12 sts 0x12C3, r26 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 15a60: b0 93 c4 12 sts 0x12C4, r27 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> if(!isnan(D)) thermal_model::data.fS = D; 15a64: aa 96 adiw r28, 0x2a ; 42 15a66: 2c ad ldd r18, Y+60 ; 0x3c 15a68: 3d ad ldd r19, Y+61 ; 0x3d 15a6a: 4e ad ldd r20, Y+62 ; 0x3e 15a6c: 5f ad ldd r21, Y+63 ; 0x3f 15a6e: aa 97 sbiw r28, 0x2a ; 42 15a70: ca 01 movw r24, r20 15a72: b9 01 movw r22, r18 15a74: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 15a78: 81 11 cpse r24, r1 15a7a: 0e c0 rjmp .+28 ; 0x15a98 15a7c: aa 96 adiw r28, 0x2a ; 42 15a7e: 2c ad ldd r18, Y+60 ; 0x3c 15a80: 3d ad ldd r19, Y+61 ; 0x3d 15a82: 4e ad ldd r20, Y+62 ; 0x3e 15a84: 5f ad ldd r21, Y+63 ; 0x3f 15a86: aa 97 sbiw r28, 0x2a ; 42 15a88: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 15a8c: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 15a90: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 15a94: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> if(L >= 0) thermal_model_set_lag(L); 15a98: 17 fd sbrc r17, 7 15a9a: 03 c0 rjmp .+6 ; 0x15aa2 15a9c: c8 01 movw r24, r16 15a9e: 0f 94 91 44 call 0x28922 ; 0x28922 if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 15aa2: a6 96 adiw r28, 0x26 ; 38 15aa4: 2c ad ldd r18, Y+60 ; 0x3c 15aa6: 3d ad ldd r19, Y+61 ; 0x3d 15aa8: 4e ad ldd r20, Y+62 ; 0x3e 15aaa: 5f ad ldd r21, Y+63 ; 0x3f 15aac: a6 97 sbiw r28, 0x26 ; 38 15aae: ca 01 movw r24, r20 15ab0: b9 01 movw r22, r18 15ab2: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 15ab6: 81 11 cpse r24, r1 15ab8: 0e c0 rjmp .+28 ; 0x15ad6 15aba: a6 96 adiw r28, 0x26 ; 38 15abc: 8c ad ldd r24, Y+60 ; 0x3c 15abe: 9d ad ldd r25, Y+61 ; 0x3d 15ac0: ae ad ldd r26, Y+62 ; 0x3e 15ac2: bf ad ldd r27, Y+63 ; 0x3f 15ac4: a6 97 sbiw r28, 0x26 ; 38 15ac6: 80 93 0b 13 sts 0x130B, r24 ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 15aca: 90 93 0c 13 sts 0x130C, r25 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 15ace: a0 93 0d 13 sts 0x130D, r26 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 15ad2: b0 93 0e 13 sts 0x130E, r27 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 15ad6: a5 01 movw r20, r10 15ad8: 94 01 movw r18, r8 15ada: c5 01 movw r24, r10 15adc: b4 01 movw r22, r8 15ade: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 15ae2: 81 11 cpse r24, r1 15ae4: 11 c0 rjmp .+34 ; 0x15b08 15ae6: 20 e0 ldi r18, 0x00 ; 0 15ae8: 30 e0 ldi r19, 0x00 ; 0 15aea: a9 01 movw r20, r18 15aec: c5 01 movw r24, r10 15aee: b4 01 movw r22, r8 15af0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 15af4: 18 16 cp r1, r24 15af6: 44 f4 brge .+16 ; 0x15b08 15af8: 80 92 0f 13 sts 0x130F, r8 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15afc: 90 92 10 13 sts 0x1310, r9 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15b00: a0 92 11 13 sts 0x1311, r10 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15b04: b0 92 12 13 sts 0x1312, r11 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 15b08: a3 01 movw r20, r6 15b0a: 92 01 movw r18, r4 15b0c: c3 01 movw r24, r6 15b0e: b2 01 movw r22, r4 15b10: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 15b14: 81 11 cpse r24, r1 15b16: 11 c0 rjmp .+34 ; 0x15b3a 15b18: 20 e0 ldi r18, 0x00 ; 0 15b1a: 30 e0 ldi r19, 0x00 ; 0 15b1c: a9 01 movw r20, r18 15b1e: c3 01 movw r24, r6 15b20: b2 01 movw r22, r4 15b22: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 15b26: 18 16 cp r1, r24 15b28: 44 f4 brge .+16 ; 0x15b3a 15b2a: 40 92 13 13 sts 0x1313, r4 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 15b2e: 50 92 14 13 sts 0x1314, r5 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 15b32: 60 92 15 13 sts 0x1315, r6 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 15b36: 70 92 16 13 sts 0x1316, r7 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> // ensure warn <= err if (thermal_model::data.warn > thermal_model::data.err) 15b3a: c0 90 13 13 lds r12, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 15b3e: d0 90 14 13 lds r13, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 15b42: e0 90 15 13 lds r14, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 15b46: f0 90 16 13 lds r15, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 15b4a: a7 01 movw r20, r14 15b4c: 96 01 movw r18, r12 15b4e: 60 91 0f 13 lds r22, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15b52: 70 91 10 13 lds r23, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15b56: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15b5a: 90 91 12 13 lds r25, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 15b5e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 15b62: 18 16 cp r1, r24 15b64: 44 f4 brge .+16 ; 0x15b76 thermal_model::data.warn = thermal_model::data.err; 15b66: c0 92 0f 13 sts 0x130F, r12 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15b6a: d0 92 10 13 sts 0x1310, r13 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15b6e: e0 92 11 13 sts 0x1311, r14 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15b72: f0 92 12 13 sts 0x1312, r15 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::setup(); 15b76: 0f 94 18 45 call 0x28a30 ; 0x28a30 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; 15b7a: ce 01 movw r24, r28 15b7c: 01 96 adiw r24, 0x01 ; 1 15b7e: 0f 94 a1 47 call 0x28f42 ; 0x28f42 15b82: 0c 94 1e bf jmp 0x17e3c ; 0x17e3c } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15b86: 85 39 cpi r24, 0x95 ; 149 15b88: a1 e0 ldi r26, 0x01 ; 1 15b8a: 9a 07 cpc r25, r26 15b8c: 11 f4 brne .+4 ; 0x15b92 15b8e: 0c 94 14 c2 jmp 0x18428 ; 0x18428 15b92: 2c f5 brge .+74 ; 0x15bde 15b94: 80 39 cpi r24, 0x90 ; 144 15b96: e1 e0 ldi r30, 0x01 ; 1 15b98: 9e 07 cpc r25, r30 15b9a: 11 f4 brne .+4 ; 0x15ba0 15b9c: 0c 94 10 c2 jmp 0x18420 ; 0x18420 15ba0: 83 39 cpi r24, 0x93 ; 147 15ba2: 91 40 sbci r25, 0x01 ; 1 15ba4: 09 f0 breq .+2 ; 0x15ba8 15ba6: a6 c8 rjmp .-3764 ; 0x14cf4 */ 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()) 15ba8: 80 91 95 13 lds r24, 0x1395 ; 0x801395 15bac: 81 30 cpi r24, 0x01 ; 1 15bae: 09 f0 breq .+2 ; 0x15bb2 15bb0: cc c4 rjmp .+2456 ; 0x1654a { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 15bb2: 85 e4 ldi r24, 0x45 ; 69 15bb4: 0e 94 8d 5c call 0xb91a ; 0xb91a 15bb8: 81 11 cpse r24, r1 15bba: 0e 94 1f 5c call 0xb83e ; 0xb83e if(code_seen('F')) filament = code_value_uint8(); 15bbe: 86 e4 ldi r24, 0x46 ; 70 15bc0: 0e 94 8d 5c call 0xb91a ; 0xb91a 15bc4: 81 11 cpse r24, r1 15bc6: 0e 94 1f 5c call 0xb83e ; 0xb83e MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 15bca: 0f 94 0b 88 call 0x31016 ; 0x31016 15bce: 88 23 and r24, r24 15bd0: 09 f4 brne .+2 ; 0x15bd4 15bd2: bb c4 rjmp .+2422 ; 0x1654a // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 15bd4: 60 e0 ldi r22, 0x00 ; 0 15bd6: 80 e0 ldi r24, 0x00 ; 0 15bd8: 0f 94 57 9f call 0x33eae ; 0x33eae 15bdc: b6 c4 rjmp .+2412 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15bde: 84 3a cpi r24, 0xA4 ; 164 15be0: 21 e0 ldi r18, 0x01 ; 1 15be2: 92 07 cpc r25, r18 15be4: 11 f4 brne .+4 ; 0x15bea 15be6: 0c 94 19 c2 jmp 0x18432 ; 0x18432 15bea: 84 3f cpi r24, 0xF4 ; 244 15bec: 31 e0 ldi r19, 0x01 ; 1 15bee: 93 07 cpc r25, r19 15bf0: 11 f4 brne .+4 ; 0x15bf6 15bf2: 0c 94 1d c2 jmp 0x1843a ; 0x1843a 15bf6: 86 39 cpi r24, 0x96 ; 150 15bf8: 91 40 sbci r25, 0x01 ; 1 15bfa: 09 f0 breq .+2 ; 0x15bfe 15bfc: 7b c8 rjmp .-3850 ; 0x14cf4 */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 15bfe: 80 e0 ldi r24, 0x00 ; 0 15c00: 0e 94 c5 75 call 0xeb8a ; 0xeb8a 15c04: a2 c4 rjmp .+2372 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15c06: 83 3c cpi r24, 0xC3 ; 195 15c08: 52 e0 ldi r21, 0x02 ; 2 15c0a: 95 07 cpc r25, r21 15c0c: 11 f4 brne .+4 ; 0x15c12 15c0e: 0c 94 4d cd jmp 0x19a9a ; 0x19a9a 15c12: 0c f0 brlt .+2 ; 0x15c16 15c14: e7 c3 rjmp .+1998 ; 0x163e4 15c16: 8a 35 cpi r24, 0x5A ; 90 15c18: b2 e0 ldi r27, 0x02 ; 2 15c1a: 9b 07 cpc r25, r27 15c1c: 11 f4 brne .+4 ; 0x15c22 15c1e: 0c 94 4b c6 jmp 0x18c96 ; 0x18c96 15c22: 0c f0 brlt .+2 ; 0x15c26 15c24: 76 c3 rjmp .+1772 ; 0x16312 15c26: 8d 3f cpi r24, 0xFD ; 253 15c28: f1 e0 ldi r31, 0x01 ; 1 15c2a: 9f 07 cpc r25, r31 15c2c: 11 f4 brne .+4 ; 0x15c32 15c2e: 0c 94 37 c2 jmp 0x1846e ; 0x1846e 15c32: 0c f0 brlt .+2 ; 0x15c36 15c34: 2e c3 rjmp .+1628 ; 0x16292 15c36: 86 3f cpi r24, 0xF6 ; 246 15c38: 31 e0 ldi r19, 0x01 ; 1 15c3a: 93 07 cpc r25, r19 15c3c: 11 f4 brne .+4 ; 0x15c42 15c3e: 0c 94 25 c2 jmp 0x1844a ; 0x1844a 15c42: 87 3f cpi r24, 0xF7 ; 247 15c44: 91 40 sbci r25, 0x01 ; 1 15c46: 09 f0 breq .+2 ; 0x15c4a 15c48: 55 c8 rjmp .-3926 ; 0x14cf4 #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( 15c4a: 80 91 ce 06 lds r24, 0x06CE ; 0x8006ce 15c4e: 8f 93 push r24 15c50: 80 91 cd 06 lds r24, 0x06CD ; 0x8006cd 15c54: 8f 93 push r24 15c56: 80 91 cc 06 lds r24, 0x06CC ; 0x8006cc 15c5a: 8f 93 push r24 15c5c: 80 91 cb 06 lds r24, 0x06CB ; 0x8006cb 15c60: 8f 93 push r24 15c62: 80 91 ca 06 lds r24, 0x06CA ; 0x8006ca 15c66: 8f 93 push r24 15c68: 80 91 c9 06 lds r24, 0x06C9 ; 0x8006c9 15c6c: 8f 93 push r24 15c6e: 80 91 c8 06 lds r24, 0x06C8 ; 0x8006c8 15c72: 8f 93 push r24 15c74: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 15c78: 8f 93 push r24 15c7a: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 15c7e: 8f 93 push r24 15c80: 80 91 c5 06 lds r24, 0x06C5 ; 0x8006c5 15c84: 8f 93 push r24 15c86: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 15c8a: 8f 93 push r24 15c8c: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 15c90: 8f 93 push r24 15c92: 04 e1 ldi r16, 0x14 ; 20 15c94: 1a ea ldi r17, 0xAA ; 170 15c96: 1f 93 push r17 15c98: 0f 93 push r16 15c9a: 1f 93 push r17 15c9c: 0f 93 push r16 15c9e: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 15ca2: 8f 93 push r24 15ca4: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 15ca8: 8f 93 push r24 15caa: 80 91 c0 06 lds r24, 0x06C0 ; 0x8006c0 15cae: 8f 93 push r24 15cb0: 80 91 bf 06 lds r24, 0x06BF ; 0x8006bf 15cb4: 8f 93 push r24 15cb6: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 15cba: 8f 93 push r24 15cbc: 80 91 bd 06 lds r24, 0x06BD ; 0x8006bd 15cc0: 8f 93 push r24 15cc2: 80 91 bc 06 lds r24, 0x06BC ; 0x8006bc 15cc6: 8f 93 push r24 15cc8: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 15ccc: 8f 93 push r24 15cce: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 15cd2: 8f 93 push r24 15cd4: 80 91 b9 06 lds r24, 0x06B9 ; 0x8006b9 15cd8: 8f 93 push r24 15cda: 80 91 b8 06 lds r24, 0x06B8 ; 0x8006b8 15cde: 8f 93 push r24 15ce0: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 15ce4: 8f 93 push r24 15ce6: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 15cea: 8f 93 push r24 15cec: 80 91 b5 06 lds r24, 0x06B5 ; 0x8006b5 15cf0: 8f 93 push r24 15cf2: 80 91 b4 06 lds r24, 0x06B4 ; 0x8006b4 15cf6: 8f 93 push r24 15cf8: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 15cfc: 8f 93 push r24 15cfe: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 15d02: 8f 93 push r24 15d04: 80 91 b1 06 lds r24, 0x06B1 ; 0x8006b1 15d08: 8f 93 push r24 15d0a: 80 91 b0 06 lds r24, 0x06B0 ; 0x8006b0 15d0e: 8f 93 push r24 15d10: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 15d14: 8f 93 push r24 15d16: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 15d1a: 8f 93 push r24 15d1c: 80 91 ad 06 lds r24, 0x06AD ; 0x8006ad 15d20: 8f 93 push r24 15d22: 80 91 ac 06 lds r24, 0x06AC ; 0x8006ac 15d26: 8f 93 push r24 15d28: 80 91 ab 06 lds r24, 0x06AB ; 0x8006ab 15d2c: 8f 93 push r24 15d2e: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 15d32: 8f 93 push r24 15d34: 80 91 a9 06 lds r24, 0x06A9 ; 0x8006a9 15d38: 8f 93 push r24 15d3a: 80 91 a8 06 lds r24, 0x06A8 ; 0x8006a8 15d3e: 8f 93 push r24 15d40: 80 91 a7 06 lds r24, 0x06A7 ; 0x8006a7 15d44: 8f 93 push r24 15d46: 1f 93 push r17 15d48: 0f 93 push r16 15d4a: 1f 93 push r17 15d4c: 0f 93 push r16 15d4e: 80 91 2e 07 lds r24, 0x072E ; 0x80072e 15d52: 8f 93 push r24 15d54: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 15d58: 8f 93 push r24 15d5a: 80 91 2c 07 lds r24, 0x072C ; 0x80072c 15d5e: 8f 93 push r24 15d60: 80 91 2b 07 lds r24, 0x072B ; 0x80072b 15d64: 8f 93 push r24 15d66: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 15d6a: 8f 93 push r24 15d6c: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 15d70: 8f 93 push r24 15d72: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 15d76: 8f 93 push r24 15d78: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 15d7c: 8f 93 push r24 15d7e: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 15d82: 8f 93 push r24 15d84: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 15d88: 8f 93 push r24 15d8a: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 15d8e: 8f 93 push r24 15d90: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 15d94: 8f 93 push r24 15d96: 1f 93 push r17 15d98: 0f 93 push r16 15d9a: 1f 93 push r17 15d9c: 0f 93 push r16 15d9e: 80 91 26 07 lds r24, 0x0726 ; 0x800726 15da2: 8f 93 push r24 15da4: 80 91 25 07 lds r24, 0x0725 ; 0x800725 15da8: 8f 93 push r24 15daa: 80 91 24 07 lds r24, 0x0724 ; 0x800724 15dae: 8f 93 push r24 15db0: 80 91 23 07 lds r24, 0x0723 ; 0x800723 15db4: 8f 93 push r24 15db6: 80 91 22 07 lds r24, 0x0722 ; 0x800722 15dba: 8f 93 push r24 15dbc: 80 91 21 07 lds r24, 0x0721 ; 0x800721 15dc0: 8f 93 push r24 15dc2: 80 91 20 07 lds r24, 0x0720 ; 0x800720 15dc6: 8f 93 push r24 15dc8: 80 91 1f 07 lds r24, 0x071F ; 0x80071f 15dcc: 8f 93 push r24 15dce: 80 91 1e 07 lds r24, 0x071E ; 0x80071e 15dd2: 8f 93 push r24 15dd4: 80 91 1d 07 lds r24, 0x071D ; 0x80071d 15dd8: 8f 93 push r24 15dda: 80 91 1c 07 lds r24, 0x071C ; 0x80071c 15dde: 8f 93 push r24 15de0: 80 91 1b 07 lds r24, 0x071B ; 0x80071b 15de4: 8f 93 push r24 15de6: 80 91 1a 07 lds r24, 0x071A ; 0x80071a 15dea: 8f 93 push r24 15dec: 80 91 19 07 lds r24, 0x0719 ; 0x800719 15df0: 8f 93 push r24 15df2: 80 91 18 07 lds r24, 0x0718 ; 0x800718 15df6: 8f 93 push r24 15df8: 80 91 17 07 lds r24, 0x0717 ; 0x800717 15dfc: 8f 93 push r24 15dfe: 1f 93 push r17 15e00: 0f 93 push r16 15e02: 1f 93 push r17 15e04: 0f 93 push r16 15e06: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 15e0a: 8f 93 push r24 15e0c: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 15e10: 8f 93 push r24 15e12: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 15e16: 8f 93 push r24 15e18: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 15e1c: 8f 93 push r24 15e1e: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 15e22: 8f 93 push r24 15e24: 80 91 99 06 lds r24, 0x0699 ; 0x800699 15e28: 8f 93 push r24 15e2a: 80 91 98 06 lds r24, 0x0698 ; 0x800698 15e2e: 8f 93 push r24 15e30: 80 91 97 06 lds r24, 0x0697 ; 0x800697 15e34: 8f 93 push r24 15e36: 80 91 96 06 lds r24, 0x0696 ; 0x800696 15e3a: 8f 93 push r24 15e3c: 80 91 95 06 lds r24, 0x0695 ; 0x800695 15e40: 8f 93 push r24 15e42: 80 91 94 06 lds r24, 0x0694 ; 0x800694 15e46: 8f 93 push r24 15e48: 80 91 93 06 lds r24, 0x0693 ; 0x800693 15e4c: 8f 93 push r24 15e4e: 80 91 92 06 lds r24, 0x0692 ; 0x800692 15e52: 8f 93 push r24 15e54: 80 91 91 06 lds r24, 0x0691 ; 0x800691 15e58: 8f 93 push r24 15e5a: 80 91 90 06 lds r24, 0x0690 ; 0x800690 15e5e: 8f 93 push r24 15e60: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 15e64: 8f 93 push r24 15e66: 1f 93 push r17 15e68: 0f 93 push r16 15e6a: 1f 93 push r17 15e6c: 0f 93 push r16 15e6e: 80 91 16 07 lds r24, 0x0716 ; 0x800716 15e72: 8f 93 push r24 15e74: 80 91 15 07 lds r24, 0x0715 ; 0x800715 15e78: 8f 93 push r24 15e7a: 80 91 14 07 lds r24, 0x0714 ; 0x800714 15e7e: 8f 93 push r24 15e80: 80 91 13 07 lds r24, 0x0713 ; 0x800713 15e84: 8f 93 push r24 15e86: 80 91 12 07 lds r24, 0x0712 ; 0x800712 15e8a: 8f 93 push r24 15e8c: 80 91 11 07 lds r24, 0x0711 ; 0x800711 15e90: 8f 93 push r24 15e92: 80 91 10 07 lds r24, 0x0710 ; 0x800710 15e96: 8f 93 push r24 15e98: 80 91 0f 07 lds r24, 0x070F ; 0x80070f 15e9c: 8f 93 push r24 15e9e: 80 91 0e 07 lds r24, 0x070E ; 0x80070e 15ea2: 8f 93 push r24 15ea4: 80 91 0d 07 lds r24, 0x070D ; 0x80070d 15ea8: 8f 93 push r24 15eaa: 80 91 0c 07 lds r24, 0x070C ; 0x80070c 15eae: 8f 93 push r24 15eb0: 80 91 0b 07 lds r24, 0x070B ; 0x80070b 15eb4: 8f 93 push r24 15eb6: 80 91 0a 07 lds r24, 0x070A ; 0x80070a 15eba: 8f 93 push r24 15ebc: 80 91 09 07 lds r24, 0x0709 ; 0x800709 15ec0: 8f 93 push r24 15ec2: 80 91 08 07 lds r24, 0x0708 ; 0x800708 15ec6: 8f 93 push r24 15ec8: 80 91 07 07 lds r24, 0x0707 ; 0x800707 15ecc: 8f 93 push r24 15ece: 1f 93 push r17 15ed0: 0f 93 push r16 15ed2: 1f 93 push r17 15ed4: 0f 93 push r16 15ed6: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 15eda: 8f 93 push r24 15edc: 80 91 8d 06 lds r24, 0x068D ; 0x80068d 15ee0: 8f 93 push r24 15ee2: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 15ee6: 8f 93 push r24 15ee8: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 15eec: 8f 93 push r24 15eee: 80 91 8a 06 lds r24, 0x068A ; 0x80068a 15ef2: 8f 93 push r24 15ef4: 80 91 89 06 lds r24, 0x0689 ; 0x800689 15ef8: 8f 93 push r24 15efa: 80 91 88 06 lds r24, 0x0688 ; 0x800688 15efe: 8f 93 push r24 15f00: 80 91 87 06 lds r24, 0x0687 ; 0x800687 15f04: 8f 93 push r24 15f06: 80 91 86 06 lds r24, 0x0686 ; 0x800686 15f0a: 8f 93 push r24 15f0c: 80 91 85 06 lds r24, 0x0685 ; 0x800685 15f10: 8f 93 push r24 15f12: 80 91 84 06 lds r24, 0x0684 ; 0x800684 15f16: 8f 93 push r24 15f18: 80 91 83 06 lds r24, 0x0683 ; 0x800683 15f1c: 8f 93 push r24 15f1e: 80 91 82 06 lds r24, 0x0682 ; 0x800682 15f22: 8f 93 push r24 15f24: 80 91 81 06 lds r24, 0x0681 ; 0x800681 15f28: 8f 93 push r24 15f2a: 80 91 80 06 lds r24, 0x0680 ; 0x800680 15f2e: 8f 93 push r24 15f30: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 15f34: 8f 93 push r24 15f36: 1f 93 push r17 15f38: 0f 93 push r16 15f3a: 1f 93 push r17 15f3c: 0f 93 push r16 15f3e: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 15f42: 1f 92 push r1 15f44: 8f 93 push r24 15f46: 80 91 29 07 lds r24, 0x0729 ; 0x800729 15f4a: 1f 92 push r1 15f4c: 8f 93 push r24 15f4e: 80 91 28 07 lds r24, 0x0728 ; 0x800728 15f52: 1f 92 push r1 15f54: 8f 93 push r24 15f56: 80 91 27 07 lds r24, 0x0727 ; 0x800727 15f5a: 1f 92 push r1 15f5c: 8f 93 push r24 15f5e: 1f 93 push r17 15f60: 0f 93 push r16 15f62: 1f 93 push r17 15f64: 0f 93 push r16 15f66: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 15f6a: 8f 93 push r24 15f6c: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 15f70: 8f 93 push r24 15f72: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 15f76: 8f 93 push r24 15f78: 80 91 7b 06 lds r24, 0x067B ; 0x80067b 15f7c: 8f 93 push r24 15f7e: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 15f82: 8f 93 push r24 15f84: 80 91 79 06 lds r24, 0x0679 ; 0x800679 15f88: 8f 93 push r24 15f8a: 80 91 78 06 lds r24, 0x0678 ; 0x800678 15f8e: 8f 93 push r24 15f90: 80 91 77 06 lds r24, 0x0677 ; 0x800677 15f94: 8f 93 push r24 15f96: 80 91 76 06 lds r24, 0x0676 ; 0x800676 15f9a: 8f 93 push r24 15f9c: 80 91 75 06 lds r24, 0x0675 ; 0x800675 15fa0: 8f 93 push r24 15fa2: 80 91 74 06 lds r24, 0x0674 ; 0x800674 15fa6: 8f 93 push r24 15fa8: 80 91 73 06 lds r24, 0x0673 ; 0x800673 15fac: 8f 93 push r24 15fae: 80 91 72 06 lds r24, 0x0672 ; 0x800672 15fb2: 8f 93 push r24 15fb4: 80 91 71 06 lds r24, 0x0671 ; 0x800671 15fb8: 8f 93 push r24 15fba: 80 91 70 06 lds r24, 0x0670 ; 0x800670 15fbe: 8f 93 push r24 15fc0: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 15fc4: 8f 93 push r24 15fc6: 1f 93 push r17 15fc8: 0f 93 push r16 15fca: 1f 93 push r17 15fcc: 0f 93 push r16 15fce: 89 e3 ldi r24, 0x39 ; 57 15fd0: 92 e8 ldi r25, 0x82 ; 130 15fd2: 9f 93 push r25 15fd4: 8f 93 push r24 15fd6: 0f 94 08 dc call 0x3b810 ; 0x3b810 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"), 15fda: 0f b6 in r0, 0x3f ; 63 15fdc: f8 94 cli 15fde: de bf out 0x3e, r29 ; 62 15fe0: 0f be out 0x3f, r0 ; 63 15fe2: 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; 15fe4: 2c ea ldi r18, 0xAC ; 172 15fe6: 35 ec ldi r19, 0xC5 ; 197 15fe8: 47 e2 ldi r20, 0x27 ; 39 15fea: 5e e3 ldi r21, 0x3E ; 62 15fec: 60 91 db 06 lds r22, 0x06DB ; 0x8006db 15ff0: 70 91 dc 06 lds r23, 0x06DC ; 0x8006dc 15ff4: 80 91 dd 06 lds r24, 0x06DD ; 0x8006dd 15ff8: 90 91 de 06 lds r25, 0x06DE ; 0x8006de 15ffc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 16000: 9f 93 push r25 16002: 8f 93 push r24 16004: 7f 93 push r23 16006: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 16008: 2c ea ldi r18, 0xAC ; 172 1600a: 35 ec ldi r19, 0xC5 ; 197 1600c: 47 e2 ldi r20, 0x27 ; 39 1600e: 5e e3 ldi r21, 0x3E ; 62 16010: 60 91 d7 06 lds r22, 0x06D7 ; 0x8006d7 16014: 70 91 d8 06 lds r23, 0x06D8 ; 0x8006d8 16018: 80 91 d9 06 lds r24, 0x06D9 ; 0x8006d9 1601c: 90 91 da 06 lds r25, 0x06DA ; 0x8006da 16020: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 16024: 9f 93 push r25 16026: 8f 93 push r24 16028: 7f 93 push r23 1602a: 6f 93 push r22 1602c: 80 91 d6 06 lds r24, 0x06D6 ; 0x8006d6 16030: 8f 93 push r24 16032: 80 91 d5 06 lds r24, 0x06D5 ; 0x8006d5 16036: 8f 93 push r24 16038: 80 91 d4 06 lds r24, 0x06D4 ; 0x8006d4 1603c: 8f 93 push r24 1603e: 80 91 d3 06 lds r24, 0x06D3 ; 0x8006d3 16042: 8f 93 push r24 16044: 1f 93 push r17 16046: 0f 93 push r16 16048: 1f 93 push r17 1604a: 0f 93 push r16 1604c: 8c e0 ldi r24, 0x0C ; 12 1604e: 92 e8 ldi r25, 0x82 ; 130 16050: 9f 93 push r25 16052: 8f 93 push r24 16054: 0f 94 08 dc call 0x3b810 ; 0x3b810 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 16058: 2c ea ldi r18, 0xAC ; 172 1605a: 35 ec ldi r19, 0xC5 ; 197 1605c: 47 e2 ldi r20, 0x27 ; 39 1605e: 5e e3 ldi r21, 0x3E ; 62 16060: 60 91 e7 06 lds r22, 0x06E7 ; 0x8006e7 16064: 70 91 e8 06 lds r23, 0x06E8 ; 0x8006e8 16068: 80 91 e9 06 lds r24, 0x06E9 ; 0x8006e9 1606c: 90 91 ea 06 lds r25, 0x06EA ; 0x8006ea 16070: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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"), 16074: 9f 93 push r25 16076: 8f 93 push r24 16078: 7f 93 push r23 1607a: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 1607c: 2c ea ldi r18, 0xAC ; 172 1607e: 35 ec ldi r19, 0xC5 ; 197 16080: 47 e2 ldi r20, 0x27 ; 39 16082: 5e e3 ldi r21, 0x3E ; 62 16084: 60 91 e3 06 lds r22, 0x06E3 ; 0x8006e3 16088: 70 91 e4 06 lds r23, 0x06E4 ; 0x8006e4 1608c: 80 91 e5 06 lds r24, 0x06E5 ; 0x8006e5 16090: 90 91 e6 06 lds r25, 0x06E6 ; 0x8006e6 16094: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 16098: 9f 93 push r25 1609a: 8f 93 push r24 1609c: 7f 93 push r23 1609e: 6f 93 push r22 160a0: 80 91 e2 06 lds r24, 0x06E2 ; 0x8006e2 160a4: 8f 93 push r24 160a6: 80 91 e1 06 lds r24, 0x06E1 ; 0x8006e1 160aa: 8f 93 push r24 160ac: 80 91 e0 06 lds r24, 0x06E0 ; 0x8006e0 160b0: 8f 93 push r24 160b2: 80 91 df 06 lds r24, 0x06DF ; 0x8006df 160b6: 8f 93 push r24 160b8: 1f 93 push r17 160ba: 0f 93 push r16 160bc: 1f 93 push r17 160be: 0f 93 push r16 160c0: 87 ed ldi r24, 0xD7 ; 215 160c2: 91 e8 ldi r25, 0x81 ; 129 160c4: 9f 93 push r25 160c6: 8f 93 push r24 160c8: 0f 94 08 dc call 0x3b810 ; 0x3b810 echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 160cc: 0f b6 in r0, 0x3f ; 63 160ce: f8 94 cli 160d0: de bf out 0x3e, r29 ; 62 160d2: 0f be out 0x3f, r0 ; 63 160d4: cd bf out 0x3d, r28 ; 61 160d6: 80 91 ed 06 lds r24, 0x06ED ; 0x8006ed 160da: 1f 92 push r1 160dc: 8f 93 push r24 160de: 1f 93 push r17 160e0: 0f 93 push r16 160e2: 1f 93 push r17 160e4: 0f 93 push r16 160e6: 20 e0 ldi r18, 0x00 ; 0 160e8: 30 e0 ldi r19, 0x00 ; 0 160ea: 40 e7 ldi r20, 0x70 ; 112 160ec: 52 e4 ldi r21, 0x42 ; 66 160ee: 60 91 fe 06 lds r22, 0x06FE ; 0x8006fe 160f2: 70 91 ff 06 lds r23, 0x06FF ; 0x8006ff 160f6: 80 91 00 07 lds r24, 0x0700 ; 0x800700 160fa: 90 91 01 07 lds r25, 0x0701 ; 0x800701 160fe: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 16102: 9f 93 push r25 16104: 8f 93 push r24 16106: 7f 93 push r23 16108: 6f 93 push r22 1610a: 80 91 fd 06 lds r24, 0x06FD ; 0x8006fd 1610e: 8f 93 push r24 16110: 80 91 fc 06 lds r24, 0x06FC ; 0x8006fc 16114: 8f 93 push r24 16116: 80 91 fb 06 lds r24, 0x06FB ; 0x8006fb 1611a: 8f 93 push r24 1611c: 80 91 fa 06 lds r24, 0x06FA ; 0x8006fa 16120: 8f 93 push r24 16122: 1f 93 push r17 16124: 0f 93 push r16 16126: 1f 93 push r17 16128: 0f 93 push r16 1612a: 80 91 f9 06 lds r24, 0x06F9 ; 0x8006f9 1612e: 8f 93 push r24 16130: 80 91 f8 06 lds r24, 0x06F8 ; 0x8006f8 16134: 8f 93 push r24 16136: 80 91 f7 06 lds r24, 0x06F7 ; 0x8006f7 1613a: 8f 93 push r24 1613c: 80 91 f6 06 lds r24, 0x06F6 ; 0x8006f6 16140: 8f 93 push r24 16142: 20 e0 ldi r18, 0x00 ; 0 16144: 30 e0 ldi r19, 0x00 ; 0 16146: 40 e7 ldi r20, 0x70 ; 112 16148: 52 e4 ldi r21, 0x42 ; 66 1614a: 60 91 f2 06 lds r22, 0x06F2 ; 0x8006f2 1614e: 70 91 f3 06 lds r23, 0x06F3 ; 0x8006f3 16152: 80 91 f4 06 lds r24, 0x06F4 ; 0x8006f4 16156: 90 91 f5 06 lds r25, 0x06F5 ; 0x8006f5 1615a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1615e: 9f 93 push r25 16160: 8f 93 push r24 16162: 7f 93 push r23 16164: 6f 93 push r22 16166: 80 91 f1 06 lds r24, 0x06F1 ; 0x8006f1 1616a: 8f 93 push r24 1616c: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 16170: 8f 93 push r24 16172: 80 91 ef 06 lds r24, 0x06EF ; 0x8006ef 16176: 8f 93 push r24 16178: 80 91 ee 06 lds r24, 0x06EE ; 0x8006ee 1617c: 8f 93 push r24 1617e: 1f 93 push r17 16180: 0f 93 push r16 16182: 1f 93 push r17 16184: 0f 93 push r16 16186: 86 ed ldi r24, 0xD6 ; 214 16188: 90 e8 ldi r25, 0x80 ; 128 1618a: 9f 93 push r25 1618c: 8f 93 push r24 1618e: 0f 94 08 dc call 0x3b810 ; 0x3b810 ); #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) { 16192: 0f b6 in r0, 0x3f ; 63 16194: f8 94 cli 16196: de bf out 0x3e, r29 ; 62 16198: 0f be out 0x3f, r0 ; 63 1619a: cd bf out 0x3d, r28 ; 61 1619c: 80 91 02 07 lds r24, 0x0702 ; 0x800702 161a0: 88 23 and r24, r24 161a2: 11 f4 brne .+4 ; 0x161a8 161a4: 0c 94 29 c2 jmp 0x18452 ; 0x18452 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 161a8: 80 91 06 07 lds r24, 0x0706 ; 0x800706 161ac: 8f 93 push r24 161ae: 80 91 05 07 lds r24, 0x0705 ; 0x800705 161b2: 8f 93 push r24 161b4: 80 91 04 07 lds r24, 0x0704 ; 0x800704 161b8: 8f 93 push r24 161ba: 80 91 03 07 lds r24, 0x0703 ; 0x800703 161be: 8f 93 push r24 161c0: 1f 93 push r17 161c2: 0f 93 push r16 161c4: 1f 93 push r17 161c6: 0f 93 push r16 161c8: 80 eb ldi r24, 0xB0 ; 176 161ca: 90 e8 ldi r25, 0x80 ; 128 161cc: 9f 93 push r25 161ce: 8f 93 push r24 161d0: 0f 94 08 dc call 0x3b810 ; 0x3b810 161d4: 0f b6 in r0, 0x3f ; 63 161d6: f8 94 cli 161d8: de bf out 0x3e, r29 ; 62 161da: 0f be out 0x3f, r0 ; 63 161dc: 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( 161de: 80 91 3b 07 lds r24, 0x073B ; 0x80073b 161e2: 8f 93 push r24 161e4: 80 91 3a 07 lds r24, 0x073A ; 0x80073a 161e8: 8f 93 push r24 161ea: 80 91 39 07 lds r24, 0x0739 ; 0x800739 161ee: 8f 93 push r24 161f0: 80 91 38 07 lds r24, 0x0738 ; 0x800738 161f4: 8f 93 push r24 161f6: 80 91 37 07 lds r24, 0x0737 ; 0x800737 161fa: 1f 92 push r1 161fc: 8f 93 push r24 161fe: 80 91 36 07 lds r24, 0x0736 ; 0x800736 16202: 8f 93 push r24 16204: 80 91 35 07 lds r24, 0x0735 ; 0x800735 16208: 8f 93 push r24 1620a: 80 91 34 07 lds r24, 0x0734 ; 0x800734 1620e: 8f 93 push r24 16210: 80 91 33 07 lds r24, 0x0733 ; 0x800733 16214: 8f 93 push r24 16216: 80 91 32 07 lds r24, 0x0732 ; 0x800732 1621a: 8f 93 push r24 1621c: 80 91 31 07 lds r24, 0x0731 ; 0x800731 16220: 8f 93 push r24 16222: 80 91 30 07 lds r24, 0x0730 ; 0x800730 16226: 8f 93 push r24 16228: 80 91 2f 07 lds r24, 0x072F ; 0x80072f 1622c: 8f 93 push r24 1622e: 04 e1 ldi r16, 0x14 ; 20 16230: 1a ea ldi r17, 0xAA ; 170 16232: 1f 93 push r17 16234: 0f 93 push r16 16236: 1f 93 push r17 16238: 0f 93 push r16 1623a: 8f e0 ldi r24, 0x0F ; 15 1623c: 90 e8 ldi r25, 0x80 ; 128 1623e: 9f 93 push r25 16240: 8f 93 push r24 16242: 0f 94 08 dc call 0x3b810 ; 0x3b810 "%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(); 16246: 0f 94 d0 43 call 0x287a0 ; 0x287a0 #endif printf_P(PSTR( 1624a: 8d ee ldi r24, 0xED ; 237 1624c: 9f e0 ldi r25, 0x0F ; 15 1624e: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 16252: f6 2e mov r15, r22 16254: e7 2e mov r14, r23 16256: d8 2e mov r13, r24 16258: c9 2e mov r12, r25 1625a: 81 ef ldi r24, 0xF1 ; 241 1625c: 9f e0 ldi r25, 0x0F ; 15 1625e: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 16262: cf 92 push r12 16264: df 92 push r13 16266: ef 92 push r14 16268: ff 92 push r15 1626a: 9f 93 push r25 1626c: 8f 93 push r24 1626e: 7f 93 push r23 16270: 6f 93 push r22 16272: 1f 93 push r17 16274: 0f 93 push r16 16276: 1f 93 push r17 16278: 0f 93 push r16 1627a: 8e ee ldi r24, 0xEE ; 238 1627c: 9f e7 ldi r25, 0x7F ; 127 1627e: 9f 93 push r25 16280: 8f 93 push r24 16282: 0f 94 08 dc call 0x3b810 ; 0x3b810 16286: 0f b6 in r0, 0x3f ; 63 16288: f8 94 cli 1628a: de bf out 0x3e, r29 ; 62 1628c: 0f be out 0x3f, r0 ; 63 1628e: cd bf out 0x3d, r28 ; 61 16290: 5c c1 rjmp .+696 ; 0x1654a 16292: 88 35 cpi r24, 0x58 ; 88 16294: 52 e0 ldi r21, 0x02 ; 2 16296: 95 07 cpc r25, r21 16298: 11 f4 brne .+4 ; 0x1629e 1629a: 0c 94 43 c2 jmp 0x18486 ; 0x18486 1629e: 14 f0 brlt .+4 ; 0x162a4 162a0: 0c 94 ee a6 jmp 0x14ddc ; 0x14ddc 162a4: 88 32 cpi r24, 0x28 ; 40 162a6: 92 40 sbci r25, 0x02 ; 2 162a8: 11 f0 breq .+4 ; 0x162ae 162aa: 0c 94 7a a6 jmp 0x14cf4 ; 0x14cf4 #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 162ae: 80 e5 ldi r24, 0x50 ; 80 162b0: 0e 94 8d 5c call 0xb91a ; 0xb91a 162b4: 88 23 and r24, r24 162b6: 09 f4 brne .+2 ; 0x162ba 162b8: 48 c1 rjmp .+656 ; 0x1654a { uint8_t valCnt = 0; IP_address = 0; 162ba: 10 92 58 06 sts 0x0658, r1 ; 0x800658 162be: 10 92 59 06 sts 0x0659, r1 ; 0x800659 162c2: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 162c6: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 162ca: 08 e5 ldi r16, 0x58 ; 88 162cc: 16 e0 ldi r17, 0x06 ; 6 162ce: 3c e5 ldi r19, 0x5C ; 92 162d0: e3 2e mov r14, r19 162d2: 36 e0 ldi r19, 0x06 ; 6 162d4: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 162d6: 4a e2 ldi r20, 0x2A ; 42 162d8: d4 2e mov r13, r20 162da: e0 91 93 03 lds r30, 0x0393 ; 0x800393 162de: f0 91 94 03 lds r31, 0x0394 ; 0x800394 162e2: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 162e4: 0e 94 2c 5c call 0xb858 ; 0xb858 162e8: d8 01 movw r26, r16 162ea: 8d 93 st X+, r24 162ec: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 162ee: ea 16 cp r14, r26 162f0: fb 06 cpc r15, r27 162f2: 09 f4 brne .+2 ; 0x162f6 162f4: 2a c1 rjmp .+596 ; 0x1654a 162f6: 8e e2 ldi r24, 0x2E ; 46 162f8: 0e 94 8d 5c call 0xb91a ; 0xb91a 162fc: 81 11 cpse r24, r1 162fe: ed cf rjmp .-38 ; 0x162da if (valCnt != 4) IP_address = 0; 16300: 10 92 58 06 sts 0x0658, r1 ; 0x800658 16304: 10 92 59 06 sts 0x0659, r1 ; 0x800659 16308: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 1630c: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 16310: 1c c1 rjmp .+568 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16312: 8e 3b cpi r24, 0xBE ; 190 16314: e2 e0 ldi r30, 0x02 ; 2 16316: 9e 07 cpc r25, r30 16318: 11 f4 brne .+4 ; 0x1631e 1631a: 0c 94 0d cd jmp 0x19a1a ; 0x19a1a 1631e: 0c f0 brlt .+2 ; 0x16322 16320: 4e c0 rjmp .+156 ; 0x163be 16322: 8b 35 cpi r24, 0x5B ; 91 16324: 22 e0 ldi r18, 0x02 ; 2 16326: 92 07 cpc r25, r18 16328: 11 f4 brne .+4 ; 0x1632e 1632a: 0c 94 53 c6 jmp 0x18ca6 ; 0x18ca6 1632e: 8d 3b cpi r24, 0xBD ; 189 16330: 92 40 sbci r25, 0x02 ; 2 16332: 11 f0 breq .+4 ; 0x16338 16334: 0c 94 7a a6 jmp 0x14cf4 ; 0x14cf4 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 16338: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1633c: 81 30 cpi r24, 0x01 ; 1 1633e: 11 f4 brne .+4 ; 0x16344 16340: 0c 94 ae cc jmp 0x1995c ; 0x1995c - `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; 16344: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16346: 8c e4 ldi r24, 0x4C ; 76 16348: 0e 94 8d 5c call 0xb91a ; 0xb91a - `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 1634c: c1 2c mov r12, r1 1634e: d1 2c mov r13, r1 16350: 6c e8 ldi r22, 0x8C ; 140 16352: e6 2e mov r14, r22 16354: 62 e4 ldi r22, 0x42 ; 66 16356: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16358: 88 23 and r24, r24 1635a: 21 f0 breq .+8 ; 0x16364 1635c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16360: 6b 01 movw r12, r22 16362: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 16364: 8a e5 ldi r24, 0x5A ; 90 16366: 0e 94 8d 5c call 0xb91a ; 0xb91a 1636a: 88 23 and r24, r24 1636c: 11 f4 brne .+4 ; 0x16372 1636e: 0c 94 bf cc jmp 0x1997e ; 0x1997e 16372: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16376: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 16378: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 1637c: 4b 01 movw r8, r22 1637e: 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 16380: 8a e5 ldi r24, 0x5A ; 90 16382: 0e 94 8d 5c call 0xb91a ; 0xb91a 16386: 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; 16388: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1638c: 10 92 86 17 sts 0x1786, r1 ; 0x801786 void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){ FSensorBlockRunout fsBlockRunout; prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 16390: 80 91 95 13 lds r24, 0x1395 ; 0x801395 16394: 81 30 cpi r24, 0x01 ; 1 16396: 11 f0 breq .+4 ; 0x1639c 16398: 0c 94 c4 cc jmp 0x19988 ; 0x19988 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 1639c: 15 30 cpi r17, 0x05 ; 5 1639e: 18 f4 brcc .+6 ; 0x163a6 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 163a0: 81 2f mov r24, r17 163a2: 0f 94 08 1d call 0x23a10 ; 0x23a10 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 163a6: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 163aa: 85 e8 ldi r24, 0x85 ; 133 163ac: 97 e1 ldi r25, 0x17 ; 23 163ae: 0e 94 95 75 call 0xeb2a ; 0xeb2a // 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); 163b2: c5 01 movw r24, r10 163b4: b4 01 movw r22, r8 163b6: 90 58 subi r25, 0x80 ; 128 163b8: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 163bc: c6 c0 rjmp .+396 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 163be: 81 3c cpi r24, 0xC1 ; 193 163c0: 42 e0 ldi r20, 0x02 ; 2 163c2: 94 07 cpc r25, r20 163c4: 11 f4 brne .+4 ; 0x163ca 163c6: 0c 94 41 cd jmp 0x19a82 ; 0x19a82 163ca: 14 f0 brlt .+4 ; 0x163d0 163cc: 0c 94 47 cd jmp 0x19a8e ; 0x19a8e 163d0: 80 3c cpi r24, 0xC0 ; 192 163d2: 92 40 sbci r25, 0x02 ; 2 163d4: 11 f0 breq .+4 ; 0x163da 163d6: 0c 94 7a a6 jmp 0x14cf4 ; 0x14cf4 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 163da: 80 ec ldi r24, 0xC0 ; 192 163dc: 92 e0 ldi r25, 0x02 ; 2 163de: 0e 94 15 61 call 0xc22a ; 0xc22a 163e2: b3 c0 rjmp .+358 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 163e4: 84 38 cpi r24, 0x84 ; 132 163e6: b3 e0 ldi r27, 0x03 ; 3 163e8: 9b 07 cpc r25, r27 163ea: 11 f4 brne .+4 ; 0x163f0 163ec: 0c 94 fd c9 jmp 0x193fa ; 0x193fa 163f0: 0c f0 brlt .+2 ; 0x163f4 163f2: 99 c0 rjmp .+306 ; 0x16526 163f4: 82 35 cpi r24, 0x52 ; 82 163f6: f3 e0 ldi r31, 0x03 ; 3 163f8: 9f 07 cpc r25, r31 163fa: 11 f4 brne .+4 ; 0x16400 163fc: 0c 94 59 c6 jmp 0x18cb2 ; 0x18cb2 16400: 9c f5 brge .+102 ; 0x16468 16402: 84 3c cpi r24, 0xC4 ; 196 16404: 32 e0 ldi r19, 0x02 ; 2 16406: 93 07 cpc r25, r19 16408: 11 f4 brne .+4 ; 0x1640e 1640a: 0c 94 6a cd jmp 0x19ad4 ; 0x19ad4 1640e: 85 3c cpi r24, 0xC5 ; 197 16410: 92 40 sbci r25, 0x02 ; 2 16412: 11 f0 breq .+4 ; 0x16418 16414: 0c 94 7a a6 jmp 0x14cf4 ; 0x14cf4 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 16418: 83 e5 ldi r24, 0x53 ; 83 1641a: 0e 94 8d 5c call 0xb91a ; 0xb91a 1641e: 88 23 and r24, r24 16420: 51 f0 breq .+20 ; 0x16436 { switch (code_value_uint8()) 16422: 0e 94 1f 5c call 0xb83e ; 0xb83e 16426: 88 23 and r24, r24 16428: 11 f4 brne .+4 ; 0x1642e 1642a: 0c 94 96 cd jmp 0x19b2c ; 0x19b2c 1642e: 81 30 cpi r24, 0x01 ; 1 16430: 11 f4 brne .+4 ; 0x16436 16432: 0c 94 a3 cd jmp 0x19b46 ; 0x19b46 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 16436: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1643a: 81 30 cpi r24, 0x01 ; 1 1643c: 91 f4 brne .+36 ; 0x16462 1643e: 88 e5 ldi r24, 0x58 ; 88 16440: 0e 94 8d 5c call 0xb91a ; 0xb91a 16444: 88 23 and r24, r24 16446: 69 f0 breq .+26 ; 0x16462 { switch (code_value_uint8()) 16448: 0e 94 1f 5c call 0xb83e ; 0xb83e 1644c: 81 30 cpi r24, 0x01 ; 1 1644e: 11 f4 brne .+4 ; 0x16454 16450: 0c 94 b1 cd jmp 0x19b62 ; 0x19b62 16454: 10 f4 brcc .+4 ; 0x1645a 16456: 0c 94 ac cd jmp 0x19b58 ; 0x19b58 1645a: 8a 32 cpi r24, 0x2A ; 42 1645c: 11 f4 brne .+4 ; 0x16462 1645e: 0c 94 b5 cd jmp 0x19b6a ; 0x19b6a break; default: break; } } MMU2::mmu2.Status(); 16462: 0f 94 bc 76 call 0x2ed78 ; 0x2ed78 16466: 71 c0 rjmp .+226 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16468: 8d 35 cpi r24, 0x5D ; 93 1646a: 53 e0 ldi r21, 0x03 ; 3 1646c: 95 07 cpc r25, r21 1646e: 11 f4 brne .+4 ; 0x16474 16470: 0c 94 cf c7 jmp 0x18f9e ; 0x18f9e 16474: 8e 35 cpi r24, 0x5E ; 94 16476: a3 e0 ldi r26, 0x03 ; 3 16478: 9a 07 cpc r25, r26 1647a: 11 f4 brne .+4 ; 0x16480 1647c: 0c 94 67 c8 jmp 0x190ce ; 0x190ce 16480: 8c 35 cpi r24, 0x5C ; 92 16482: 93 40 sbci r25, 0x03 ; 3 16484: 11 f0 breq .+4 ; 0x1648a 16486: 0c 94 7a a6 jmp 0x14cf4 ; 0x14cf4 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1648a: 83 e5 ldi r24, 0x53 ; 83 1648c: 0e 94 8d 5c call 0xb91a ; 0xb91a 16490: 88 23 and r24, r24 16492: 09 f4 brne .+2 ; 0x16496 16494: 5a c0 rjmp .+180 ; 0x1654a set_target_pinda = code_value_short(); 16496: 0e 94 2c 5c call 0xb858 ; 0xb858 1649a: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1649c: 89 e9 ldi r24, 0x99 ; 153 1649e: 99 e3 ldi r25, 0x39 ; 57 164a0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 164a4: 0f 94 be 0b call 0x2177c ; 0x2177c SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 164a8: 89 e0 ldi r24, 0x09 ; 9 164aa: 97 e8 ldi r25, 0x87 ; 135 164ac: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLLN(set_target_pinda); 164b0: c8 01 movw r24, r16 164b2: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c codenum = _millis(); 164b6: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 164ba: 4b 01 movw r8, r22 164bc: 5c 01 movw r10, r24 cancel_heatup = false; 164be: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.404> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 164c2: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 164c6: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 164ca: 89 2b or r24, r25 164cc: 41 f4 brne .+16 ; 0x164de 164ce: ff 24 eor r15, r15 164d0: f3 94 inc r15 164d2: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 164d6: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 164da: 89 2b or r24, r25 164dc: 09 f0 breq .+2 ; 0x164e0 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 164de: 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)) ) { 164e0: 28 01 movw r4, r16 164e2: 01 2e mov r0, r17 164e4: 00 0c add r0, r0 164e6: 66 08 sbc r6, r6 164e8: 77 08 sbc r7, r7 164ea: f1 10 cpse r15, r1 164ec: 0c 94 8f c7 jmp 0x18f1e ; 0x18f1e 164f0: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.404> 164f4: 81 11 cpse r24, r1 164f6: 12 c0 rjmp .+36 ; 0x1651c 164f8: c3 01 movw r24, r6 164fa: b2 01 movw r22, r4 164fc: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 16500: 20 91 95 03 lds r18, 0x0395 ; 0x800395 16504: 30 91 96 03 lds r19, 0x0396 ; 0x800396 16508: 40 91 97 03 lds r20, 0x0397 ; 0x800397 1650c: 50 91 98 03 lds r21, 0x0398 ; 0x800398 16510: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 16514: 18 16 cp r1, r24 16516: 14 f4 brge .+4 ; 0x1651c 16518: 0c 94 a1 c7 jmp 0x18f42 ; 0x18f42 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 1651c: 84 e4 ldi r24, 0x44 ; 68 1651e: 9e e6 ldi r25, 0x6E ; 110 16520: 0f 94 be 0b call 0x2177c ; 0x2177c 16524: 12 c0 rjmp .+36 ; 0x1654a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16526: 81 39 cpi r24, 0x91 ; 145 16528: e3 e0 ldi r30, 0x03 ; 3 1652a: 9e 07 cpc r25, r30 1652c: 11 f4 brne .+4 ; 0x16532 1652e: 0c 94 30 cb jmp 0x19660 ; 0x19660 16532: 8c f4 brge .+34 ; 0x16556 16534: 8b 38 cpi r24, 0x8B ; 139 16536: 23 e0 ldi r18, 0x03 ; 3 16538: 92 07 cpc r25, r18 1653a: 11 f4 brne .+4 ; 0x16540 1653c: 0c 94 ac ca jmp 0x19558 ; 0x19558 16540: 8c 38 cpi r24, 0x8C ; 140 16542: 93 40 sbci r25, 0x03 ; 3 16544: 11 f0 breq .+4 ; 0x1654a 16546: 0c 94 7a a6 jmp 0x14cf4 ; 0x14cf4 */ 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; 1654a: 10 92 59 0e sts 0x0E59, r1 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.550+0x1> 1654e: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 <_ZL17mcode_in_progress.lto_priv.550> 16552: 0c 94 f6 97 jmp 0x12fec ; 0x12fec } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16556: 84 39 cpi r24, 0x94 ; 148 16558: 43 e0 ldi r20, 0x03 ; 3 1655a: 94 07 cpc r25, r20 1655c: 14 f4 brge .+4 ; 0x16562 1655e: 0c 94 7f cb jmp 0x196fe ; 0x196fe 16562: 80 3a cpi r24, 0xA0 ; 160 16564: 93 40 sbci r25, 0x03 ; 3 16566: 11 f0 breq .+4 ; 0x1656c 16568: 0c 94 7a a6 jmp 0x14cf4 ; 0x14cf4 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 1656c: 80 91 93 03 lds r24, 0x0393 ; 0x800393 16570: 90 91 94 03 lds r25, 0x0394 ; 0x800394 } } void CardReader::openLogFile(const char* name) { logging = true; 16574: 21 e0 ldi r18, 0x01 ; 1 16576: 20 93 6a 14 sts 0x146A, r18 ; 0x80146a openFileWrite(name); 1657a: 05 96 adiw r24, 0x05 ; 5 1657c: 0f 94 d1 85 call 0x30ba2 ; 0x30ba2 16580: e4 cf rjmp .-56 ; 0x1654a - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 16582: 00 91 93 03 lds r16, 0x0393 ; 0x800393 16586: 10 91 94 03 lds r17, 0x0394 ; 0x800394 1658a: 0e 5f subi r16, 0xFE ; 254 1658c: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1658e: 80 e5 ldi r24, 0x50 ; 80 16590: 0e 94 8d 5c call 0xb91a ; 0xb91a */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 16594: c1 2c mov r12, r1 16596: d1 2c mov r13, r1 16598: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1659a: 88 23 and r24, r24 1659c: 21 f0 breq .+8 ; 0x165a6 1659e: 0e 94 39 5c call 0xb872 ; 0xb872 165a2: 6b 01 movw r12, r22 165a4: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 165a6: 83 e5 ldi r24, 0x53 ; 83 165a8: 0e 94 8d 5c call 0xb91a ; 0xb91a 165ac: 88 23 and r24, r24 165ae: 51 f0 breq .+20 ; 0x165c4 165b0: 0e 94 39 5c call 0xb872 ; 0xb872 165b4: 9b 01 movw r18, r22 165b6: ac 01 movw r20, r24 165b8: a8 ee ldi r26, 0xE8 ; 232 165ba: b3 e0 ldi r27, 0x03 ; 3 165bc: 0f 94 db dd call 0x3bbb6 ; 0x3bbb6 <__muluhisi3> 165c0: 6b 01 movw r12, r22 165c2: 7c 01 movw r14, r24 165c4: c8 01 movw r24, r16 165c6: 0f 5f subi r16, 0xFF ; 255 165c8: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 165ca: dc 01 movw r26, r24 165cc: 4c 91 ld r20, X 165ce: 40 32 cpi r20, 0x20 ; 32 165d0: c9 f3 breq .-14 ; 0x165c4 custom_message_type = CustomMsg::M0Wait; 165d2: 26 e0 ldi r18, 0x06 ; 6 165d4: 20 93 72 07 sts 0x0772, r18 ; 0x800772 if (!expiration_time_set && *src != '\0') { 165d8: c1 14 cp r12, r1 165da: d1 04 cpc r13, r1 165dc: e1 04 cpc r14, r1 165de: f1 04 cpc r15, r1 165e0: a1 f5 brne .+104 ; 0x1664a 165e2: 2c 91 ld r18, X 165e4: 22 23 and r18, r18 165e6: 89 f1 breq .+98 ; 0x1664a lcd_setstatus(src); 165e8: 0f 94 26 15 call 0x22a4c ; 0x22a4c 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(); 165ec: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 165f0: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 165f4: 84 60 ori r24, 0x04 ; 4 165f6: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce previous_millis_cmd.start(); 165fa: 84 e8 ldi r24, 0x84 ; 132 165fc: 93 e0 ldi r25, 0x03 ; 3 165fe: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> if (expiration_time_set) { 16602: c1 14 cp r12, r1 16604: d1 04 cpc r13, r1 16606: e1 04 cpc r14, r1 16608: f1 04 cpc r15, r1 1660a: 79 f1 breq .+94 ; 0x1666a codenum += _millis(); // keep track of when we started waiting 1660c: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 16610: c6 0e add r12, r22 16612: d7 1e adc r13, r23 16614: e8 1e adc r14, r24 16616: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 16618: 84 e0 ldi r24, 0x04 ; 4 1661a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(_millis() < codenum && !lcd_clicked()) { 1661e: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 16622: 6c 15 cp r22, r12 16624: 7d 05 cpc r23, r13 16626: 8e 05 cpc r24, r14 16628: 9f 05 cpc r25, r15 1662a: b0 f0 brcs .+44 ; 0x16658 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 1662c: 82 e0 ldi r24, 0x02 ; 2 1662e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 16632: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 16636: 8b 7f andi r24, 0xFB ; 251 16638: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce if (IS_SD_PRINTING) 1663c: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 16640: 88 23 and r24, r24 16642: 31 f1 breq .+76 ; 0x16690 custom_message_type = CustomMsg::Status; 16644: 10 92 72 07 sts 0x0772, r1 ; 0x800772 16648: 80 cf rjmp .-256 ; 0x1654a } 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)); 1664a: 82 eb ldi r24, 0xB2 ; 178 1664c: 99 e3 ldi r25, 0x39 ; 57 1664e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 16652: 0f 94 be 0b call 0x2177c ; 0x2177c 16656: ca cf rjmp .-108 ; 0x165ec 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()) { 16658: 0e 94 c3 71 call 0xe386 ; 0xe386 1665c: 81 11 cpse r24, r1 1665e: e6 cf rjmp .-52 ; 0x1662c delay_keep_alive(0); 16660: 90 e0 ldi r25, 0x00 ; 0 16662: 80 e0 ldi r24, 0x00 ; 0 16664: 0e 94 98 8e call 0x11d30 ; 0x11d30 16668: da cf rjmp .-76 ; 0x1661e //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 1666a: 10 91 96 02 lds r17, 0x0296 ; 0x800296 KEEPALIVE_STATE(PAUSED_FOR_USER); 1666e: 84 e0 ldi r24, 0x04 ; 4 16670: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 16674: 0e 94 be 71 call 0xe37c ; 0xe37c while(!lcd_clicked()) 16678: 0e 94 c3 71 call 0xe386 ; 0xe386 1667c: 81 11 cpse r24, r1 1667e: 05 c0 rjmp .+10 ; 0x1668a { delay_keep_alive(0); 16680: 90 e0 ldi r25, 0x00 ; 0 16682: 80 e0 ldi r24, 0x00 ; 0 16684: 0e 94 98 8e call 0x11d30 ; 0x11d30 16688: f7 cf rjmp .-18 ; 0x16678 } KEEPALIVE_STATE(busy_state_backup); 1668a: 10 93 96 02 sts 0x0296, r17 ; 0x800296 1668e: d1 cf rjmp .-94 ; 0x16632 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 16690: 8d ea ldi r24, 0xAD ; 173 16692: 90 e7 ldi r25, 0x70 ; 112 16694: 0f 94 be 0b call 0x2177c ; 0x2177c 16698: 58 cf rjmp .-336 ; 0x1654a /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 1669a: 87 ea ldi r24, 0xA7 ; 167 1669c: 99 e3 ldi r25, 0x39 ; 57 1669e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 166a2: 0f 94 be 0b call 0x2177c ; 0x2177c enable_x(); 166a6: 17 98 cbi 0x02, 7 ; 2 enable_y(); 166a8: 16 98 cbi 0x02, 6 ; 2 enable_z(); 166aa: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 166ac: 14 98 cbi 0x02, 4 ; 2 166ae: 4d cf rjmp .-358 ; 0x1654a /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 166b0: 81 e0 ldi r24, 0x01 ; 1 166b2: 0f 94 2d 81 call 0x3025a ; 0x3025a 166b6: 49 cf rjmp .-366 ; 0x1654a presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 166b8: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b mounted = false; 166bc: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c SERIAL_ECHO_START; 166c0: 84 e1 ldi r24, 0x14 ; 20 166c2: 9a ea ldi r25, 0xAA ; 170 166c4: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 166c8: 83 e0 ldi r24, 0x03 ; 3 166ca: 9c e6 ldi r25, 0x6C ; 108 166cc: 0e 94 17 7b call 0xf62e ; 0xf62e 166d0: 3c cf rjmp .-392 ; 0x1654a /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 166d2: 0e 94 4b 68 call 0xd096 ; 0xd096 166d6: 88 23 and r24, r24 166d8: 19 f0 breq .+6 ; 0x166e0 lcd_resume_print(); 166da: 0f 94 fa 14 call 0x229f4 ; 0x229f4 166de: 35 cf rjmp .-406 ; 0x1654a else { if (!filament_presence_check()) { 166e0: 0f 94 4f 16 call 0x22c9e ; 0x22c9e 166e4: 88 23 and r24, r24 166e6: 09 f4 brne .+2 ; 0x166ea 166e8: 30 cf rjmp .-416 ; 0x1654a 166ea: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 166ee: 88 23 and r24, r24 166f0: 61 f0 breq .+24 ; 0x1670a // Print was aborted break; } if (!card.get_sdpos()) 166f2: 80 91 7f 17 lds r24, 0x177F ; 0x80177f 166f6: 90 91 80 17 lds r25, 0x1780 ; 0x801780 166fa: a0 91 81 17 lds r26, 0x1781 ; 0x801781 166fe: b0 91 82 17 lds r27, 0x1782 ; 0x801782 16702: 89 2b or r24, r25 16704: 8a 2b or r24, r26 16706: 8b 2b or r24, r27 16708: 69 f4 brne .+26 ; 0x16724 { // A new print has started from scratch, reset stats failstats_reset_print(); 1670a: 0e 94 db 5c call 0xb9b6 ; 0xb9b6 sdpos_atomic = 0; 1670e: 10 92 80 03 sts 0x0380, r1 ; 0x800380 16712: 10 92 81 03 sts 0x0381, r1 ; 0x800381 16716: 10 92 82 03 sts 0x0382, r1 ; 0x800382 1671a: 10 92 83 03 sts 0x0383, r1 ; 0x800383 1671e: 80 e0 ldi r24, 0x00 ; 0 16720: 0e 94 53 83 call 0x106a6 ; 0x106a6 } void CardReader::startFileprint() { if(mounted) 16724: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 16728: 88 23 and r24, r24 1672a: 31 f0 breq .+12 ; 0x16738 { sdprinting = true; 1672c: 81 e0 ldi r24, 0x01 ; 1 1672e: 80 93 6b 14 sts 0x146B, r24 ; 0x80146b 16732: 85 e0 ldi r24, 0x05 ; 5 16734: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 16738: 0f 94 86 58 call 0x2b10c ; 0x2b10c if (MMU2::mmu2.Enabled()) 1673c: 80 91 95 13 lds r24, 0x1395 ; 0x801395 16740: 81 30 cpi r24, 0x01 ; 1 16742: 09 f0 breq .+2 ; 0x16746 16744: 02 cf rjmp .-508 ; 0x1654a { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 16746: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1674a: 88 23 and r24, r24 1674c: 09 f4 brne .+2 ; 0x16750 1674e: fd ce rjmp .-518 ; 0x1654a 16750: 0e 94 cc e4 call 0x1c998 ; 0x1c998 16754: 81 11 cpse r24, r1 16756: f9 ce rjmp .-526 ; 0x1654a { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 16758: 0f 94 22 a0 call 0x34044 ; 0x34044 1675c: f6 ce rjmp .-532 ; 0x1654a #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 1675e: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 16762: 88 23 and r24, r24 16764: 09 f4 brne .+2 ; 0x16768 16766: f1 ce rjmp .-542 ; 0x1654a 16768: 83 e5 ldi r24, 0x53 ; 83 1676a: 0e 94 8d 5c call 0xb91a ; 0xb91a 1676e: 88 23 and r24, r24 16770: 09 f4 brne .+2 ; 0x16774 16772: eb ce rjmp .-554 ; 0x1654a long index = code_value_long(); 16774: 0e 94 39 5c call 0xb872 ; 0xb872 16778: 6b 01 movw r12, r22 1677a: 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);}; 1677c: c0 92 7f 17 sts 0x177F, r12 ; 0x80177f 16780: d0 92 80 17 sts 0x1780, r13 ; 0x801780 16784: e0 92 81 17 sts 0x1781, r14 ; 0x801781 16788: f0 92 82 17 sts 0x1782, r15 ; 0x801782 1678c: 0f 94 75 77 call 0x2eeea ; 0x2eeea 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; 16790: c0 92 80 03 sts 0x0380, r12 ; 0x800380 16794: d0 92 81 03 sts 0x0381, r13 ; 0x800381 16798: e0 92 82 03 sts 0x0382, r14 ; 0x800382 1679c: f0 92 83 03 sts 0x0383, r15 ; 0x800383 167a0: d4 ce rjmp .-600 ; 0x1654a #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 167a2: 80 e5 ldi r24, 0x50 ; 80 167a4: 0e 94 8d 5c call 0xb91a ; 0xb91a 167a8: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 167aa: 0e 94 4b 68 call 0xd096 ; 0xd096 167ae: 88 23 and r24, r24 167b0: 91 f0 breq .+36 ; 0x167d6 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 167b2: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 167b6: 88 23 and r24, r24 167b8: 49 f0 breq .+18 ; 0x167cc 167ba: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 167be: 81 11 cpse r24, r1 167c0: 05 c0 rjmp .+10 ; 0x167cc SERIAL_PROTOCOLLNPGM("SD print paused"); 167c2: 8f e3 ldi r24, 0x3F ; 63 167c4: 96 e8 ldi r25, 0x86 ; 134 167c6: 0e 94 17 7b call 0xf62e ; 0xf62e 167ca: bf ce rjmp .-642 ; 0x1654a else SERIAL_PROTOCOLLNPGM("Print saved"); 167cc: 83 e3 ldi r24, 0x33 ; 51 167ce: 96 e8 ldi r25, 0x86 ; 134 167d0: 0e 94 17 7b call 0xf62e ; 0xf62e 167d4: ba ce rjmp .-652 ; 0x1654a } else if (sdprinting) 167d6: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 167da: 88 23 and r24, r24 167dc: 09 f4 brne .+2 ; 0x167e0 167de: 4a c0 rjmp .+148 ; 0x16874 { if (arg_P) 167e0: 11 23 and r17, r17 167e2: e1 f1 breq .+120 ; 0x1685c { printAbsFilenameFast(); 167e4: 0f 94 fa 7b call 0x2f7f4 ; 0x2f7f4 SERIAL_PROTOCOLLN(); 167e8: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 167ec: 8d e8 ldi r24, 0x8D ; 141 167ee: 98 e6 ldi r25, 0x68 ; 104 167f0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 167f4: 60 91 7f 17 lds r22, 0x177F ; 0x80177f 167f8: 70 91 80 17 lds r23, 0x1780 ; 0x801780 167fc: 80 91 81 17 lds r24, 0x1781 ; 0x801781 16800: 90 91 82 17 lds r25, 0x1782 ; 0x801782 16804: 4a e0 ldi r20, 0x0A ; 10 16806: 0f 94 35 d2 call 0x3a46a ; 0x3a46a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1680a: 8f e2 ldi r24, 0x2F ; 47 1680c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 16810: 60 91 78 17 lds r22, 0x1778 ; 0x801778 16814: 70 91 79 17 lds r23, 0x1779 ; 0x801779 16818: 80 91 7a 17 lds r24, 0x177A ; 0x80177a 1681c: 90 91 7b 17 lds r25, 0x177B ; 0x80177b 16820: 4a e0 ldi r20, 0x0A ; 10 16822: 0f 94 35 d2 call 0x3a46a ; 0x3a46a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 16826: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 1682a: 0f 94 b3 54 call 0x2a966 ; 0x2a966 1682e: 2c e3 ldi r18, 0x3C ; 60 16830: 30 e0 ldi r19, 0x00 ; 0 16832: 40 e0 ldi r20, 0x00 ; 0 16834: 50 e0 ldi r21, 0x00 ; 0 16836: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 1683a: c9 01 movw r24, r18 1683c: 6c e3 ldi r22, 0x3C ; 60 1683e: 70 e0 ldi r23, 0x00 ; 0 16840: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 16844: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 16846: 90 e0 ldi r25, 0x00 ; 0 16848: 80 e0 ldi r24, 0x00 ; 0 1684a: 0f 94 9a d2 call 0x3a534 ; 0x3a534 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1684e: 8a e3 ldi r24, 0x3A ; 58 16850: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 16854: c8 01 movw r24, r16 16856: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c 1685a: 77 ce rjmp .-786 ; 0x1654a { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 1685c: 80 91 82 14 lds r24, 0x1482 ; 0x801482 16860: 88 23 and r24, r24 16862: 29 f0 breq .+10 ; 0x1686e 16864: 82 e8 ldi r24, 0x82 ; 130 16866: 94 e1 ldi r25, 0x14 ; 20 16868: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 1686c: bf cf rjmp .-130 ; 0x167ec 1686e: 8d e6 ldi r24, 0x6D ; 109 16870: 94 e1 ldi r25, 0x14 ; 20 16872: fa cf rjmp .-12 ; 0x16868 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 16874: 83 e2 ldi r24, 0x23 ; 35 16876: 96 e8 ldi r25, 0x86 ; 134 16878: 0e 94 17 7b call 0xf62e ; 0xf62e 1687c: 66 ce rjmp .-820 ; 0x1654a /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1687e: 80 91 93 03 lds r24, 0x0393 ; 0x800393 16882: 90 91 94 03 lds r25, 0x0394 ; 0x800394 16886: 04 96 adiw r24, 0x04 ; 4 16888: 0f 94 d1 85 call 0x30ba2 ; 0x30ba2 1688c: 5e ce rjmp .-836 ; 0x1654a * 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; 1688e: ce 01 movw r24, r28 16890: 01 96 adiw r24, 0x01 ; 1 16892: 0f 94 56 78 call 0x2f0ac ; 0x2f0ac 16896: 88 23 and r24, r24 16898: 11 f4 brne .+4 ; 0x1689e 1689a: 0c 94 c2 a7 jmp 0x14f84 ; 0x14f84 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1689e: 61 e0 ldi r22, 0x01 ; 1 168a0: ce 01 movw r24, r28 168a2: 01 96 adiw r24, 0x01 ; 1 168a4: 0f 94 32 a4 call 0x34864 ; 0x34864 if (!d) goto fail; 168a8: 00 97 sbiw r24, 0x00 ; 0 168aa: 11 f4 brne .+4 ; 0x168b0 168ac: 0c 94 c2 a7 jmp 0x14f84 ; 0x14f84 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 168b0: 25 ee ldi r18, 0xE5 ; 229 168b2: fc 01 movw r30, r24 168b4: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 168b6: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 168b8: 0f 94 55 6b call 0x2d6aa ; 0x2d6aa 168bc: 18 2f mov r17, r24 168be: 0c 94 c3 a7 jmp 0x14f86 ; 0x14f86 presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 168c2: 8d ef ldi r24, 0xFD ; 253 168c4: 95 e8 ldi r25, 0x85 ; 133 168c6: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 168ca: 23 96 adiw r28, 0x03 ; 3 168cc: 8e ad ldd r24, Y+62 ; 0x3e 168ce: 9f ad ldd r25, Y+63 ; 0x3f 168d0: 23 97 sbiw r28, 0x03 ; 3 168d2: 0e 94 50 89 call 0x112a0 ; 0x112a0 168d6: 8e e2 ldi r24, 0x2E ; 46 168d8: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 168dc: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 168e0: 34 ce rjmp .-920 ; 0x1654a ### 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(); 168e2: 0f 94 b3 54 call 0x2a966 ; 0x2a966 int16_t sec, min; min = t / 60; sec = t % 60; 168e6: 2c e3 ldi r18, 0x3C ; 60 168e8: 30 e0 ldi r19, 0x00 ; 0 168ea: 40 e0 ldi r20, 0x00 ; 0 168ec: 50 e0 ldi r21, 0x00 ; 0 168ee: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 168f2: 7f 93 push r23 168f4: 6f 93 push r22 168f6: 3f 93 push r19 168f8: 2f 93 push r18 168fa: 8e ed ldi r24, 0xDE ; 222 168fc: 98 e8 ldi r25, 0x88 ; 136 168fe: 9f 93 push r25 16900: 8f 93 push r24 16902: 8e 01 movw r16, r28 16904: 0f 5f subi r16, 0xFF ; 255 16906: 1f 4f sbci r17, 0xFF ; 255 16908: 1f 93 push r17 1690a: 0f 93 push r16 1690c: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba SERIAL_ECHO_START; 16910: 84 e1 ldi r24, 0x14 ; 20 16912: 9a ea ldi r25, 0xAA ; 170 16914: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(time); 16918: c8 01 movw r24, r16 1691a: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 lcd_setstatus(time); 1691e: c8 01 movw r24, r16 16920: 0f 94 26 15 call 0x22a4c ; 0x22a4c autotempShutdown(); 16924: 0f b6 in r0, 0x3f ; 63 16926: f8 94 cli 16928: de bf out 0x3e, r29 ; 62 1692a: 0f be out 0x3f, r0 ; 63 1692c: cd bf out 0x3d, r28 ; 61 1692e: 0d ce rjmp .-998 ; 0x1654a #### 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')) 16930: 83 e5 ldi r24, 0x53 ; 83 16932: 0e 94 8d 5c call 0xb91a ; 0xb91a 16936: 88 23 and r24, r24 16938: 09 f4 brne .+2 ; 0x1693c 1693a: 07 ce rjmp .-1010 ; 0x1654a { uint8_t pin_status = code_value_uint8(); 1693c: 0e 94 1f 5c call 0xb83e ; 0xb83e 16940: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 16942: 80 e5 ldi r24, 0x50 ; 80 16944: 0e 94 8d 5c call 0xb91a ; 0xb91a */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 16948: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 1694a: 88 23 and r24, r24 1694c: 19 f0 breq .+6 ; 0x16954 pin_number = code_value_uint8(); 1694e: 0e 94 1f 5c call 0xb83e ; 0xb83e 16952: 18 2f mov r17, r24 16954: e2 ec ldi r30, 0xC2 ; 194 16956: f8 e8 ldi r31, 0x88 ; 136 16958: 8e ed ldi r24, 0xDE ; 222 1695a: 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) 1695c: 24 91 lpm r18, Z 1695e: 21 17 cp r18, r17 16960: 09 f4 brne .+2 ; 0x16964 16962: f3 cd rjmp .-1050 ; 0x1654a 16964: 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++) 16966: 8e 17 cp r24, r30 16968: 9f 07 cpc r25, r31 1696a: c1 f7 brne .-16 ; 0x1695c pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 1696c: 16 30 cpi r17, 0x06 ; 6 1696e: 81 f4 brne .+32 ; 0x16990 fanSpeed = pin_status; 16970: 00 93 df 03 sts 0x03DF, r16 ; 0x8003df #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 16974: 61 e0 ldi r22, 0x01 ; 1 16976: 81 2f mov r24, r17 16978: 0e 94 74 df call 0x1bee8 ; 0x1bee8 digitalWrite(pin_number, pin_status); 1697c: 60 2f mov r22, r16 1697e: 81 2f mov r24, r17 16980: 0e 94 46 df call 0x1be8c ; 0x1be8c analogWrite(pin_number, pin_status); 16984: 60 2f mov r22, r16 16986: 70 e0 ldi r23, 0x00 ; 0 16988: 81 2f mov r24, r17 1698a: 0e 94 a5 df call 0x1bf4a ; 0x1bf4a 1698e: dd cd rjmp .-1094 ; 0x1654a } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 16990: 17 fd sbrc r17, 7 16992: db cd rjmp .-1098 ; 0x1654a 16994: ef cf rjmp .-34 ; 0x16974 ### 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); 16996: 80 e1 ldi r24, 0x10 ; 16 16998: 0e 94 e5 e6 call 0x1cdca ; 0x1cdca eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1699c: 81 ea ldi r24, 0xA1 ; 161 1699e: 9d e0 ldi r25, 0x0D ; 13 169a0: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 169a4: 3b e0 ldi r19, 0x0B ; 11 169a6: 83 9f mul r24, r19 169a8: c0 01 movw r24, r0 169aa: 11 24 eor r1, r1 169ac: 70 e0 ldi r23, 0x00 ; 0 169ae: 60 e0 ldi r22, 0x00 ; 0 169b0: 80 5b subi r24, 0xB0 ; 176 169b2: 92 4f sbci r25, 0xF2 ; 242 169b4: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 169b8: 82 e0 ldi r24, 0x02 ; 2 169ba: 0e 94 e5 e6 call 0x1cdca ; 0x1cdca reset_bed_offset_and_skew(); 169be: 0f 94 84 cb call 0x39708 ; 0x39708 // 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(); 169c2: 0f 94 65 cb call 0x396ca ; 0x396ca 169c6: c1 cd rjmp .-1150 ; 0x1654a */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 169c8: 8a e5 ldi r24, 0x5A ; 90 169ca: 0e 94 8d 5c call 0xb91a ; 0xb91a // 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); 169ce: 0e 94 47 e7 call 0x1ce8e ; 0x1ce8e 169d2: bb cd rjmp .-1162 ; 0x1654a ### 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()) { 169d4: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 169d8: 88 23 and r24, r24 169da: 19 f1 breq .+70 ; 0x16a22 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 169dc: ce 01 movw r24, r28 169de: 01 96 adiw r24, 0x01 ; 1 169e0: 0f 94 39 86 call 0x30c72 ; 0x30c72 169e4: 88 23 and r24, r24 169e6: c1 f0 breq .+48 ; 0x16a18 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169e8: 89 81 ldd r24, Y+1 ; 0x01 169ea: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 169ee: 8e e2 ldi r24, 0x2E ; 46 169f0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169f4: 8a 81 ldd r24, Y+2 ; 0x02 169f6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 169fa: 8e e2 ldi r24, 0x2E ; 46 169fc: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 16a00: 8b 81 ldd r24, Y+3 ; 0x03 16a02: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 16a06: 8e e2 ldi r24, 0x2E ; 46 16a08: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 16a0c: 8c 81 ldd r24, Y+4 ; 0x04 16a0e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 16a12: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 16a16: 99 cd rjmp .-1230 ; 0x1654a SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 16a18: 82 ea ldi r24, 0xA2 ; 162 16a1a: 98 e8 ldi r25, 0x88 ; 136 16a1c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 16a20: 94 cd rjmp .-1240 ; 0x1654a } } else { SERIAL_PROTOCOLLNPGM("n/a"); 16a22: 8e e9 ldi r24, 0x9E ; 158 16a24: 98 e8 ldi r25, 0x88 ; 136 16a26: 0e 94 17 7b call 0xf62e ; 0xf62e 16a2a: 8f cd rjmp .-1250 ; 0x1654a 16a2c: 10 92 64 0e sts 0x0E64, r1 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 16a30: 8c cd rjmp .-1256 ; 0x1654a break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 16a32: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 16a36: 1f 92 push r1 16a38: 8f 93 push r24 16a3a: 84 ef ldi r24, 0xF4 ; 244 16a3c: 99 e6 ldi r25, 0x69 ; 105 16a3e: 9f 93 push r25 16a40: 8f 93 push r24 16a42: 0f 94 08 dc call 0x3b810 ; 0x3b810 16a46: 0f 90 pop r0 16a48: 0f 90 pop r0 16a4a: 0f 90 pop r0 16a4c: 0f 90 pop r0 16a4e: 7d cd rjmp .-1286 ; 0x1654a - `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(); 16a50: 80 e5 ldi r24, 0x50 ; 80 16a52: 0e 94 8d 5c call 0xb91a ; 0xb91a 16a56: 88 23 and r24, r24 16a58: 21 f0 breq .+8 ; 0x16a62 16a5a: 0e 94 1f 5c call 0xb83e ; 0xb83e 16a5e: 80 93 86 02 sts 0x0286, r24 ; 0x800286 if(code_seen('R')) print_time_remaining_normal = code_value(); 16a62: 82 e5 ldi r24, 0x52 ; 82 16a64: 0e 94 8d 5c call 0xb91a ; 0xb91a 16a68: 88 23 and r24, r24 16a6a: 41 f0 breq .+16 ; 0x16a7c 16a6c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16a70: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 16a74: 70 93 8a 02 sts 0x028A, r23 ; 0x80028a 16a78: 60 93 89 02 sts 0x0289, r22 ; 0x800289 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 16a7c: 81 e5 ldi r24, 0x51 ; 81 16a7e: 0e 94 8d 5c call 0xb91a ; 0xb91a 16a82: 88 23 and r24, r24 16a84: 21 f0 breq .+8 ; 0x16a8e 16a86: 0e 94 1f 5c call 0xb83e ; 0xb83e 16a8a: 80 93 85 02 sts 0x0285, r24 ; 0x800285 if(code_seen('S')) print_time_remaining_silent = code_value(); 16a8e: 83 e5 ldi r24, 0x53 ; 83 16a90: 0e 94 8d 5c call 0xb91a ; 0xb91a 16a94: 88 23 and r24, r24 16a96: 41 f0 breq .+16 ; 0x16aa8 16a98: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16a9c: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 16aa0: 70 93 8e 02 sts 0x028E, r23 ; 0x80028e 16aa4: 60 93 8d 02 sts 0x028D, r22 ; 0x80028d if(code_seen('C')){ 16aa8: 83 e4 ldi r24, 0x43 ; 67 16aaa: 0e 94 8d 5c call 0xb91a ; 0xb91a 16aae: 88 23 and r24, r24 16ab0: a9 f0 breq .+42 ; 0x16adc float print_time_to_change_normal_f = code_value(); 16ab2: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16ab6: 6b 01 movw r12, r22 16ab8: 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; 16aba: 20 e0 ldi r18, 0x00 ; 0 16abc: 30 e0 ldi r19, 0x00 ; 0 16abe: a9 01 movw r20, r18 16ac0: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 16ac4: 6f ef ldi r22, 0xFF ; 255 16ac6: 7f ef ldi r23, 0xFF ; 255 16ac8: 18 16 cp r1, r24 16aca: 24 f4 brge .+8 ; 0x16ad4 16acc: c7 01 movw r24, r14 16ace: b6 01 movw r22, r12 16ad0: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 16ad4: 70 93 88 02 sts 0x0288, r23 ; 0x800288 16ad8: 60 93 87 02 sts 0x0287, r22 ; 0x800287 } if(code_seen('D')){ 16adc: 84 e4 ldi r24, 0x44 ; 68 16ade: 0e 94 8d 5c call 0xb91a ; 0xb91a 16ae2: 88 23 and r24, r24 16ae4: a9 f0 breq .+42 ; 0x16b10 float print_time_to_change_silent_f = code_value(); 16ae6: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16aea: 6b 01 movw r12, r22 16aec: 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; 16aee: 20 e0 ldi r18, 0x00 ; 0 16af0: 30 e0 ldi r19, 0x00 ; 0 16af2: a9 01 movw r20, r18 16af4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 16af8: 6f ef ldi r22, 0xFF ; 255 16afa: 7f ef ldi r23, 0xFF ; 255 16afc: 18 16 cp r1, r24 16afe: 24 f4 brge .+8 ; 0x16b08 16b00: c7 01 movw r24, r14 16b02: b6 01 movw r22, r12 16b04: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 16b08: 70 93 8c 02 sts 0x028C, r23 ; 0x80028c 16b0c: 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); 16b10: 80 91 88 02 lds r24, 0x0288 ; 0x800288 16b14: 8f 93 push r24 16b16: 80 91 87 02 lds r24, 0x0287 ; 0x800287 16b1a: 8f 93 push r24 16b1c: 80 91 8a 02 lds r24, 0x028A ; 0x80028a 16b20: 8f 93 push r24 16b22: 80 91 89 02 lds r24, 0x0289 ; 0x800289 16b26: 8f 93 push r24 16b28: 80 91 86 02 lds r24, 0x0286 ; 0x800286 16b2c: 28 2f mov r18, r24 16b2e: 08 2e mov r0, r24 16b30: 00 0c add r0, r0 16b32: 33 0b sbc r19, r19 16b34: 3f 93 push r19 16b36: 8f 93 push r24 16b38: 8a e9 ldi r24, 0x9A ; 154 16b3a: 99 e6 ldi r25, 0x69 ; 105 16b3c: 9f 93 push r25 16b3e: 8f 93 push r24 16b40: 01 ea ldi r16, 0xA1 ; 161 16b42: 19 e6 ldi r17, 0x69 ; 105 16b44: 1f 93 push r17 16b46: 0f 93 push r16 16b48: 0f 94 08 dc call 0x3b810 ; 0x3b810 printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 16b4c: 80 91 8c 02 lds r24, 0x028C ; 0x80028c 16b50: 8f 93 push r24 16b52: 80 91 8b 02 lds r24, 0x028B ; 0x80028b 16b56: 8f 93 push r24 16b58: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 16b5c: 8f 93 push r24 16b5e: 80 91 8d 02 lds r24, 0x028D ; 0x80028d 16b62: 8f 93 push r24 16b64: 80 91 85 02 lds r24, 0x0285 ; 0x800285 16b68: 28 2f mov r18, r24 16b6a: 08 2e mov r0, r24 16b6c: 00 0c add r0, r0 16b6e: 33 0b sbc r19, r19 16b70: 3f 93 push r19 16b72: 8f 93 push r24 16b74: 83 e9 ldi r24, 0x93 ; 147 16b76: 99 e6 ldi r25, 0x69 ; 105 16b78: 9f 93 push r25 16b7a: 8f 93 push r24 16b7c: 1f 93 push r17 16b7e: 0f 93 push r16 16b80: 0f 94 08 dc call 0x3b810 ; 0x3b810 16b84: 0f b6 in r0, 0x3f ; 63 16b86: f8 94 cli 16b88: de bf out 0x3e, r29 ; 62 16b8a: 0f be out 0x3f, r0 ; 63 16b8c: cd bf out 0x3d, r28 ; 61 16b8e: dd cc rjmp .-1606 ; 0x1654a } else return false; } bool Stopwatch::pause() { if (isRunning()) { 16b90: 80 91 99 03 lds r24, 0x0399 ; 0x800399 16b94: 81 30 cpi r24, 0x01 ; 1 16b96: 09 f0 breq .+2 ; 0x16b9a 16b98: d8 cc rjmp .-1616 ; 0x1654a state = PAUSED; 16b9a: 82 e0 ldi r24, 0x02 ; 2 16b9c: 80 93 99 03 sts 0x0399, r24 ; 0x800399 stopTimestamp = _millis(); 16ba0: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 16ba4: 60 93 4c 06 sts 0x064C, r22 ; 0x80064c 16ba8: 70 93 4d 06 sts 0x064D, r23 ; 0x80064d 16bac: 80 93 4e 06 sts 0x064E, r24 ; 0x80064e 16bb0: 90 93 4f 06 sts 0x064F, r25 ; 0x80064f 16bb4: ca cc rjmp .-1644 ; 0x1654a /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 16bb6: 0f 94 aa 58 call 0x2b154 ; 0x2b154 save_statistics(); 16bba: 0e 94 e5 66 call 0xcdca ; 0xcdca 16bbe: c5 cc rjmp .-1654 ; 0x1654a const char *_m_fil; const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { 16bc0: 0e 94 56 68 call 0xd0ac ; 0xd0ac 16bc4: 88 23 and r24, r24 16bc6: c1 f1 breq .+112 ; 0x16c38 _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; 16bc8: 60 91 5f 06 lds r22, 0x065F ; 0x80065f 16bcc: 70 91 60 06 lds r23, 0x0660 ; 0x800660 16bd0: 80 91 61 06 lds r24, 0x0661 ; 0x800661 16bd4: 90 91 62 06 lds r25, 0x0662 ; 0x800662 16bd8: 28 ee ldi r18, 0xE8 ; 232 16bda: 33 e0 ldi r19, 0x03 ; 3 16bdc: 40 e0 ldi r20, 0x00 ; 0 16bde: 50 e0 ldi r21, 0x00 ; 0 16be0: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 16be4: 12 2f mov r17, r18 16be6: 03 2f mov r16, r19 16be8: f4 2e mov r15, r20 16bea: e5 2e mov r14, r21 _min = print_job_timer.duration() / 60; 16bec: 0f 94 b3 54 call 0x2a966 ; 0x2a966 16bf0: 2c e3 ldi r18, 0x3C ; 60 16bf2: 30 e0 ldi r19, 0x00 ; 0 16bf4: 40 e0 ldi r20, 0x00 ; 0 16bf6: 50 e0 ldi r21, 0x00 ; 0 16bf8: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 16bfc: b9 01 movw r22, r18 16bfe: 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); 16c00: 44 ea ldi r20, 0xA4 ; 164 16c02: 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); 16c04: 24 e9 ldi r18, 0x94 ; 148 16c06: 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); 16c08: 9f 93 push r25 16c0a: 8f 93 push r24 16c0c: 7f 93 push r23 16c0e: 6f 93 push r22 16c10: 5f 93 push r21 16c12: 4f 93 push r20 16c14: ef 92 push r14 16c16: ff 92 push r15 16c18: 0f 93 push r16 16c1a: 1f 93 push r17 16c1c: 3f 93 push r19 16c1e: 2f 93 push r18 16c20: 8d e7 ldi r24, 0x7D ; 125 16c22: 99 e6 ldi r25, 0x69 ; 105 16c24: 9f 93 push r25 16c26: 8f 93 push r24 16c28: 0f 94 08 dc call 0x3b810 ; 0x3b810 16c2c: 0f b6 in r0, 0x3f ; 63 16c2e: f8 94 cli 16c30: de bf out 0x3e, r29 ; 62 16c32: 0f be out 0x3f, r0 ; 63 16c34: cd bf out 0x3d, r28 ; 61 16c36: 89 cc rjmp .-1774 ; 0x1654a _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')) { 16c38: 83 e5 ldi r24, 0x53 ; 83 16c3a: 0e 94 8d 5c call 0xb91a ; 0xb91a 16c3e: 88 23 and r24, r24 16c40: 51 f0 breq .+20 ; 0x16c56 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); 16c42: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16c46: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 16c4a: ab 01 movw r20, r22 16c4c: 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); 16c4e: 81 ef ldi r24, 0xF1 ; 241 16c50: 9f e0 ldi r25, 0x0F ; 15 16c52: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 } if (code_seen('T')) { 16c56: 84 e5 ldi r24, 0x54 ; 84 16c58: 0e 94 8d 5c call 0xb91a ; 0xb91a 16c5c: 88 23 and r24, r24 16c5e: 51 f0 breq .+20 ; 0x16c74 eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); 16c60: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16c64: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 16c68: ab 01 movw r20, r22 16c6a: bc 01 movw r22, r24 16c6c: 8d ee ldi r24, 0xED ; 237 16c6e: 9f e0 ldi r25, 0x0F ; 15 16c70: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); 16c74: 81 ef ldi r24, 0xF1 ; 241 16c76: 9f e0 ldi r25, 0x0F ; 15 16c78: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 16c7c: 16 2f mov r17, r22 16c7e: 07 2f mov r16, r23 16c80: f8 2e mov r15, r24 16c82: e9 2e mov r14, r25 _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); 16c84: 8d ee ldi r24, 0xED ; 237 16c86: 9f e0 ldi r25, 0x0F ; 15 16c88: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c } 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); 16c8c: 41 e8 ldi r20, 0x81 ; 129 16c8e: 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); 16c90: 20 e7 ldi r18, 0x70 ; 112 16c92: 3c e4 ldi r19, 0x4C ; 76 16c94: b9 cf rjmp .-142 ; 0x16c08 void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 16c96: 8a e9 ldi r24, 0x9A ; 154 16c98: 93 e0 ldi r25, 0x03 ; 3 16c9a: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 16c9e: 83 e5 ldi r24, 0x53 ; 83 16ca0: 0e 94 8d 5c call 0xb91a ; 0xb91a 16ca4: 88 23 and r24, r24 16ca6: 09 f1 breq .+66 ; 0x16cea , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 16ca8: 62 e2 ldi r22, 0x22 ; 34 16caa: 70 e0 ldi r23, 0x00 ; 0 16cac: 80 91 93 03 lds r24, 0x0393 ; 0x800393 16cb0: 90 91 94 03 lds r25, 0x0394 ; 0x800394 16cb4: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 16cb8: 8c 01 movw r16, r24 if (!this->ptr) { 16cba: 89 2b or r24, r25 16cbc: b1 f0 breq .+44 ; 0x16cea // First quote not found return; } // Skip the leading quote this->ptr++; 16cbe: 0f 5f subi r16, 0xFF ; 255 16cc0: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 16cc2: 62 e2 ldi r22, 0x22 ; 34 16cc4: 70 e0 ldi r23, 0x00 ; 0 16cc6: c8 01 movw r24, r16 16cc8: 0f 94 9d e3 call 0x3c73a ; 0x3c73a if(!pStrEnd) { 16ccc: 89 2b or r24, r25 16cce: 69 f0 breq .+26 ; 0x16cea char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 16cd0: e6 e4 ldi r30, 0x46 ; 70 16cd2: f6 e0 ldi r31, 0x06 ; 6 16cd4: 83 e0 ldi r24, 0x03 ; 3 16cd6: df 01 movw r26, r30 16cd8: 1d 92 st X+, r1 16cda: 8a 95 dec r24 16cdc: e9 f7 brne .-6 ; 0x16cd8 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 16cde: 42 e0 ldi r20, 0x02 ; 2 16ce0: 50 e0 ldi r21, 0x00 ; 0 16ce2: b8 01 movw r22, r16 16ce4: cf 01 movw r24, r30 16ce6: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c } #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 16cea: 8c e8 ldi r24, 0x8C ; 140 16cec: 9f e0 ldi r25, 0x0F ; 15 16cee: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c && printer_recovering() && printingIsPaused()) { 16cf2: 81 30 cpi r24, 0x01 ; 1 16cf4: 09 f0 breq .+2 ; 0x16cf8 16cf6: 29 cc rjmp .-1966 ; 0x1654a #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() 16cf8: 0e 94 41 68 call 0xd082 ; 0xd082 16cfc: 88 23 and r24, r24 16cfe: 09 f4 brne .+2 ; 0x16d02 16d00: 24 cc rjmp .-1976 ; 0x1654a && printingIsPaused()) { 16d02: 0e 94 4b 68 call 0xd096 ; 0xd096 16d06: 88 23 and r24, r24 16d08: 09 f4 brne .+2 ; 0x16d0c 16d0a: 1f cc rjmp .-1986 ; 0x1654a // 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) { 16d0c: 80 91 ed 04 lds r24, 0x04ED ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.551> 16d10: 88 23 and r24, r24 16d12: 29 f0 breq .+10 ; 0x16d1e SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 16d14: 8b e5 ldi r24, 0x5B ; 91 16d16: 99 e6 ldi r25, 0x69 ; 105 16d18: 0e 94 17 7b call 0xf62e ; 0xf62e 16d1c: 16 cc rjmp .-2004 ; 0x1654a } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 16d1e: 8e e3 ldi r24, 0x3E ; 62 16d20: 99 e6 ldi r25, 0x69 ; 105 16d22: 0e 94 17 7b call 0xf62e ; 0xf62e 16d26: 11 cc rjmp .-2014 ; 0x1654a /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 16d28: 81 e2 ldi r24, 0x21 ; 33 16d2a: 99 e6 ldi r25, 0x69 ; 105 16d2c: 0e 94 a6 7b call 0xf74c ; 0xf74c #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 16d30: 83 e5 ldi r24, 0x53 ; 83 16d32: 0e 94 8d 5c call 0xb91a ; 0xb91a 16d36: 88 23 and r24, r24 16d38: 09 f4 brne .+2 ; 0x16d3c 16d3a: 07 cc rjmp .-2034 ; 0x1654a 16d3c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 16d40: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 16d44: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 16d48: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 16d4c: fe cb rjmp .-2052 ; 0x1654a 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 "); 16d4e: 8a e9 ldi r24, 0x9A ; 154 16d50: 98 e8 ldi r25, 0x88 ; 136 16d52: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 gcode_M105(); 16d56: 0e 94 5e 7a call 0xf4bc ; 0xf4bc cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 16d5a: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 cmdbuffer_front_already_processed = true; 16d5e: 81 e0 ldi r24, 0x01 ; 1 16d60: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d 16d64: f2 cb rjmp .-2076 ; 0x1654a 16d66: 10 92 64 14 sts 0x1464, r1 ; 0x801464 16d6a: 0c 94 8e a9 jmp 0x1531c ; 0x1531c 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; } 16d6e: 81 e0 ldi r24, 0x01 ; 1 16d70: 80 93 62 14 sts 0x1462, r24 ; 0x801462 16d74: ea cb rjmp .-2092 ; 0x1654a #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 16d76: 82 e5 ldi r24, 0x52 ; 82 16d78: 0e 94 8d 5c call 0xb91a ; 0xb91a 16d7c: 81 11 cpse r24, r1 16d7e: 0c 94 1a a9 jmp 0x15234 ; 0x15234 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 16d82: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 16d86: 6b 01 movw r12, r22 16d88: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 16d8a: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 16d8e: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 16d92: 07 2e mov r0, r23 16d94: 00 0c add r0, r0 16d96: 88 0b sbc r24, r24 16d98: 99 0b sbc r25, r25 16d9a: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 16d9e: 11 e0 ldi r17, 0x01 ; 1 16da0: 20 91 5e 0e lds r18, 0x0E5E ; 0x800e5e 16da4: 30 91 5f 0e lds r19, 0x0E5F ; 0x800e5f 16da8: 40 91 60 0e lds r20, 0x0E60 ; 0x800e60 16dac: 50 91 61 0e lds r21, 0x0E61 ; 0x800e61 16db0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 16db4: 18 16 cp r1, r24 16db6: 0c f0 brlt .+2 ; 0x16dba 16db8: 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 16dba: 10 93 5d 0e sts 0x0E5D, r17 ; 0x800e5d <_ZL16target_direction.lto_priv.552> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 16dbe: c7 01 movw r24, r14 16dc0: b6 01 movw r22, r12 16dc2: 0f 94 4c 82 call 0x30498 ; 0x30498 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 16dc6: 8c ef ldi r24, 0xFC ; 252 16dc8: 99 e4 ldi r25, 0x49 ; 73 16dca: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 16dce: 0f 94 be 0b call 0x2177c ; 0x2177c heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 16dd2: 82 e0 ldi r24, 0x02 ; 2 16dd4: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db prusa_statistics(2); previous_millis_cmd.start(); 16dd8: 84 e8 ldi r24, 0x84 ; 132 16dda: 93 e0 ldi r25, 0x03 ; 3 16ddc: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> 16de0: b4 cb rjmp .-2200 ; 0x1654a */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 16de2: 8e ee ldi r24, 0xEE ; 238 16de4: 99 e4 ldi r25, 0x49 ; 73 16de6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 16dea: 0f 94 be 0b call 0x2177c ; 0x2177c heating_status = HeatingStatus::BED_HEATING; 16dee: 83 e0 ldi r24, 0x03 ; 3 16df0: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db prusa_statistics(1); if (code_seen('S')) 16df4: 83 e5 ldi r24, 0x53 ; 83 16df6: 0e 94 8d 5c call 0xb91a ; 0xb91a 16dfa: 18 2f mov r17, r24 16dfc: 88 23 and r24, r24 16dfe: 49 f0 breq .+18 ; 0x16e12 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 16e00: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 16e04: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 16e08: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 16e0c: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 16e10: 05 c0 rjmp .+10 ; 0x16e1c if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 16e12: 82 e5 ldi r24, 0x52 ; 82 16e14: 0e 94 8d 5c call 0xb91a ; 0xb91a 16e18: 81 11 cpse r24, r1 16e1a: f2 cf rjmp .-28 ; 0x16e00 { setTargetBed(code_value()); } codenum = _millis(); 16e1c: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 16e20: 6b 01 movw r12, r22 16e22: 7c 01 movw r14, r24 cancel_heatup = false; 16e24: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 <_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; 16e28: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 16e2c: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 16e30: 07 2e mov r0, r23 16e32: 00 0c add r0, r0 16e34: 88 0b sbc r24, r24 16e36: 99 0b sbc r25, r25 16e38: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 16e3c: 01 e0 ldi r16, 0x01 ; 1 16e3e: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 16e42: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 16e46: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 16e4a: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 16e4e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 16e52: 18 16 cp r1, r24 16e54: 0c f0 brlt .+2 ; 0x16e58 16e56: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 16e58: 00 93 5d 0e sts 0x0E5D, r16 ; 0x800e5d <_ZL16target_direction.lto_priv.552> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 16e5c: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.404> 16e60: 81 11 cpse r24, r1 16e62: 1a c0 rjmp .+52 ; 0x16e98 16e64: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 16e68: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 16e6c: 07 2e mov r0, r23 16e6e: 00 0c add r0, r0 16e70: 88 0b sbc r24, r24 16e72: 99 0b sbc r25, r25 16e74: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 16e78: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 16e7c: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 16e80: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 16e84: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 16e88: e0 91 5d 0e lds r30, 0x0E5D ; 0x800e5d <_ZL16target_direction.lto_priv.552> 16e8c: ee 23 and r30, r30 16e8e: 91 f0 breq .+36 ; 0x16eb4 16e90: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 16e94: 18 16 cp r1, r24 16e96: a4 f0 brlt .+40 ; 0x16ec0 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 16e98: 83 ee ldi r24, 0xE3 ; 227 16e9a: 99 e4 ldi r25, 0x49 ; 73 16e9c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 16ea0: 0f 94 be 0b call 0x2177c ; 0x2177c heating_status = HeatingStatus::BED_HEATING_COMPLETE; 16ea4: 84 e0 ldi r24, 0x04 ; 4 16ea6: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db previous_millis_cmd.start(); 16eaa: 84 e8 ldi r24, 0x84 ; 132 16eac: 93 e0 ldi r25, 0x03 ; 3 16eae: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> 16eb2: 4b cb rjmp .-2410 ; 0x1654a codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 16eb4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 16eb8: 87 ff sbrs r24, 7 16eba: ee cf rjmp .-36 ; 0x16e98 16ebc: 11 11 cpse r17, r1 16ebe: ec cf rjmp .-40 ; 0x16e98 { if (lcd_commands_type == LcdCommands::LongPause) { 16ec0: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 16ec4: 82 30 cpi r24, 0x02 ; 2 16ec6: 41 f3 breq .-48 ; 0x16e98 // 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. 16ec8: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 16ecc: 6c 19 sub r22, r12 16ece: 7d 09 sbc r23, r13 16ed0: 8e 09 sbc r24, r14 16ed2: 9f 09 sbc r25, r15 16ed4: 69 3e cpi r22, 0xE9 ; 233 16ed6: 73 40 sbci r23, 0x03 ; 3 16ed8: 81 05 cpc r24, r1 16eda: 91 05 cpc r25, r1 16edc: 30 f0 brcs .+12 ; 0x16eea { if (!farm_mode) { serialecho_temperatures(); 16ede: 0e 94 fa 78 call 0xf1f4 ; 0xf1f4 } codenum = _millis(); 16ee2: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 16ee6: 6b 01 movw r12, r22 16ee8: 7c 01 movw r14, r24 } manage_heater(); 16eea: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(); 16eee: 80 e0 ldi r24, 0x00 ; 0 16ef0: 0e 94 f3 8b call 0x117e6 ; 0x117e6 lcd_update(0); 16ef4: 80 e0 ldi r24, 0x00 ; 0 16ef6: 0e 94 6d 6f call 0xdeda ; 0xdeda 16efa: b0 cf rjmp .-160 ; 0x16e5c #### 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')){ 16efc: 83 e5 ldi r24, 0x53 ; 83 16efe: 0e 94 8d 5c call 0xb91a ; 0xb91a 16f02: 88 23 and r24, r24 16f04: 29 f0 breq .+10 ; 0x16f10 fanSpeed = code_value_uint8(); 16f06: 0e 94 1f 5c call 0xb83e ; 0xb83e 16f0a: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 16f0e: 1d cb rjmp .-2502 ; 0x1654a } else { fanSpeed = 255; 16f10: 8f ef ldi r24, 0xFF ; 255 16f12: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 16f16: 19 cb rjmp .-2510 ; 0x1654a /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 16f18: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df 16f1c: 16 cb rjmp .-2516 ; 0x1654a /*! ### 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; 16f1e: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 16f22: 88 60 ori r24, 0x08 ; 8 16f24: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd 16f28: 10 cb rjmp .-2528 ; 0x1654a ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 16f2a: 83 e5 ldi r24, 0x53 ; 83 16f2c: 0e 94 8d 5c call 0xb91a ; 0xb91a 16f30: 88 23 and r24, r24 16f32: 99 f0 breq .+38 ; 0x16f5a stepper_inactive_time = code_value() * 1000; 16f34: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16f38: 20 e0 ldi r18, 0x00 ; 0 16f3a: 30 e0 ldi r19, 0x00 ; 0 16f3c: 4a e7 ldi r20, 0x7A ; 122 16f3e: 54 e4 ldi r21, 0x44 ; 68 16f40: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 16f44: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 16f48: 60 93 34 02 sts 0x0234, r22 ; 0x800234 16f4c: 70 93 35 02 sts 0x0235, r23 ; 0x800235 16f50: 80 93 36 02 sts 0x0236, r24 ; 0x800236 16f54: 90 93 37 02 sts 0x0237, r25 ; 0x800237 16f58: f8 ca rjmp .-2576 ; 0x1654a } 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]))); 16f5a: 88 e5 ldi r24, 0x58 ; 88 16f5c: 0e 94 8d 5c call 0xb91a ; 0xb91a 16f60: 88 23 and r24, r24 16f62: d1 f0 breq .+52 ; 0x16f98 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 16f64: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 if (code_seen('X')) disable_x(); 16f68: 88 e5 ldi r24, 0x58 ; 88 16f6a: 0e 94 8d 5c call 0xb91a ; 0xb91a 16f6e: 81 11 cpse r24, r1 16f70: 28 c0 rjmp .+80 ; 0x16fc2 if (code_seen('Y')) disable_y(); 16f72: 89 e5 ldi r24, 0x59 ; 89 16f74: 0e 94 8d 5c call 0xb91a ; 0xb91a 16f78: 88 23 and r24, r24 16f7a: 19 f0 breq .+6 ; 0x16f82 16f7c: 16 9a sbi 0x02, 6 ; 2 16f7e: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e if (code_seen('Z')) disable_z(); 16f82: 8a e5 ldi r24, 0x5A ; 90 16f84: 0e 94 8d 5c call 0xb91a ; 0xb91a #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 16f88: 85 e4 ldi r24, 0x45 ; 69 16f8a: 0e 94 8d 5c call 0xb91a ; 0xb91a 16f8e: 88 23 and r24, r24 16f90: 09 f4 brne .+2 ; 0x16f94 16f92: db ca rjmp .-2634 ; 0x1654a 16f94: 14 9a sbi 0x02, 4 ; 2 16f96: d9 ca rjmp .-2638 ; 0x1654a 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]))); 16f98: 89 e5 ldi r24, 0x59 ; 89 16f9a: 0e 94 8d 5c call 0xb91a ; 0xb91a 16f9e: 81 11 cpse r24, r1 16fa0: e1 cf rjmp .-62 ; 0x16f64 16fa2: 8a e5 ldi r24, 0x5A ; 90 16fa4: 0e 94 8d 5c call 0xb91a ; 0xb91a 16fa8: 81 11 cpse r24, r1 16faa: dc cf rjmp .-72 ; 0x16f64 16fac: 85 e4 ldi r24, 0x45 ; 69 16fae: 0e 94 8d 5c call 0xb91a ; 0xb91a 16fb2: 81 11 cpse r24, r1 16fb4: d7 cf rjmp .-82 ; 0x16f64 if(all_axis) { st_synchronize(); 16fb6: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 disable_e0(); 16fba: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 16fbc: 0e 94 a4 83 call 0x10748 ; 0x10748 16fc0: c4 ca rjmp .-2680 ; 0x1654a } else { st_synchronize(); if (code_seen('X')) disable_x(); 16fc2: 17 9a sbi 0x02, 7 ; 2 16fc4: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d 16fc8: d4 cf rjmp .-88 ; 0x16f72 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 16fca: 83 e5 ldi r24, 0x53 ; 83 16fcc: 0e 94 8d 5c call 0xb91a ; 0xb91a 16fd0: 88 23 and r24, r24 16fd2: 09 f4 brne .+2 ; 0x16fd6 16fd4: ba ca rjmp .-2700 ; 0x1654a safetytimer_inactive_time = code_value() * 1000; 16fd6: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 16fda: 20 e0 ldi r18, 0x00 ; 0 16fdc: 30 e0 ldi r19, 0x00 ; 0 16fde: 4a e7 ldi r20, 0x7A ; 122 16fe0: 54 e4 ldi r21, 0x44 ; 68 16fe2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 16fe6: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 16fea: 60 93 30 02 sts 0x0230, r22 ; 0x800230 16fee: 70 93 31 02 sts 0x0231, r23 ; 0x800231 16ff2: 80 93 32 02 sts 0x0232, r24 ; 0x800232 16ff6: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 16ffa: 88 ed ldi r24, 0xD8 ; 216 16ffc: 95 e0 ldi r25, 0x05 ; 5 16ffe: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> 17002: a3 ca rjmp .-2746 ; 0x1654a 17004: 4d ed ldi r20, 0xDD ; 221 17006: c4 2e mov r12, r20 17008: 42 e0 ldi r20, 0x02 ; 2 1700a: d4 2e mov r13, r20 1700c: 5b e6 ldi r21, 0x6B ; 107 1700e: e5 2e mov r14, r21 17010: 56 e0 ldi r21, 0x06 ; 6 17012: 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++) 17014: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 17016: f6 01 movw r30, r12 17018: 81 91 ld r24, Z+ 1701a: 6f 01 movw r12, r30 1701c: 0e 94 8d 5c call 0xb91a ; 0xb91a 17020: 88 23 and r24, r24 17022: 09 f4 brne .+2 ; 0x17026 17024: 65 c0 rjmp .+202 ; 0x170f0 { float value = code_value(); 17026: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1702a: 2b 01 movw r4, r22 1702c: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 1702e: 13 30 cpi r17, 0x03 ; 3 17030: 09 f0 breq .+2 ; 0x17034 17032: 68 c0 rjmp .+208 ; 0x17104 if(value < 20.0) { 17034: 20 e0 ldi r18, 0x00 ; 0 17036: 30 e0 ldi r19, 0x00 ; 0 17038: 40 ea ldi r20, 0xA0 ; 160 1703a: 51 e4 ldi r21, 0x41 ; 65 1703c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 17040: 87 ff sbrs r24, 7 17042: 4e c0 rjmp .+156 ; 0x170e0 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 17044: a3 01 movw r20, r6 17046: 92 01 movw r18, r4 17048: 60 91 7b 06 lds r22, 0x067B ; 0x80067b 1704c: 70 91 7c 06 lds r23, 0x067C ; 0x80067c 17050: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 17054: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 17058: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1705c: 4b 01 movw r8, r22 1705e: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 17060: ac 01 movw r20, r24 17062: 9b 01 movw r18, r22 17064: 60 91 bf 06 lds r22, 0x06BF ; 0x8006bf 17068: 70 91 c0 06 lds r23, 0x06C0 ; 0x8006c0 1706c: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 17070: 90 91 c2 06 lds r25, 0x06C2 ; 0x8006c2 17074: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 17078: 60 93 bf 06 sts 0x06BF, r22 ; 0x8006bf 1707c: 70 93 c0 06 sts 0x06C0, r23 ; 0x8006c0 17080: 80 93 c1 06 sts 0x06C1, r24 ; 0x8006c1 17084: 90 93 c2 06 sts 0x06C2, r25 ; 0x8006c2 max_feedrate[E_AXIS] *= factor; 17088: 20 90 99 02 lds r2, 0x0299 ; 0x800299 1708c: 30 90 9a 02 lds r3, 0x029A ; 0x80029a 17090: a5 01 movw r20, r10 17092: 94 01 movw r18, r8 17094: d1 01 movw r26, r2 17096: 1c 96 adiw r26, 0x0c ; 12 17098: 6d 91 ld r22, X+ 1709a: 7d 91 ld r23, X+ 1709c: 8d 91 ld r24, X+ 1709e: 9c 91 ld r25, X 170a0: 1f 97 sbiw r26, 0x0f ; 15 170a2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 170a6: f1 01 movw r30, r2 170a8: 64 87 std Z+12, r22 ; 0x0c 170aa: 75 87 std Z+13, r23 ; 0x0d 170ac: 86 87 std Z+14, r24 ; 0x0e 170ae: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 170b0: 60 91 f9 17 lds r22, 0x17F9 ; 0x8017f9 170b4: 70 91 fa 17 lds r23, 0x17FA ; 0x8017fa 170b8: 80 91 fb 17 lds r24, 0x17FB ; 0x8017fb 170bc: 90 91 fc 17 lds r25, 0x17FC ; 0x8017fc 170c0: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 170c4: a5 01 movw r20, r10 170c6: 94 01 movw r18, r8 170c8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 170cc: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 170d0: 60 93 f9 17 sts 0x17F9, r22 ; 0x8017f9 170d4: 70 93 fa 17 sts 0x17FA, r23 ; 0x8017fa 170d8: 80 93 fb 17 sts 0x17FB, r24 ; 0x8017fb 170dc: 90 93 fc 17 sts 0x17FC, r25 ; 0x8017fc } cs.axis_steps_per_mm[E_AXIS] = value; 170e0: 40 92 7b 06 sts 0x067B, r4 ; 0x80067b 170e4: 50 92 7c 06 sts 0x067C, r5 ; 0x80067c 170e8: 60 92 7d 06 sts 0x067D, r6 ; 0x80067d 170ec: 70 92 7e 06 sts 0x067E, r7 ; 0x80067e 170f0: b4 e0 ldi r27, 0x04 ; 4 170f2: eb 0e add r14, r27 170f4: f1 1c adc r15, r1 170f6: 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++) 170f8: 14 30 cpi r17, 0x04 ; 4 170fa: 09 f0 breq .+2 ; 0x170fe 170fc: 8c cf rjmp .-232 ; 0x17016 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 170fe: 0f 94 3a aa call 0x35474 ; 0x35474 17102: 23 ca rjmp .-3002 ; 0x1654a 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; 17104: d7 01 movw r26, r14 17106: 14 96 adiw r26, 0x04 ; 4 17108: 4d 92 st X+, r4 1710a: 5d 92 st X+, r5 1710c: 6d 92 st X+, r6 1710e: 7c 92 st X, r7 17110: 17 97 sbiw r26, 0x07 ; 7 17112: ee cf rjmp .-36 ; 0x170f0 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 17114: 8e e4 ldi r24, 0x4E ; 78 17116: 0e 94 8d 5c call 0xb91a ; 0xb91a 1711a: 88 23 and r24, r24 1711c: 09 f4 brne .+2 ; 0x17120 1711e: 15 ca rjmp .-3030 ; 0x1654a gcode_LastN = code_value_long(); 17120: 0e 94 39 5c call 0xb872 ; 0xb872 17124: 60 93 78 03 sts 0x0378, r22 ; 0x800378 17128: 70 93 79 03 sts 0x0379, r23 ; 0x800379 1712c: 80 93 7a 03 sts 0x037A, r24 ; 0x80037a 17130: 90 93 7b 03 sts 0x037B, r25 ; 0x80037b 17134: 0a ca rjmp .-3052 ; 0x1654a case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 17136: 84 e1 ldi r24, 0x14 ; 20 17138: 9a ea ldi r25, 0xAA ; 170 1713a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 1713e: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 17142: d1 2c mov r13, r1 17144: f1 2c mov r15, r1 17146: 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); } 17148: 83 e9 ldi r24, 0x93 ; 147 1714a: 98 e8 ldi r25, 0x88 ; 136 1714c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 17150: 4a e0 ldi r20, 0x0A ; 10 17152: c7 01 movw r24, r14 17154: b6 01 movw r22, r12 17156: 0f 94 35 d2 call 0x3a46a ; 0x3a46a host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 1715a: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 1715e: f5 c9 rjmp .-3094 ; 0x1654a */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 17160: 85 e5 ldi r24, 0x55 ; 85 17162: 0e 94 8d 5c call 0xb91a ; 0xb91a 17166: 88 23 and r24, r24 17168: 09 f4 brne .+2 ; 0x1716c 1716a: 5a c0 rjmp .+180 ; 0x17220 // 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); 1716c: 00 91 93 03 lds r16, 0x0393 ; 0x800393 17170: 10 91 94 03 lds r17, 0x0394 ; 0x800394 17174: 0f 5f subi r16, 0xFF ; 255 17176: 1f 4f sbci r17, 0xFF ; 255 17178: 10 93 94 03 sts 0x0394, r17 ; 0x800394 1717c: 00 93 93 03 sts 0x0393, r16 ; 0x800393 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 17180: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 17184: 88 23 and r24, r24 17186: 09 f4 brne .+2 ; 0x1718a 17188: e0 c9 rjmp .-3136 ; 0x1654a // 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)) 1718a: be 01 movw r22, r28 1718c: 6f 5f subi r22, 0xFF ; 255 1718e: 7f 4f sbci r23, 0xFF ; 255 17190: c8 01 movw r24, r16 17192: 0e 94 2c f9 call 0x1f258 ; 0x1f258 17196: 88 23 and r24, r24 17198: 09 f4 brne .+2 ; 0x1719c 1719a: d7 c9 rjmp .-3154 ; 0x1654a 1719c: 8a eb ldi r24, 0xBA ; 186 1719e: 9f e8 ldi r25, 0x8F ; 143 171a0: de 01 movw r26, r28 171a2: 11 96 adiw r26, 0x01 ; 1 171a4: be 01 movw r22, r28 171a6: 67 5f subi r22, 0xF7 ; 247 171a8: 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]); 171aa: fc 01 movw r30, r24 171ac: 45 91 lpm r20, Z+ 171ae: 54 91 lpm r21, Z if (ver_gcode[i] > v) 171b0: 2d 91 ld r18, X+ 171b2: 3d 91 ld r19, X+ 171b4: 42 17 cp r20, r18 171b6: 53 07 cpc r21, r19 171b8: 10 f4 brcc .+4 ; 0x171be 171ba: 0c 94 68 cf jmp 0x19ed0 ; 0x19ed0 return 1; else if (ver_gcode[i] < v) 171be: 24 17 cp r18, r20 171c0: 35 07 cpc r19, r21 171c2: 08 f4 brcc .+2 ; 0x171c6 171c4: c2 c9 rjmp .-3196 ; 0x1654a 171c6: 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) 171c8: a6 17 cp r26, r22 171ca: b7 07 cpc r27, r23 171cc: 71 f7 brne .-36 ; 0x171aa 171ce: bd c9 rjmp .-3206 ; 0x1654a 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)); 171d0: 83 e4 ldi r24, 0x43 ; 67 171d2: 99 e3 ldi r25, 0x39 ; 57 171d4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 171d8: ac 01 movw r20, r24 171da: 63 e0 ldi r22, 0x03 ; 3 171dc: 80 e0 ldi r24, 0x00 ; 0 171de: 0e 94 ba 6f call 0xdf74 ; 0xdf74 Sound_MakeCustom(50,1000,false); 171e2: 40 e0 ldi r20, 0x00 ; 0 171e4: 68 ee ldi r22, 0xE8 ; 232 171e6: 73 e0 ldi r23, 0x03 ; 3 171e8: 82 e3 ldi r24, 0x32 ; 50 171ea: 90 e0 ldi r25, 0x00 ; 0 171ec: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac delay_keep_alive(500); 171f0: 84 ef ldi r24, 0xF4 ; 244 171f2: 91 e0 ldi r25, 0x01 ; 1 171f4: 0e 94 98 8e call 0x11d30 ; 0x11d30 Sound_MakeCustom(50,1000,false); 171f8: 40 e0 ldi r20, 0x00 ; 0 171fa: 68 ee ldi r22, 0xE8 ; 232 171fc: 73 e0 ldi r23, 0x03 ; 3 171fe: 82 e3 ldi r24, 0x32 ; 50 17200: 90 e0 ldi r25, 0x00 ; 0 17202: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac lcd_wait_for_click_delay(30); 17206: 8e e1 ldi r24, 0x1E ; 30 17208: 90 e0 ldi r25, 0x00 ; 0 1720a: 0f 94 3f 50 call 0x2a07e ; 0x2a07e lcd_update_enable(true); 1720e: 81 e0 ldi r24, 0x01 ; 1 17210: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_clear(); 17214: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_update(0); 17218: 80 e0 ldi r24, 0x00 ; 0 1721a: 0e 94 6d 6f call 0xdeda ; 0xdeda 1721e: 95 c9 rjmp .-3286 ; 0x1654a } 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); 17220: 41 e1 ldi r20, 0x11 ; 17 17222: 50 e0 ldi r21, 0x00 ; 0 17224: 60 e8 ldi r22, 0x80 ; 128 17226: 7c e0 ldi r23, 0x0C ; 12 17228: ce 01 movw r24, r28 1722a: 01 96 adiw r24, 0x01 ; 1 1722c: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 17230: 85 e7 ldi r24, 0x75 ; 117 17232: 98 e8 ldi r25, 0x88 ; 136 17234: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 17238: 86 ef ldi r24, 0xF6 ; 246 1723a: 95 e8 ldi r25, 0x85 ; 133 1723c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM("+"); 17240: 83 e7 ldi r24, 0x73 ; 115 17242: 98 e8 ldi r25, 0x88 ; 136 17244: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 17248: 8e e6 ldi r24, 0x6E ; 110 1724a: 98 e8 ldi r25, 0x88 ; 136 1724c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM("_"); 17250: 8c e6 ldi r24, 0x6C ; 108 17252: 98 e8 ldi r25, 0x88 ; 136 17254: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM(FW_COMMIT_HASH); 17258: 82 e6 ldi r24, 0x62 ; 98 1725a: 98 e8 ldi r25, 0x88 ; 136 1725c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 17260: 88 e0 ldi r24, 0x08 ; 8 17262: 98 e8 ldi r25, 0x88 ; 136 17264: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM(PROTOCOL_VERSION); 17268: 84 e0 ldi r24, 0x04 ; 4 1726a: 98 e8 ldi r25, 0x88 ; 136 1726c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 17270: 85 ef ldi r24, 0xF5 ; 245 17272: 97 e8 ldi r25, 0x87 ; 135 17274: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 17278: ce 01 movw r24, r28 1727a: 01 96 adiw r24, 0x01 ; 1 1727c: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 17280: 83 ee ldi r24, 0xE3 ; 227 17282: 97 e8 ldi r25, 0x87 ; 135 17284: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 17288: 82 ee ldi r24, 0xE2 ; 226 1728a: 97 e8 ldi r25, 0x87 ; 135 1728c: 0e 94 17 7b call 0xf62e ; 0xf62e } #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'); 17290: 1f 92 push r1 17292: 31 e3 ldi r19, 0x31 ; 49 17294: f3 2e mov r15, r19 17296: ff 92 push r15 17298: 85 ee ldi r24, 0xE5 ; 229 1729a: 95 e8 ldi r25, 0x85 ; 133 1729c: 9f 93 push r25 1729e: 8f 93 push r24 172a0: 0e e9 ldi r16, 0x9E ; 158 172a2: 15 e8 ldi r17, 0x85 ; 133 172a4: 1f 93 push r17 172a6: 0f 93 push r16 172a8: 0f 94 08 dc call 0x3b810 ; 0x3b810 172ac: 1f 92 push r1 172ae: ff 92 push r15 172b0: 85 ed ldi r24, 0xD5 ; 213 172b2: 95 e8 ldi r25, 0x85 ; 133 172b4: 9f 93 push r25 172b6: 8f 93 push r24 172b8: 1f 93 push r17 172ba: 0f 93 push r16 172bc: 0f 94 08 dc call 0x3b810 ; 0x3b810 172c0: 1f 92 push r1 172c2: ff 92 push r15 172c4: 81 ec ldi r24, 0xC1 ; 193 172c6: 95 e8 ldi r25, 0x85 ; 133 172c8: 9f 93 push r25 172ca: 8f 93 push r24 172cc: 1f 93 push r17 172ce: 0f 93 push r16 172d0: 0f 94 08 dc call 0x3b810 ; 0x3b810 172d4: 1f 92 push r1 172d6: ff 92 push r15 172d8: 84 eb ldi r24, 0xB4 ; 180 172da: 95 e8 ldi r25, 0x85 ; 133 172dc: 9f 93 push r25 172de: 8f 93 push r24 172e0: 1f 93 push r17 172e2: 0f 93 push r16 172e4: 0f 94 08 dc call 0x3b810 ; 0x3b810 172e8: 1f 92 push r1 172ea: ff 92 push r15 172ec: 89 ea ldi r24, 0xA9 ; 169 172ee: 95 e8 ldi r25, 0x85 ; 133 172f0: 9f 93 push r25 172f2: 8f 93 push r24 172f4: 1f 93 push r17 172f6: 0f 93 push r16 172f8: 0f 94 08 dc call 0x3b810 ; 0x3b810 172fc: 0f b6 in r0, 0x3f ; 63 172fe: f8 94 cli 17300: de bf out 0x3e, r29 ; 62 17302: 0f be out 0x3f, r0 ; 63 17304: cd bf out 0x3d, r28 ; 61 17306: 21 c9 rjmp .-3518 ; 0x1654a /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 17308: 0e 94 e3 79 call 0xf3c6 ; 0xf3c6 1730c: 1e c9 rjmp .-3524 ; 0x1654a /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 1730e: e0 91 93 03 lds r30, 0x0393 ; 0x800393 17312: f0 91 94 03 lds r31, 0x0394 ; 0x800394 17316: cf 01 movw r24, r30 17318: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 1731a: 24 81 ldd r18, Z+4 ; 0x04 1731c: 20 32 cpi r18, 0x20 ; 32 1731e: 09 f4 brne .+2 ; 0x17322 17320: 01 96 adiw r24, 0x01 ; 1 17322: 0f 94 26 15 call 0x22a4c ; 0x22a4c custom_message_type = CustomMsg::M117; 17326: 87 e0 ldi r24, 0x07 ; 7 17328: 80 93 72 07 sts 0x0772, r24 ; 0x800772 1732c: 0e c9 rjmp .-3556 ; 0x1654a - `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; 1732e: 00 91 93 03 lds r16, 0x0393 ; 0x800393 17332: 10 91 94 03 lds r17, 0x0394 ; 0x800394 17336: 0b 5f subi r16, 0xFB ; 251 17338: 1f 4f sbci r17, 0xFF ; 255 1733a: 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; 1733c: f1 2c mov r15, r1 1733e: 40 e0 ldi r20, 0x00 ; 0 17340: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 17342: e9 f0 breq .+58 ; 0x1737e // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 17344: d8 01 movw r26, r16 17346: 9c 91 ld r25, X 17348: 29 2f mov r18, r25 1734a: 2b 7f andi r18, 0xFB ; 251 1734c: 21 34 cpi r18, 0x41 ; 65 1734e: b9 f4 brne .+46 ; 0x1737e 17350: 11 96 adiw r26, 0x01 ; 1 17352: 2c 91 ld r18, X 17354: 21 33 cpi r18, 0x31 ; 49 17356: 99 f4 brne .+38 ; 0x1737e switch (p[0]) { 17358: 91 34 cpi r25, 0x41 ; 65 1735a: 71 f0 breq .+28 ; 0x17378 1735c: 95 34 cpi r25, 0x45 ; 69 1735e: 09 f4 brne .+2 ; 0x17362 case 'A': hasA = true; break; case 'E': hasE = true; break; 17360: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 17362: 98 01 movw r18, r16 17364: 2e 5f subi r18, 0xFE ; 254 17366: 3f 4f sbci r19, 0xFF ; 255 17368: 89 01 movw r16, r18 1736a: 2f 5f subi r18, 0xFF ; 255 1736c: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 1736e: f8 01 movw r30, r16 17370: 90 81 ld r25, Z 17372: 90 32 cpi r25, 0x20 ; 32 17374: c9 f3 breq .-14 ; 0x17368 17376: e4 cf rjmp .-56 ; 0x17340 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; 17378: ff 24 eor r15, r15 1737a: f3 94 inc r15 1737c: f2 cf rjmp .-28 ; 0x17362 } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 1737e: 44 23 and r20, r20 17380: 21 f0 breq .+8 ; 0x1738a 17382: 84 e1 ldi r24, 0x14 ; 20 17384: 9a ea ldi r25, 0xAA ; 170 17386: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if (hasA) SERIAL_ECHOPGM("//"); 1738a: ff 20 and r15, r15 1738c: 21 f0 breq .+8 ; 0x17396 1738e: 8f ed ldi r24, 0xDF ; 223 17390: 97 e8 ldi r25, 0x87 ; 135 17392: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(p); 17396: c8 01 movw r24, r16 17398: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 1739c: d6 c8 rjmp .-3668 ; 0x1654a /*! ### 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 1739e: 88 e0 ldi r24, 0x08 ; 8 173a0: 99 e6 ldi r25, 0x69 ; 105 173a2: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLLN(); 173a6: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 173aa: 80 e0 ldi r24, 0x00 ; 0 173ac: 99 e6 ldi r25, 0x69 ; 105 173ae: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 173b2: 1e 99 sbic 0x03, 6 ; 3 173b4: 47 c0 rjmp .+142 ; 0x17444 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173b6: 8b ef ldi r24, 0xFB ; 251 173b8: 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); 173ba: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173be: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 173c2: 89 ee ldi r24, 0xE9 ; 233 173c4: 98 e6 ldi r25, 0x68 ; 104 173c6: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 173ca: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 173ce: 82 fd sbrc r24, 2 173d0: 3c c0 rjmp .+120 ; 0x1744a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173d2: 8b ef ldi r24, 0xFB ; 251 173d4: 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); 173d6: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173da: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 173de: 81 ee ldi r24, 0xE1 ; 225 173e0: 98 e6 ldi r25, 0x68 ; 104 173e2: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 173e6: 1d 99 sbic 0x03, 5 ; 3 173e8: 33 c0 rjmp .+102 ; 0x17450 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173ea: 8b ef ldi r24, 0xFB ; 251 173ec: 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); 173ee: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173f2: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 173f6: 89 ed ldi r24, 0xD9 ; 217 173f8: 98 e6 ldi r25, 0x68 ; 104 173fa: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 173fe: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 17402: 87 fd sbrc r24, 7 17404: 28 c0 rjmp .+80 ; 0x17456 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 17406: 8b ef ldi r24, 0xFB ; 251 17408: 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); 1740a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1740e: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 17412: 81 ed ldi r24, 0xD1 ; 209 17414: 98 e6 ldi r25, 0x68 ; 104 17416: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 1741a: 1c 99 sbic 0x03, 4 ; 3 1741c: 1f c0 rjmp .+62 ; 0x1745c SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1741e: 8b ef ldi r24, 0xFB ; 251 17420: 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); 17422: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 17426: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 1742a: 89 ec ldi r24, 0xC9 ; 201 1742c: 98 e6 ldi r25, 0x68 ; 104 1742e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 17432: 01 9b sbis 0x00, 1 ; 0 17434: 16 c0 rjmp .+44 ; 0x17462 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 17436: 8b ef ldi r24, 0xFB ; 251 17438: 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); 1743a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1743e: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 17442: 83 c8 rjmp .-3834 ; 0x1654a 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); 17444: 81 ef ldi r24, 0xF1 ; 241 17446: 98 e6 ldi r25, 0x68 ; 104 17448: b8 cf rjmp .-144 ; 0x173ba 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); 1744a: 81 ef ldi r24, 0xF1 ; 241 1744c: 98 e6 ldi r25, 0x68 ; 104 1744e: c3 cf rjmp .-122 ; 0x173d6 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); 17450: 81 ef ldi r24, 0xF1 ; 241 17452: 98 e6 ldi r25, 0x68 ; 104 17454: cc cf rjmp .-104 ; 0x173ee 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); 17456: 81 ef ldi r24, 0xF1 ; 241 17458: 98 e6 ldi r25, 0x68 ; 104 1745a: d7 cf rjmp .-82 ; 0x1740a 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); 1745c: 81 ef ldi r24, 0xF1 ; 241 1745e: 98 e6 ldi r25, 0x68 ; 104 17460: e0 cf rjmp .-64 ; 0x17422 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); 17462: 81 ef ldi r24, 0xF1 ; 241 17464: 98 e6 ldi r25, 0x68 ; 104 17466: e9 cf rjmp .-46 ; 0x1743a E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 17468: 0e 94 4a 67 call 0xce94 ; 0xce94 1746c: 6e c8 rjmp .-3876 ; 0x1654a */ 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')) { 1746e: 84 e5 ldi r24, 0x54 ; 84 17470: 0e 94 8d 5c call 0xb91a ; 0xb91a 17474: 88 23 and r24, r24 17476: 69 f0 breq .+26 ; 0x17492 extruder = code_value_uint8(); 17478: 0e 94 1f 5c call 0xb83e ; 0xb83e if(extruder >= EXTRUDERS) { 1747c: 88 23 and r24, r24 1747e: 49 f0 breq .+18 ; 0x17492 SERIAL_ECHO_START; 17480: 84 e1 ldi r24, 0x14 ; 20 17482: 9a ea ldi r25, 0xAA ; 170 17484: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 17488: 82 eb ldi r24, 0xB2 ; 178 1748a: 98 e6 ldi r25, 0x68 ; 104 1748c: 0e 94 50 89 call 0x112a0 ; 0x112a0 17490: 5c c8 rjmp .-3912 ; 0x1654a SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 17492: 84 e4 ldi r24, 0x44 ; 68 17494: 0e 94 8d 5c call 0xb91a ; 0xb91a 17498: 88 23 and r24, r24 1749a: 09 f4 brne .+2 ; 0x1749e 1749c: 56 c8 rjmp .-3924 ; 0x1654a float diameter = code_value(); 1749e: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 if (diameter == 0.0) { 174a2: 20 e0 ldi r18, 0x00 ; 0 174a4: 30 e0 ldi r19, 0x00 ; 0 174a6: a9 01 movw r20, r18 174a8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 174ac: 81 11 cpse r24, r1 174ae: 05 c0 rjmp .+10 ; 0x174ba // 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; 174b0: 10 92 02 07 sts 0x0702, r1 ; 0x800702 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 174b4: 0e 94 7f 66 call 0xccfe ; 0xccfe 174b8: 48 c8 rjmp .-3952 ; 0x1654a // 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(); 174ba: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 174be: 6b 01 movw r12, r22 174c0: 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]); 174c2: 20 e0 ldi r18, 0x00 ; 0 174c4: 30 e0 ldi r19, 0x00 ; 0 174c6: a9 01 movw r20, r18 174c8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 174cc: 81 11 cpse r24, r1 174ce: 06 c0 rjmp .+12 ; 0x174dc 174d0: c1 2c mov r12, r1 174d2: d1 2c mov r13, r1 174d4: 20 ee ldi r18, 0xE0 ; 224 174d6: e2 2e mov r14, r18 174d8: 2f e3 ldi r18, 0x3F ; 63 174da: f2 2e mov r15, r18 174dc: c0 92 03 07 sts 0x0703, r12 ; 0x800703 174e0: d0 92 04 07 sts 0x0704, r13 ; 0x800704 174e4: e0 92 05 07 sts 0x0705, r14 ; 0x800705 174e8: f0 92 06 07 sts 0x0706, r15 ; 0x800706 cs.filament_size[1] = (cs.filament_size[1] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[1]); #if EXTRUDERS > 2 cs.filament_size[2] = (cs.filament_size[2] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[2]); #endif #endif cs.volumetric_enabled = true; 174ec: 81 e0 ldi r24, 0x01 ; 1 174ee: 80 93 02 07 sts 0x0702, r24 ; 0x800702 174f2: e0 cf rjmp .-64 ; 0x174b4 174f4: 8d ed ldi r24, 0xDD ; 221 174f6: c8 2e mov r12, r24 174f8: 82 e0 ldi r24, 0x02 ; 2 174fa: d8 2e mov r13, r24 174fc: 9b e6 ldi r25, 0x6B ; 107 174fe: e9 2e mov r14, r25 17500: 96 e0 ldi r25, 0x06 ; 6 17502: 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++) 17504: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 17506: d6 01 movw r26, r12 17508: 8d 91 ld r24, X+ 1750a: 6d 01 movw r12, r26 1750c: 0e 94 8d 5c call 0xb91a ; 0xb91a 17510: 88 23 and r24, r24 17512: 41 f1 breq .+80 ; 0x17564 { unsigned long val = code_value(); 17514: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 17518: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 1751c: 12 30 cpi r17, 0x02 ; 2 1751e: 4c f5 brge .+82 ; 0x17572 { if (val > NORMAL_MAX_ACCEL_XY) 17520: 65 3c cpi r22, 0xC5 ; 197 17522: b9 e0 ldi r27, 0x09 ; 9 17524: 7b 07 cpc r23, r27 17526: 81 05 cpc r24, r1 17528: 91 05 cpc r25, r1 1752a: 40 f5 brcc .+80 ; 0x1757c 1752c: 56 2f mov r21, r22 1752e: 47 2f mov r20, r23 17530: 38 2f mov r19, r24 17532: 29 2f mov r18, r25 17534: 61 3c cpi r22, 0xC1 ; 193 17536: e3 e0 ldi r30, 0x03 ; 3 17538: 7e 07 cpc r23, r30 1753a: 81 05 cpc r24, r1 1753c: 91 05 cpc r25, r1 1753e: 20 f0 brcs .+8 ; 0x17548 17540: 50 ec ldi r21, 0xC0 ; 192 17542: 43 e0 ldi r20, 0x03 ; 3 17544: 30 e0 ldi r19, 0x00 ; 0 17546: 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; 17548: d7 01 movw r26, r14 1754a: 94 96 adiw r26, 0x24 ; 36 1754c: 6d 93 st X+, r22 1754e: 7d 93 st X+, r23 17550: 8d 93 st X+, r24 17552: 9c 93 st X, r25 17554: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 17556: f7 01 movw r30, r14 17558: e4 55 subi r30, 0x54 ; 84 1755a: ff 4f sbci r31, 0xFF ; 255 1755c: 50 83 st Z, r21 1755e: 41 83 std Z+1, r20 ; 0x01 17560: 32 83 std Z+2, r19 ; 0x02 17562: 23 83 std Z+3, r18 ; 0x03 17564: b4 e0 ldi r27, 0x04 ; 4 17566: eb 0e add r14, r27 17568: f1 1c adc r15, r1 1756a: 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++) 1756c: 14 30 cpi r17, 0x04 ; 4 1756e: 59 f6 brne .-106 ; 0x17506 17570: c6 cd rjmp .-1140 ; 0x170fe { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 17572: 56 2f mov r21, r22 17574: 47 2f mov r20, r23 17576: 38 2f mov r19, r24 17578: 29 2f mov r18, r25 1757a: e6 cf rjmp .-52 ; 0x17548 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; 1757c: 50 ec ldi r21, 0xC0 ; 192 1757e: 43 e0 ldi r20, 0x03 ; 3 17580: 30 e0 ldi r19, 0x00 ; 0 17582: 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; 17584: 64 ec ldi r22, 0xC4 ; 196 17586: 79 e0 ldi r23, 0x09 ; 9 17588: 80 e0 ldi r24, 0x00 ; 0 1758a: 90 e0 ldi r25, 0x00 ; 0 1758c: dd cf rjmp .-70 ; 0x17548 1758e: 1d ed ldi r17, 0xDD ; 221 17590: a1 2e mov r10, r17 17592: 12 e0 ldi r17, 0x02 ; 2 17594: b1 2e mov r11, r17 17596: 0b e6 ldi r16, 0x6B ; 107 17598: c0 2e mov r12, r16 1759a: 06 e0 ldi r16, 0x06 ; 6 1759c: 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++) 1759e: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 175a0: f5 01 movw r30, r10 175a2: 81 91 ld r24, Z+ 175a4: 5f 01 movw r10, r30 175a6: 0e 94 8d 5c call 0xb91a ; 0xb91a 175aa: 88 23 and r24, r24 175ac: 71 f1 breq .+92 ; 0x1760a { float val = code_value(); 175ae: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 175b2: 7b 01 movw r14, r22 175b4: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 175b6: f1 e0 ldi r31, 0x01 ; 1 175b8: f9 15 cp r31, r9 175ba: b8 f1 brcs .+110 ; 0x1762a { if (val > NORMAL_MAX_FEEDRATE_XY) 175bc: 20 e0 ldi r18, 0x00 ; 0 175be: 30 e0 ldi r19, 0x00 ; 0 175c0: 48 e4 ldi r20, 0x48 ; 72 175c2: 53 e4 ldi r21, 0x43 ; 67 175c4: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 175c8: 18 16 cp r1, r24 175ca: 44 f1 brlt .+80 ; 0x1761c 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(); 175cc: 5e 2c mov r5, r14 175ce: 6f 2c mov r6, r15 175d0: 70 2e mov r7, r16 175d2: 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) 175d4: 20 e0 ldi r18, 0x00 ; 0 175d6: 30 e0 ldi r19, 0x00 ; 0 175d8: 48 ec ldi r20, 0xC8 ; 200 175da: 52 e4 ldi r21, 0x42 ; 66 175dc: b7 01 movw r22, r14 175de: c8 01 movw r24, r16 175e0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 175e4: 18 16 cp r1, r24 175e6: 34 f1 brlt .+76 ; 0x17634 val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 175e8: 85 2d mov r24, r5 175ea: 96 2d mov r25, r6 175ec: a7 2d mov r26, r7 175ee: b8 2d mov r27, r8 175f0: f6 01 movw r30, r12 175f2: 84 8b std Z+20, r24 ; 0x14 175f4: 95 8b std Z+21, r25 ; 0x15 175f6: a6 8b std Z+22, r26 ; 0x16 175f8: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 175fa: c7 01 movw r24, r14 175fc: d8 01 movw r26, r16 175fe: e4 56 subi r30, 0x64 ; 100 17600: ff 4f sbci r31, 0xFF ; 255 17602: 80 83 st Z, r24 17604: 91 83 std Z+1, r25 ; 0x01 17606: a2 83 std Z+2, r26 ; 0x02 17608: 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++) 1760a: 93 94 inc r9 1760c: f4 e0 ldi r31, 0x04 ; 4 1760e: cf 0e add r12, r31 17610: d1 1c adc r13, r1 17612: 24 e0 ldi r18, 0x04 ; 4 17614: 92 12 cpse r9, r18 17616: c4 cf rjmp .-120 ; 0x175a0 17618: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 1761c: 51 2c mov r5, r1 1761e: 61 2c mov r6, r1 17620: a8 e4 ldi r26, 0x48 ; 72 17622: 7a 2e mov r7, r26 17624: b3 e4 ldi r27, 0x43 ; 67 17626: 8b 2e mov r8, r27 17628: d5 cf rjmp .-86 ; 0x175d4 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(); 1762a: 56 2e mov r5, r22 1762c: 6f 2c mov r6, r15 1762e: 78 2e mov r7, r24 17630: 81 2e mov r8, r17 17632: da cf rjmp .-76 ; 0x175e8 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; 17634: e1 2c mov r14, r1 17636: f1 2c mov r15, r1 17638: 08 ec ldi r16, 0xC8 ; 200 1763a: 12 e4 ldi r17, 0x42 ; 66 1763c: d5 cf rjmp .-86 ; 0x175e8 // 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')) 1763e: 80 e5 ldi r24, 0x50 ; 80 17640: 0e 94 8d 5c call 0xb91a ; 0xb91a 17644: 88 23 and r24, r24 17646: 51 f0 breq .+20 ; 0x1765c cs.acceleration = code_value(); 17648: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1764c: 60 93 9f 06 sts 0x069F, r22 ; 0x80069f 17650: 70 93 a0 06 sts 0x06A0, r23 ; 0x8006a0 17654: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 17658: 90 93 a2 06 sts 0x06A2, r25 ; 0x8006a2 if(code_seen('R')) 1765c: 82 e5 ldi r24, 0x52 ; 82 1765e: 0e 94 8d 5c call 0xb91a ; 0xb91a 17662: 88 23 and r24, r24 17664: 51 f0 breq .+20 ; 0x1767a cs.retract_acceleration = code_value(); 17666: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1766a: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 1766e: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 17672: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 17676: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 if(code_seen('T')) 1767a: 84 e5 ldi r24, 0x54 ; 84 1767c: 0e 94 8d 5c call 0xb91a ; 0xb91a 17680: 88 23 and r24, r24 17682: 11 f4 brne .+4 ; 0x17688 17684: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a cs.travel_acceleration = code_value(); 17688: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1768c: 60 93 2b 07 sts 0x072B, r22 ; 0x80072b 17690: 70 93 2c 07 sts 0x072C, r23 ; 0x80072c 17694: 80 93 2d 07 sts 0x072D, r24 ; 0x80072d 17698: 90 93 2e 07 sts 0x072E, r25 ; 0x80072e 1769c: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 176a0: 83 e5 ldi r24, 0x53 ; 83 176a2: 0e 94 8d 5c call 0xb91a ; 0xb91a 176a6: 88 23 and r24, r24 176a8: 51 f0 breq .+20 ; 0x176be 176aa: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 176ae: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 176b2: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 176b6: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 176ba: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa if(code_seen('T')) cs.mintravelfeedrate = code_value(); 176be: 84 e5 ldi r24, 0x54 ; 84 176c0: 0e 94 8d 5c call 0xb91a ; 0xb91a 176c4: 88 23 and r24, r24 176c6: 51 f0 breq .+20 ; 0x176dc 176c8: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 176cc: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 176d0: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 176d4: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 176d8: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 176dc: 82 e4 ldi r24, 0x42 ; 66 176de: 0e 94 8d 5c call 0xb91a ; 0xb91a 176e2: 88 23 and r24, r24 176e4: 61 f0 breq .+24 ; 0x176fe 176e6: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 176ea: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 176ee: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 176f2: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 176f6: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 176fa: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 176fe: 88 e5 ldi r24, 0x58 ; 88 17700: 0e 94 8d 5c call 0xb91a ; 0xb91a 17704: 88 23 and r24, r24 17706: 91 f0 breq .+36 ; 0x1772c 17708: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1770c: 60 93 b7 06 sts 0x06B7, r22 ; 0x8006b7 17710: 70 93 b8 06 sts 0x06B8, r23 ; 0x8006b8 17714: 80 93 b9 06 sts 0x06B9, r24 ; 0x8006b9 17718: 90 93 ba 06 sts 0x06BA, r25 ; 0x8006ba 1771c: 60 93 b3 06 sts 0x06B3, r22 ; 0x8006b3 17720: 70 93 b4 06 sts 0x06B4, r23 ; 0x8006b4 17724: 80 93 b5 06 sts 0x06B5, r24 ; 0x8006b5 17728: 90 93 b6 06 sts 0x06B6, r25 ; 0x8006b6 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 1772c: 89 e5 ldi r24, 0x59 ; 89 1772e: 0e 94 8d 5c call 0xb91a ; 0xb91a 17732: 88 23 and r24, r24 17734: 51 f0 breq .+20 ; 0x1774a 17736: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 1773a: 60 93 b7 06 sts 0x06B7, r22 ; 0x8006b7 1773e: 70 93 b8 06 sts 0x06B8, r23 ; 0x8006b8 17742: 80 93 b9 06 sts 0x06B9, r24 ; 0x8006b9 17746: 90 93 ba 06 sts 0x06BA, r25 ; 0x8006ba if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 1774a: 8a e5 ldi r24, 0x5A ; 90 1774c: 0e 94 8d 5c call 0xb91a ; 0xb91a 17750: 88 23 and r24, r24 17752: 51 f0 breq .+20 ; 0x17768 17754: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 17758: 60 93 bb 06 sts 0x06BB, r22 ; 0x8006bb 1775c: 70 93 bc 06 sts 0x06BC, r23 ; 0x8006bc 17760: 80 93 bd 06 sts 0x06BD, r24 ; 0x8006bd 17764: 90 93 be 06 sts 0x06BE, r25 ; 0x8006be if(code_seen('E')) 17768: 85 e4 ldi r24, 0x45 ; 69 1776a: 0e 94 8d 5c call 0xb91a ; 0xb91a 1776e: 88 23 and r24, r24 17770: 11 f4 brne .+4 ; 0x17776 17772: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { float e = code_value(); 17776: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 1777a: 0e 94 ee 82 call 0x105dc ; 0x105dc #endif cs.max_jerk[E_AXIS] = e; 1777e: 60 93 bf 06 sts 0x06BF, r22 ; 0x8006bf 17782: 70 93 c0 06 sts 0x06C0, r23 ; 0x8006c0 17786: 80 93 c1 06 sts 0x06C1, r24 ; 0x8006c1 1778a: 90 93 c2 06 sts 0x06C2, r25 ; 0x8006c2 1778e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 17792: 0d ed ldi r16, 0xDD ; 221 17794: 12 e0 ldi r17, 0x02 ; 2 17796: f3 ec ldi r31, 0xC3 ; 195 17798: ef 2e mov r14, r31 1779a: f6 e0 ldi r31, 0x06 ; 6 1779c: 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(); 1779e: d8 01 movw r26, r16 177a0: 8d 91 ld r24, X+ 177a2: 8d 01 movw r16, r26 177a4: 0e 94 8d 5c call 0xb91a ; 0xb91a 177a8: 88 23 and r24, r24 177aa: 39 f0 breq .+14 ; 0x177ba 177ac: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 177b0: f7 01 movw r30, r14 177b2: 60 83 st Z, r22 177b4: 71 83 std Z+1, r23 ; 0x01 177b6: 82 83 std Z+2, r24 ; 0x02 177b8: 93 83 std Z+3, r25 ; 0x03 177ba: f4 e0 ldi r31, 0x04 ; 4 177bc: ef 0e add r14, r31 177be: 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++) 177c0: 22 e0 ldi r18, 0x02 ; 2 177c2: 00 3e cpi r16, 0xE0 ; 224 177c4: 12 07 cpc r17, r18 177c6: 59 f7 brne .-42 ; 0x1779e 177c8: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a - `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')) 177cc: 83 e5 ldi r24, 0x53 ; 83 177ce: 0e 94 8d 5c call 0xb91a ; 0xb91a 177d2: 88 23 and r24, r24 177d4: 51 f0 breq .+20 ; 0x177ea { cs.retract_recover_length = code_value() ; 177d6: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 177da: 60 93 fa 06 sts 0x06FA, r22 ; 0x8006fa 177de: 70 93 fb 06 sts 0x06FB, r23 ; 0x8006fb 177e2: 80 93 fc 06 sts 0x06FC, r24 ; 0x8006fc 177e6: 90 93 fd 06 sts 0x06FD, r25 ; 0x8006fd } if(code_seen('F')) 177ea: 86 e4 ldi r24, 0x46 ; 70 177ec: 0e 94 8d 5c call 0xb91a ; 0xb91a 177f0: 88 23 and r24, r24 177f2: 11 f4 brne .+4 ; 0x177f8 177f4: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 177f8: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 177fc: 0e 94 8d 67 call 0xcf1a ; 0xcf1a 17800: 60 93 fe 06 sts 0x06FE, r22 ; 0x8006fe 17804: 70 93 ff 06 sts 0x06FF, r23 ; 0x8006ff 17808: 80 93 00 07 sts 0x0700, r24 ; 0x800700 1780c: 90 93 01 07 sts 0x0701, r25 ; 0x800701 17810: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a #### 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')) 17814: 83 e5 ldi r24, 0x53 ; 83 17816: 0e 94 8d 5c call 0xb91a ; 0xb91a 1781a: 88 23 and r24, r24 1781c: 11 f4 brne .+4 ; 0x17822 1781e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { switch(code_value_uint8()) 17822: 0e 94 1f 5c call 0xb83e ; 0xb83e 17826: 88 23 and r24, r24 17828: c1 f0 breq .+48 ; 0x1785a 1782a: 81 30 cpi r24, 0x01 ; 1 1782c: e1 f0 breq .+56 ; 0x17866 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 1782e: 84 e1 ldi r24, 0x14 ; 20 17830: 9a ea ldi r25, 0xAA ; 170 17832: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 17836: 8f e9 ldi r24, 0x9F ; 159 17838: 98 e6 ldi r25, 0x68 ; 104 1783a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1783e: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 17842: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 17846: 8d 57 subi r24, 0x7D ; 125 17848: 9f 4e sbci r25, 0xEF ; 239 1784a: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_ECHOLNPGM("\"(1)"); 1784e: 8a ed ldi r24, 0xDA ; 218 17850: 97 e8 ldi r25, 0x87 ; 135 17852: 0e 94 17 7b call 0xf62e ; 0xf62e 17856: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 1785a: 10 92 ed 06 sts 0x06ED, r1 ; 0x8006ed retracted[0]=false; 1785e: 10 92 3c 07 sts 0x073C, r1 ; 0x80073c 17862: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 17866: 80 93 ed 06 sts 0x06ED, r24 ; 0x8006ed retracted[0]=false; 1786a: 10 92 3c 07 sts 0x073C, r1 ; 0x80073c 1786e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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; 17872: 40 90 2f 07 lds r4, 0x072F ; 0x80072f 17876: 50 90 30 07 lds r5, 0x0730 ; 0x800730 1787a: 60 90 31 07 lds r6, 0x0731 ; 0x800731 1787e: 70 90 32 07 lds r7, 0x0732 ; 0x800732 17882: 0c 94 44 aa jmp 0x15488 ; 0x15488 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 17886: 80 90 33 07 lds r8, 0x0733 ; 0x800733 1788a: 90 90 34 07 lds r9, 0x0734 ; 0x800734 1788e: a0 90 35 07 lds r10, 0x0735 ; 0x800735 17892: b0 90 36 07 lds r11, 0x0736 ; 0x800736 17896: 0c 94 4f aa jmp 0x1549e ; 0x1549e - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 1789a: 82 e4 ldi r24, 0x42 ; 66 1789c: 0e 94 8d 5c call 0xb91a ; 0xb91a 178a0: 18 2f mov r17, r24 178a2: 88 23 and r24, r24 178a4: 41 f0 breq .+16 ; 0x178b6 { saved_feedmultiply_mm = feedmultiply; 178a6: 80 91 39 02 lds r24, 0x0239 ; 0x800239 178aa: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 178ae: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 178b2: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 178b6: 83 e5 ldi r24, 0x53 ; 83 178b8: 0e 94 8d 5c call 0xb91a ; 0xb91a 178bc: 08 2f mov r16, r24 178be: 88 23 and r24, r24 178c0: 39 f0 breq .+14 ; 0x178d0 { feedmultiply = code_value_short(); 178c2: 0e 94 2c 5c call 0xb858 ; 0xb858 178c6: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 178ca: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 178ce: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 178d0: 82 e5 ldi r24, 0x52 ; 82 178d2: 0e 94 8d 5c call 0xb91a ; 0xb91a 178d6: 88 23 and r24, r24 178d8: 51 f0 breq .+20 ; 0x178ee { feedmultiply = saved_feedmultiply_mm; 178da: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 178de: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 178e2: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 178e6: 80 93 39 02 sts 0x0239, r24 ; 0x800239 178ea: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a codesWereSeen = true; } if (!codesWereSeen) 178ee: 11 11 cpse r17, r1 178f0: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { printf_P(PSTR("%i%%\n"), feedmultiply); 178f4: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 178f8: 8f 93 push r24 178fa: 80 91 39 02 lds r24, 0x0239 ; 0x800239 178fe: 8f 93 push r24 17900: 84 ed ldi r24, 0xD4 ; 212 17902: 97 e8 ldi r25, 0x87 ; 135 17904: 9f 93 push r25 17906: 8f 93 push r24 17908: 0f 94 08 dc call 0x3b810 ; 0x3b810 1790c: 0f 90 pop r0 1790e: 0f 90 pop r0 17910: 0f 90 pop r0 17912: 0f 90 pop r0 17914: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 17918: 80 91 95 02 lds r24, 0x0295 ; 0x800295 1791c: 8f 93 push r24 1791e: 80 91 94 02 lds r24, 0x0294 ; 0x800294 17922: 8f 93 push r24 17924: 8e ec ldi r24, 0xCE ; 206 17926: 97 e8 ldi r25, 0x87 ; 135 17928: 9f 93 push r25 1792a: 8f 93 push r24 1792c: 0f 94 08 dc call 0x3b810 ; 0x3b810 17930: 0f 90 pop r0 17932: 0f 90 pop r0 17934: 0f 90 pop r0 17936: 0f 90 pop r0 17938: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1793c: 80 e5 ldi r24, 0x50 ; 80 1793e: 0e 94 8d 5c call 0xb91a ; 0xb91a 17942: 88 23 and r24, r24 17944: 11 f4 brne .+4 ; 0x1794a 17946: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a int pin_number = code_value_short(); // pin number 1794a: 0e 94 2c 5c call 0xb858 ; 0xb858 1794e: 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 17950: 83 e5 ldi r24, 0x53 ; 83 17952: 0e 94 8d 5c call 0xb91a ; 0xb91a */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 17956: 0f ef ldi r16, 0xFF ; 255 17958: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 1795a: 88 23 and r24, r24 1795c: 19 f0 breq .+6 ; 0x17964 1795e: 0e 94 2c 5c call 0xb858 ; 0xb858 17962: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 17964: c8 01 movw r24, r16 17966: 01 96 adiw r24, 0x01 ; 1 17968: 03 97 sbiw r24, 0x03 ; 3 1796a: 10 f0 brcs .+4 ; 0x17970 1796c: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 17970: e2 ec ldi r30, 0xC2 ; 194 17972: 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)) 17974: 84 91 lpm r24, Z 17976: 08 2e mov r0, r24 17978: 00 0c add r0, r0 1797a: 99 0b sbc r25, r25 1797c: e8 16 cp r14, r24 1797e: f9 06 cpc r15, r25 17980: 11 f4 brne .+4 ; 0x17986 17982: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 17986: 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++) 17988: 38 e8 ldi r19, 0x88 ; 136 1798a: ee 3d cpi r30, 0xDE ; 222 1798c: f3 07 cpc r31, r19 1798e: 91 f7 brne .-28 ; 0x17974 pin_number = -1; break; } } if (pin_number > -1) 17990: f7 fe sbrs r15, 7 17992: 02 c0 rjmp .+4 ; 0x17998 17994: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { int target = LOW; st_synchronize(); 17998: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 pinMode(pin_number, INPUT); 1799c: de 2c mov r13, r14 1799e: 60 e0 ldi r22, 0x00 ; 0 179a0: 8e 2d mov r24, r14 179a2: 0e 94 74 df call 0x1bee8 ; 0x1bee8 switch(pin_state){ 179a6: 0f 3f cpi r16, 0xFF ; 255 179a8: 10 07 cpc r17, r16 179aa: b1 f0 breq .+44 ; 0x179d8 179ac: 01 30 cpi r16, 0x01 ; 1 179ae: 11 05 cpc r17, r1 179b0: 11 f0 breq .+4 ; 0x179b6 } } if (pin_number > -1) { int target = LOW; 179b2: 10 e0 ldi r17, 0x00 ; 0 179b4: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 179b6: 8d 2d mov r24, r13 179b8: 0e 94 1d df call 0x1be3a ; 0x1be3a 179bc: 80 17 cp r24, r16 179be: 91 07 cpc r25, r17 179c0: 11 f4 brne .+4 ; 0x179c6 179c2: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a manage_heater(); 179c6: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(); 179ca: 80 e0 ldi r24, 0x00 ; 0 179cc: 0e 94 f3 8b call 0x117e6 ; 0x117e6 lcd_update(0); 179d0: 80 e0 ldi r24, 0x00 ; 0 179d2: 0e 94 6d 6f call 0xdeda ; 0xdeda 179d6: ef cf rjmp .-34 ; 0x179b6 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 179d8: 8e 2d mov r24, r14 179da: 0e 94 1d df call 0x1be3a ; 0x1be3a 179de: 31 e0 ldi r19, 0x01 ; 1 179e0: 20 e0 ldi r18, 0x00 ; 0 179e2: 89 2b or r24, r25 179e4: 09 f0 breq .+2 ; 0x179e8 179e6: 30 e0 ldi r19, 0x00 ; 0 179e8: 03 2f mov r16, r19 179ea: 12 2f mov r17, r18 179ec: e4 cf rjmp .-56 ; 0x179b6 - `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; 179ee: 80 e5 ldi r24, 0x50 ; 80 179f0: 0e 94 8d 5c call 0xb91a ; 0xb91a 179f4: 08 ee ldi r16, 0xE8 ; 232 179f6: 13 e0 ldi r17, 0x03 ; 3 179f8: 88 23 and r24, r24 179fa: 89 f0 breq .+34 ; 0x17a1e 179fc: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 17a00: 20 e0 ldi r18, 0x00 ; 0 17a02: 30 ec ldi r19, 0xC0 ; 192 17a04: 4a e5 ldi r20, 0x5A ; 90 17a06: 55 e4 ldi r21, 0x45 ; 69 17a08: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 17a0c: 0c ea ldi r16, 0xAC ; 172 17a0e: 1d e0 ldi r17, 0x0D ; 13 17a10: 87 ff sbrs r24, 7 17a12: 05 c0 rjmp .+10 ; 0x17a1e 17a14: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 17a18: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 17a1c: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 17a1e: 83 e5 ldi r24, 0x53 ; 83 17a20: 0e 94 8d 5c call 0xb91a ; 0xb91a 17a24: 88 23 and r24, r24 17a26: 71 f0 breq .+28 ; 0x17a44 beepS = 0; else { beepS = code_value(); 17a28: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 17a2c: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> if (!beepS) { 17a30: 61 15 cp r22, r1 17a32: 71 05 cpc r23, r1 17a34: 49 f4 brne .+18 ; 0x17a48 // handle S0 as a pause _delay(beepP); 17a36: b8 01 movw r22, r16 17a38: 90 e0 ldi r25, 0x00 ; 0 17a3a: 80 e0 ldi r24, 0x00 ; 0 17a3c: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 17a40: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 17a44: 70 e0 ldi r23, 0x00 ; 0 17a46: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 17a48: 40 e0 ldi r20, 0x00 ; 0 17a4a: c8 01 movw r24, r16 17a4c: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac 17a50: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 17a54: 80 e5 ldi r24, 0x50 ; 80 17a56: 0e 94 8d 5c call 0xb91a ; 0xb91a 17a5a: 88 23 and r24, r24 17a5c: 51 f0 breq .+20 ; 0x17a72 17a5e: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 17a62: 60 93 df 06 sts 0x06DF, r22 ; 0x8006df 17a66: 70 93 e0 06 sts 0x06E0, r23 ; 0x8006e0 17a6a: 80 93 e1 06 sts 0x06E1, r24 ; 0x8006e1 17a6e: 90 93 e2 06 sts 0x06E2, r25 ; 0x8006e2 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 17a72: 89 e4 ldi r24, 0x49 ; 73 17a74: 0e 94 8d 5c call 0xb91a ; 0xb91a 17a78: 88 23 and r24, r24 17a7a: 81 f0 breq .+32 ; 0x17a9c 17a7c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17a80: 2c ea ldi r18, 0xAC ; 172 17a82: 35 ec ldi r19, 0xC5 ; 197 17a84: 47 e2 ldi r20, 0x27 ; 39 17a86: 5e e3 ldi r21, 0x3E ; 62 17a88: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 17a8c: 60 93 e3 06 sts 0x06E3, r22 ; 0x8006e3 17a90: 70 93 e4 06 sts 0x06E4, r23 ; 0x8006e4 17a94: 80 93 e5 06 sts 0x06E5, r24 ; 0x8006e5 17a98: 90 93 e6 06 sts 0x06E6, r25 ; 0x8006e6 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 17a9c: 84 e4 ldi r24, 0x44 ; 68 17a9e: 0e 94 8d 5c call 0xb91a ; 0xb91a 17aa2: 88 23 and r24, r24 17aa4: 81 f0 breq .+32 ; 0x17ac6 17aa6: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 } float unscalePID_i(float i) { return i/PID_dT; 17aaa: 2c ea ldi r18, 0xAC ; 172 17aac: 35 ec ldi r19, 0xC5 ; 197 17aae: 47 e2 ldi r20, 0x27 ; 39 17ab0: 5e e3 ldi r21, 0x3E ; 62 17ab2: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 17ab6: 60 93 e7 06 sts 0x06E7, r22 ; 0x8006e7 17aba: 70 93 e8 06 sts 0x06E8, r23 ; 0x8006e8 17abe: 80 93 e9 06 sts 0x06E9, r24 ; 0x8006e9 17ac2: 90 93 ea 06 sts 0x06EA, r25 ; 0x8006ea updatePID(); 17ac6: 0f 94 e3 50 call 0x2a1c6 ; 0x2a1c6 SERIAL_PROTOCOLRPGM(MSG_OK); 17aca: 84 e4 ldi r24, 0x44 ; 68 17acc: 9e e6 ldi r25, 0x6E ; 110 17ace: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLPGM(" p:"); 17ad2: 8e eb ldi r24, 0xBE ; 190 17ad4: 97 e8 ldi r25, 0x87 ; 135 17ad6: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 17ada: 60 91 df 06 lds r22, 0x06DF ; 0x8006df 17ade: 70 91 e0 06 lds r23, 0x06E0 ; 0x8006e0 17ae2: 80 91 e1 06 lds r24, 0x06E1 ; 0x8006e1 17ae6: 90 91 e2 06 lds r25, 0x06E2 ; 0x8006e2 17aea: 42 e0 ldi r20, 0x02 ; 2 17aec: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 17af0: 8a eb ldi r24, 0xBA ; 186 17af2: 97 e8 ldi r25, 0x87 ; 135 17af4: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 17af8: 2c ea ldi r18, 0xAC ; 172 17afa: 35 ec ldi r19, 0xC5 ; 197 17afc: 47 e2 ldi r20, 0x27 ; 39 17afe: 5e e3 ldi r21, 0x3E ; 62 17b00: 60 91 e3 06 lds r22, 0x06E3 ; 0x8006e3 17b04: 70 91 e4 06 lds r23, 0x06E4 ; 0x8006e4 17b08: 80 91 e5 06 lds r24, 0x06E5 ; 0x8006e5 17b0c: 90 91 e6 06 lds r25, 0x06E6 ; 0x8006e6 17b10: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 17b14: 42 e0 ldi r20, 0x02 ; 2 17b16: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 17b1a: 86 eb ldi r24, 0xB6 ; 182 17b1c: 97 e8 ldi r25, 0x87 ; 135 17b1e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17b22: 2c ea ldi r18, 0xAC ; 172 17b24: 35 ec ldi r19, 0xC5 ; 197 17b26: 47 e2 ldi r20, 0x27 ; 39 17b28: 5e e3 ldi r21, 0x3E ; 62 17b2a: 60 91 e7 06 lds r22, 0x06E7 ; 0x8006e7 17b2e: 70 91 e8 06 lds r23, 0x06E8 ; 0x8006e8 17b32: 80 91 e9 06 lds r24, 0x06E9 ; 0x8006e9 17b36: 90 91 ea 06 lds r25, 0x06EA ; 0x8006ea 17b3a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 17b3e: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a 17b42: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a - `T` - Brightness timeout (15 - 900), default 15 seconds */ #ifdef LCD_BL_PIN case 256: { if (backlightSupport) { 17b46: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 17b4a: 88 23 and r24, r24 17b4c: 11 f4 brne .+4 ; 0x17b52 17b4e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a if (code_seen('B') ) backlightLevel_HIGH = code_value_uint8(); 17b52: 82 e4 ldi r24, 0x42 ; 66 17b54: 0e 94 8d 5c call 0xb91a ; 0xb91a 17b58: 88 23 and r24, r24 17b5a: 21 f0 breq .+8 ; 0x17b64 17b5c: 0e 94 1f 5c call 0xb83e ; 0xb83e 17b60: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa if (code_seen('D')) backlightLevel_LOW = code_value_uint8(); 17b64: 84 e4 ldi r24, 0x44 ; 68 17b66: 0e 94 8d 5c call 0xb91a ; 0xb91a 17b6a: 88 23 and r24, r24 17b6c: 21 f0 breq .+8 ; 0x17b76 17b6e: 0e 94 1f 5c call 0xb83e ; 0xb83e 17b72: 80 93 f9 03 sts 0x03F9, r24 ; 0x8003f9 if (code_seen('S')) { 17b76: 83 e5 ldi r24, 0x53 ; 83 17b78: 0e 94 8d 5c call 0xb91a ; 0xb91a 17b7c: 88 23 and r24, r24 17b7e: 31 f0 breq .+12 ; 0x17b8c uint8_t mode = code_value_uint8(); 17b80: 0e 94 1f 5c call 0xb83e ; 0xb83e if (mode <= BACKLIGHT_MODE_AUTO) { 17b84: 83 30 cpi r24, 0x03 ; 3 17b86: 10 f4 brcc .+4 ; 0x17b8c backlightMode = static_cast(mode); 17b88: 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); 17b8c: 84 e5 ldi r24, 0x54 ; 84 17b8e: 0e 94 8d 5c call 0xb91a ; 0xb91a 17b92: 88 23 and r24, r24 17b94: 79 f0 breq .+30 ; 0x17bb4 17b96: 0e 94 2c 5c call 0xb858 ; 0xb858 17b9a: 0f 97 sbiw r24, 0x0f ; 15 17b9c: 64 f1 brlt .+88 ; 0x17bf6 17b9e: 0e 94 2c 5c call 0xb858 ; 0xb858 17ba2: 85 38 cpi r24, 0x85 ; 133 17ba4: 93 40 sbci r25, 0x03 ; 3 17ba6: 54 f5 brge .+84 ; 0x17bfc 17ba8: 0e 94 2c 5c call 0xb858 ; 0xb858 17bac: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 17bb0: 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); 17bb4: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17bb8: 8f 93 push r24 17bba: 80 91 4d 02 lds r24, 0x024D ; 0x80024d 17bbe: 8f 93 push r24 17bc0: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 17bc4: 1f 92 push r1 17bc6: 8f 93 push r24 17bc8: 80 91 f9 03 lds r24, 0x03F9 ; 0x8003f9 17bcc: 1f 92 push r1 17bce: 8f 93 push r24 17bd0: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 17bd4: 1f 92 push r1 17bd6: 8f 93 push r24 17bd8: 80 ea ldi r24, 0xA0 ; 160 17bda: 97 e8 ldi r25, 0x87 ; 135 17bdc: 9f 93 push r25 17bde: 8f 93 push r24 17be0: 0f 94 08 dc call 0x3b810 ; 0x3b810 backlight_save(); 17be4: 0e 94 73 8b call 0x116e6 ; 0x116e6 17be8: 0f b6 in r0, 0x3f ; 63 17bea: f8 94 cli 17bec: de bf out 0x3e, r29 ; 62 17bee: 0f be out 0x3f, r0 ; 63 17bf0: cd bf out 0x3d, r28 ; 61 17bf2: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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); 17bf6: 8f e0 ldi r24, 0x0F ; 15 17bf8: 90 e0 ldi r25, 0x00 ; 0 17bfa: d8 cf rjmp .-80 ; 0x17bac 17bfc: 84 e8 ldi r24, 0x84 ; 132 17bfe: 93 e0 ldi r25, 0x03 ; 3 17c00: d5 cf rjmp .-86 ; 0x17bac - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 17c02: 83 e5 ldi r24, 0x53 ; 83 17c04: 0e 94 8d 5c call 0xb91a ; 0xb91a 17c08: 88 23 and r24, r24 17c0a: 41 f0 breq .+16 ; 0x17c1c 17c0c: 0e 94 2c 5c call 0xb858 ; 0xb858 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 17c10: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 17c14: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 17c18: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 17c1c: 90 e0 ldi r25, 0x00 ; 0 17c1e: 80 e0 ldi r24, 0x00 ; 0 17c20: f7 cf rjmp .-18 ; 0x17c10 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 17c22: 85 e4 ldi r24, 0x45 ; 69 17c24: 0e 94 8d 5c call 0xb91a ; 0xb91a - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 17c28: 10 e0 ldi r17, 0x00 ; 0 17c2a: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 17c2c: 88 23 and r24, r24 17c2e: 59 f0 breq .+22 ; 0x17c46 17c30: 0e 94 2c 5c call 0xb858 ; 0xb858 17c34: 8c 01 movw r16, r24 if (e < 0) temp = 70; 17c36: c1 2c mov r12, r1 17c38: d1 2c mov r13, r1 17c3a: 7c e8 ldi r23, 0x8C ; 140 17c3c: e7 2e mov r14, r23 17c3e: 72 e4 ldi r23, 0x42 ; 66 17c40: 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) 17c42: 97 fd sbrc r25, 7 17c44: 06 c0 rjmp .+12 ; 0x17c52 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 17c46: c1 2c mov r12, r1 17c48: d1 2c mov r13, r1 17c4a: e6 e1 ldi r30, 0x16 ; 22 17c4c: ee 2e mov r14, r30 17c4e: e3 e4 ldi r30, 0x43 ; 67 17c50: 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(); 17c52: 83 e5 ldi r24, 0x53 ; 83 17c54: 0e 94 8d 5c call 0xb91a ; 0xb91a 17c58: 88 23 and r24, r24 17c5a: 21 f0 breq .+8 ; 0x17c64 17c5c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 17c60: 6b 01 movw r12, r22 17c62: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 17c64: 83 e4 ldi r24, 0x43 ; 67 17c66: 0e 94 8d 5c call 0xb91a ; 0xb91a 17c6a: 88 23 and r24, r24 17c6c: 51 f0 breq .+20 ; 0x17c82 17c6e: 0e 94 2c 5c call 0xb858 ; 0xb858 PID_autotune(temp, e, c); 17c72: 9c 01 movw r18, r24 17c74: a8 01 movw r20, r16 17c76: c7 01 movw r24, r14 17c78: b6 01 movw r22, r12 17c7a: 0f 94 10 51 call 0x2a220 ; 0x2a220 17c7e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a */ case 303: { float temp = 150.0; int e = 0; int c = 5; 17c82: 85 e0 ldi r24, 0x05 ; 5 17c84: 90 e0 ldi r25, 0x00 ; 0 17c86: f5 cf rjmp .-22 ; 0x17c72 */ 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; 17c88: 9f ef ldi r25, 0xFF ; 255 17c8a: ab 96 adiw r28, 0x2b ; 43 17c8c: 9f af std Y+63, r25 ; 0x3f 17c8e: ab 97 sbiw r28, 0x2b ; 43 17c90: 0c 94 7a ab jmp 0x156f4 ; 0x156f4 - `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; 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: e2 96 adiw r28, 0x32 ; 50 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: e2 97 sbiw r28, 0x32 ; 50 17ca8: 0c 94 89 ab jmp 0x15712 ; 0x15712 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: 6e 96 adiw r28, 0x1e ; 30 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: 6e 97 sbiw r28, 0x1e ; 30 17cc0: 0c 94 a7 ab jmp 0x1574e ; 0x1574e 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: a2 96 adiw r28, 0x22 ; 34 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: a2 97 sbiw r28, 0x22 ; 34 17cd8: 0c 94 b6 ab jmp 0x1576c ; 0x1576c 17cdc: 80 e0 ldi r24, 0x00 ; 0 17cde: 90 e0 ldi r25, 0x00 ; 0 17ce0: a0 ec ldi r26, 0xC0 ; 192 17ce2: bf e7 ldi r27, 0x7F ; 127 17ce4: 6a 96 adiw r28, 0x1a ; 26 17ce6: 8c af std Y+60, r24 ; 0x3c 17ce8: 9d af std Y+61, r25 ; 0x3d 17cea: ae af std Y+62, r26 ; 0x3e 17cec: bf af std Y+63, r27 ; 0x3f 17cee: 6a 97 sbiw r28, 0x1a ; 26 17cf0: 0c 94 c5 ab jmp 0x1578a ; 0x1578a 17cf4: 20 e0 ldi r18, 0x00 ; 0 17cf6: 30 e0 ldi r19, 0x00 ; 0 17cf8: 40 ec ldi r20, 0xC0 ; 192 17cfa: 5f e7 ldi r21, 0x7F ; 127 17cfc: aa 96 adiw r28, 0x2a ; 42 17cfe: 2c af std Y+60, r18 ; 0x3c 17d00: 3d af std Y+61, r19 ; 0x3d 17d02: 4e af std Y+62, r20 ; 0x3e 17d04: 5f af std Y+63, r21 ; 0x3f 17d06: aa 97 sbiw r28, 0x2a ; 42 17d08: 0c 94 d4 ab jmp 0x157a8 ; 0x157a8 int8_t I = -1, S = -1, B = -1, F = -1; 17d0c: 3f ef ldi r19, 0xFF ; 255 17d0e: e3 96 adiw r28, 0x33 ; 51 17d10: 3f af std Y+63, r19 ; 0x3f 17d12: e3 97 sbiw r28, 0x33 ; 51 17d14: 0c 94 ea ab jmp 0x157d4 ; 0x157d4 17d18: 4f ef ldi r20, 0xFF ; 255 17d1a: e7 96 adiw r28, 0x37 ; 55 17d1c: 4f af std Y+63, r20 ; 0x3f 17d1e: e7 97 sbiw r28, 0x37 ; 55 17d20: 0c 94 f6 ab jmp 0x157ec ; 0x157ec - `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; 17d24: 80 e0 ldi r24, 0x00 ; 0 17d26: 90 e0 ldi r25, 0x00 ; 0 17d28: a0 ec ldi r26, 0xC0 ; 192 17d2a: bf e7 ldi r27, 0x7F ; 127 17d2c: a6 96 adiw r28, 0x26 ; 38 17d2e: 8c af std Y+60, r24 ; 0x3c 17d30: 9d af std Y+61, r25 ; 0x3d 17d32: ae af std Y+62, r26 ; 0x3e 17d34: bf af std Y+63, r27 ; 0x3f 17d36: a6 97 sbiw r28, 0x26 ; 38 17d38: 0c 94 05 ac jmp 0x1580a ; 0x1580a int8_t I = -1, S = -1, B = -1, F = -1; 17d3c: 9f ef ldi r25, 0xFF ; 255 17d3e: eb 96 adiw r28, 0x3b ; 59 17d40: 9f af std Y+63, r25 ; 0x3f 17d42: eb 97 sbiw r28, 0x3b ; 59 17d44: 0c 94 3a ac jmp 0x15874 ; 0x15874 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(); 17d48: 0f 94 d0 43 call 0x287a0 ; 0x287a0 17d4c: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a break; } // update all parameters if(B >= 0) 17d50: e7 96 adiw r28, 0x37 ; 55 17d52: ff ad ldd r31, Y+63 ; 0x3f 17d54: e7 97 sbiw r28, 0x37 ; 55 17d56: f7 fd sbrc r31, 7 17d58: 09 c0 rjmp .+18 ; 0x17d6c thermal_model_set_warn_beep(B); 17d5a: 81 e0 ldi r24, 0x01 ; 1 17d5c: e7 96 adiw r28, 0x37 ; 55 17d5e: 2f ad ldd r18, Y+63 ; 0x3f 17d60: e7 97 sbiw r28, 0x37 ; 55 17d62: 21 11 cpse r18, r1 17d64: 01 c0 rjmp .+2 ; 0x17d68 17d66: 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; 17d68: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.469> if(!isnan(P) || !isnan(U) || !isnan(V) || !isnan(C) || !isnan(D) || (L >= 0) || !isnan(T) || !isnan(W) || !isnan(E)) 17d6c: a7 01 movw r20, r14 17d6e: 96 01 movw r18, r12 17d70: c7 01 movw r24, r14 17d72: b6 01 movw r22, r12 17d74: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17d78: 88 23 and r24, r24 17d7a: 11 f4 brne .+4 ; 0x17d80 17d7c: 0c 94 c9 ac jmp 0x15992 ; 0x15992 17d80: 6e 96 adiw r28, 0x1e ; 30 17d82: 2c ad ldd r18, Y+60 ; 0x3c 17d84: 3d ad ldd r19, Y+61 ; 0x3d 17d86: 4e ad ldd r20, Y+62 ; 0x3e 17d88: 5f ad ldd r21, Y+63 ; 0x3f 17d8a: 6e 97 sbiw r28, 0x1e ; 30 17d8c: ca 01 movw r24, r20 17d8e: b9 01 movw r22, r18 17d90: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17d94: 88 23 and r24, r24 17d96: 11 f4 brne .+4 ; 0x17d9c 17d98: 0c 94 c9 ac jmp 0x15992 ; 0x15992 17d9c: a2 96 adiw r28, 0x22 ; 34 17d9e: 2c ad ldd r18, Y+60 ; 0x3c 17da0: 3d ad ldd r19, Y+61 ; 0x3d 17da2: 4e ad ldd r20, Y+62 ; 0x3e 17da4: 5f ad ldd r21, Y+63 ; 0x3f 17da6: a2 97 sbiw r28, 0x22 ; 34 17da8: ca 01 movw r24, r20 17daa: b9 01 movw r22, r18 17dac: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17db0: 88 23 and r24, r24 17db2: 11 f4 brne .+4 ; 0x17db8 17db4: 0c 94 c9 ac jmp 0x15992 ; 0x15992 17db8: 6a 96 adiw r28, 0x1a ; 26 17dba: 2c ad ldd r18, Y+60 ; 0x3c 17dbc: 3d ad ldd r19, Y+61 ; 0x3d 17dbe: 4e ad ldd r20, Y+62 ; 0x3e 17dc0: 5f ad ldd r21, Y+63 ; 0x3f 17dc2: 6a 97 sbiw r28, 0x1a ; 26 17dc4: ca 01 movw r24, r20 17dc6: b9 01 movw r22, r18 17dc8: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17dcc: 88 23 and r24, r24 17dce: 11 f4 brne .+4 ; 0x17dd4 17dd0: 0c 94 c9 ac jmp 0x15992 ; 0x15992 17dd4: aa 96 adiw r28, 0x2a ; 42 17dd6: 2c ad ldd r18, Y+60 ; 0x3c 17dd8: 3d ad ldd r19, Y+61 ; 0x3d 17dda: 4e ad ldd r20, Y+62 ; 0x3e 17ddc: 5f ad ldd r21, Y+63 ; 0x3f 17dde: aa 97 sbiw r28, 0x2a ; 42 17de0: ca 01 movw r24, r20 17de2: b9 01 movw r22, r18 17de4: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17de8: 88 23 and r24, r24 17dea: 11 f4 brne .+4 ; 0x17df0 17dec: 0c 94 c9 ac jmp 0x15992 ; 0x15992 17df0: 17 fd sbrc r17, 7 17df2: 02 c0 rjmp .+4 ; 0x17df8 17df4: 0c 94 89 cf jmp 0x19f12 ; 0x19f12 17df8: a6 96 adiw r28, 0x26 ; 38 17dfa: 2c ad ldd r18, Y+60 ; 0x3c 17dfc: 3d ad ldd r19, Y+61 ; 0x3d 17dfe: 4e ad ldd r20, Y+62 ; 0x3e 17e00: 5f ad ldd r21, Y+63 ; 0x3f 17e02: a6 97 sbiw r28, 0x26 ; 38 17e04: ca 01 movw r24, r20 17e06: b9 01 movw r22, r18 17e08: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17e0c: 88 23 and r24, r24 17e0e: 11 f4 brne .+4 ; 0x17e14 17e10: 0c 94 c9 ac jmp 0x15992 ; 0x15992 17e14: a5 01 movw r20, r10 17e16: 94 01 movw r18, r8 17e18: c5 01 movw r24, r10 17e1a: b4 01 movw r22, r8 17e1c: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17e20: 88 23 and r24, r24 17e22: 11 f4 brne .+4 ; 0x17e28 17e24: 0c 94 c9 ac jmp 0x15992 ; 0x15992 17e28: a3 01 movw r20, r6 17e2a: 92 01 movw r18, r4 17e2c: c3 01 movw r24, r6 17e2e: b2 01 movw r22, r4 17e30: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17e34: 88 23 and r24, r24 17e36: 11 f4 brne .+4 ; 0x17e3c 17e38: 0c 94 c9 ac jmp 0x15992 ; 0x15992 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 17e3c: ab 96 adiw r28, 0x2b ; 43 17e3e: 9f ad ldd r25, Y+63 ; 0x3f 17e40: ab 97 sbiw r28, 0x2b ; 43 17e42: 97 fd sbrc r25, 7 17e44: 3b c0 rjmp .+118 ; 0x17ebc 17e46: e2 96 adiw r28, 0x32 ; 50 17e48: 2c ad ldd r18, Y+60 ; 0x3c 17e4a: 3d ad ldd r19, Y+61 ; 0x3d 17e4c: 4e ad ldd r20, Y+62 ; 0x3e 17e4e: 5f ad ldd r21, Y+63 ; 0x3f 17e50: e2 97 sbiw r28, 0x32 ; 50 17e52: ca 01 movw r24, r20 17e54: b9 01 movw r22, r18 17e56: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 17e5a: 81 11 cpse r24, r1 17e5c: 2f c0 rjmp .+94 ; 0x17ebc thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 17e5e: ab 96 adiw r28, 0x2b ; 43 17e60: af ad ldd r26, Y+63 ; 0x3f 17e62: ab 97 sbiw r28, 0x2b ; 43 17e64: a0 31 cpi r26, 0x10 ; 16 17e66: 54 f5 brge .+84 ; 0x17ebc 17e68: 20 e0 ldi r18, 0x00 ; 0 17e6a: 30 e0 ldi r19, 0x00 ; 0 17e6c: a9 01 movw r20, r18 17e6e: e2 96 adiw r28, 0x32 ; 50 17e70: 6c ad ldd r22, Y+60 ; 0x3c 17e72: 7d ad ldd r23, Y+61 ; 0x3d 17e74: 8e ad ldd r24, Y+62 ; 0x3e 17e76: 9f ad ldd r25, Y+63 ; 0x3f 17e78: e2 97 sbiw r28, 0x32 ; 50 17e7a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 17e7e: 18 16 cp r1, r24 17e80: ec f4 brge .+58 ; 0x17ebc return; TempMgrGuard temp_mgr_guard; 17e82: ce 01 movw r24, r28 17e84: 01 96 adiw r24, 0x01 ; 1 17e86: 0f 94 ae 47 call 0x28f5c ; 0x28f5c thermal_model::data.R[index] = R; 17e8a: ab 96 adiw r28, 0x2b ; 43 17e8c: bf ad ldd r27, Y+63 ; 0x3f 17e8e: ab 97 sbiw r28, 0x2b ; 43 17e90: 24 e0 ldi r18, 0x04 ; 4 17e92: b2 02 muls r27, r18 17e94: f0 01 movw r30, r0 17e96: 11 24 eor r1, r1 17e98: e5 53 subi r30, 0x35 ; 53 17e9a: fd 4e sbci r31, 0xED ; 237 17e9c: e2 96 adiw r28, 0x32 ; 50 17e9e: 8c ad ldd r24, Y+60 ; 0x3c 17ea0: 9d ad ldd r25, Y+61 ; 0x3d 17ea2: ae ad ldd r26, Y+62 ; 0x3e 17ea4: bf ad ldd r27, Y+63 ; 0x3f 17ea6: e2 97 sbiw r28, 0x32 ; 50 17ea8: 80 83 st Z, r24 17eaa: 91 83 std Z+1, r25 ; 0x01 17eac: a2 83 std Z+2, r26 ; 0x02 17eae: b3 83 std Z+3, r27 ; 0x03 thermal_model::setup(); 17eb0: 0f 94 18 45 call 0x28a30 ; 0x28a30 void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 17eb4: ce 01 movw r24, r28 17eb6: 01 96 adiw r24, 0x01 ; 1 17eb8: 0f 94 a1 47 call 0x28f42 ; 0x28f42 thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17ebc: e3 96 adiw r28, 0x33 ; 51 17ebe: 9f ad ldd r25, Y+63 ; 0x3f 17ec0: e3 97 sbiw r28, 0x33 ; 51 17ec2: 97 fd sbrc r25, 7 17ec4: 06 c0 rjmp .+12 ; 0x17ed2 17ec6: 81 e0 ldi r24, 0x01 ; 1 17ec8: 91 11 cpse r25, r1 17eca: 01 c0 rjmp .+2 ; 0x17ece 17ecc: 80 e0 ldi r24, 0x00 ; 0 17ece: 0f 94 4d 48 call 0x2909a ; 0x2909a // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 17ed2: 37 fe sbrs r3, 7 17ed4: 02 c0 rjmp .+4 ; 0x17eda 17ed6: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 17eda: 11 e0 ldi r17, 0x01 ; 1 17edc: eb 96 adiw r28, 0x3b ; 59 17ede: af ad ldd r26, Y+63 ; 0x3f 17ee0: eb 97 sbiw r28, 0x3b ; 59 17ee2: 1a 16 cp r1, r26 17ee4: 0c f0 brlt .+2 ; 0x17ee8 17ee6: 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; 17ee8: 81 e0 ldi r24, 0x01 ; 1 17eea: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.556> } //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); 17eee: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 17ef2: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 17ef6: 89 1b sub r24, r25 17ef8: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 17efa: 41 f4 brne .+16 ; 0x17f0c 17efc: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 17f00: 85 30 cpi r24, 0x05 ; 5 17f02: 79 f1 breq .+94 ; 0x17f62 17f04: 0e 94 a7 68 call 0xd14e ; 0xd14e 17f08: 88 23 and r24, r24 17f0a: 59 f1 breq .+86 ; 0x17f62 sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 17f0c: 8c e8 ldi r24, 0x8C ; 140 17f0e: 95 e8 ldi r25, 0x85 ; 133 17f10: 9f 93 push r25 17f12: 8f 93 push r24 17f14: e1 e0 ldi r30, 0x01 ; 1 17f16: f0 e0 ldi r31, 0x00 ; 0 17f18: ec 0f add r30, r28 17f1a: fd 1f adc r31, r29 17f1c: ff 93 push r31 17f1e: ef 93 push r30 17f20: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba lcd_setstatus_serial(tm_message); 17f24: ce 01 movw r24, r28 17f26: 01 96 adiw r24, 0x01 ; 1 17f28: 0f 94 ad 0b call 0x2175a ; 0x2175a return; 17f2c: 0f 90 pop r0 17f2e: 0f 90 pop r0 17f30: 0f 90 pop r0 17f32: 0f 90 pop r0 17f34: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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; 17f38: 20 e0 ldi r18, 0x00 ; 0 17f3a: 30 e0 ldi r19, 0x00 ; 0 17f3c: a9 01 movw r20, r18 17f3e: c7 01 movw r24, r14 17f40: b6 01 movw r22, r12 17f42: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 17f46: 18 16 cp r1, r24 17f48: 14 f0 brlt .+4 ; 0x17f4e 17f4a: 0c 94 d7 ac jmp 0x159ae ; 0x159ae 17f4e: c0 92 b5 12 sts 0x12B5, r12 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 17f52: d0 92 b6 12 sts 0x12B6, r13 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 17f56: e0 92 b7 12 sts 0x12B7, r14 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 17f5a: f0 92 b8 12 sts 0x12B8, r15 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 17f5e: 0c 94 d7 ac jmp 0x159ae ; 0x159ae lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 17f62: 83 e0 ldi r24, 0x03 ; 3 17f64: 80 93 96 02 sts 0x0296, r24 ; 0x800296 menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 17f68: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 17f6c: 82 60 ori r24, 0x02 ; 2 17f6e: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce lcd_return_to_status(); 17f72: 0f 94 23 27 call 0x24e46 ; 0x24e46 // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 17f76: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 17f7a: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 17f7e: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 17f82: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 17f86: 6e 96 adiw r28, 0x1e ; 30 17f88: 2c af std Y+60, r18 ; 0x3c 17f8a: 3d af std Y+61, r19 ; 0x3d 17f8c: 4e af std Y+62, r20 ; 0x3e 17f8e: 5f af std Y+63, r21 ; 0x3f 17f90: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 17f92: 80 e4 ldi r24, 0x40 ; 64 17f94: eb ec ldi r30, 0xCB ; 203 17f96: f2 e1 ldi r31, 0x12 ; 18 17f98: de 01 movw r26, r28 17f9a: 11 96 adiw r26, 0x01 ; 1 17f9c: 01 90 ld r0, Z+ 17f9e: 0d 92 st X+, r0 17fa0: 8a 95 dec r24 17fa2: e1 f7 brne .-8 ; 0x17f9c orig_enabled = thermal_model::enabled; 17fa4: 30 91 1d 05 lds r19, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> 17fa8: 67 96 adiw r28, 0x17 ; 23 17faa: 3f af std Y+63, r19 ; 0x3f 17fac: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 17fae: 81 2f mov r24, r17 17fb0: 0f 94 6f 48 call 0x290de ; 0x290de // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 17fb4: 86 e7 ldi r24, 0x76 ; 118 17fb6: 95 e8 ldi r25, 0x85 ; 133 17fb8: 0e 94 17 7b call 0xf62e ; 0xf62e thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17fbc: 21 14 cp r2, r1 17fbe: 31 04 cpc r3, r1 17fc0: 19 f4 brne .+6 ; 0x17fc8 17fc2: 26 ee ldi r18, 0xE6 ; 230 17fc4: 22 2e mov r2, r18 17fc6: 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); 17fc8: 80 e0 ldi r24, 0x00 ; 0 17fca: 0f 94 c6 43 call 0x2878c ; 0x2878c 17fce: 82 e0 ldi r24, 0x02 ; 2 17fd0: 48 2e mov r4, r24 17fd2: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 17fd4: 9a e5 ldi r25, 0x5A ; 90 17fd6: 69 2e mov r6, r25 17fd8: 95 e8 ldi r25, 0x85 ; 133 17fda: 79 2e mov r7, r25 17fdc: ae 01 movw r20, r28 17fde: 4f 5b subi r20, 0xBF ; 191 17fe0: 5f 4f sbci r21, 0xFF ; 255 17fe2: 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); 17fe4: 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; 17fe6: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 17fea: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 17fee: 20 e0 ldi r18, 0x00 ; 0 17ff0: 30 e0 ldi r19, 0x00 ; 0 17ff2: 48 e4 ldi r20, 0x48 ; 72 17ff4: 52 e4 ldi r21, 0x42 ; 66 17ff6: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 17ffa: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 17ffe: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 18002: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 18006: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1800a: 87 fd sbrc r24, 7 1800c: 58 c0 rjmp .+176 ; 0x180be sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 1800e: 1f 92 push r1 18010: 1f 93 push r17 18012: 80 e4 ldi r24, 0x40 ; 64 18014: 95 e8 ldi r25, 0x85 ; 133 18016: 9f 93 push r25 18018: 8f 93 push r24 1801a: 9f 92 push r9 1801c: 8f 92 push r8 1801e: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba lcd_setstatus_serial(tm_message); 18022: c4 01 movw r24, r8 18024: 0f 94 ad 0b call 0x2175a ; 0x2175a } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 18028: 00 91 df 03 lds r16, 0x03DF ; 0x8003df set_fan_speed(255); 1802c: 8f ef ldi r24, 0xFF ; 255 1802e: 0f 94 c6 43 call 0x2878c ; 0x2878c 18032: 0f 90 pop r0 18034: 0f 90 pop r0 18036: 0f 90 pop r0 18038: 0f 90 pop r0 1803a: 0f 90 pop r0 1803c: 0f 90 pop r0 while(current_temperature[0] >= temp) { 1803e: c0 90 5e 0e lds r12, 0x0E5E ; 0x800e5e 18042: d0 90 5f 0e lds r13, 0x0E5F ; 0x800e5f 18046: e0 90 60 0e lds r14, 0x0E60 ; 0x800e60 1804a: f0 90 61 0e lds r15, 0x0E61 ; 0x800e61 1804e: 20 e0 ldi r18, 0x00 ; 0 18050: 30 e0 ldi r19, 0x00 ; 0 18052: 48 e4 ldi r20, 0x48 ; 72 18054: 52 e4 ldi r21, 0x42 ; 66 18056: c7 01 movw r24, r14 18058: b6 01 movw r22, r12 1805a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1805e: 87 fd sbrc r24, 7 18060: 27 c0 rjmp .+78 ; 0x180b0 if(temp_error_state.v) break; 18062: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 18066: 81 11 cpse r24, r1 18068: 23 c0 rjmp .+70 ; 0x180b0 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 1806a: 20 91 50 06 lds r18, 0x0650 ; 0x800650 1806e: 30 91 51 06 lds r19, 0x0651 ; 0x800651 18072: 40 91 52 06 lds r20, 0x0652 ; 0x800652 18076: 50 91 53 06 lds r21, 0x0653 ; 0x800653 1807a: 60 91 0b 13 lds r22, 0x130B ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 1807e: 70 91 0c 13 lds r23, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 18082: 80 91 0d 13 lds r24, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 18086: 90 91 0e 13 lds r25, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1808a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 1808e: 20 e0 ldi r18, 0x00 ; 0 18090: 30 e0 ldi r19, 0x00 ; 0 18092: 40 ea ldi r20, 0xA0 ; 160 18094: 50 e4 ldi r21, 0x40 ; 64 18096: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1809a: 9b 01 movw r18, r22 1809c: ac 01 movw r20, r24 1809e: c7 01 movw r24, r14 180a0: b6 01 movw r22, r12 180a2: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 180a6: 87 fd sbrc r24, 7 180a8: 03 c0 rjmp .+6 ; 0x180b0 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 180aa: 0f 94 94 50 call 0x2a128 ; 0x2a128 180ae: c7 cf rjmp .-114 ; 0x1803e } set_fan_speed(old_speed); 180b0: 80 2f mov r24, r16 180b2: 0f 94 c6 43 call 0x2878c ; 0x2878c 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); 180b6: 80 e1 ldi r24, 0x10 ; 16 180b8: 97 e2 ldi r25, 0x27 ; 39 180ba: 0f 94 c1 50 call 0x2a182 ; 0x2a182 } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 180be: 7f 92 push r7 180c0: 6f 92 push r6 180c2: e2 e3 ldi r30, 0x32 ; 50 180c4: f5 e8 ldi r31, 0x85 ; 133 180c6: ff 93 push r31 180c8: ef 93 push r30 180ca: 9f 92 push r9 180cc: 8f 92 push r8 180ce: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba lcd_setstatus_serial(tm_message); 180d2: c4 01 movw r24, r8 180d4: 0f 94 ad 0b call 0x2175a ; 0x2175a target_temperature[0] = cal_temp; 180d8: 30 92 6b 0e sts 0x0E6B, r3 ; 0x800e6b 180dc: 20 92 6a 0e sts 0x0E6A, r2 ; 0x800e6a samples = record(); 180e0: 0f 94 d9 1d call 0x23bb2 ; 0x23bb2 180e4: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 180e6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 180ea: 0f 90 pop r0 180ec: 0f 90 pop r0 180ee: 0f 90 pop r0 180f0: 0f 90 pop r0 180f2: 0f 90 pop r0 180f4: 0f 90 pop r0 180f6: 81 11 cpse r24, r1 180f8: 7a c0 rjmp .+244 ; 0x181ee 180fa: a1 14 cp r10, r1 180fc: b1 04 cpc r11, r1 180fe: 09 f4 brne .+2 ; 0x18102 18100: 76 c0 rjmp .+236 ; 0x181ee return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 18102: 60 91 cb 12 lds r22, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 18106: 70 91 cc 12 lds r23, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 1810a: 80 91 cd 12 lds r24, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 1810e: 90 91 ce 12 lds r25, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> 18112: 9b 01 movw r18, r22 18114: ac 01 movw r20, r24 18116: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 1811a: 88 23 and r24, r24 1811c: 61 f0 breq .+24 ; 0x18136 thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 1811e: 80 e0 ldi r24, 0x00 ; 0 18120: 90 e0 ldi r25, 0x00 ; 0 18122: a8 e4 ldi r26, 0x48 ; 72 18124: b2 e4 ldi r27, 0x42 ; 66 18126: 80 93 cb 12 sts 0x12CB, r24 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 1812a: 90 93 cc 12 sts 0x12CC, r25 ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 1812e: a0 93 cd 12 sts 0x12CD, r26 ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 18132: b0 93 ce 12 sts 0x12CE, r27 ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> e = estimate(samples, &thermal_model::data.C, 18136: c0 90 50 06 lds r12, 0x0650 ; 0x800650 1813a: d0 90 51 06 lds r13, 0x0651 ; 0x800651 1813e: e0 90 52 06 lds r14, 0x0652 ; 0x800652 18142: f0 90 53 06 lds r15, 0x0653 ; 0x800653 18146: 00 e0 ldi r16, 0x00 ; 0 18148: 20 e0 ldi r18, 0x00 ; 0 1814a: 30 e0 ldi r19, 0x00 ; 0 1814c: 40 ea ldi r20, 0xA0 ; 160 1814e: 51 e4 ldi r21, 0x41 ; 65 18150: 61 ec ldi r22, 0xC1 ; 193 18152: 72 e1 ldi r23, 0x12 ; 18 18154: c5 01 movw r24, r10 18156: 0e 94 46 dd call 0x1ba8c ; 0x1ba8c 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)) 1815a: 9b 01 movw r18, r22 1815c: ac 01 movw r20, r24 1815e: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 18162: 81 11 cpse r24, r1 18164: 44 c0 rjmp .+136 ; 0x181ee return true; wait_temp(); 18166: 0f 94 9f 50 call 0x2a13e ; 0x2a13e if(i) break; // we don't need to refine R 1816a: 4a 94 dec r4 1816c: 45 28 or r4, r5 1816e: 09 f4 brne .+2 ; 0x18172 18170: 85 c0 rjmp .+266 ; 0x1827c wait(30000); // settle PID regulation 18172: 80 e3 ldi r24, 0x30 ; 48 18174: 95 e7 ldi r25, 0x75 ; 117 18176: 0f 94 c1 50 call 0x2a182 ; 0x2a182 sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 1817a: 3f 92 push r3 1817c: 2f 92 push r2 1817e: 7f 92 push r7 18180: 6f 92 push r6 18182: 45 e2 ldi r20, 0x25 ; 37 18184: 55 e8 ldi r21, 0x85 ; 133 18186: 5f 93 push r21 18188: 4f 93 push r20 1818a: 9f 92 push r9 1818c: 8f 92 push r8 1818e: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba lcd_setstatus_serial(tm_message); 18192: c4 01 movw r24, r8 18194: 0f 94 ad 0b call 0x2175a ; 0x2175a samples = record(); 18198: 0f 94 d9 1d call 0x23bb2 ; 0x23bb2 if(temp_error_state.v || !samples) 1819c: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 181a0: 0f b6 in r0, 0x3f ; 63 181a2: f8 94 cli 181a4: de bf out 0x3e, r29 ; 62 181a6: 0f be out 0x3f, r0 ; 63 181a8: cd bf out 0x3d, r28 ; 61 181aa: 21 11 cpse r18, r1 181ac: 20 c0 rjmp .+64 ; 0x181ee 181ae: 00 97 sbiw r24, 0x00 ; 0 181b0: f1 f0 breq .+60 ; 0x181ee return true; e = estimate(samples, &thermal_model::data.R[0], 181b2: c0 90 50 06 lds r12, 0x0650 ; 0x800650 181b6: d0 90 51 06 lds r13, 0x0651 ; 0x800651 181ba: e0 90 52 06 lds r14, 0x0652 ; 0x800652 181be: f0 90 53 06 lds r15, 0x0653 ; 0x800653 181c2: 20 e0 ldi r18, 0x00 ; 0 181c4: 30 e0 ldi r19, 0x00 ; 0 181c6: 48 e4 ldi r20, 0x48 ; 72 181c8: 52 e4 ldi r21, 0x42 ; 66 181ca: 6b ec ldi r22, 0xCB ; 203 181cc: 72 e1 ldi r23, 0x12 ; 18 181ce: 0e 94 46 dd call 0x1ba8c ; 0x1ba8c // 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")); 181d2: b3 e5 ldi r27, 0x53 ; 83 181d4: 6b 2e mov r6, r27 181d6: b5 e8 ldi r27, 0x85 ; 133 181d8: 7b 2e mov r7, r27 181da: 44 24 eor r4, r4 181dc: 43 94 inc r4 181de: 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)) 181e0: 9b 01 movw r18, r22 181e2: ac 01 movw r20, r24 181e4: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 181e8: 88 23 and r24, r24 181ea: 09 f4 brne .+2 ; 0x181ee 181ec: fc ce rjmp .-520 ; 0x17fe6 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; 181ee: 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); 181f0: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.556> // always reset temperature disable_heater(); 181f4: 0f 94 27 45 call 0x28a4e ; 0x28a4e if(thermal_model_autotune_err) { 181f8: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.556> 181fc: 88 23 and r24, r24 181fe: 09 f4 brne .+2 ; 0x18202 18200: fd c0 rjmp .+506 ; 0x183fc sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 18202: 82 e6 ldi r24, 0x62 ; 98 18204: 95 e8 ldi r25, 0x85 ; 133 18206: 9f 93 push r25 18208: 8f 93 push r24 1820a: 9f 92 push r9 1820c: 8f 92 push r8 1820e: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba lcd_setstatus_serial(tm_message); 18212: c4 01 movw r24, r8 18214: 0f 94 ad 0b call 0x2175a ; 0x2175a if(temp_error_state.v) 18218: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 1821c: 0f 90 pop r0 1821e: 0f 90 pop r0 18220: 0f 90 pop r0 18222: 0f 90 pop r0 18224: 88 23 and r24, r24 18226: 19 f0 breq .+6 ; 0x1822e thermal_model_cal::set_fan_speed(255); 18228: 8f ef ldi r24, 0xFF ; 255 1822a: 0f 94 c6 43 call 0x2878c ; 0x2878c // show calibrated values before overwriting them thermal_model_report_settings(); 1822e: 0f 94 d0 43 call 0x287a0 ; 0x287a0 // restore original state thermal_model::data.C = orig_C; 18232: 6e 96 adiw r28, 0x1e ; 30 18234: 2c ad ldd r18, Y+60 ; 0x3c 18236: 3d ad ldd r19, Y+61 ; 0x3d 18238: 4e ad ldd r20, Y+62 ; 0x3e 1823a: 5f ad ldd r21, Y+63 ; 0x3f 1823c: 6e 97 sbiw r28, 0x1e ; 30 1823e: 20 93 c1 12 sts 0x12C1, r18 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 18242: 30 93 c2 12 sts 0x12C2, r19 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 18246: 40 93 c3 12 sts 0x12C3, r20 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 1824a: 50 93 c4 12 sts 0x12C4, r21 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); 1824e: 80 e4 ldi r24, 0x40 ; 64 18250: fe 01 movw r30, r28 18252: 31 96 adiw r30, 0x01 ; 1 18254: ab ec ldi r26, 0xCB ; 203 18256: b2 e1 ldi r27, 0x12 ; 18 18258: 01 90 ld r0, Z+ 1825a: 0d 92 st X+, r0 1825c: 8a 95 dec r24 1825e: e1 f7 brne .-8 ; 0x18258 thermal_model_set_enabled(orig_enabled); 18260: 67 96 adiw r28, 0x17 ; 23 18262: 8f ad ldd r24, Y+63 ; 0x3f 18264: 67 97 sbiw r28, 0x17 ; 23 18266: 0f 94 4d 48 call 0x2909a ; 0x2909a thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 1826a: 0e 94 be 71 call 0xe37c ; 0xe37c menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 1826e: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18272: 8d 7f andi r24, 0xFD ; 253 18274: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce 18278: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a // 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); 1827c: 8f ef ldi r24, 0xFF ; 255 1827e: 0f 94 c6 43 call 0x2878c ; 0x2878c wait(30000); 18282: 80 e3 ldi r24, 0x30 ; 48 18284: 95 e7 ldi r25, 0x75 ; 117 18286: 0f 94 c1 50 call 0x2a182 ; 0x2a182 1828a: e7 e0 ldi r30, 0x07 ; 7 1828c: 6e 2e mov r6, r30 1828e: e3 e1 ldi r30, 0x13 ; 19 18290: 7e 2e mov r7, r30 18292: 1f ef ldi r17, 0xFF ; 255 18294: ff e0 ldi r31, 0x0F ; 15 18296: af 2e mov r10, r31 18298: 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; 1829a: 21 2c mov r2, r1 1829c: 31 2c mov r3, r1 1829e: a0 ec ldi r26, 0xC0 ; 192 182a0: 4a 2e mov r4, r26 182a2: af e7 ldi r26, 0x7F ; 127 182a4: 5a 2e mov r5, r26 182a6: f3 01 movw r30, r6 182a8: 20 82 st Z, r2 182aa: 31 82 std Z+1, r3 ; 0x01 182ac: 42 82 std Z+2, r4 ; 0x02 182ae: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 182b0: 81 2f mov r24, r17 182b2: 0f 94 c6 43 call 0x2878c ; 0x2878c wait(10000); 182b6: 80 e1 ldi r24, 0x10 ; 16 182b8: 97 e2 ldi r25, 0x27 ; 39 182ba: 0f 94 c1 50 call 0x2a182 ; 0x2a182 sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 182be: bf 92 push r11 182c0: af 92 push r10 182c2: 21 e1 ldi r18, 0x11 ; 17 182c4: 35 e8 ldi r19, 0x85 ; 133 182c6: 3f 93 push r19 182c8: 2f 93 push r18 182ca: 9f 92 push r9 182cc: 8f 92 push r8 182ce: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba lcd_setstatus_serial(tm_message); 182d2: c4 01 movw r24, r8 182d4: 0f 94 ad 0b call 0x2175a ; 0x2175a samples = record(); 182d8: 0f 94 d9 1d call 0x23bb2 ; 0x23bb2 if(temp_error_state.v || !samples) 182dc: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 182e0: 0f 90 pop r0 182e2: 0f 90 pop r0 182e4: 0f 90 pop r0 182e6: 0f 90 pop r0 182e8: 0f 90 pop r0 182ea: 0f 90 pop r0 182ec: 21 11 cpse r18, r1 182ee: 7f cf rjmp .-258 ; 0x181ee 182f0: 00 97 sbiw r24, 0x00 ; 0 182f2: 09 f4 brne .+2 ; 0x182f6 182f4: 7c cf rjmp .-264 ; 0x181ee 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], 182f6: c0 90 50 06 lds r12, 0x0650 ; 0x800650 182fa: d0 90 51 06 lds r13, 0x0651 ; 0x800651 182fe: e0 90 52 06 lds r14, 0x0652 ; 0x800652 18302: f0 90 53 06 lds r15, 0x0653 ; 0x800653 18306: 20 91 cb 12 lds r18, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 1830a: 30 91 cc 12 lds r19, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 1830e: 40 91 cd 12 lds r20, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 18312: 50 91 ce 12 lds r21, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> 18316: 0a 2d mov r16, r10 18318: b3 01 movw r22, r6 1831a: 0e 94 46 dd call 0x1ba8c ; 0x1ba8c 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)) 1831e: 9b 01 movw r18, r22 18320: ac 01 movw r20, r24 18322: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 18326: 81 11 cpse r24, r1 18328: 62 cf rjmp .-316 ; 0x181ee 1832a: 54 e0 ldi r21, 0x04 ; 4 1832c: a5 1a sub r10, r21 1832e: b1 08 sbc r11, r1 18330: 80 e1 ldi r24, 0x10 ; 16 18332: 68 1a sub r6, r24 18334: 71 08 sbc r7, r1 18336: 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) { 18338: 9f ef ldi r25, 0xFF ; 255 1833a: a9 16 cp r10, r25 1833c: b9 06 cpc r11, r25 1833e: 09 f0 breq .+2 ; 0x18342 18340: b2 cf rjmp .-156 ; 0x182a6 18342: 63 e0 ldi r22, 0x03 ; 3 18344: e6 2e mov r14, r22 18346: 63 e1 ldi r22, 0x13 ; 19 18348: f6 2e mov r15, r22 1834a: 0e e0 ldi r16, 0x0E ; 14 1834c: 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; 1834e: 7f e0 ldi r23, 0x0F ; 15 18350: 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)) { 18352: 8f e0 ldi r24, 0x0F ; 15 18354: 90 e0 ldi r25, 0x00 ; 0 18356: 80 1b sub r24, r16 18358: 91 0b sbc r25, r17 1835a: 83 70 andi r24, 0x03 ; 3 1835c: 99 27 eor r25, r25 1835e: 89 2b or r24, r25 18360: 59 f4 brne .+22 ; 0x18378 next = i; 18362: 30 2e mov r3, r16 18364: 01 50 subi r16, 0x01 ; 1 18366: 11 09 sbc r17, r1 18368: f4 e0 ldi r31, 0x04 ; 4 1836a: ef 1a sub r14, r31 1836c: 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) { 1836e: 01 15 cp r16, r1 18370: 11 05 cpc r17, r1 18372: 79 f7 brne .-34 ; 0x18352 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; 18374: 80 e0 ldi r24, 0x00 ; 0 18376: 3c cf rjmp .-392 ; 0x181f0 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; 18378: 8c ef ldi r24, 0xFC ; 252 1837a: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 1837c: 87 fd sbrc r24, 7 1837e: 80 e0 ldi r24, 0x00 ; 0 18380: 08 2e mov r0, r24 18382: 00 0c add r0, r0 18384: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 18386: fc 01 movw r30, r24 18388: ee 0f add r30, r30 1838a: ff 1f adc r31, r31 1838c: ee 0f add r30, r30 1838e: ff 1f adc r31, r31 18390: e5 53 subi r30, 0x35 ; 53 18392: fd 4e sbci r31, 0xED ; 237 18394: 40 80 ld r4, Z 18396: 51 80 ldd r5, Z+1 ; 0x01 18398: 62 80 ldd r6, Z+2 ; 0x02 1839a: 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; 1839c: b8 01 movw r22, r16 1839e: 68 1b sub r22, r24 183a0: 79 0b sbc r23, r25 183a2: 07 2e mov r0, r23 183a4: 00 0c add r0, r0 183a6: 88 0b sbc r24, r24 183a8: 99 0b sbc r25, r25 183aa: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 183ae: 20 e0 ldi r18, 0x00 ; 0 183b0: 30 e0 ldi r19, 0x00 ; 0 183b2: 40 e8 ldi r20, 0x80 ; 128 183b4: 5e e3 ldi r21, 0x3E ; 62 183b6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 183ba: 5b 01 movw r10, r22 183bc: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 183be: a3 2d mov r26, r3 183c0: b4 e0 ldi r27, 0x04 ; 4 183c2: ab 02 muls r26, r27 183c4: f0 01 movw r30, r0 183c6: 11 24 eor r1, r1 183c8: e5 53 subi r30, 0x35 ; 53 183ca: fd 4e sbci r31, 0xED ; 237 183cc: a3 01 movw r20, r6 183ce: 92 01 movw r18, r4 183d0: 60 81 ld r22, Z 183d2: 71 81 ldd r23, Z+1 ; 0x01 183d4: 82 81 ldd r24, Z+2 ; 0x02 183d6: 93 81 ldd r25, Z+3 ; 0x03 183d8: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 183dc: 9b 01 movw r18, r22 183de: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 183e0: c6 01 movw r24, r12 183e2: b5 01 movw r22, r10 183e4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 183e8: a3 01 movw r20, r6 183ea: 92 01 movw r18, r4 183ec: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 183f0: f7 01 movw r30, r14 183f2: 60 83 st Z, r22 183f4: 71 83 std Z+1, r23 ; 0x01 183f6: 82 83 std Z+2, r24 ; 0x02 183f8: 93 83 std Z+3, r25 ; 0x03 183fa: b4 cf rjmp .-152 ; 0x18364 // 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); 183fc: 88 e0 ldi r24, 0x08 ; 8 183fe: 0e 94 3a e7 call 0x1ce74 ; 0x1ce74 lcd_setstatuspgm(MSG_WELCOME); 18402: 8d ea ldi r24, 0xAD ; 173 18404: 90 e7 ldi r25, 0x70 ; 112 18406: 0f 94 be 0b call 0x2177c ; 0x2177c thermal_model_cal::set_fan_speed(0); 1840a: 80 e0 ldi r24, 0x00 ; 0 1840c: 0f 94 c6 43 call 0x2878c ; 0x2878c thermal_model_set_enabled(orig_enabled); 18410: 67 96 adiw r28, 0x17 ; 23 18412: 8f ad ldd r24, Y+63 ; 0x3f 18414: 67 97 sbiw r28, 0x17 ; 23 18416: 0f 94 4d 48 call 0x2909a ; 0x2909a thermal_model_report_settings(); 1841a: 0f 94 d0 43 call 0x287a0 ; 0x287a0 1841e: 25 cf rjmp .-438 ; 0x1826a M400 */ case 400: { st_synchronize(); 18420: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 18424: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 18428: 81 e0 ldi r24, 0x01 ; 1 1842a: 0e 94 c5 75 call 0xeb8a ; 0xeb8a 1842e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 18432: 0e 94 f7 80 call 0x101ee ; 0x101ee 18436: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a M500 */ case 500: { Config_StoreSettings(); 1843a: 0e 94 e0 83 call 0x107c0 ; 0x107c0 1843e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a M501 */ case 501: { Config_RetrieveSettings(); 18442: 0e 94 6a 95 call 0x12ad4 ; 0x12ad4 18446: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a M502 */ case 502: { Config_ResetDefault(); 1844a: 0e 94 c8 83 call 0x10790 ; 0x10790 1844e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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); 18452: 1f 93 push r17 18454: 0f 93 push r16 18456: 81 e9 ldi r24, 0x91 ; 145 18458: 90 e8 ldi r25, 0x80 ; 128 1845a: 9f 93 push r25 1845c: 8f 93 push r24 1845e: 0f 94 08 dc call 0x3b810 ; 0x3b810 18462: 0f 90 pop r0 18464: 0f 90 pop r0 18466: 0f 90 pop r0 18468: 0f 90 pop r0 1846a: 0c 94 ef b0 jmp 0x161de ; 0x161de M509 */ case 509: { lang_reset(); 1846e: 0e 94 f2 71 call 0xe3e4 ; 0xe3e4 SERIAL_ECHO_START; 18472: 84 e1 ldi r24, 0x14 ; 20 18474: 9a ea ldi r25, 0xAA ; 170 18476: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 1847a: 80 e9 ldi r24, 0x90 ; 144 1847c: 97 e8 ldi r25, 0x87 ; 135 1847e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 18482: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a - `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(); 18486: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 /// 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; 1848a: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 1848e: 81 11 cpse r24, r1 18490: 02 c0 rjmp .+4 ; 0x18496 18492: 0e 94 0f 65 call 0xca1e ; 0xca1e 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(); 18496: 85 e4 ldi r24, 0x45 ; 69 18498: 0e 94 8d 5c call 0xb91a ; 0xb91a 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; 1849c: 81 2c mov r8, r1 1849e: 91 2c mov r9, r1 184a0: a1 2c mov r10, r1 184a2: 20 ec ldi r18, 0xC0 ; 192 184a4: 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(); 184a6: 88 23 and r24, r24 184a8: 21 f0 breq .+8 ; 0x184b2 184aa: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 184ae: 4b 01 movw r8, r22 184b0: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 184b2: 8c e4 ldi r24, 0x4C ; 76 184b4: 0e 94 8d 5c call 0xb91a ; 0xb91a 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; 184b8: c1 2c mov r12, r1 184ba: d1 2c mov r13, r1 184bc: 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(); 184be: 88 23 and r24, r24 184c0: 21 f0 breq .+8 ; 0x184ca 184c2: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 184c6: 6b 01 movw r12, r22 184c8: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 184ca: 8a e5 ldi r24, 0x5A ; 90 184cc: 0e 94 8d 5c call 0xb91a ; 0xb91a // 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; 184d0: 41 2c mov r4, r1 184d2: 51 2c mov r5, r1 184d4: 98 ed ldi r25, 0xD8 ; 216 184d6: 69 2e mov r6, r25 184d8: 91 e4 ldi r25, 0x41 ; 65 184da: 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()); 184dc: 88 23 and r24, r24 184de: 31 f0 breq .+12 ; 0x184ec 184e0: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 184e4: 2b 01 movw r4, r22 184e6: 3c 01 movw r6, r24 184e8: e8 94 clt 184ea: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 184ec: 88 e5 ldi r24, 0x58 ; 88 184ee: 0e 94 8d 5c call 0xb91a ; 0xb91a 184f2: 88 23 and r24, r24 184f4: 09 f4 brne .+2 ; 0x184f8 184f6: ba c1 rjmp .+884 ; 0x1886c 184f8: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 184fc: 6a 96 adiw r28, 0x1a ; 26 184fe: 6c af std Y+60, r22 ; 0x3c 18500: 7d af std Y+61, r23 ; 0x3d 18502: 8e af std Y+62, r24 ; 0x3e 18504: 9f af std Y+63, r25 ; 0x3f 18506: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 18508: 89 e5 ldi r24, 0x59 ; 89 1850a: 0e 94 8d 5c call 0xb91a ; 0xb91a 1850e: 88 23 and r24, r24 18510: 09 f4 brne .+2 ; 0x18514 18512: b7 c1 rjmp .+878 ; 0x18882 18514: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 18518: 6e 96 adiw r28, 0x1e ; 30 1851a: 6c af std Y+60, r22 ; 0x3c 1851c: 7d af std Y+61, r23 ; 0x3d 1851e: 8e af std Y+62, r24 ; 0x3e 18520: 9f af std Y+63, r25 ; 0x3f 18522: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 18524: 1a 82 std Y+2, r1 ; 0x02 18526: 19 82 std Y+1, r1 ; 0x01 18528: fe 01 movw r30, r28 1852a: 33 96 adiw r30, 0x03 ; 3 1852c: 83 e1 ldi r24, 0x13 ; 19 1852e: df 01 movw r26, r30 18530: 1d 92 st X+, r1 18532: 8a 95 dec r24 18534: e9 f7 brne .-6 ; 0x18530 if (code_seen('C')) { 18536: 83 e4 ldi r24, 0x43 ; 67 18538: 0e 94 8d 5c call 0xb91a ; 0xb91a 1853c: 88 23 and r24, r24 1853e: f9 f0 breq .+62 ; 0x1857e , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18540: 62 e2 ldi r22, 0x22 ; 34 18542: 70 e0 ldi r23, 0x00 ; 0 18544: 80 91 93 03 lds r24, 0x0393 ; 0x800393 18548: 90 91 94 03 lds r25, 0x0394 ; 0x800394 1854c: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 18550: 8c 01 movw r16, r24 if (!this->ptr) { 18552: 89 2b or r24, r25 18554: a1 f0 breq .+40 ; 0x1857e // First quote not found return; } // Skip the leading quote this->ptr++; 18556: 0f 5f subi r16, 0xFF ; 255 18558: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 1855a: 62 e2 ldi r22, 0x22 ; 34 1855c: 70 e0 ldi r23, 0x00 ; 0 1855e: c8 01 movw r24, r16 18560: 0f 94 9d e3 call 0x3c73a ; 0x3c73a if(!pStrEnd) { 18564: 00 97 sbiw r24, 0x00 ; 0 18566: 59 f0 breq .+22 ; 0x1857e // Second quote not found return; } this->len = pStrEnd - this->ptr; 18568: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 1856a: 84 31 cpi r24, 0x14 ; 20 1856c: 08 f0 brcs .+2 ; 0x18570 1856e: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 18570: 48 2f mov r20, r24 18572: 50 e0 ldi r21, 0x00 ; 0 18574: b8 01 movw r22, r16 18576: ce 01 movw r24, r28 18578: 01 96 adiw r24, 0x01 ; 1 1857a: 0f 94 6f e3 call 0x3c6de ; 0x3c6de } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 1857e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 float x_position = FILAMENTCHANGE_XPOS; float y_position = FILAMENTCHANGE_YPOS; float z_shift = MIN_Z_FOR_SWAP; float e_shift_init = FILAMENTCHANGE_FIRSTRETRACT; float e_shift_late = FILAMENTCHANGE_FINALRETRACT; bool automatic = false; 18582: 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"))) 18584: 81 30 cpi r24, 0x01 ; 1 18586: 29 f4 brne .+10 ; 0x18592 18588: 8b e8 ldi r24, 0x8B ; 139 1858a: 97 e8 ldi r25, 0x87 ; 135 1858c: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 18590: 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(); 18592: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 18596: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // Retract E if (!printingIsPaused()) 1859a: 0e 94 4b 68 call 0xd096 ; 0xd096 1859e: 81 11 cpse r24, r1 185a0: 77 c1 rjmp .+750 ; 0x18890 { current_position[E_AXIS] += e_shift; 185a2: a5 01 movw r20, r10 185a4: 94 01 movw r18, r8 185a6: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 185aa: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 185ae: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 185b2: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 185b6: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 185ba: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 185be: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 185c2: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 185c6: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 185ca: 60 e0 ldi r22, 0x00 ; 0 185cc: 70 e0 ldi r23, 0x00 ; 0 185ce: 88 ee ldi r24, 0xE8 ; 232 185d0: 92 e4 ldi r25, 0x42 ; 66 185d2: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 185d6: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 185da: 89 e6 ldi r24, 0x69 ; 105 185dc: 9f e6 ldi r25, 0x6F ; 111 185de: 0e 94 17 7b call 0xf62e ; 0xf62e // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 185e2: c3 01 movw r24, r6 185e4: b2 01 movw r22, r4 185e6: 0e 94 a7 6e call 0xdd4e ; 0xdd4e // Move XY to side current_position[X_AXIS] = x_position; 185ea: 6a 96 adiw r28, 0x1a ; 26 185ec: 2c ad ldd r18, Y+60 ; 0x3c 185ee: 3d ad ldd r19, Y+61 ; 0x3d 185f0: 4e ad ldd r20, Y+62 ; 0x3e 185f2: 5f ad ldd r21, Y+63 ; 0x3f 185f4: 6a 97 sbiw r28, 0x1a ; 26 185f6: 20 93 40 07 sts 0x0740, r18 ; 0x800740 185fa: 30 93 41 07 sts 0x0741, r19 ; 0x800741 185fe: 40 93 42 07 sts 0x0742, r20 ; 0x800742 18602: 50 93 43 07 sts 0x0743, r21 ; 0x800743 current_position[Y_AXIS] = y_position; 18606: 6e 96 adiw r28, 0x1e ; 30 18608: 8c ad ldd r24, Y+60 ; 0x3c 1860a: 9d ad ldd r25, Y+61 ; 0x3d 1860c: ae ad ldd r26, Y+62 ; 0x3e 1860e: bf ad ldd r27, Y+63 ; 0x3f 18610: 6e 97 sbiw r28, 0x1e ; 30 18612: 80 93 44 07 sts 0x0744, r24 ; 0x800744 18616: 90 93 45 07 sts 0x0745, r25 ; 0x800745 1861a: a0 93 46 07 sts 0x0746, r26 ; 0x800746 1861e: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 18622: 60 e0 ldi r22, 0x00 ; 0 18624: 70 e0 ldi r23, 0x00 ; 0 18626: 88 e4 ldi r24, 0x48 ; 72 18628: 92 e4 ldi r25, 0x42 ; 66 1862a: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1862e: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 bool repeat = false; 18632: 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; 18634: 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)); 18636: 0a ed ldi r16, 0xDA ; 218 18638: 20 2e mov r2, r16 1863a: 0f e7 ldi r16, 0x7F ; 127 1863c: 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)); 1863e: 82 ee ldi r24, 0xE2 ; 226 18640: 88 2e mov r8, r24 18642: 8f e7 ldi r24, 0x7F ; 127 18644: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 18646: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1864a: 81 30 cpi r24, 0x01 ; 1 1864c: 09 f0 breq .+2 ; 0x18650 1864e: 23 c1 rjmp .+582 ; 0x18896 eject_slot = MMU2::mmu2.get_current_tool(); 18650: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 18654: a8 2e mov r10, r24 mmu_M600_unload_filament(); 18656: 0e 94 dd 73 call 0xe7ba ; 0xe7ba } 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 1865a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1865e: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 18662: 10 92 86 17 sts 0x1786, r1 ; 0x801786 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 18666: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1866a: 81 30 cpi r24, 0x01 ; 1 1866c: 09 f4 brne .+2 ; 0x18670 1866e: e1 c1 rjmp .+962 ; 0x18a32 { KEEPALIVE_STATE(PAUSED_FOR_USER); 18670: 84 e0 ldi r24, 0x04 ; 4 18672: 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); 18676: 81 e2 ldi r24, 0x21 ; 33 18678: 99 e3 ldi r25, 0x39 ; 57 1867a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1867e: 40 e0 ldi r20, 0x00 ; 0 18680: 60 e0 ldi r22, 0x00 ; 0 18682: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c 18686: 08 2f mov r16, r24 lcd_update_enable(false); 18688: 80 e0 ldi r24, 0x00 ; 0 1868a: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 1868e: 01 30 cpi r16, 0x01 ; 1 18690: 29 f5 brne .+74 ; 0x186dc lcd_clear(); 18692: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18696: 89 e9 ldi r24, 0x99 ; 153 18698: 99 e3 ldi r25, 0x39 ; 57 1869a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1869e: ac 01 movw r20, r24 186a0: 62 e0 ldi r22, 0x02 ; 2 186a2: 80 e0 ldi r24, 0x00 ; 0 186a4: 0e 94 ba 6f call 0xdf74 ; 0xdf74 current_position[X_AXIS] = 100; 186a8: 80 e0 ldi r24, 0x00 ; 0 186aa: 90 e0 ldi r25, 0x00 ; 0 186ac: a8 ec ldi r26, 0xC8 ; 200 186ae: b2 e4 ldi r27, 0x42 ; 66 186b0: 80 93 40 07 sts 0x0740, r24 ; 0x800740 186b4: 90 93 41 07 sts 0x0741, r25 ; 0x800741 186b8: a0 93 42 07 sts 0x0742, r26 ; 0x800742 186bc: b0 93 43 07 sts 0x0743, r27 ; 0x800743 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 186c0: 60 e0 ldi r22, 0x00 ; 0 186c2: 70 e0 ldi r23, 0x00 ; 0 186c4: 88 e4 ldi r24, 0x48 ; 72 186c6: 92 e4 ldi r25, 0x42 ; 66 186c8: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 186cc: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 186d0: 8f ee ldi r24, 0xEF ; 239 186d2: 98 e3 ldi r25, 0x38 ; 56 186d4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 186d8: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 186dc: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 186e0: 8d e7 ldi r24, 0x7D ; 125 186e2: 98 e3 ldi r25, 0x38 ; 56 186e4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 186e8: ac 01 movw r20, r24 186ea: 60 e0 ldi r22, 0x00 ; 0 186ec: 80 e0 ldi r24, 0x00 ; 0 186ee: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(0, 1); 186f2: 61 e0 ldi r22, 0x01 ; 1 186f4: 80 e0 ldi r24, 0x00 ; 0 186f6: 0e 94 a6 6f call 0xdf4c ; 0xdf4c if (filament_name[0]) { 186fa: 89 81 ldd r24, Y+1 ; 0x01 186fc: 88 23 and r24, r24 186fe: 41 f0 breq .+16 ; 0x18710 lcd_print(filament_name); 18700: ce 01 movw r24, r28 18702: 01 96 adiw r24, 0x01 ; 1 18704: 0e 94 ad 71 call 0xe35a ; 0xe35a lcd_set_cursor(0, 2); 18708: 62 e0 ldi r22, 0x02 ; 2 1870a: 80 e0 ldi r24, 0x00 ; 0 1870c: 0e 94 a6 6f call 0xdf4c ; 0xdf4c } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 18710: 80 91 86 17 lds r24, 0x1786 ; 0x801786 18714: 81 11 cpse r24, r1 18716: 06 c0 rjmp .+12 ; 0x18724 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 18718: 88 e6 ldi r24, 0x68 ; 104 1871a: 98 e3 ldi r25, 0x38 ; 56 1871c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18720: 0e 94 91 6f call 0xdf22 ; 0xdf22 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); 18724: 84 e0 ldi r24, 0x04 ; 4 18726: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(!lcd_clicked()) 1872a: 0e 94 c3 71 call 0xe386 ; 0xe386 1872e: 81 11 cpse r24, r1 18730: 10 c0 rjmp .+32 ; 0x18752 { manage_heater(); 18732: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 18736: 81 e0 ldi r24, 0x01 ; 1 18738: 0e 94 f3 8b call 0x117e6 ; 0x117e6 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 1873c: 80 91 89 17 lds r24, 0x1789 ; 0x801789 18740: 88 23 and r24, r24 18742: 99 f3 breq .-26 ; 0x1872a Sound_MakeCustom(50,1000,false); 18744: 40 e0 ldi r20, 0x00 ; 0 18746: 68 ee ldi r22, 0xE8 ; 232 18748: 73 e0 ldi r23, 0x03 ; 3 1874a: 82 e3 ldi r24, 0x32 ; 50 1874c: 90 e0 ldi r25, 0x00 ; 0 1874e: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 18752: 32 e0 ldi r19, 0x02 ; 2 18754: 30 93 96 02 sts 0x0296, r19 ; 0x800296 M600_load_filament_movements(filament_name); 18758: ce 01 movw r24, r28 1875a: 01 96 adiw r24, 0x01 ; 1 1875c: 0e 94 96 73 call 0xe72c ; 0xe72c Sound_MakeCustom(50,1000,false); 18760: 40 e0 ldi r20, 0x00 ; 0 18762: 68 ee ldi r22, 0xE8 ; 232 18764: 73 e0 ldi r23, 0x03 ; 3 18766: 82 e3 ldi r24, 0x32 ; 50 18768: 90 e0 ldi r25, 0x00 ; 0 1876a: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 1876e: 11 11 cpse r17, r1 18770: a6 c1 rjmp .+844 ; 0x18abe 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); 18772: b4 e0 ldi r27, 0x04 ; 4 18774: bb 2e mov r11, r27 18776: b0 92 96 02 sts 0x0296, r11 ; 0x800296 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 1877a: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 1877e: 89 eb ldi r24, 0xB9 ; 185 18780: 98 e3 ldi r25, 0x38 ; 56 18782: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18786: ac 01 movw r20, r24 18788: 60 e0 ldi r22, 0x00 ; 0 1878a: 81 e0 ldi r24, 0x01 ; 1 1878c: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 18790: 83 ea ldi r24, 0xA3 ; 163 18792: 98 e3 ldi r25, 0x38 ; 56 18794: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18798: ac 01 movw r20, r24 1879a: 61 e0 ldi r22, 0x01 ; 1 1879c: 81 e0 ldi r24, 0x01 ; 1 1879e: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 187a2: 8f e8 ldi r24, 0x8F ; 143 187a4: 98 e3 ldi r25, 0x38 ; 56 187a6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 187aa: ac 01 movw r20, r24 187ac: 62 e0 ldi r22, 0x02 ; 2 187ae: 81 e0 ldi r24, 0x01 ; 1 187b0: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 187b4: 83 eb ldi r24, 0xB3 ; 179 187b6: 9b e3 ldi r25, 0x3B ; 59 187b8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 187bc: ac 01 movw r20, r24 187be: 63 e0 ldi r22, 0x03 ; 3 187c0: 81 e0 ldi r24, 0x01 ; 1 187c2: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_putc_at(0, cursor_pos, '>'); 187c6: 4e e3 ldi r20, 0x3E ; 62 187c8: 60 e0 ldi r22, 0x00 ; 0 187ca: 80 e0 ldi r24, 0x00 ; 0 187cc: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_consume_click(); 187d0: 0e 94 be 71 call 0xe37c ; 0xe37c uint8_t lcd_alright() { uint8_t cursor_pos = 0; 187d4: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 187d6: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 187da: 81 e0 ldi r24, 0x01 ; 1 187dc: 0e 94 f3 8b call 0x117e6 ; 0x117e6 if (lcd_encoder) 187e0: 80 91 34 05 lds r24, 0x0534 ; 0x800534 187e4: 90 91 35 05 lds r25, 0x0535 ; 0x800535 187e8: 00 97 sbiw r24, 0x00 ; 0 187ea: d9 f0 breq .+54 ; 0x18822 { if (lcd_encoder < 0 ) { 187ec: 97 ff sbrs r25, 7 187ee: 2a c1 rjmp .+596 ; 0x18a44 // Rotating knob counter clockwise if (cursor_pos > 0) 187f0: 00 23 and r16, r16 187f2: 09 f4 brne .+2 ; 0x187f6 187f4: 2b c1 rjmp .+598 ; 0x18a4c cursor_pos--; 187f6: 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 ")); 187f8: 46 ee ldi r20, 0xE6 ; 230 187fa: 5f e7 ldi r21, 0x7F ; 127 187fc: 60 e0 ldi r22, 0x00 ; 0 187fe: 80 e0 ldi r24, 0x00 ; 0 18800: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_putc_at(0, cursor_pos, '>'); 18804: 4e e3 ldi r20, 0x3E ; 62 18806: 60 2f mov r22, r16 18808: 80 e0 ldi r24, 0x00 ; 0 1880a: 0e 94 c6 6f call 0xdf8c ; 0xdf8c // Consume rotation event and make feedback sound lcd_encoder = 0; 1880e: 10 92 35 05 sts 0x0535, r1 ; 0x800535 18812: 10 92 34 05 sts 0x0534, r1 ; 0x800534 _delay(100); 18816: 64 e6 ldi r22, 0x64 ; 100 18818: 70 e0 ldi r23, 0x00 ; 0 1881a: 80 e0 ldi r24, 0x00 ; 0 1881c: 90 e0 ldi r25, 0x00 ; 0 1881e: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 } if (lcd_clicked()) 18822: 0e 94 c3 71 call 0xe386 ; 0xe386 18826: 88 23 and r24, r24 18828: b1 f2 breq .-84 ; 0x187d6 { lcd_clear(); 1882a: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_return_to_status(); 1882e: 0f 94 23 27 call 0x24e46 ; 0x24e46 lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 18832: 42 e0 ldi r20, 0x02 ; 2 18834: 40 93 96 02 sts 0x0296, r20 ; 0x800296 switch(lcd_change_filament_state) 18838: 02 30 cpi r16, 0x02 ; 2 1883a: 09 f4 brne .+2 ; 0x1883e 1883c: 10 c1 rjmp .+544 ; 0x18a5e 1883e: 03 30 cpi r16, 0x03 ; 3 18840: 09 f4 brne .+2 ; 0x18844 18842: f7 c1 rjmp .+1006 ; 0x18c32 18844: 01 30 cpi r16, 0x01 ; 1 18846: 09 f0 breq .+2 ; 0x1884a 18848: 29 c1 rjmp .+594 ; 0x18a9c { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 1884a: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1884e: 81 30 cpi r24, 0x01 ; 1 18850: 09 f0 breq .+2 ; 0x18854 18852: 00 c1 rjmp .+512 ; 0x18a54 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 18854: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 18858: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 1885a: 0e 94 dd 73 call 0xe7ba ; 0xe7ba // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 1885e: 80 2f mov r24, r16 18860: 0e 94 bb 8e call 0x11d76 ; 0x11d76 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 18864: 80 e0 ldi r24, 0x00 ; 0 18866: 0e 94 aa 79 call 0xf354 ; 0xf354 1886a: 85 cf rjmp .-246 ; 0x18776 // 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; 1886c: 20 e0 ldi r18, 0x00 ; 0 1886e: 30 e0 ldi r19, 0x00 ; 0 18870: 43 e5 ldi r20, 0x53 ; 83 18872: 53 e4 ldi r21, 0x43 ; 67 18874: 6a 96 adiw r28, 0x1a ; 26 18876: 2c af std Y+60, r18 ; 0x3c 18878: 3d af std Y+61, r19 ; 0x3d 1887a: 4e af std Y+62, r20 ; 0x3e 1887c: 5f af std Y+63, r21 ; 0x3f 1887e: 6a 97 sbiw r28, 0x1a ; 26 18880: 43 ce rjmp .-890 ; 0x18508 float y_position = FILAMENTCHANGE_YPOS; 18882: 6e 96 adiw r28, 0x1e ; 30 18884: 1c ae std Y+60, r1 ; 0x3c 18886: 1d ae std Y+61, r1 ; 0x3d 18888: 1e ae std Y+62, r1 ; 0x3e 1888a: 1f ae std Y+63, r1 ; 0x3f 1888c: 6e 97 sbiw r28, 0x1e ; 30 1888e: 4a ce rjmp .-876 ; 0x18524 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(); 18890: 0e 94 8f 65 call 0xcb1e ; 0xcb1e 18894: a6 ce rjmp .-692 ; 0x185e2 //! //! 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); 18896: 84 e0 ldi r24, 0x04 ; 4 18898: 80 93 96 02 sts 0x0296, r24 ; 0x800296 unsigned long waiting_start_time = _millis(); 1889c: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 188a0: 2b 01 movw r4, r22 188a2: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 188a4: 8d e3 ldi r24, 0x3D ; 61 188a6: 98 e3 ldi r25, 0x38 ; 56 188a8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 188ac: 0f 94 55 35 call 0x26aaa ; 0x26aaa while (!(wait_for_user_state == 0 && lcd_clicked())){ 188b0: 0e 94 c3 71 call 0xe386 ; 0xe386 188b4: 08 2f mov r16, r24 188b6: 81 11 cpse r24, r1 188b8: 38 c0 rjmp .+112 ; 0x1892a 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) { 188ba: a3 01 movw r20, r6 188bc: 92 01 movw r18, r4 188be: 20 54 subi r18, 0x40 ; 64 188c0: 38 4d sbci r19, 0xD8 ; 216 188c2: 46 4f sbci r20, 0xF6 ; 246 188c4: 5f 4f sbci r21, 0xFF ; 255 188c6: 6a 96 adiw r28, 0x1a ; 26 188c8: 2c af std Y+60, r18 ; 0x3c 188ca: 3d af std Y+61, r19 ; 0x3d 188cc: 4e af std Y+62, r20 ; 0x3e 188ce: 5f af std Y+63, r21 ; 0x3f 188d0: 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(); 188d2: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 188d6: 81 e0 ldi r24, 0x01 ; 1 188d8: 0e 94 f3 8b call 0x117e6 ; 0x117e6 if (wait_for_user_state != 2) sound_wait_for_user(); 188dc: 02 30 cpi r16, 0x02 ; 2 188de: 09 f4 brne .+2 ; 0x188e2 188e0: 67 c0 rjmp .+206 ; 0x189b0 188e2: 0f 94 fa 6a call 0x2d5f4 ; 0x2d5f4 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); 188e6: 84 e0 ldi r24, 0x04 ; 4 188e8: 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) { 188ea: 01 30 cpi r16, 0x01 ; 1 188ec: 39 f1 breq .+78 ; 0x1893c case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 188ee: 0e 94 98 8e call 0x11d30 ; 0x11d30 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 188f2: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 188f6: 6a 96 adiw r28, 0x1a ; 26 188f8: 2c ad ldd r18, Y+60 ; 0x3c 188fa: 3d ad ldd r19, Y+61 ; 0x3d 188fc: 4e ad ldd r20, Y+62 ; 0x3e 188fe: 5f ad ldd r21, Y+63 ; 0x3f 18900: 6a 97 sbiw r28, 0x1a ; 26 18902: 26 17 cp r18, r22 18904: 37 07 cpc r19, r23 18906: 48 07 cpc r20, r24 18908: 59 07 cpc r21, r25 1890a: 90 f6 brcc .-92 ; 0x188b0 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 1890c: 8c e0 ldi r24, 0x0C ; 12 1890e: 98 e3 ldi r25, 0x38 ; 56 18910: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18914: 0f 94 55 35 call 0x26aaa ; 0x26aaa return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 18918: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 1891c: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 18920: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 disable_e0(); 18924: 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; 18926: 01 e0 ldi r16, 0x01 ; 1 18928: d4 cf rjmp .-88 ; 0x188d2 1892a: 10 92 69 05 sts 0x0569, r1 ; 0x800569 <_ZL10beep_timer.lto_priv.512> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 1892e: 10 92 6c 05 sts 0x056C, r1 ; 0x80056c <_ZL6bFirst.lto_priv.513> 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); 18932: c7 01 movw r24, r14 18934: b6 01 movw r22, r12 18936: 0f 94 a7 16 call 0x22d4e ; 0x22d4e 1893a: 8f ce rjmp .-738 ; 0x1865a 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); 1893c: 0e 94 98 8e call 0x11d30 ; 0x11d30 if (lcd_clicked()) { 18940: 0e 94 c3 71 call 0xe386 ; 0xe386 18944: 88 23 and r24, r24 18946: 29 f2 breq .-118 ; 0x188d2 18948: 80 91 aa 05 lds r24, 0x05AA ; 0x8005aa 1894c: 90 91 ab 05 lds r25, 0x05AB ; 0x8005ab 18950: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 18954: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 18958: 8a e9 ldi r24, 0x9A ; 154 1895a: 9f e4 ldi r25, 0x4F ; 79 1895c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18960: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 18964: 42 e8 ldi r20, 0x82 ; 130 18966: 64 e0 ldi r22, 0x04 ; 4 18968: 80 e0 ldi r24, 0x00 ; 0 1896a: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 1896e: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 18972: 8f 93 push r24 18974: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 18978: 8f 93 push r24 1897a: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 1897e: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 18982: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 18986: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 1898a: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 1898e: 7f 93 push r23 18990: 6f 93 push r22 18992: 3f 92 push r3 18994: 2f 92 push r2 18996: 0e 94 7f 6f call 0xdefe ; 0xdefe lcd_putc(LCD_STR_DEGREE[0]); 1899a: 81 e8 ldi r24, 0x81 ; 129 1899c: 0e 94 95 6f call 0xdf2a ; 0xdf2a 189a0: 0f 90 pop r0 189a2: 0f 90 pop r0 189a4: 0f 90 pop r0 189a6: 0f 90 pop r0 189a8: 0f 90 pop r0 189aa: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 189ac: 02 e0 ldi r16, 0x02 ; 2 189ae: 91 cf rjmp .-222 ; 0x188d2 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 189b0: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 189b4: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 189b8: 07 2e mov r0, r23 189ba: 00 0c add r0, r0 189bc: 88 0b sbc r24, r24 189be: 99 0b sbc r25, r25 189c0: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 189c4: 20 91 5e 0e lds r18, 0x0E5E ; 0x800e5e 189c8: 30 91 5f 0e lds r19, 0x0E5F ; 0x800e5f 189cc: 40 91 60 0e lds r20, 0x0E60 ; 0x800e60 189d0: 50 91 61 0e lds r21, 0x0E61 ; 0x800e61 189d4: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 189d8: 9f 77 andi r25, 0x7F ; 127 189da: 20 e0 ldi r18, 0x00 ; 0 189dc: 30 e0 ldi r19, 0x00 ; 0 189de: 40 ea ldi r20, 0xA0 ; 160 189e0: 50 e4 ldi r21, 0x40 ; 64 189e2: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 189e6: 87 ff sbrs r24, 7 189e8: 0b c0 rjmp .+22 ; 0x18a00 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 189ea: 8d e3 ldi r24, 0x3D ; 61 189ec: 98 e3 ldi r25, 0x38 ; 56 189ee: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 189f2: 0f 94 55 35 call 0x26aaa ; 0x26aaa waiting_start_time = _millis(); 189f6: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 189fa: 2b 01 movw r4, r22 189fc: 3c 01 movw r6, r24 189fe: 58 cf rjmp .-336 ; 0x188b0 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 18a00: 64 e0 ldi r22, 0x04 ; 4 18a02: 81 e0 ldi r24, 0x01 ; 1 18a04: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 18a08: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 18a0c: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 18a10: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 18a14: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 18a18: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 18a1c: 7f 93 push r23 18a1e: 6f 93 push r22 18a20: 9f 92 push r9 18a22: 8f 92 push r8 18a24: 0e 94 7f 6f call 0xdefe ; 0xdefe 18a28: 0f 90 pop r0 18a2a: 0f 90 pop r0 18a2c: 0f 90 pop r0 18a2e: 0f 90 pop r0 18a30: 50 cf rjmp .-352 ; 0x188d2 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 18a32: 11 11 cpse r17, r1 18a34: 03 c0 rjmp .+6 ; 0x18a3c 18a36: 8a 2d mov r24, r10 18a38: 0e 94 bb 8e call 0x11d76 ; 0x11d76 mmu_M600_load_filament(automatic); 18a3c: 81 2f mov r24, r17 18a3e: 0e 94 aa 79 call 0xf354 ; 0xf354 18a42: 95 ce rjmp .-726 ; 0x1876e cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 18a44: 03 30 cpi r16, 0x03 ; 3 18a46: 10 f4 brcc .+4 ; 0x18a4c cursor_pos++; 18a48: 0f 5f subi r16, 0xFF ; 255 18a4a: d6 ce rjmp .-596 ; 0x187f8 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18a4c: 87 e0 ldi r24, 0x07 ; 7 18a4e: 0f 94 34 64 call 0x2c868 ; 0x2c868 18a52: d2 ce rjmp .-604 ; 0x187f8 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); 18a54: ce 01 movw r24, r28 18a56: 01 96 adiw r24, 0x01 ; 1 18a58: 0e 94 96 73 call 0xe72c ; 0xe72c 18a5c: 8c ce rjmp .-744 ; 0x18776 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 18a5e: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 load_filament_final_feed(); 18a62: 0e 94 59 65 call 0xcab2 ; 0xcab2 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(); 18a66: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 18a6a: 8d ec ldi r24, 0xCD ; 205 18a6c: 98 e3 ldi r25, 0x38 ; 56 18a6e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18a72: ac 01 movw r20, r24 18a74: 60 e0 ldi r22, 0x00 ; 0 18a76: 80 e0 ldi r24, 0x00 ; 0 18a78: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18a7c: 89 e9 ldi r24, 0x99 ; 153 18a7e: 99 e3 ldi r25, 0x39 ; 57 18a80: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18a84: ac 01 movw r20, r24 18a86: 62 e0 ldi r22, 0x02 ; 2 18a88: 80 e0 ldi r24, 0x00 ; 0 18a8a: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 18a8e: 87 e9 ldi r24, 0x97 ; 151 18a90: 9d e1 ldi r25, 0x1D ; 29 18a92: 0f 94 a0 36 call 0x26d40 ; 0x26d40 lcd_loading_color(); st_synchronize(); 18a96: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 18a9a: 6d ce rjmp .-806 ; 0x18776 } void lcd_change_success() { lcd_clear(); 18a9c: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 18aa0: 8d ed ldi r24, 0xDD ; 221 18aa2: 98 e3 ldi r25, 0x38 ; 56 18aa4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18aa8: ac 01 movw r20, r24 18aaa: 62 e0 ldi r22, 0x02 ; 2 18aac: 80 e0 ldi r24, 0x00 ; 0 18aae: 0e 94 ba 6f call 0xdf74 ; 0xdf74 //! @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) 18ab2: 00 23 and r16, r16 18ab4: 19 f0 breq .+6 ; 0x18abc 18ab6: 03 30 cpi r16, 0x03 ; 3 18ab8: 09 f0 breq .+2 ; 0x18abc 18aba: 5d ce rjmp .-838 ; 0x18776 default: lcd_change_success(); break; } } return false; 18abc: 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(); } 18abe: 85 e8 ldi r24, 0x85 ; 133 18ac0: 97 e1 ldi r25, 0x17 ; 23 18ac2: 0e 94 95 75 call 0xeb2a ; 0xeb2a current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 18ac6: b1 10 cpse r11, r1 18ac8: be cd rjmp .-1156 ; 0x18646 if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 18aca: 81 e0 ldi r24, 0x01 ; 1 18acc: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 // Not let's go back to print fanSpeed = saved_fan_speed; 18ad0: 80 91 a9 05 lds r24, 0x05A9 ; 0x8005a9 18ad4: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df // Feed a little of filament to stabilize pressure if (!automatic) { 18ad8: 11 11 cpse r17, r1 18ada: 27 c0 rjmp .+78 ; 0x18b2a if (printingIsPaused()) 18adc: 0e 94 4b 68 call 0xd096 ; 0xd096 18ae0: c0 90 4c 07 lds r12, 0x074C ; 0x80074c 18ae4: d0 90 4d 07 lds r13, 0x074D ; 0x80074d 18ae8: e0 90 4e 07 lds r14, 0x074E ; 0x80074e 18aec: f0 90 4f 07 lds r15, 0x074F ; 0x80074f 18af0: 88 23 and r24, r24 18af2: 09 f4 brne .+2 ; 0x18af6 18af4: a1 c0 rjmp .+322 ; 0x18c38 { // 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; 18af6: 20 e0 ldi r18, 0x00 ; 0 18af8: 30 e0 ldi r19, 0x00 ; 0 18afa: 40 e8 ldi r20, 0x80 ; 128 18afc: 5f e3 ldi r21, 0x3F ; 63 18afe: c7 01 movw r24, r14 18b00: b6 01 movw r22, r12 18b02: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 18b06: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 18b0a: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 18b0e: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 18b12: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 18b16: 60 e0 ldi r22, 0x00 ; 0 18b18: 70 e0 ldi r23, 0x00 ; 0 18b1a: 88 ee ldi r24, 0xE8 ; 232 18b1c: 92 e4 ldi r25, 0x42 ; 66 18b1e: 0f 94 48 ba call 0x37490 ; 0x37490 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 18b22: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 18b26: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); } } // Move XY back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_XYFEED); 18b2a: e0 90 48 07 lds r14, 0x0748 ; 0x800748 18b2e: f0 90 49 07 lds r15, 0x0749 ; 0x800749 18b32: 00 91 4a 07 lds r16, 0x074A ; 0x80074a 18b36: 10 91 4b 07 lds r17, 0x074B ; 0x80074b 18b3a: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 18b3e: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 18b42: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 18b46: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 18b4a: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 18b4e: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 18b52: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 18b56: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 18b5a: 1f 92 push r1 18b5c: 1f 92 push r1 18b5e: 1f 92 push r1 18b60: 1f 92 push r1 18b62: 81 2c mov r8, r1 18b64: 91 2c mov r9, r1 18b66: e8 e4 ldi r30, 0x48 ; 72 18b68: ae 2e mov r10, r30 18b6a: e2 e4 ldi r30, 0x42 ; 66 18b6c: be 2e mov r11, r30 18b6e: fc e4 ldi r31, 0x4C ; 76 18b70: cf 2e mov r12, r31 18b72: f7 e0 ldi r31, 0x07 ; 7 18b74: df 2e mov r13, r31 18b76: 0f 94 f3 aa call 0x355e6 ; 0x355e6 st_synchronize(); 18b7a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 18b7e: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 18b82: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 18b86: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 18b8a: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 18b8e: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 18b92: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 18b96: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 18b9a: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 18b9e: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 18ba2: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 18ba6: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 18baa: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 18bae: 1f 92 push r1 18bb0: 1f 92 push r1 18bb2: 1f 92 push r1 18bb4: 1f 92 push r1 18bb6: 81 2c mov r8, r1 18bb8: 91 2c mov r9, r1 18bba: a0 e7 ldi r26, 0x70 ; 112 18bbc: aa 2e mov r10, r26 18bbe: a1 e4 ldi r26, 0x41 ; 65 18bc0: ba 2e mov r11, r26 18bc2: 0f 94 f3 aa call 0x355e6 ; 0x355e6 st_synchronize(); 18bc6: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 18bca: 87 ea ldi r24, 0xA7 ; 167 18bcc: 92 e0 ldi r25, 0x02 ; 2 18bce: 0f 94 99 aa call 0x35532 ; 0x35532 memcpy(current_position, saved_pos, sizeof(saved_pos)); 18bd2: 80 e1 ldi r24, 0x10 ; 16 18bd4: eb e9 ldi r30, 0x9B ; 155 18bd6: f2 e0 ldi r31, 0x02 ; 2 18bd8: a0 e4 ldi r26, 0x40 ; 64 18bda: b7 e0 ldi r27, 0x07 ; 7 18bdc: 01 90 ld r0, Z+ 18bde: 0d 92 st X+, r0 18be0: 8a 95 dec r24 18be2: e1 f7 brne .-8 ; 0x18bdc set_destination_to_current(); 18be4: 0e 94 00 69 call 0xd200 ; 0xd200 // Recover feed rate feedmultiply = saved_feedmultiply2; 18be8: 80 91 6f 03 lds r24, 0x036F ; 0x80036f 18bec: 90 91 70 03 lds r25, 0x0370 ; 0x800370 18bf0: 80 93 39 02 sts 0x0239, r24 ; 0x800239 18bf4: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 18bf8: 9f 93 push r25 18bfa: 8f 93 push r24 18bfc: 8e ed ldi r24, 0xDE ; 222 18bfe: 91 e7 ldi r25, 0x71 ; 113 18c00: 9f 93 push r25 18c02: 8f 93 push r24 18c04: 0e 94 fa 89 call 0x113f4 ; 0x113f4 if (printingIsPaused()) { 18c08: 0e 94 4b 68 call 0xd096 ; 0xd096 18c0c: 0f b6 in r0, 0x3f ; 63 18c0e: f8 94 cli 18c10: de bf out 0x3e, r29 ; 62 18c12: 0f be out 0x3f, r0 ; 63 18c14: cd bf out 0x3d, r28 ; 61 18c16: 88 23 and r24, r24 18c18: 31 f1 breq .+76 ; 0x18c66 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 18c1a: 8a eb ldi r24, 0xBA ; 186 18c1c: 90 e4 ldi r25, 0x40 ; 64 18c1e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 18c22: 0f 94 be 0b call 0x2177c ; 0x2177c } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 18c26: 10 92 72 07 sts 0x0772, r1 ; 0x800772 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 18c2a: 10 92 50 07 sts 0x0750, r1 ; 0x800750 18c2e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a st_synchronize(); break; // Unload filament case 3: return true; 18c32: bb 24 eor r11, r11 18c34: b3 94 inc r11 18c36: 43 cf rjmp .-378 ; 0x18abe setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 18c38: 20 e0 ldi r18, 0x00 ; 0 18c3a: 30 e0 ldi r19, 0x00 ; 0 18c3c: 40 ea ldi r20, 0xA0 ; 160 18c3e: 50 e4 ldi r21, 0x40 ; 64 18c40: c7 01 movw r24, r14 18c42: b6 01 movw r22, r12 18c44: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 18c48: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 18c4c: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 18c50: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 18c54: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 18c58: 60 e0 ldi r22, 0x00 ; 0 18c5a: 70 e0 ldi r23, 0x00 ; 0 18c5c: 80 e0 ldi r24, 0x00 ; 0 18c5e: 90 e4 ldi r25, 0x40 ; 64 18c60: 0f 94 48 ba call 0x37490 ; 0x37490 18c64: 62 cf rjmp .-316 ; 0x18b2a if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18c66: 8d ea ldi r24, 0xAD ; 173 18c68: 90 e7 ldi r25, 0x70 ; 112 18c6a: 0f 94 be 0b call 0x2177c ; 0x2177c SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 18c6e: 8e e5 ldi r24, 0x5E ; 94 18c70: 9b e6 ldi r25, 0x6B ; 107 18c72: 0e 94 17 7b call 0xf62e ; 0xf62e 18c76: d7 cf rjmp .-82 ; 0x18c26 SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18c78: 0e 94 4b 68 call 0xd096 ; 0xd096 18c7c: 81 11 cpse r24, r1 18c7e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a st_synchronize(); 18c82: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18c86: 0e 94 c6 80 call 0x1018c ; 0x1018c cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18c8a: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 lcd_pause_print(); 18c8e: 0f 94 67 3f call 0x27ece ; 0x27ece 18c92: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 18c96: 0e 94 4b 68 call 0xd096 ; 0xd096 18c9a: 88 23 and r24, r24 18c9c: 11 f4 brne .+4 ; 0x18ca2 18c9e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 18ca2: 0c 94 6d b3 jmp 0x166da ; 0x166da /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 18ca6: 60 e0 ldi r22, 0x00 ; 0 18ca8: 80 e0 ldi r24, 0x00 ; 0 18caa: 0f 94 e7 15 call 0x22bce ; 0x22bce 18cae: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 18cb2: 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')) { 18cb4: 83 e5 ldi r24, 0x53 ; 83 18cb6: 0e 94 8d 5c call 0xb91a ; 0xb91a 18cba: 88 23 and r24, r24 18cbc: b1 f0 breq .+44 ; 0x18cea iSel = code_value_uint8(); 18cbe: 0e 94 1f 5c call 0xb83e ; 0xb83e 18cc2: 18 2f mov r17, r24 if (iSel>=max_sheets) 18cc4: 88 30 cpi r24, 0x08 ; 8 18cc6: b0 f0 brcs .+44 ; 0x18cf4 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 18cc8: 8c e6 ldi r24, 0x6C ; 108 18cca: 97 e8 ldi r25, 0x87 ; 135 18ccc: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18cd0: 4a e0 ldi r20, 0x0A ; 10 18cd2: 67 e0 ldi r22, 0x07 ; 7 18cd4: 70 e0 ldi r23, 0x00 ; 0 18cd6: 80 e0 ldi r24, 0x00 ; 0 18cd8: 90 e0 ldi r25, 0x00 ; 0 18cda: 0f 94 35 d2 call 0x3a46a ; 0x3a46a SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 18cde: 81 ef ldi r24, 0xF1 ; 241 18ce0: 92 e0 ldi r25, 0x02 ; 2 18ce2: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 18ce6: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18cea: 81 ea ldi r24, 0xA1 ; 161 18cec: 9d e0 ldi r25, 0x0D ; 13 18cee: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 18cf2: 18 2f mov r17, r24 } if (code_seen('Z')){ 18cf4: 8a e5 ldi r24, 0x5A ; 90 18cf6: 0e 94 8d 5c call 0xb91a ; 0xb91a 18cfa: 88 23 and r24, r24 18cfc: 09 f4 brne .+2 ; 0x18d00 18cfe: d7 c0 rjmp .+430 ; 0x18eae z_val = code_value(); 18d00: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 18d04: 2b 01 movw r4, r22 18d06: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 18d08: 20 91 77 06 lds r18, 0x0677 ; 0x800677 18d0c: 30 91 78 06 lds r19, 0x0678 ; 0x800678 18d10: 40 91 79 06 lds r20, 0x0679 ; 0x800679 18d14: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 18d18: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 18d1c: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 18d20: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 18d22: 9b 01 movw r18, r22 18d24: 21 56 subi r18, 0x61 ; 97 18d26: 30 4f sbci r19, 0xF0 ; 240 18d28: 20 3a cpi r18, 0xA0 ; 160 18d2a: 3f 40 sbci r19, 0x0F ; 15 18d2c: 30 f0 brcs .+12 ; 0x18d3a { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 18d2e: 86 e5 ldi r24, 0x56 ; 86 18d30: 97 e8 ldi r25, 0x87 ; 135 18d32: 0e 94 17 7b call 0xf62e ; 0xf62e 18d36: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 18d3a: 5b e0 ldi r21, 0x0B ; 11 18d3c: 15 9f mul r17, r21 18d3e: 90 01 movw r18, r0 18d40: 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); 18d42: c9 01 movw r24, r18 18d44: 80 5b subi r24, 0xB0 ; 176 18d46: 92 4f sbci r25, 0xF2 ; 242 18d48: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 { 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')) 18d4c: 8c e4 ldi r24, 0x4C ; 76 18d4e: 0e 94 8d 5c call 0xb91a ; 0xb91a 18d52: bb e0 ldi r27, 0x0B ; 11 18d54: 1b 9f mul r17, r27 18d56: 70 01 movw r14, r0 18d58: 11 24 eor r1, r1 18d5a: 57 01 movw r10, r14 18d5c: e7 eb ldi r30, 0xB7 ; 183 18d5e: ae 1a sub r10, r30 18d60: e2 ef ldi r30, 0xF2 ; 242 18d62: be 0a sbc r11, r30 18d64: 88 23 and r24, r24 18d66: 09 f4 brne .+2 ; 0x18d6a 18d68: be c0 rjmp .+380 ; 0x18ee6 { char *src = strchr_pointer + 1; 18d6a: e0 91 93 03 lds r30, 0x0393 ; 0x800393 18d6e: f0 91 94 03 lds r31, 0x0394 ; 0x800394 18d72: 31 96 adiw r30, 0x01 ; 1 18d74: bf 01 movw r22, r30 while (*src == ' ') ++src; 18d76: 81 91 ld r24, Z+ 18d78: 80 32 cpi r24, 0x20 ; 32 18d7a: e1 f3 breq .-8 ; 0x18d74 if (*src != '\0') 18d7c: 88 23 and r24, r24 18d7e: 31 f0 breq .+12 ; 0x18d8c { strncpy(strLabel,src,7); 18d80: 47 e0 ldi r20, 0x07 ; 7 18d82: 50 e0 ldi r21, 0x00 ; 0 18d84: ce 01 movw r24, r28 18d86: 01 96 adiw r24, 0x01 ; 1 18d88: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c #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); 18d8c: 47 e0 ldi r20, 0x07 ; 7 18d8e: 50 e0 ldi r21, 0x00 ; 0 18d90: b5 01 movw r22, r10 18d92: ce 01 movw r24, r28 18d94: 01 96 adiw r24, 0x01 ; 1 18d96: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 18d9a: 82 e4 ldi r24, 0x42 ; 66 18d9c: 0e 94 8d 5c call 0xb91a ; 0xb91a 18da0: 57 01 movw r10, r14 18da2: fe ea ldi r31, 0xAE ; 174 18da4: af 1a sub r10, r31 18da6: f2 ef ldi r31, 0xF2 ; 242 18da8: bf 0a sbc r11, r31 18daa: 88 23 and r24, r24 18dac: 09 f4 brne .+2 ; 0x18db0 18dae: a3 c0 rjmp .+326 ; 0x18ef6 { iBedC = code_value_uint8(); 18db0: 0e 94 1f 5c call 0xb83e ; 0xb83e 18db4: 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); 18db6: 68 2f mov r22, r24 18db8: c5 01 movw r24, r10 18dba: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 18dbe: 80 e5 ldi r24, 0x50 ; 80 18dc0: 0e 94 8d 5c call 0xb91a ; 0xb91a 18dc4: 2d ea ldi r18, 0xAD ; 173 18dc6: e2 1a sub r14, r18 18dc8: 22 ef ldi r18, 0xF2 ; 242 18dca: f2 0a sbc r15, r18 18dcc: 88 23 and r24, r24 18dce: 09 f4 brne .+2 ; 0x18dd2 18dd0: 97 c0 rjmp .+302 ; 0x18f00 { iPindaC = code_value_uint8(); 18dd2: 0e 94 1f 5c call 0xb83e ; 0xb83e 18dd6: b8 2e mov r11, r24 18dd8: 68 2f mov r22, r24 18dda: c7 01 movw r24, r14 18ddc: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 18de0: 81 e4 ldi r24, 0x41 ; 65 18de2: 0e 94 8d 5c call 0xb91a ; 0xb91a 18de6: 88 23 and r24, r24 18de8: 09 f4 brne .+2 ; 0x18dec 18dea: 8f c0 rjmp .+286 ; 0x18f0a { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18dec: 0e 94 1f 5c call 0xb83e ; 0xb83e 18df0: 81 11 cpse r24, r1 18df2: 06 c0 rjmp .+12 ; 0x18e00 18df4: 81 ea ldi r24, 0xA1 ; 161 18df6: 9d e0 ldi r25, 0x0D ; 13 18df8: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 18dfc: 18 13 cpse r17, r24 18dfe: 8d c0 rjmp .+282 ; 0x18f1a if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 18e00: 81 2f mov r24, r17 18e02: 0e 94 dd 77 call 0xefba ; 0xefba 18e06: 08 2f mov r16, r24 18e08: 88 23 and r24, r24 18e0a: 29 f0 breq .+10 ; 0x18e16 18e0c: 61 2f mov r22, r17 18e0e: 81 ea ldi r24, 0xA1 ; 161 18e10: 9d e0 ldi r25, 0x0D ; 13 18e12: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 18e16: 8f e4 ldi r24, 0x4F ; 79 18e18: 97 e8 ldi r25, 0x87 ; 135 18e1a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18e1e: 61 2f mov r22, r17 18e20: 70 e0 ldi r23, 0x00 ; 0 18e22: 90 e0 ldi r25, 0x00 ; 0 18e24: 80 e0 ldi r24, 0x00 ; 0 18e26: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 18e2a: 81 2f mov r24, r17 18e2c: 0e 94 dd 77 call 0xefba ; 0xefba 18e30: 81 11 cpse r24, r1 18e32: 04 c0 rjmp .+8 ; 0x18e3c SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 18e34: 8e e3 ldi r24, 0x3E ; 62 18e36: 97 e8 ldi r25, 0x87 ; 135 18e38: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLPGM(" Z"); 18e3c: 8b e3 ldi r24, 0x3B ; 59 18e3e: 97 e8 ldi r25, 0x87 ; 135 18e40: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18e44: 44 e0 ldi r20, 0x04 ; 4 18e46: c3 01 movw r24, r6 18e48: b2 01 movw r22, r4 18e4a: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 18e4e: 88 e3 ldi r24, 0x38 ; 56 18e50: 97 e8 ldi r25, 0x87 ; 135 18e52: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18e56: b6 01 movw r22, r12 18e58: dd 0c add r13, r13 18e5a: 88 0b sbc r24, r24 18e5c: 99 0b sbc r25, r25 18e5e: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 18e62: 85 e3 ldi r24, 0x35 ; 53 18e64: 97 e8 ldi r25, 0x87 ; 135 18e66: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 18e6a: ce 01 movw r24, r28 18e6c: 01 96 adiw r24, 0x01 ; 1 18e6e: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 18e72: 82 e3 ldi r24, 0x32 ; 50 18e74: 97 e8 ldi r25, 0x87 ; 135 18e76: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 18e7a: 69 2d mov r22, r9 18e7c: 70 e0 ldi r23, 0x00 ; 0 18e7e: 90 e0 ldi r25, 0x00 ; 0 18e80: 80 e0 ldi r24, 0x00 ; 0 18e82: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18e86: 8f e2 ldi r24, 0x2F ; 47 18e88: 97 e8 ldi r25, 0x87 ; 135 18e8a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 18e8e: 6b 2d mov r22, r11 18e90: 70 e0 ldi r23, 0x00 ; 0 18e92: 90 e0 ldi r25, 0x00 ; 0 18e94: 80 e0 ldi r24, 0x00 ; 0 18e96: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 18e9a: 8c e2 ldi r24, 0x2C ; 44 18e9c: 97 e8 ldi r25, 0x87 ; 135 18e9e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLLN((int)bIsActive); 18ea2: 80 2f mov r24, r16 18ea4: 90 e0 ldi r25, 0x00 ; 0 18ea6: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c 18eaa: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } 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))); 18eae: ab e0 ldi r26, 0x0B ; 11 18eb0: 1a 9f mul r17, r26 18eb2: c0 01 movw r24, r0 18eb4: 11 24 eor r1, r1 18eb6: 80 5b subi r24, 0xB0 ; 176 18eb8: 92 4f sbci r25, 0xF2 ; 242 18eba: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 18ebe: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 18ec0: bc 01 movw r22, r24 18ec2: 99 0f add r25, r25 18ec4: 88 0b sbc r24, r24 18ec6: 99 0b sbc r25, r25 18ec8: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 18ecc: 20 91 77 06 lds r18, 0x0677 ; 0x800677 18ed0: 30 91 78 06 lds r19, 0x0678 ; 0x800678 18ed4: 40 91 79 06 lds r20, 0x0679 ; 0x800679 18ed8: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 18edc: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 18ee0: 2b 01 movw r4, r22 18ee2: 3c 01 movw r6, r24 18ee4: 33 cf rjmp .-410 ; 0x18d4c } 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)); 18ee6: 47 e0 ldi r20, 0x07 ; 7 18ee8: 50 e0 ldi r21, 0x00 ; 0 18eea: b5 01 movw r22, r10 18eec: ce 01 movw r24, r28 18eee: 01 96 adiw r24, 0x01 ; 1 18ef0: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c 18ef4: 52 cf rjmp .-348 ; 0x18d9a 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); 18ef6: c5 01 movw r24, r10 18ef8: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 18efc: 98 2e mov r9, r24 18efe: 5f cf rjmp .-322 ; 0x18dbe 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); 18f00: c7 01 movw r24, r14 18f02: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 18f06: b8 2e mov r11, r24 18f08: 6b cf rjmp .-298 ; 0x18de0 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18f0a: 81 ea ldi r24, 0xA1 ; 161 18f0c: 9d e0 ldi r25, 0x0D ; 13 18f0e: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 18f12: 01 e0 ldi r16, 0x01 ; 1 18f14: 18 17 cp r17, r24 18f16: 09 f4 brne .+2 ; 0x18f1a 18f18: 7e cf rjmp .-260 ; 0x18e16 { 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; 18f1a: 00 e0 ldi r16, 0x00 ; 0 18f1c: 7c cf rjmp .-264 ; 0x18e16 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)) ) { 18f1e: c3 01 movw r24, r6 18f20: b2 01 movw r22, r4 18f22: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 18f26: 20 91 95 03 lds r18, 0x0395 ; 0x800395 18f2a: 30 91 96 03 lds r19, 0x0396 ; 0x800396 18f2e: 40 91 97 03 lds r20, 0x0397 ; 0x800397 18f32: 50 91 98 03 lds r21, 0x0398 ; 0x800398 18f36: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 18f3a: 87 fd sbrc r24, 7 18f3c: 02 c0 rjmp .+4 ; 0x18f42 18f3e: 0c 94 8e b2 jmp 0x1651c ; 0x1651c if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 18f42: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 18f46: 68 19 sub r22, r8 18f48: 79 09 sbc r23, r9 18f4a: 8a 09 sbc r24, r10 18f4c: 9b 09 sbc r25, r11 18f4e: 69 3e cpi r22, 0xE9 ; 233 18f50: 73 40 sbci r23, 0x03 ; 3 18f52: 81 05 cpc r24, r1 18f54: 91 05 cpc r25, r1 18f56: c8 f0 brcs .+50 ; 0x18f8a { SERIAL_PROTOCOLPGM("P:"); 18f58: 86 e0 ldi r24, 0x06 ; 6 18f5a: 97 e8 ldi r25, 0x87 ; 135 18f5c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18f60: 60 91 95 03 lds r22, 0x0395 ; 0x800395 18f64: 70 91 96 03 lds r23, 0x0396 ; 0x800396 18f68: 80 91 97 03 lds r24, 0x0397 ; 0x800397 18f6c: 90 91 98 03 lds r25, 0x0398 ; 0x800398 18f70: 41 e0 ldi r20, 0x01 ; 1 18f72: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18f76: 8f e2 ldi r24, 0x2F ; 47 18f78: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 18f7c: c8 01 movw r24, r16 18f7e: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c codenum = _millis(); 18f82: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 18f86: 4b 01 movw r8, r22 18f88: 5c 01 movw r10, r24 } manage_heater(); 18f8a: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(); 18f8e: 80 e0 ldi r24, 0x00 ; 0 18f90: 0e 94 f3 8b call 0x117e6 ; 0x117e6 lcd_update(0); 18f94: 80 e0 ldi r24, 0x00 ; 0 18f96: 0e 94 6d 6f call 0xdeda ; 0xdeda 18f9a: 0c 94 75 b2 jmp 0x164ea ; 0x164ea - `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 18f9e: 8f e3 ldi r24, 0x3F ; 63 18fa0: 0e 94 8d 5c call 0xb91a ; 0xb91a 18fa4: 88 23 and r24, r24 18fa6: c9 f0 breq .+50 ; 0x18fda SERIAL_PROTOCOLPGM("PINDA cal status: "); 18fa8: 83 ef ldi r24, 0xF3 ; 243 18faa: 96 e8 ldi r25, 0x86 ; 134 18fac: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 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); } 18fb0: 86 ea ldi r24, 0xA6 ; 166 18fb2: 9f e0 ldi r25, 0x0F ; 15 18fb4: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 18fb8: 21 e0 ldi r18, 0x01 ; 1 18fba: 30 e0 ldi r19, 0x00 ; 0 18fbc: 81 11 cpse r24, r1 18fbe: 02 c0 rjmp .+4 ; 0x18fc4 18fc0: 30 e0 ldi r19, 0x00 ; 0 18fc2: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 18fc4: c9 01 movw r24, r18 18fc6: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c SERIAL_PROTOCOLLNRPGM(_header); 18fca: 8c ed ldi r24, 0xDC ; 220 18fcc: 96 e8 ldi r25, 0x86 ; 134 18fce: 0e 94 17 7b call 0xf62e ; 0xf62e gcode_M861_print_pinda_cal_eeprom(); 18fd2: 0e 94 24 79 call 0xf248 ; 0xf248 18fd6: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else if (code_seen('!')) { // ! - Set factory default values 18fda: 81 e2 ldi r24, 0x21 ; 33 18fdc: 0e 94 8d 5c call 0xb91a ; 0xb91a 18fe0: 88 23 and r24, r24 18fe2: 49 f1 breq .+82 ; 0x19036 18fe4: 61 e0 ldi r22, 0x01 ; 1 18fe6: 86 ea ldi r24, 0xA6 ; 166 18fe8: 9f e0 ldi r25, 0x0F ; 15 18fea: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 18fee: 68 e0 ldi r22, 0x08 ; 8 18ff0: 70 e0 ldi r23, 0x00 ; 0 18ff2: 80 eb ldi r24, 0xB0 ; 176 18ff4: 9f e0 ldi r25, 0x0F ; 15 18ff6: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 18ffa: 68 e1 ldi r22, 0x18 ; 24 18ffc: 70 e0 ldi r23, 0x00 ; 0 18ffe: 82 eb ldi r24, 0xB2 ; 178 19000: 9f e0 ldi r25, 0x0F ; 15 19002: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 19006: 60 e3 ldi r22, 0x30 ; 48 19008: 70 e0 ldi r23, 0x00 ; 0 1900a: 84 eb ldi r24, 0xB4 ; 180 1900c: 9f e0 ldi r25, 0x0F ; 15 1900e: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 19012: 60 e5 ldi r22, 0x50 ; 80 19014: 70 e0 ldi r23, 0x00 ; 0 19016: 86 eb ldi r24, 0xB6 ; 182 19018: 9f e0 ldi r25, 0x0F ; 15 1901a: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 1901e: 68 e7 ldi r22, 0x78 ; 120 19020: 70 e0 ldi r23, 0x00 ; 0 19022: 88 eb ldi r24, 0xB8 ; 184 19024: 9f e0 ldi r25, 0x0F ; 15 19026: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 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"); 1902a: 8b ec ldi r24, 0xCB ; 203 1902c: 96 e8 ldi r25, 0x86 ; 134 1902e: 0e 94 17 7b call 0xf62e ; 0xf62e 19032: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 19036: 8a e5 ldi r24, 0x5A ; 90 19038: 0e 94 8d 5c call 0xb91a ; 0xb91a 1903c: 88 23 and r24, r24 1903e: c1 f0 breq .+48 ; 0x19070 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 19040: 61 e0 ldi r22, 0x01 ; 1 19042: 86 ea ldi r24, 0xA6 ; 166 19044: 9f e0 ldi r25, 0x0F ; 15 19046: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 1904a: 00 eb ldi r16, 0xB0 ; 176 1904c: 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); 1904e: 70 e0 ldi r23, 0x00 ; 0 19050: 60 e0 ldi r22, 0x00 ; 0 19052: c8 01 movw r24, r16 19054: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 19058: 0e 5f subi r16, 0xFE ; 254 1905a: 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++) { 1905c: 0a 3b cpi r16, 0xBA ; 186 1905e: 4f e0 ldi r20, 0x0F ; 15 19060: 14 07 cpc r17, r20 19062: a9 f7 brne .-22 ; 0x1904e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 19064: 81 ec ldi r24, 0xC1 ; 193 19066: 96 e8 ldi r25, 0x86 ; 134 19068: 0e 94 17 7b call 0xf62e ; 0xf62e 1906c: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 19070: 83 e5 ldi r24, 0x53 ; 83 19072: 0e 94 8d 5c call 0xb91a ; 0xb91a 19076: 88 23 and r24, r24 19078: 21 f1 breq .+72 ; 0x190c2 int16_t usteps = code_value_short(); 1907a: 0e 94 2c 5c call 0xb858 ; 0xb858 1907e: 8c 01 movw r16, r24 if (code_seen('I')) { 19080: 89 e4 ldi r24, 0x49 ; 73 19082: 0e 94 8d 5c call 0xb91a ; 0xb91a 19086: 88 23 and r24, r24 19088: 11 f4 brne .+4 ; 0x1908e 1908a: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a uint8_t index = code_value_uint8(); 1908e: 0e 94 1f 5c call 0xb83e ; 0xb83e if (index < 5) { 19092: 85 30 cpi r24, 0x05 ; 5 19094: 10 f0 brcs .+4 ; 0x1909a 19096: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 1909a: 90 e0 ldi r25, 0x00 ; 0 1909c: 88 52 subi r24, 0x28 ; 40 1909e: 98 4f sbci r25, 0xF8 ; 248 190a0: b8 01 movw r22, r16 190a2: 88 0f add r24, r24 190a4: 99 1f adc r25, r25 190a6: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 SERIAL_PROTOCOLLNRPGM(MSG_OK); 190aa: 84 e4 ldi r24, 0x44 ; 68 190ac: 9e e6 ldi r25, 0x6E ; 110 190ae: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLLNRPGM(_header); 190b2: 8c ed ldi r24, 0xDC ; 220 190b4: 96 e8 ldi r25, 0x86 ; 134 190b6: 0e 94 17 7b call 0xf62e ; 0xf62e gcode_M861_print_pinda_cal_eeprom(); 190ba: 0e 94 24 79 call 0xf248 ; 0xf248 190be: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 190c2: 80 eb ldi r24, 0xB0 ; 176 190c4: 96 e8 ldi r25, 0x86 ; 134 190c6: 0e 94 17 7b call 0xf62e ; 0xf62e 190ca: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a */ 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); 190ce: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 190d2: 20 e0 ldi r18, 0x00 ; 0 190d4: 30 e0 ldi r19, 0x00 ; 0 190d6: 40 e2 ldi r20, 0x20 ; 32 190d8: 51 e4 ldi r21, 0x41 ; 65 190da: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 190de: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 190e2: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 190e4: 63 30 cpi r22, 0x03 ; 3 190e6: 09 f4 brne .+2 ; 0x190ea 190e8: a2 c0 rjmp .+324 ; 0x1922e 190ea: 98 f5 brcc .+102 ; 0x19152 190ec: 61 30 cpi r22, 0x01 ; 1 190ee: 09 f4 brne .+2 ; 0x190f2 190f0: 59 c0 rjmp .+178 ; 0x191a4 190f2: 62 30 cpi r22, 0x02 ; 2 190f4: 11 f0 breq .+4 ; 0x190fa 190f6: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 190fa: 80 91 95 13 lds r24, 0x1395 ; 0x801395 return pgm_read_word(&_nPrinterMmuType); 190fe: e6 ed ldi r30, 0xD6 ; 214 19100: ff e7 ldi r31, 0x7F ; 127 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 19102: 81 30 cpi r24, 0x01 ; 1 19104: 11 f0 breq .+4 ; 0x1910a return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 19106: e8 ed ldi r30, 0xD8 ; 216 19108: ff e7 ldi r31, 0x7F ; 127 1910a: 05 91 lpm r16, Z+ 1910c: 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')) 1910e: 80 e5 ldi r24, 0x50 ; 80 19110: 0e 94 8d 5c call 0xb91a ; 0xb91a 19114: 88 23 and r24, r24 19116: 09 f4 brne .+2 ; 0x1911a 19118: 79 c0 rjmp .+242 ; 0x1920c { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 1911a: 0e 94 39 5c call 0xb872 ; 0xb872 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 1911e: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 19122: ff 20 and r15, r15 19124: 11 f4 brne .+4 ; 0x1912a 19126: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a return; if (nPrinterModel == actualPrinterModel) 1912a: 60 17 cp r22, r16 1912c: 71 07 cpc r23, r17 1912e: 11 f4 brne .+4 ; 0x19134 19130: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 19134: 8d eb ldi r24, 0xBD ; 189 19136: 97 e3 ldi r25, 0x37 ; 55 19138: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1913c: 8c 01 movw r16, r24 1913e: 8f e8 ldi r24, 0x8F ; 143 19140: 97 e3 ldi r25, 0x37 ; 55 19142: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 19146: 4f 2d mov r20, r15 19148: b8 01 movw r22, r16 1914a: 0f 94 3e 16 call 0x22c7c ; 0x22c7c 1914e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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) 19152: 64 30 cpi r22, 0x04 ; 4 19154: 09 f4 brne .+2 ; 0x19158 19156: be c0 rjmp .+380 ; 0x192d4 19158: 65 30 cpi r22, 0x05 ; 5 1915a: 11 f0 breq .+4 ; 0x19160 1915c: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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')) 19160: 80 e5 ldi r24, 0x50 ; 80 19162: 0e 94 8d 5c call 0xb91a ; 0xb91a 19166: 88 23 and r24, r24 19168: 09 f4 brne .+2 ; 0x1916c 1916a: 3a c1 rjmp .+628 ; 0x193e0 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 1916c: 0e 94 39 5c call 0xb872 ; 0xb872 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 19170: 10 91 e8 04 lds r17, 0x04E8 ; 0x8004e8 19174: 11 23 and r17, r17 19176: 11 f4 brne .+4 ; 0x1917c 19178: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 1917c: 62 30 cpi r22, 0x02 ; 2 1917e: 71 05 cpc r23, r1 19180: 10 f4 brcc .+4 ; 0x19186 19182: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 19186: 8f ed ldi r24, 0xDF ; 223 19188: 96 e3 ldi r25, 0x36 ; 54 1918a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1918e: 7c 01 movw r14, r24 19190: 88 eb ldi r24, 0xB8 ; 184 19192: 96 e3 ldi r25, 0x36 ; 54 19194: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 19198: 41 2f mov r20, r17 1919a: b7 01 movw r22, r14 1919c: 0f 94 3e 16 call 0x22c7c ; 0x22c7c 191a0: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 191a4: 80 e5 ldi r24, 0x50 ; 80 191a6: 0e 94 8d 5c call 0xb91a ; 0xb91a 191aa: 88 23 and r24, r24 191ac: a9 f0 breq .+42 ; 0x191d8 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 191ae: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 191b2: 20 e0 ldi r18, 0x00 ; 0 191b4: 30 e0 ldi r19, 0x00 ; 0 191b6: 4a e7 ldi r20, 0x7A ; 122 191b8: 54 e4 ldi r21, 0x44 ; 68 191ba: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 191be: 20 e0 ldi r18, 0x00 ; 0 191c0: 30 e0 ldi r19, 0x00 ; 0 191c2: 40 e0 ldi r20, 0x00 ; 0 191c4: 5f e3 ldi r21, 0x3F ; 63 191c6: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 191ca: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> nozzle_diameter_check(nDiameter); 191ce: cb 01 movw r24, r22 191d0: 0f 94 7d 16 call 0x22cfa ; 0x22cfa 191d4: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } else if(code_seen('Q')) 191d8: 81 e5 ldi r24, 0x51 ; 81 191da: 0e 94 8d 5c call 0xb91a ; 0xb91a 191de: 88 23 and r24, r24 191e0: 11 f4 brne .+4 ; 0x191e6 191e2: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 191e6: 85 ea ldi r24, 0xA5 ; 165 191e8: 9d e0 ldi r25, 0x0D ; 13 191ea: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 191ee: bc 01 movw r22, r24 191f0: 90 e0 ldi r25, 0x00 ; 0 191f2: 80 e0 ldi r24, 0x00 ; 0 191f4: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 191f8: 20 e0 ldi r18, 0x00 ; 0 191fa: 30 e0 ldi r19, 0x00 ; 0 191fc: 4a e7 ldi r20, 0x7A ; 122 191fe: 54 e4 ldi r21, 0x44 ; 68 19200: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 19204: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a 19208: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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')) 1920c: 81 e5 ldi r24, 0x51 ; 81 1920e: 0e 94 8d 5c call 0xb91a ; 0xb91a 19212: 88 23 and r24, r24 19214: 11 f4 brne .+4 ; 0x1921a 19216: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 1921a: b8 01 movw r22, r16 1921c: 90 e0 ldi r25, 0x00 ; 0 1921e: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 19220: 4a e0 ldi r20, 0x0A ; 10 19222: 0f 94 35 d2 call 0x3a46a ; 0x3a46a } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 19226: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 1922a: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 1922e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 return _sPrinterMmuName; 19232: 6d ec ldi r22, 0xCD ; 205 19234: e6 2e mov r14, r22 19236: 6f e7 ldi r22, 0x7F ; 127 19238: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 1923a: 81 30 cpi r24, 0x01 ; 1 1923c: 21 f0 breq .+8 ; 0x19246 return _sPrinterMmuName; } else { return _sPrinterName; 1923e: 58 ec ldi r21, 0xC8 ; 200 19240: e5 2e mov r14, r21 19242: 5f e7 ldi r21, 0x7F ; 127 19244: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 19246: 80 e5 ldi r24, 0x50 ; 80 19248: 0e 94 8d 5c call 0xb91a ; 0xb91a 1924c: 88 23 and r24, r24 1924e: b1 f1 breq .+108 ; 0x192bc , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 19250: 62 e2 ldi r22, 0x22 ; 34 19252: 70 e0 ldi r23, 0x00 ; 0 19254: 80 91 93 03 lds r24, 0x0393 ; 0x800393 19258: 90 91 94 03 lds r25, 0x0394 ; 0x800394 1925c: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 19260: 8c 01 movw r16, r24 if (!this->ptr) { 19262: 89 2b or r24, r25 19264: d1 f0 breq .+52 ; 0x1929a // First quote not found return; } // Skip the leading quote this->ptr++; 19266: 0f 5f subi r16, 0xFF ; 255 19268: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 1926a: 62 e2 ldi r22, 0x22 ; 34 1926c: 70 e0 ldi r23, 0x00 ; 0 1926e: c8 01 movw r24, r16 19270: 0f 94 9d e3 call 0x3c73a ; 0x3c73a if(!pStrEnd) { 19274: 00 97 sbiw r24, 0x00 ; 0 19276: 89 f0 breq .+34 ; 0x1929a // Second quote not found return; } this->len = pStrEnd - this->ptr; 19278: d8 2e mov r13, r24 1927a: d0 1a sub r13, r16 1927c: c7 01 movw r24, r14 1927e: 0f 94 04 db call 0x3b608 ; 0x3b608 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 19282: d8 12 cpse r13, r24 19284: 0a c0 rjmp .+20 ; 0x1929a if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 19286: ac 01 movw r20, r24 19288: 55 27 eor r21, r21 1928a: b7 01 movw r22, r14 1928c: c8 01 movw r24, r16 1928e: 0f 94 25 db call 0x3b64a ; 0x3b64a 19292: 89 2b or r24, r25 19294: 11 f4 brne .+4 ; 0x1929a 19296: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } } render_M862_warnings( 1929a: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 1929e: 8d eb ldi r24, 0xBD ; 189 192a0: 97 e3 ldi r25, 0x37 ; 55 192a2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 192a6: 8c 01 movw r16, r24 192a8: 8f e8 ldi r24, 0x8F ; 143 192aa: 97 e3 ldi r25, 0x37 ; 55 192ac: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 192b0: 4f 2d mov r20, r15 192b2: b8 01 movw r22, r16 192b4: 0f 94 3e 16 call 0x22c7c ; 0x22c7c 192b8: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 192bc: 81 e5 ldi r24, 0x51 ; 81 192be: 0e 94 8d 5c call 0xb91a ; 0xb91a 192c2: 88 23 and r24, r24 192c4: 11 f4 brne .+4 ; 0x192ca 192c6: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a SERIAL_PROTOCOLLNRPGM(type); 192ca: c7 01 movw r24, r14 192cc: 0e 94 17 7b call 0xf62e ; 0xf62e 192d0: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 192d4: 80 e5 ldi r24, 0x50 ; 80 192d6: 0e 94 8d 5c call 0xb91a ; 0xb91a 192da: 88 23 and r24, r24 192dc: 09 f4 brne .+2 ; 0x192e0 192de: 77 c0 rjmp .+238 ; 0x193ce fw_version_check(++strchr_pointer); 192e0: 80 91 93 03 lds r24, 0x0393 ; 0x800393 192e4: 90 91 94 03 lds r25, 0x0394 ; 0x800394 192e8: 01 96 adiw r24, 0x01 ; 1 192ea: 90 93 94 03 sts 0x0394, r25 ; 0x800394 192ee: 80 93 93 03 sts 0x0393, r24 ; 0x800393 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 192f2: 20 91 e9 04 lds r18, 0x04E9 ; 0x8004e9 192f6: 22 23 and r18, r18 192f8: 11 f4 brne .+4 ; 0x192fe 192fa: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 192fe: be 01 movw r22, r28 19300: 6f 5f subi r22, 0xFF ; 255 19302: 7f 4f sbci r23, 0xFF ; 255 19304: 0e 94 2c f9 call 0x1f258 ; 0x1f258 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 19308: 8a e0 ldi r24, 0x0A ; 10 1930a: 90 e0 ldi r25, 0x00 ; 0 1930c: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 19310: 29 81 ldd r18, Y+1 ; 0x01 19312: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19314: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19316: 82 17 cp r24, r18 19318: 93 07 cpc r25, r19 1931a: 28 f0 brcs .+10 ; 0x19326 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 1931c: 11 e0 ldi r17, 0x01 ; 1 1931e: 28 17 cp r18, r24 19320: 39 07 cpc r19, r25 19322: 08 f4 brcc .+2 ; 0x19326 19324: 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; 19326: 12 95 swap r17 19328: 11 0f add r17, r17 1932a: 11 0f add r17, r17 1932c: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 1932e: 8c e0 ldi r24, 0x0C ; 12 19330: 90 e0 ldi r25, 0x00 ; 0 19332: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 19336: ac 01 movw r20, r24 19338: 2b 81 ldd r18, Y+3 ; 0x03 1933a: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 1933c: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1933e: 42 17 cp r20, r18 19340: 53 07 cpc r21, r19 19342: 28 f0 brcs .+10 ; 0x1934e return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19344: 81 e0 ldi r24, 0x01 ; 1 19346: 24 17 cp r18, r20 19348: 35 07 cpc r19, r21 1934a: 08 f4 brcc .+2 ; 0x1934e 1934c: 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; 1934e: 50 e1 ldi r21, 0x10 ; 16 19350: 85 9f mul r24, r21 19352: c0 01 movw r24, r0 19354: 11 24 eor r1, r1 19356: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 19358: 8e e0 ldi r24, 0x0E ; 14 1935a: 90 e0 ldi r25, 0x00 ; 0 1935c: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 19360: ac 01 movw r20, r24 19362: 2d 81 ldd r18, Y+5 ; 0x05 19364: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19366: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19368: 42 17 cp r20, r18 1936a: 53 07 cpc r21, r19 1936c: 28 f0 brcs .+10 ; 0x19378 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 1936e: 81 e0 ldi r24, 0x01 ; 1 19370: 24 17 cp r18, r20 19372: 35 07 cpc r19, r21 19374: 08 f4 brcc .+2 ; 0x19378 19376: 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; 19378: a4 e0 ldi r26, 0x04 ; 4 1937a: 8a 9f mul r24, r26 1937c: c0 01 movw r24, r0 1937e: 11 24 eor r1, r1 19380: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 19382: 80 e1 ldi r24, 0x10 ; 16 19384: 90 e0 ldi r25, 0x00 ; 0 19386: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 1938a: ac 01 movw r20, r24 1938c: 2f 81 ldd r18, Y+7 ; 0x07 1938e: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19390: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19392: 42 17 cp r20, r18 19394: 53 07 cpc r21, r19 19396: 28 f0 brcs .+10 ; 0x193a2 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19398: 91 e0 ldi r25, 0x01 ; 1 1939a: 24 17 cp r18, r20 1939c: 35 07 cpc r19, r21 1939e: 08 f4 brcc .+2 ; 0x193a2 193a0: 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)); 193a2: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 193a4: 16 35 cpi r17, 0x56 ; 86 193a6: 10 f4 brcc .+4 ; 0x193ac 193a8: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 193ac: f0 90 e9 04 lds r15, 0x04E9 ; 0x8004e9 193b0: 8d e4 ldi r24, 0x4D ; 77 193b2: 97 e3 ldi r25, 0x37 ; 55 193b4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 193b8: 8c 01 movw r16, r24 193ba: 87 e2 ldi r24, 0x27 ; 39 193bc: 97 e3 ldi r25, 0x37 ; 55 193be: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 193c2: 4f 2d mov r20, r15 193c4: b8 01 movw r22, r16 193c6: 0f 94 3e 16 call 0x22c7c ; 0x22c7c 193ca: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a else if(code_seen('Q')) 193ce: 81 e5 ldi r24, 0x51 ; 81 193d0: 0e 94 8d 5c call 0xb91a ; 0xb91a 193d4: 88 23 and r24, r24 193d6: 11 f4 brne .+4 ; 0x193dc 193d8: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 193dc: 0c 94 59 a9 jmp 0x152b2 ; 0x152b2 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 193e0: 81 e5 ldi r24, 0x51 ; 81 193e2: 0e 94 8d 5c call 0xb91a ; 0xb91a 193e6: 88 23 and r24, r24 193e8: 11 f4 brne .+4 ; 0x193ee 193ea: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a SERIAL_PROTOCOLLN(GCODE_LEVEL); 193ee: 81 e0 ldi r24, 0x01 ; 1 193f0: 90 e0 ldi r25, 0x00 ; 0 193f2: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c 193f6: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a * 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; 193fa: 8b e4 ldi r24, 0x4B ; 75 193fc: 0e 94 8d 5c call 0xb91a ; 0xb91a 19400: c1 2c mov r12, r1 19402: d1 2c mov r13, r1 19404: e1 2c mov r14, r1 19406: 40 ec ldi r20, 0xC0 ; 192 19408: f4 2e mov r15, r20 1940a: 88 23 and r24, r24 1940c: 49 f1 breq .+82 ; 0x19460 1940e: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 19412: 6b 01 movw r12, r22 19414: 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) 19416: 20 e0 ldi r18, 0x00 ; 0 19418: 30 e0 ldi r19, 0x00 ; 0 1941a: a9 01 movw r20, r18 1941c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 19420: 81 11 cpse r24, r1 19422: 1e c0 rjmp .+60 ; 0x19460 { extruder_advance_K = 0; 19424: 10 92 04 18 sts 0x1804, r1 ; 0x801804 19428: 10 92 05 18 sts 0x1805, r1 ; 0x801805 1942c: 10 92 06 18 sts 0x1806, r1 ; 0x801806 19430: 10 92 07 18 sts 0x1807, r1 ; 0x801807 19434: 0e 94 53 83 call 0x106a6 ; 0x106a6 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 19438: 84 e1 ldi r24, 0x14 ; 20 1943a: 9a ea ldi r25, 0xAA ; 170 1943c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM("Advance K="); 19440: 85 ea ldi r24, 0xA5 ; 165 19442: 9f e7 ldi r25, 0x7F ; 127 19444: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(extruder_advance_K); 19448: 60 91 04 18 lds r22, 0x1804 ; 0x801804 1944c: 70 91 05 18 lds r23, 0x1805 ; 0x801805 19450: 80 91 06 18 lds r24, 0x1806 ; 0x801806 19454: 90 91 07 18 lds r25, 0x1807 ; 0x801807 19458: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a 1945c: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 19460: 80 91 6e 03 lds r24, 0x036E ; 0x80036e 19464: 81 11 cpse r24, r1 19466: 1b c0 rjmp .+54 ; 0x1949e { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 19468: 20 e0 ldi r18, 0x00 ; 0 1946a: 30 e0 ldi r19, 0x00 ; 0 1946c: a9 01 movw r20, r18 1946e: c7 01 movw r24, r14 19470: b6 01 movw r22, r12 19472: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 19476: 87 ff sbrs r24, 7 19478: 05 c0 rjmp .+10 ; 0x19484 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 1947a: 80 eb ldi r24, 0xB0 ; 176 1947c: 9f e7 ldi r25, 0x7F ; 127 1947e: 0e 94 17 7b call 0xf62e ; 0xf62e 19482: da cf rjmp .-76 ; 0x19438 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 19484: 20 e0 ldi r18, 0x00 ; 0 19486: 30 e0 ldi r19, 0x00 ; 0 19488: 40 e2 ldi r20, 0x20 ; 32 1948a: 51 e4 ldi r21, 0x41 ; 65 1948c: c7 01 movw r24, r14 1948e: b6 01 movw r22, r12 19490: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 19494: 87 ff sbrs r24, 7 19496: 2c c0 rjmp .+88 ; 0x194f0 19498: 81 e0 ldi r24, 0x01 ; 1 1949a: 0e 94 53 83 call 0x106a6 ; 0x106a6 } if(la10c_mode == LA10C_LA15) 1949e: 80 91 6e 03 lds r24, 0x036E ; 0x80036e return (k >= 0 && k < LA_K_MAX? k: -1); 194a2: 20 e0 ldi r18, 0x00 ; 0 194a4: 30 e0 ldi r19, 0x00 ; 0 194a6: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 194a8: 81 30 cpi r24, 0x01 ; 1 194aa: 21 f5 brne .+72 ; 0x194f4 return (k >= 0 && k < LA_K_MAX? k: -1); 194ac: c7 01 movw r24, r14 194ae: b6 01 movw r22, r12 194b0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 194b4: 87 fd sbrc r24, 7 194b6: e1 cf rjmp .-62 ; 0x1947a 194b8: 20 e0 ldi r18, 0x00 ; 0 194ba: 30 e0 ldi r19, 0x00 ; 0 194bc: 40 e2 ldi r20, 0x20 ; 32 194be: 51 e4 ldi r21, 0x41 ; 65 194c0: c7 01 movw r24, r14 194c2: b6 01 movw r22, r12 194c4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 194c8: 87 ff sbrs r24, 7 194ca: d7 cf rjmp .-82 ; 0x1947a la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 194cc: 20 e0 ldi r18, 0x00 ; 0 194ce: 30 e0 ldi r19, 0x00 ; 0 194d0: a9 01 movw r20, r18 194d2: c7 01 movw r24, r14 194d4: b6 01 movw r22, r12 194d6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 194da: 87 fd sbrc r24, 7 194dc: ce cf rjmp .-100 ; 0x1947a SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 194de: c0 92 04 18 sts 0x1804, r12 ; 0x801804 194e2: d0 92 05 18 sts 0x1805, r13 ; 0x801805 194e6: e0 92 06 18 sts 0x1806, r14 ; 0x801806 194ea: f0 92 07 18 sts 0x1807, r15 ; 0x801807 194ee: a4 cf rjmp .-184 ; 0x19438 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 194f0: 82 e0 ldi r24, 0x02 ; 2 194f2: d3 cf rjmp .-90 ; 0x1949a } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 194f4: c7 01 movw r24, r14 194f6: b6 01 movw r22, r12 194f8: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 194fc: 87 fd sbrc r24, 7 194fe: bd cf rjmp .-134 ; 0x1947a // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 19500: 2f e6 ldi r18, 0x6F ; 111 19502: 32 e1 ldi r19, 0x12 ; 18 19504: 43 e0 ldi r20, 0x03 ; 3 19506: 5b e3 ldi r21, 0x3B ; 59 19508: c7 01 movw r24, r14 1950a: b6 01 movw r22, r12 1950c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 19510: 2a e0 ldi r18, 0x0A ; 10 19512: 37 ed ldi r19, 0xD7 ; 215 19514: 43 e2 ldi r20, 0x23 ; 35 19516: 5c e3 ldi r21, 0x3C ; 60 19518: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1951c: 6b 01 movw r12, r22 1951e: 7c 01 movw r14, r24 return new_K < 0? 0: 19520: 20 e0 ldi r18, 0x00 ; 0 19522: 30 e0 ldi r19, 0x00 ; 0 19524: a9 01 movw r20, r18 19526: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1952a: 87 fd sbrc r24, 7 1952c: 11 c0 rjmp .+34 ; 0x19550 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 1952e: 20 e0 ldi r18, 0x00 ; 0 19530: 30 e0 ldi r19, 0x00 ; 0 19532: 40 e2 ldi r20, 0x20 ; 32 19534: 51 e4 ldi r21, 0x41 ; 65 19536: c7 01 movw r24, r14 19538: b6 01 movw r22, r12 1953a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1953e: 18 16 cp r1, r24 19540: 2c f6 brge .-118 ; 0x194cc 19542: c1 2c mov r12, r1 19544: d1 2c mov r13, r1 19546: 30 e2 ldi r19, 0x20 ; 32 19548: e3 2e mov r14, r19 1954a: 31 e4 ldi r19, 0x41 ; 65 1954c: f3 2e mov r15, r19 1954e: c7 cf rjmp .-114 ; 0x194de // 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: 19550: c1 2c mov r12, r1 19552: d1 2c mov r13, r1 19554: 76 01 movw r14, r12 19556: c3 cf rjmp .-122 ; 0x194de 19558: 9d ed ldi r25, 0xDD ; 221 1955a: 89 2e mov r8, r25 1955c: 92 e0 ldi r25, 0x02 ; 2 1955e: 99 2e mov r9, r25 19560: 0d e5 ldi r16, 0x5D ; 93 19562: 12 e0 ldi r17, 0x02 ; 2 19564: 25 ef ldi r18, 0xF5 ; 245 19566: a2 2e mov r10, r18 19568: 24 e0 ldi r18, 0x04 ; 4 1956a: 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++){ 1956c: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 1956e: f4 01 movw r30, r8 19570: 81 91 ld r24, Z+ 19572: 4f 01 movw r8, r30 19574: 0e 94 8d 5c call 0xb91a ; 0xb91a 19578: 88 23 and r24, r24 1957a: 09 f4 brne .+2 ; 0x1957e 1957c: 45 c0 rjmp .+138 ; 0x19608 if( i == E_AXIS && FarmOrUserECool() ){ 1957e: f3 e0 ldi r31, 0x03 ; 3 19580: 7f 12 cpse r7, r31 19582: 04 c0 rjmp .+8 ; 0x1958c 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(); 19584: 0e 94 aa f9 call 0x1f354 ; 0x1f354 19588: 81 11 cpse r24, r1 1958a: 61 c0 rjmp .+194 ; 0x1964e SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 1958c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 19590: 6b 01 movw r12, r22 19592: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 19594: 20 e0 ldi r18, 0x00 ; 0 19596: 30 e0 ldi r19, 0x00 ; 0 19598: a9 01 movw r20, r18 1959a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1959e: 87 fd sbrc r24, 7 195a0: 46 c0 rjmp .+140 ; 0x1962e if (cur > 1029) cur = 1029; //limit max 195a2: 20 e0 ldi r18, 0x00 ; 0 195a4: 30 ea ldi r19, 0xA0 ; 160 195a6: 40 e8 ldi r20, 0x80 ; 128 195a8: 54 e4 ldi r21, 0x44 ; 68 195aa: c7 01 movw r24, r14 195ac: b6 01 movw r22, r12 195ae: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 195b2: 18 16 cp r1, r24 195b4: a4 f1 brlt .+104 ; 0x1961e //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; 195b6: 20 e0 ldi r18, 0x00 ; 0 195b8: 30 e0 ldi r19, 0x00 ; 0 195ba: 47 e0 ldi r20, 0x07 ; 7 195bc: 54 e4 ldi r21, 0x44 ; 68 195be: c7 01 movw r24, r14 195c0: b6 01 movw r22, r12 195c2: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 195c6: 87 fd sbrc r24, 7 195c8: 35 c0 rjmp .+106 ; 0x19634 195ca: 20 e0 ldi r18, 0x00 ; 0 195cc: 30 e0 ldi r19, 0x00 ; 0 195ce: 4c e7 ldi r20, 0x7C ; 124 195d0: 52 e4 ldi r21, 0x42 ; 66 195d2: c7 01 movw r24, r14 195d4: b6 01 movw r22, r12 195d6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 195da: 20 e0 ldi r18, 0x00 ; 0 195dc: 30 ea ldi r19, 0xA0 ; 160 195de: 40 e8 ldi r20, 0x80 ; 128 195e0: 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); 195e2: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 195e6: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 195ea: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 195ec: c8 01 movw r24, r16 195ee: 0e 94 c4 68 call 0xd188 ; 0xd188 currents[i].setiRun(val); 195f2: 6f 2d mov r22, r15 195f4: c8 01 movw r24, r16 195f6: 0e 94 cc 68 call 0xd198 ; 0xd198 tmc2130_setup_chopper(i, tmc2130_mres[i]); 195fa: 50 e0 ldi r21, 0x00 ; 0 195fc: 40 e0 ldi r20, 0x00 ; 0 195fe: d5 01 movw r26, r10 19600: 6c 91 ld r22, X 19602: 87 2d mov r24, r7 19604: 0f 94 1a 3a call 0x27434 ; 0x27434 */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 19608: 73 94 inc r7 1960a: 0d 5f subi r16, 0xFD ; 253 1960c: 1f 4f sbci r17, 0xFF ; 255 1960e: bf ef ldi r27, 0xFF ; 255 19610: ab 1a sub r10, r27 19612: bb 0a sbc r11, r27 19614: e4 e0 ldi r30, 0x04 ; 4 19616: 7e 12 cpse r7, r30 19618: aa cf rjmp .-172 ; 0x1956e 1961a: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 1961e: c1 2c mov r12, r1 19620: 80 ea ldi r24, 0xA0 ; 160 19622: d8 2e mov r13, r24 19624: 80 e8 ldi r24, 0x80 ; 128 19626: e8 2e mov r14, r24 19628: 84 e4 ldi r24, 0x44 ; 68 1962a: f8 2e mov r15, r24 1962c: ce cf rjmp .-100 ; 0x195ca //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 1962e: c1 2c mov r12, r1 19630: d1 2c mov r13, r1 19632: 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); 19634: 20 e0 ldi r18, 0x00 ; 0 19636: 30 e0 ldi r19, 0x00 ; 0 19638: 4c e7 ldi r20, 0x7C ; 124 1963a: 52 e4 ldi r21, 0x42 ; 66 1963c: c7 01 movw r24, r14 1963e: b6 01 movw r22, r12 19640: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 19644: 20 e0 ldi r18, 0x00 ; 0 19646: 34 eb ldi r19, 0xB4 ; 180 19648: 40 e9 ldi r20, 0x90 ; 144 1964a: 54 e4 ldi r21, 0x44 ; 68 1964c: ca cf rjmp .-108 ; 0x195e2 if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 1964e: 84 ef ldi r24, 0xF4 ; 244 19650: 9f e9 ldi r25, 0x9F ; 159 19652: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM(", M907 E ignored"); 19656: 8f e9 ldi r24, 0x9F ; 159 19658: 96 e8 ldi r25, 0x86 ; 134 1965a: 0e 94 17 7b call 0xf62e ; 0xf62e 1965e: d4 cf rjmp .-88 ; 0x19608 19660: 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; } 19664: 80 91 66 02 lds r24, 0x0266 ; 0x800266 19668: 81 11 cpse r24, r1 1966a: 01 c0 rjmp .+2 ; 0x1966e 1966c: 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"), 1966e: 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() 19670: 86 e6 ldi r24, 0x66 ; 102 19672: 92 e0 ldi r25, 0x02 ; 2 19674: 0f 94 25 3d call 0x27a4a ; 0x27a4a 19678: 88 2e mov r8, r24 1967a: c0 90 64 02 lds r12, 0x0264 ; 0x800264 1967e: 80 91 63 02 lds r24, 0x0263 ; 0x800263 19682: 81 11 cpse r24, r1 19684: 01 c0 rjmp .+2 ; 0x19688 19686: 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"), 19688: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 1968a: 83 e6 ldi r24, 0x63 ; 99 1968c: 92 e0 ldi r25, 0x02 ; 2 1968e: 0f 94 25 3d call 0x27a4a ; 0x27a4a 19692: 98 2e mov r9, r24 19694: 00 91 61 02 lds r16, 0x0261 ; 0x800261 19698: 80 91 60 02 lds r24, 0x0260 ; 0x800260 1969c: 81 11 cpse r24, r1 1969e: 01 c0 rjmp .+2 ; 0x196a2 196a0: 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"), 196a2: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 196a4: 80 e6 ldi r24, 0x60 ; 96 196a6: 92 e0 ldi r25, 0x02 ; 2 196a8: 0f 94 25 3d call 0x27a4a ; 0x27a4a 196ac: e8 2e mov r14, r24 196ae: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 196b2: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 196b6: 81 11 cpse r24, r1 196b8: 01 c0 rjmp .+2 ; 0x196bc 196ba: 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(), 196bc: 8d e5 ldi r24, 0x5D ; 93 196be: 92 e0 ldi r25, 0x02 ; 2 196c0: 0f 94 25 3d call 0x27a4a ; 0x27a4a 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"), 196c4: bf 92 push r11 196c6: af 92 push r10 196c8: 1f 92 push r1 196ca: 8f 92 push r8 196cc: df 92 push r13 196ce: cf 92 push r12 196d0: 1f 92 push r1 196d2: 9f 92 push r9 196d4: 1f 93 push r17 196d6: 0f 93 push r16 196d8: 1f 92 push r1 196da: ef 92 push r14 196dc: 1f 92 push r1 196de: ff 92 push r15 196e0: 1f 92 push r1 196e2: 8f 93 push r24 196e4: 8e e4 ldi r24, 0x4E ; 78 196e6: 98 e6 ldi r25, 0x68 ; 104 196e8: 9f 93 push r25 196ea: 8f 93 push r24 196ec: 0f 94 08 dc call 0x3b810 ; 0x3b810 196f0: 0f b6 in r0, 0x3f ; 63 196f2: f8 94 cli 196f4: de bf out 0x3e, r29 ; 62 196f6: 0f be out 0x3f, r0 ; 63 196f8: cd bf out 0x3d, r28 ; 61 196fa: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a - `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; 196fe: 11 e0 ldi r17, 0x01 ; 1 19700: 82 39 cpi r24, 0x92 ; 146 19702: 93 40 sbci r25, 0x03 ; 3 19704: 09 f4 brne .+2 ; 0x19708 19706: 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')) 19708: 82 e5 ldi r24, 0x52 ; 82 1970a: 0e 94 8d 5c call 0xb91a ; 0xb91a 1970e: 88 23 and r24, r24 19710: 81 f0 breq .+32 ; 0x19732 { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 19712: 8f ef ldi r24, 0xFF ; 255 19714: 9f e0 ldi r25, 0x0F ; 15 19716: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1971a: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 1971c: 80 91 69 06 lds r24, 0x0669 ; 0x800669 19720: 81 17 cp r24, r17 19722: 11 f4 brne .+4 ; 0x19728 19724: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 19728: 81 2f mov r24, r17 1972a: 0e 94 4f 61 call 0xc29e ; 0xc29e 1972e: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a //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')) 19732: 80 e5 ldi r24, 0x50 ; 80 19734: 0e 94 8d 5c call 0xb91a ; 0xb91a 19738: 88 23 and r24, r24 1973a: 89 f0 breq .+34 ; 0x1975e { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 1973c: 01 e0 ldi r16, 0x01 ; 1 1973e: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 <_ZL17mcode_in_progress.lto_priv.550> 19742: 90 91 59 0e lds r25, 0x0E59 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.550+0x1> 19746: 82 39 cpi r24, 0x92 ; 146 19748: 93 40 sbci r25, 0x03 ; 3 1974a: 09 f4 brne .+2 ; 0x1974e 1974c: 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); 1974e: 60 2f mov r22, r16 19750: 8f ef ldi r24, 0xFF ; 255 19752: 9f e0 ldi r25, 0x0F ; 15 19754: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 19758: 00 93 a0 03 sts 0x03A0, r16 ; 0x8003a0 1975c: df cf rjmp .-66 ; 0x1971c //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')) 1975e: 81 e5 ldi r24, 0x51 ; 81 19760: 0e 94 8d 5c call 0xb91a ; 0xb91a 19764: 88 23 and r24, r24 19766: d1 f2 breq .-76 ; 0x1971c { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 19768: 80 91 69 06 lds r24, 0x0669 ; 0x800669 1976c: 81 11 cpse r24, r1 1976e: 15 c0 rjmp .+42 ; 0x1979a 19770: 88 eb ldi r24, 0xB8 ; 184 19772: 97 e5 ldi r25, 0x57 ; 87 19774: 9f 93 push r25 19776: 8f 93 push r24 19778: 82 e2 ldi r24, 0x22 ; 34 1977a: 9d e3 ldi r25, 0x3D ; 61 1977c: 9f 93 push r25 1977e: 8f 93 push r24 19780: 87 e9 ldi r24, 0x97 ; 151 19782: 96 e8 ldi r25, 0x86 ; 134 19784: 9f 93 push r25 19786: 8f 93 push r24 19788: 0f 94 08 dc call 0x3b810 ; 0x3b810 1978c: 0f 90 pop r0 1978e: 0f 90 pop r0 19790: 0f 90 pop r0 19792: 0f 90 pop r0 19794: 0f 90 pop r0 19796: 0f 90 pop r0 19798: c1 cf rjmp .-126 ; 0x1971c 1979a: 8f e9 ldi r24, 0x9F ; 159 1979c: 9c e3 ldi r25, 0x3C ; 60 1979e: ea cf rjmp .-44 ; 0x19774 197a0: 8d ed ldi r24, 0xDD ; 221 197a2: 92 e0 ldi r25, 0x02 ; 2 197a4: 6c 96 adiw r28, 0x1c ; 28 197a6: 9f af std Y+63, r25 ; 0x3f 197a8: 8e af std Y+62, r24 ; 0x3e 197aa: 6c 97 sbiw r28, 0x1c ; 28 197ac: eb e6 ldi r30, 0x6B ; 107 197ae: ce 2e mov r12, r30 197b0: e6 e0 ldi r30, 0x06 ; 6 197b2: de 2e mov r13, r30 197b4: f1 e5 ldi r31, 0x51 ; 81 197b6: ef 2e mov r14, r31 197b8: f7 e0 ldi r31, 0x07 ; 7 197ba: ff 2e mov r15, r31 197bc: a5 ef ldi r26, 0xF5 ; 245 197be: 2a 2e mov r2, r26 197c0: a4 e0 ldi r26, 0x04 ; 4 197c2: 3a 2e mov r3, r26 197c4: b7 e2 ldi r27, 0x27 ; 39 197c6: 8b 2e mov r8, r27 197c8: b7 e0 ldi r27, 0x07 ; 7 197ca: 9b 2e mov r9, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 197e8: b8 2e mov r11, r24 197ea: 88 23 and r24, r24 197ec: 09 f4 brne .+2 ; 0x197f0 197ee: 75 c0 rjmp .+234 ; 0x198da { uint16_t res_new = code_value(); 197f0: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 197f4: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 197f8: 2b 01 movw r4, r22 197fa: 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 197fc: 68 30 cpi r22, 0x08 ; 8 197fe: 71 05 cpc r23, r1 19800: 09 f4 brne .+2 ; 0x19804 19802: 59 c3 rjmp .+1714 ; 0x19eb6 19804: 60 31 cpi r22, 0x10 ; 16 19806: 71 05 cpc r23, r1 19808: 09 f4 brne .+2 ; 0x1980c 1980a: 55 c3 rjmp .+1706 ; 0x19eb6 1980c: 81 e0 ldi r24, 0x01 ; 1 1980e: 00 32 cpi r16, 0x20 ; 32 19810: 11 05 cpc r17, r1 19812: 09 f0 breq .+2 ; 0x19816 19814: 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 19816: 67 96 adiw r28, 0x17 ; 23 19818: bf ad ldd r27, Y+63 ; 0x3f 1981a: 67 97 sbiw r28, 0x17 ; 23 1981c: b3 30 cpi r27, 0x03 ; 3 1981e: 09 f4 brne .+2 ; 0x19822 19820: 55 c3 rjmp .+1706 ; 0x19ecc 19822: 92 01 movw r18, r4 19824: 21 50 subi r18, 0x01 ; 1 19826: 31 09 sbc r19, r1 19828: 22 30 cpi r18, 0x02 ; 2 1982a: 31 05 cpc r19, r1 1982c: 08 f0 brcs .+2 ; 0x19830 1982e: 49 c3 rjmp .+1682 ; 0x19ec2 19830: 9b 2d mov r25, r11 19832: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 19834: 67 96 adiw r28, 0x17 ; 23 19836: ef ad ldd r30, Y+63 ; 0x3f 19838: 67 97 sbiw r28, 0x17 ; 23 1983a: e3 30 cpi r30, 0x03 ; 3 1983c: 41 f4 brne .+16 ; 0x1984e 1983e: 00 34 cpi r16, 0x40 ; 64 19840: 11 05 cpc r17, r1 19842: 31 f0 breq .+12 ; 0x19850 19844: bb 24 eor r11, r11 19846: b3 94 inc r11 19848: 00 38 cpi r16, 0x80 ; 128 1984a: 11 05 cpc r17, r1 1984c: 09 f0 breq .+2 ; 0x19850 1984e: b1 2c mov r11, r1 #endif if (res_valid) 19850: 81 11 cpse r24, r1 19852: 03 c0 rjmp .+6 ; 0x1985a 19854: bb 20 and r11, r11 19856: 09 f4 brne .+2 ; 0x1985a 19858: 40 c0 rjmp .+128 ; 0x198da { st_synchronize(); 1985a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 1985e: d1 01 movw r26, r2 19860: 8c 91 ld r24, X 19862: a1 2c mov r10, r1 19864: bb 24 eor r11, r11 19866: b3 94 inc r11 19868: 02 c0 rjmp .+4 ; 0x1986e 1986a: b6 94 lsr r11 1986c: a7 94 ror r10 1986e: 8a 95 dec r24 19870: e2 f7 brpl .-8 ; 0x1986a uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 19872: b2 01 movw r22, r4 19874: 67 96 adiw r28, 0x17 ; 23 19876: 8f ad ldd r24, Y+63 ; 0x3f 19878: 67 97 sbiw r28, 0x17 ; 23 1987a: 0f 94 85 3a call 0x2750a ; 0x2750a cs.axis_ustep_resolution[i] = res_new; 1987e: f4 01 movw r30, r8 19880: 40 82 st Z, r4 if (res_new > res) 19882: a0 16 cp r10, r16 19884: b1 06 cpc r11, r17 19886: 08 f0 brcs .+2 ; 0x1988a 19888: 40 c0 rjmp .+128 ; 0x1990a { uint16_t fac = (res_new / res); 1988a: c8 01 movw r24, r16 1988c: b5 01 movw r22, r10 1988e: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 19892: 2b 01 movw r4, r22 19894: 71 2c mov r7, r1 19896: 61 2c mov r6, r1 19898: c3 01 movw r24, r6 1989a: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 1989e: 9b 01 movw r18, r22 198a0: ac 01 movw r20, r24 198a2: d6 01 movw r26, r12 198a4: 14 96 adiw r26, 0x04 ; 4 198a6: 6d 91 ld r22, X+ 198a8: 7d 91 ld r23, X+ 198aa: 8d 91 ld r24, X+ 198ac: 9c 91 ld r25, X 198ae: 17 97 sbiw r26, 0x07 ; 7 198b0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 198b4: f6 01 movw r30, r12 198b6: 64 83 std Z+4, r22 ; 0x04 198b8: 75 83 std Z+5, r23 ; 0x05 198ba: 86 83 std Z+6, r24 ; 0x06 198bc: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 198be: d7 01 movw r26, r14 198c0: 2d 91 ld r18, X+ 198c2: 3d 91 ld r19, X+ 198c4: 4d 91 ld r20, X+ 198c6: 5c 91 ld r21, X 198c8: c3 01 movw r24, r6 198ca: b2 01 movw r22, r4 198cc: 0f 94 a9 dd call 0x3bb52 ; 0x3bb52 <__mulsi3> 198d0: f7 01 movw r30, r14 198d2: 60 83 st Z, r22 198d4: 71 83 std Z+1, r23 ; 0x01 198d6: 82 83 std Z+2, r24 ; 0x02 198d8: 93 83 std Z+3, r25 ; 0x03 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 19904: 66 cf rjmp .-308 ; 0x197d2 19906: 0c 94 7f b8 jmp 0x170fe ; 0x170fe cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 1990a: c5 01 movw r24, r10 1990c: b8 01 movw r22, r16 1990e: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 19912: 2b 01 movw r4, r22 19914: 71 2c mov r7, r1 19916: 61 2c mov r6, r1 19918: c3 01 movw r24, r6 1991a: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 1991e: 9b 01 movw r18, r22 19920: ac 01 movw r20, r24 19922: d6 01 movw r26, r12 19924: 14 96 adiw r26, 0x04 ; 4 19926: 6d 91 ld r22, X+ 19928: 7d 91 ld r23, X+ 1992a: 8d 91 ld r24, X+ 1992c: 9c 91 ld r25, X 1992e: 17 97 sbiw r26, 0x07 ; 7 19930: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 19934: f6 01 movw r30, r12 19936: 64 83 std Z+4, r22 ; 0x04 19938: 75 83 std Z+5, r23 ; 0x05 1993a: 86 83 std Z+6, r24 ; 0x06 1993c: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 1993e: d7 01 movw r26, r14 19940: 6d 91 ld r22, X+ 19942: 7d 91 ld r23, X+ 19944: 8d 91 ld r24, X+ 19946: 9c 91 ld r25, X 19948: a3 01 movw r20, r6 1994a: 92 01 movw r18, r4 1994c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__divmodsi4> 19950: f7 01 movw r30, r14 19952: 20 83 st Z, r18 19954: 31 83 std Z+1, r19 ; 0x01 19956: 42 83 std Z+2, r20 ; 0x02 19958: 53 83 std Z+3, r21 ; 0x03 1995a: bf cf rjmp .-130 ; 0x198da 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') ) { 1995c: 80 e5 ldi r24, 0x50 ; 80 1995e: 0e 94 8d 5c call 0xb91a ; 0xb91a 19962: 88 23 and r24, r24 19964: 29 f0 breq .+10 ; 0x19970 mmuSlotIndex = code_value_uint8(); 19966: 0e 94 1f 5c call 0xb83e ; 0xb83e 1996a: 18 2f mov r17, r24 1996c: 0c 94 a3 b1 jmp 0x16346 ; 0x16346 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') ) { 19970: 84 e5 ldi r24, 0x54 ; 84 19972: 0e 94 8d 5c call 0xb91a ; 0xb91a 19976: 81 11 cpse r24, r1 19978: f6 cf rjmp .-20 ; 0x19966 1997a: 0c 94 a2 b1 jmp 0x16344 ; 0x16344 */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 1997e: 60 e0 ldi r22, 0x00 ; 0 19980: 70 e0 ldi r23, 0x00 ; 0 19982: cb 01 movw r24, r22 19984: 0c 94 bc b1 jmp 0x16378 ; 0x16378 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; 19988: 82 e0 ldi r24, 0x02 ; 2 1998a: 80 93 72 07 sts 0x0772, r24 ; 0x800772 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 1998e: 80 eb ldi r24, 0xB0 ; 176 19990: 9c e5 ldi r25, 0x5C ; 92 19992: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 19996: 0f 94 be 0b call 0x2177c ; 0x2177c current_position[E_AXIS] += fastLoadLength; 1999a: a7 01 movw r20, r14 1999c: 96 01 movw r18, r12 1999e: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 199a2: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 199a6: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 199aa: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 199ae: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 199b2: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 199b6: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 199ba: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 199be: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 199c2: 60 e0 ldi r22, 0x00 ; 0 199c4: 70 e0 ldi r23, 0x00 ; 0 199c6: 80 ea ldi r24, 0xA0 ; 160 199c8: 91 e4 ldi r25, 0x41 ; 65 199ca: 0f 94 48 ba call 0x37490 ; 0x37490 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 199ce: 01 11 cpse r16, r1 199d0: 06 c0 rjmp .+12 ; 0x199de raise_z_above(MIN_Z_FOR_LOAD); 199d2: 60 e0 ldi r22, 0x00 ; 0 199d4: 70 e0 ldi r23, 0x00 ; 0 199d6: 8c e0 ldi r24, 0x0C ; 12 199d8: 92 e4 ldi r25, 0x42 ; 66 199da: 0e 94 26 6f call 0xde4c ; 0xde4c } load_filament_final_feed(); // slow sequence 199de: 0e 94 59 65 call 0xcab2 ; 0xcab2 st_synchronize(); 199e2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 Sound_MakeCustom(50, 500, false); 199e6: 40 e0 ldi r20, 0x00 ; 0 199e8: 64 ef ldi r22, 0xF4 ; 244 199ea: 71 e0 ldi r23, 0x01 ; 1 199ec: 82 e3 ldi r24, 0x32 ; 50 199ee: 90 e0 ldi r25, 0x00 ; 0 199f0: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 199f4: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 199f8: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 199fa: 0f 94 6c 68 call 0x2d0d8 ; 0x2d0d8 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 199fe: 81 e0 ldi r24, 0x01 ; 1 19a00: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_update(2); 19a04: 82 e0 ldi r24, 0x02 ; 2 19a06: 0e 94 6d 6f call 0xdeda ; 0xdeda lcd_setstatuspgm(MSG_WELCOME); 19a0a: 8d ea ldi r24, 0xAD ; 173 19a0c: 90 e7 ldi r25, 0x70 ; 112 19a0e: 0f 94 be 0b call 0x2177c ; 0x2177c custom_message_type = CustomMsg::Status; 19a12: 10 92 72 07 sts 0x0772, r1 ; 0x800772 19a16: 0c 94 d3 b1 jmp 0x163a6 ; 0x163a6 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 19a1a: 85 e5 ldi r24, 0x55 ; 85 19a1c: 0e 94 8d 5c call 0xb91a ; 0xb91a - `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; 19a20: c1 2c mov r12, r1 19a22: d1 2c mov r13, r1 19a24: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 19a26: 88 23 and r24, r24 19a28: 21 f0 breq .+8 ; 0x19a32 19a2a: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 19a2e: 6b 01 movw r12, r22 19a30: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 19a32: 8a e5 ldi r24, 0x5A ; 90 19a34: 0e 94 8d 5c call 0xb91a ; 0xb91a 19a38: 88 23 and r24, r24 19a3a: a1 f0 breq .+40 ; 0x19a64 19a3c: 0e 94 63 61 call 0xc2c6 ; 0xc2c6 19a40: 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); 19a42: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 19a46: 4b 01 movw r8, r22 19a48: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 19a4a: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19a4e: 81 30 cpi r24, 0x01 ; 1 19a50: 99 f4 brne .+38 ; 0x19a78 19a52: 0f 94 22 a0 call 0x34044 ; 0x34044 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 19a56: c5 01 movw r24, r10 19a58: b4 01 movw r22, r8 19a5a: 90 58 subi r25, 0x80 ; 128 19a5c: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 19a60: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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 19a64: 60 e0 ldi r22, 0x00 ; 0 19a66: 70 e0 ldi r23, 0x00 ; 0 19a68: 8c e0 ldi r24, 0x0C ; 12 19a6a: 92 e4 ldi r25, 0x42 ; 66 19a6c: 0e 94 26 6f call 0xde4c ; 0xde4c - `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; 19a70: 60 e0 ldi r22, 0x00 ; 0 19a72: 70 e0 ldi r23, 0x00 ; 0 19a74: cb 01 movw r24, r22 19a76: e5 cf rjmp .-54 ; 0x19a42 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 19a78: c7 01 movw r24, r14 19a7a: b6 01 movw r22, r12 19a7c: 0f 94 a7 16 call 0x22d4e ; 0x22d4e 19a80: ea cf rjmp .-44 ; 0x19a56 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 19a82: 81 ec ldi r24, 0xC1 ; 193 19a84: 92 e0 ldi r25, 0x02 ; 2 19a86: 0e 94 15 61 call 0xc22a ; 0xc22a 19a8a: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 19a8e: 82 ec ldi r24, 0xC2 ; 194 19a90: 92 e0 ldi r25, 0x02 ; 2 19a92: 0e 94 15 61 call 0xc22a ; 0xc22a 19a96: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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() ) { 19a9a: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19a9e: 81 30 cpi r24, 0x01 ; 1 19aa0: 11 f0 breq .+4 ; 0x19aa6 19aa2: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a if( code_seen('A') ) { 19aa6: 81 e4 ldi r24, 0x41 ; 65 19aa8: 0e 94 8d 5c call 0xb91a ; 0xb91a 19aac: 88 23 and r24, r24 19aae: 11 f4 brne .+4 ; 0x19ab4 19ab0: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 19ab4: 80 91 93 03 lds r24, 0x0393 ; 0x800393 19ab8: 90 91 94 03 lds r25, 0x0394 ; 0x800394 19abc: 40 e1 ldi r20, 0x10 ; 16 19abe: 50 e0 ldi r21, 0x00 ; 0 19ac0: 70 e0 ldi r23, 0x00 ; 0 19ac2: 60 e0 ldi r22, 0x00 ; 0 19ac4: 01 96 adiw r24, 0x01 ; 1 19ac6: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 19aca: 86 2f mov r24, r22 19acc: 0f 94 a8 1d call 0x23b50 ; 0x23b50 19ad0: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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() ){ 19ad4: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19ad8: 81 30 cpi r24, 0x01 ; 1 19ada: 11 f0 breq .+4 ; 0x19ae0 19adc: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a uint8_t addr = 0; if( code_seen('A') ) { 19ae0: 81 e4 ldi r24, 0x41 ; 65 19ae2: 0e 94 8d 5c call 0xb91a ; 0xb91a Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 19ae6: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 19ae8: 88 23 and r24, r24 19aea: 61 f0 breq .+24 ; 0x19b04 addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 19aec: 80 91 93 03 lds r24, 0x0393 ; 0x800393 19af0: 90 91 94 03 lds r25, 0x0394 ; 0x800394 19af4: 40 e1 ldi r20, 0x10 ; 16 19af6: 50 e0 ldi r21, 0x00 ; 0 19af8: 70 e0 ldi r23, 0x00 ; 0 19afa: 60 e0 ldi r22, 0x00 ; 0 19afc: 01 96 adiw r24, 0x01 ; 1 19afe: 0f 94 d1 d8 call 0x3b1a2 ; 0x3b1a2 19b02: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 19b04: 88 e5 ldi r24, 0x58 ; 88 19b06: 0e 94 8d 5c call 0xb91a ; 0xb91a 19b0a: 88 23 and r24, r24 19b0c: 61 f0 breq .+24 ; 0x19b26 data = code_value_short(); 19b0e: 0e 94 2c 5c call 0xb858 ; 0xb858 } if(addr){ 19b12: 11 23 and r17, r17 19b14: 11 f4 brne .+4 ; 0x19b1a 19b16: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a MMU2::mmu2.WriteRegister(addr, data); 19b1a: bc 01 movw r22, r24 19b1c: 81 2f mov r24, r17 19b1e: 0e 94 d3 de call 0x1bda6 ; 0x1bda6 19b22: 0c 94 a5 b2 jmp 0x1654a ; 0x1654a 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; 19b26: 90 e0 ldi r25, 0x00 ; 0 19b28: 80 e0 ldi r24, 0x00 ; 0 19b2a: f3 cf rjmp .-26 ; 0x19b12 19b2c: 60 e0 ldi r22, 0x00 ; 0 19b2e: 8c ea ldi r24, 0xAC ; 172 19b30: 9c e0 ldi r25, 0x0C ; 12 19b32: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 19b36: 10 92 95 13 sts 0x1395, r1 ; 0x801395 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 19b3a: 10 92 43 13 sts 0x1343, r1 ; 0x801343 currentScope = Scope::Stopped; 19b3e: 10 92 28 13 sts 0x1328, r1 ; 0x801328 19b42: 0c 94 1b b2 jmp 0x16436 ; 0x16436 19b46: 61 e0 ldi r22, 0x01 ; 1 19b48: 8c ea ldi r24, 0xAC ; 172 19b4a: 9c e0 ldi r25, 0x0C ; 12 19b4c: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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(); 19b50: 0e 94 33 db call 0x1b666 ; 0x1b666 19b54: 0c 94 1b b2 jmp 0x16436 ; 0x16436 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19b58: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 19b5a: 0f 94 8c 1d call 0x23b18 ; 0x23b18 19b5e: 0c 94 31 b2 jmp 0x16462 ; 0x16462 } void MMU2::TriggerResetPin() { reset(); 19b62: 0f 94 ce c2 call 0x3859c ; 0x3859c 19b66: 0c 94 31 b2 jmp 0x16462 ; 0x16462 void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 19b6a: 8a e2 ldi r24, 0x2A ; 42 19b6c: f6 cf rjmp .-20 ; 0x19b5a 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') { 19b6e: 84 35 cpi r24, 0x54 ; 84 19b70: 09 f0 breq .+2 ; 0x19b74 19b72: 79 c0 rjmp .+242 ; 0x19c66 strchr_pointer = CMDBUFFER_CURRENT_STRING; 19b74: 10 93 94 03 sts 0x0394, r17 ; 0x800394 19b78: 00 93 93 03 sts 0x0393, r16 ; 0x800393 processing_tcode = true; 19b7c: 81 e0 ldi r24, 0x01 ; 1 19b7e: 80 93 9f 03 sts 0x039F, r24 ; 0x80039f TCodes(strchr_pointer, code_value_uint8()); 19b82: 0e 94 1f 5c call 0xb83e ; 0xb83e 19b86: 18 2f mov r17, r24 19b88: 20 91 93 03 lds r18, 0x0393 ; 0x800393 19b8c: 30 91 94 03 lds r19, 0x0394 ; 0x800394 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 19b90: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 19b92: 79 01 movw r14, r18 19b94: e9 0e add r14, r25 19b96: f1 1c adc r15, r1 19b98: d7 01 movw r26, r14 19b9a: 8c 91 ld r24, X 19b9c: 80 32 cpi r24, 0x20 ; 32 19b9e: 11 f0 breq .+4 ; 0x19ba4 19ba0: 89 30 cpi r24, 0x09 ; 9 19ba2: 11 f4 brne .+4 ; 0x19ba8 19ba4: 9f 5f subi r25, 0xFF ; 255 19ba6: f5 cf rjmp .-22 ; 0x19b92 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 19ba8: 08 2e mov r0, r24 19baa: 00 0c add r0, r0 19bac: 99 0b sbc r25, r25 19bae: 0f 94 5a e3 call 0x3c6b4 ; 0x3c6b4 19bb2: f7 01 movw r30, r14 19bb4: 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'); 19bb6: 90 ed ldi r25, 0xD0 ; 208 19bb8: 98 0f add r25, r24 19bba: 95 30 cpi r25, 0x05 ; 5 19bbc: 58 f0 brcs .+22 ; 0x19bd4 19bbe: 8f 33 cpi r24, 0x3F ; 63 19bc0: 59 f0 breq .+22 ; 0x19bd8 19bc2: 88 37 cpi r24, 0x78 ; 120 19bc4: 49 f0 breq .+18 ; 0x19bd8 19bc6: 83 36 cpi r24, 0x63 ; 99 19bc8: f1 f0 breq .+60 ; 0x19c06 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 19bca: 8b e7 ldi r24, 0x7B ; 123 19bcc: 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 19bce: 0e 94 17 7b call 0xf62e ; 0xf62e 19bd2: 13 c0 rjmp .+38 ; 0x19bfa strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 19bd4: 8f 33 cpi r24, 0x3F ; 63 19bd6: a9 f4 brne .+42 ; 0x19c02 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 19bd8: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19bdc: 81 30 cpi r24, 0x01 ; 1 19bde: 69 f4 brne .+26 ; 0x19bfa MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 19be0: 82 e1 ldi r24, 0x12 ; 18 19be2: 9f e3 ldi r25, 0x3F ; 63 19be4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 19be8: 70 e0 ldi r23, 0x00 ; 0 19bea: 60 e0 ldi r22, 0x00 ; 0 19bec: 0e 94 ca d9 call 0x1b394 ; 0x1b394 19bf0: 68 2f mov r22, r24 19bf2: d7 01 movw r26, r14 19bf4: 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()); 19bf6: 0f 94 41 1d call 0x23a82 ; 0x23a82 processing_tcode = false; 19bfa: 10 92 9f 03 sts 0x039F, r1 ; 0x80039f 19bfe: 0c 94 f6 97 jmp 0x12fec ; 0x12fec } 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'){ 19c02: 83 36 cpi r24, 0x63 ; 99 19c04: 49 f4 brne .+18 ; 0x19c18 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 19c06: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19c0a: 81 30 cpi r24, 0x01 ; 1 19c0c: b1 f7 brne .-20 ; 0x19bfa MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 19c0e: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 19c12: 68 2f mov r22, r24 19c14: 83 e6 ldi r24, 0x63 ; 99 19c16: ef cf rjmp .-34 ; 0x19bf6 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 19c18: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19c1c: 81 30 cpi r24, 0x01 ; 1 19c1e: 69 f4 brne .+26 ; 0x19c3a if (codeValue == MMU2::mmu2.get_current_tool()){ 19c20: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 19c24: 18 13 cpse r17, r24 19c26: 05 c0 rjmp .+10 ; 0x19c32 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 19c28: 8b e8 ldi r24, 0x8B ; 139 19c2a: 9f e7 ldi r25, 0x7F ; 127 19c2c: 0f 94 2f dc call 0x3b85e ; 0x3b85e 19c30: e4 cf rjmp .-56 ; 0x19bfa #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); 19c32: 81 2f mov r24, r17 19c34: 0f 94 25 1a call 0x2344a ; 0x2344a 19c38: e0 cf rjmp .-64 ; 0x19bfa } } else { SERIAL_ECHO_START; 19c3a: 84 e1 ldi r24, 0x14 ; 20 19c3c: 9a ea ldi r25, 0xAA ; 170 19c3e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if (codeValue >= EXTRUDERS) { 19c42: 11 23 and r17, r17 19c44: 59 f0 breq .+22 ; 0x19c5c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 19c46: 84 e5 ldi r24, 0x54 ; 84 19c48: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 19c4c: 81 2f mov r24, r17 19c4e: 90 e0 ldi r25, 0x00 ; 0 19c50: c0 96 adiw r24, 0x30 ; 48 19c52: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19c56: 8d e3 ldi r24, 0x3D ; 61 19c58: 98 e6 ldi r25, 0x68 ; 104 19c5a: b9 cf rjmp .-142 ; 0x19bce // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19c5c: 8a e2 ldi r24, 0x2A ; 42 19c5e: 98 e6 ldi r25, 0x68 ; 104 19c60: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 19c64: ca cf rjmp .-108 ; 0x19bfa /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19c66: 84 34 cpi r24, 0x44 ; 68 19c68: 09 f0 breq .+2 ; 0x19c6c 19c6a: ee c0 rjmp .+476 ; 0x19e48 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19c6c: 10 93 94 03 sts 0x0394, r17 ; 0x800394 19c70: 00 93 93 03 sts 0x0393, r16 ; 0x800393 switch(code_value_short()) 19c74: 0e 94 2c 5c call 0xb858 ; 0xb858 19c78: 86 30 cpi r24, 0x06 ; 6 19c7a: 91 05 cpc r25, r1 19c7c: 09 f4 brne .+2 ; 0x19c80 19c7e: 79 c0 rjmp .+242 ; 0x19d72 19c80: 9c f4 brge .+38 ; 0x19ca8 19c82: 82 30 cpi r24, 0x02 ; 2 19c84: 91 05 cpc r25, r1 19c86: 09 f4 brne .+2 ; 0x19c8a 19c88: 52 c0 rjmp .+164 ; 0x19d2e 19c8a: 83 30 cpi r24, 0x03 ; 3 19c8c: 91 05 cpc r25, r1 19c8e: 09 f4 brne .+2 ; 0x19c92 19c90: 61 c0 rjmp .+194 ; 0x19d54 19c92: 01 96 adiw r24, 0x01 ; 1 19c94: 89 f4 brne .+34 ; 0x19cb8 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 19c96: 86 e1 ldi r24, 0x16 ; 22 19c98: 98 e6 ldi r25, 0x68 ; 104 19c9a: 9f 93 push r25 19c9c: 8f 93 push r24 19c9e: 0f 94 08 dc call 0x3b810 ; 0x3b810 19ca2: 0f 90 pop r0 19ca4: 0f 90 pop r0 19ca6: ff cf rjmp .-2 ; 0x19ca6 19ca8: 85 31 cpi r24, 0x15 ; 21 19caa: 91 05 cpc r25, r1 19cac: 09 f4 brne .+2 ; 0x19cb0 19cae: 8d c0 rjmp .+282 ; 0x19dca 19cb0: 94 f4 brge .+36 ; 0x19cd6 19cb2: 44 97 sbiw r24, 0x14 ; 20 19cb4: 09 f4 brne .+2 ; 0x19cb8 19cb6: 69 c0 rjmp .+210 ; 0x19d8a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 19cb8: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 19cbc: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 19cc0: 8d 57 subi r24, 0x7D ; 125 19cc2: 9f 4e sbci r25, 0xEF ; 239 19cc4: 9f 93 push r25 19cc6: 8f 93 push r24 19cc8: 1f 92 push r1 19cca: 84 e4 ldi r24, 0x44 ; 68 19ccc: 8f 93 push r24 19cce: 84 e2 ldi r24, 0x24 ; 36 19cd0: 9a e6 ldi r25, 0x6A ; 106 19cd2: 0c 94 91 99 jmp 0x13322 ; 0x13322 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 19cd6: 86 31 cpi r24, 0x16 ; 22 19cd8: 91 05 cpc r25, r1 19cda: 09 f4 brne .+2 ; 0x19cde 19cdc: 9b c0 rjmp .+310 ; 0x19e14 19cde: 86 34 cpi r24, 0x46 ; 70 19ce0: 91 05 cpc r25, r1 19ce2: 51 f7 brne .-44 ; 0x19cb8 #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 19ce4: 83 e5 ldi r24, 0x53 ; 83 19ce6: 0e 94 8d 5c call 0xb91a ; 0xb91a 19cea: 88 23 and r24, r24 19cec: 11 f4 brne .+4 ; 0x19cf2 19cee: 0c 94 f6 97 jmp 0x12fec ; 0x12fec thermal_model_log_enable(code_value_short()); 19cf2: 0e 94 2c 5c call 0xb858 ; 0xb858 19cf6: 11 e0 ldi r17, 0x01 ; 1 19cf8: 00 97 sbiw r24, 0x00 ; 0 19cfa: 09 f4 brne .+2 ; 0x19cfe 19cfc: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 19cfe: 89 2b or r24, r25 19d00: 91 f0 breq .+36 ; 0x19d26 TempMgrGuard temp_mgr_guard; 19d02: ce 01 movw r24, r28 19d04: 01 96 adiw r24, 0x01 ; 1 19d06: 0f 94 ae 47 call 0x28f5c ; 0x28f5c thermal_model::log_buf.entry.stamp = _millis(); 19d0a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 19d0e: 60 93 1e 06 sts 0x061E, r22 ; 0x80061e <_ZN13thermal_modelL7log_bufE.lto_priv.557> 19d12: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x1> 19d16: 80 93 20 06 sts 0x0620, r24 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x2> 19d1a: 90 93 21 06 sts 0x0621, r25 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x3> #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { TempMgrGuard temp_mgr_guard; 19d1e: ce 01 movw r24, r28 19d20: 01 96 adiw r24, 0x01 ; 1 19d22: 0f 94 a1 47 call 0x28f42 ; 0x28f42 thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 19d26: 10 93 2e 06 sts 0x062E, r17 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x10> 19d2a: 0c 94 f6 97 jmp 0x12fec ; 0x12fec - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 19d2e: 41 e1 ldi r20, 0x11 ; 17 19d30: c4 2e mov r12, r20 19d32: 48 e6 ldi r20, 0x68 ; 104 19d34: d4 2e mov r13, r20 19d36: 52 e0 ldi r21, 0x02 ; 2 19d38: e5 2e mov r14, r21 19d3a: 00 e0 ldi r16, 0x00 ; 0 19d3c: 20 e0 ldi r18, 0x00 ; 0 19d3e: 32 e2 ldi r19, 0x22 ; 34 19d40: 40 e0 ldi r20, 0x00 ; 0 19d42: 50 e0 ldi r21, 0x00 ; 0 19d44: 60 e0 ldi r22, 0x00 ; 0 19d46: 72 e0 ldi r23, 0x02 ; 2 19d48: 80 e0 ldi r24, 0x00 ; 0 19d4a: 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")); 19d4c: 0e 94 69 63 call 0xc6d2 ; 0xc6d2 19d50: 0c 94 f6 97 jmp 0x12fec ; 0x12fec - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 19d54: 2a e0 ldi r18, 0x0A ; 10 19d56: c2 2e mov r12, r18 19d58: 28 e6 ldi r18, 0x68 ; 104 19d5a: d2 2e mov r13, r18 19d5c: 33 e0 ldi r19, 0x03 ; 3 19d5e: e3 2e mov r14, r19 19d60: 01 e0 ldi r16, 0x01 ; 1 19d62: 20 e0 ldi r18, 0x00 ; 0 19d64: 30 e1 ldi r19, 0x10 ; 16 19d66: 40 e0 ldi r20, 0x00 ; 0 19d68: 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")); 19d6a: 60 e0 ldi r22, 0x00 ; 0 19d6c: 70 e0 ldi r23, 0x00 ; 0 19d6e: cb 01 movw r24, r22 19d70: ed cf rjmp .-38 ; 0x19d4c 19d72: 83 e0 ldi r24, 0x03 ; 3 19d74: c8 2e mov r12, r24 19d76: 88 e6 ldi r24, 0x68 ; 104 19d78: d8 2e mov r13, r24 19d7a: 96 e0 ldi r25, 0x06 ; 6 19d7c: e9 2e mov r14, r25 19d7e: 03 e0 ldi r16, 0x03 ; 3 19d80: 20 e0 ldi r18, 0x00 ; 0 19d82: 30 e0 ldi r19, 0x00 ; 0 19d84: 44 e0 ldi r20, 0x04 ; 4 19d86: 50 e0 ldi r21, 0x00 ; 0 19d88: f0 cf rjmp .-32 ; 0x19d6a #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 19d8a: 85 e4 ldi r24, 0x45 ; 69 19d8c: 0e 94 8d 5c call 0xb91a ; 0xb91a 19d90: 88 23 and r24, r24 19d92: 29 f0 breq .+10 ; 0x19d9e xfdump_full_dump_and_reset(); 19d94: 80 e0 ldi r24, 0x00 ; 0 19d96: 0e 94 4b e4 call 0x1c896 ; 0x1c896 19d9a: 0c 94 f6 97 jmp 0x12fec ; 0x12fec else { unsigned long ts = _millis(); 19d9e: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 19da2: 6b 01 movw r12, r22 19da4: 7c 01 movw r14, r24 xfdump_dump(); 19da6: 0e 94 79 e4 call 0x1c8f2 ; 0x1c8f2 ts = _millis() - ts; 19daa: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 19dae: dc 01 movw r26, r24 19db0: cb 01 movw r24, r22 19db2: 8c 19 sub r24, r12 19db4: 9d 09 sbc r25, r13 19db6: ae 09 sbc r26, r14 19db8: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 19dba: bf 93 push r27 19dbc: af 93 push r26 19dbe: 9f 93 push r25 19dc0: 8f 93 push r24 19dc2: 8a ee ldi r24, 0xEA ; 234 19dc4: 97 e6 ldi r25, 0x67 ; 103 19dc6: 0c 94 91 99 jmp 0x13322 ; 0x13322 } } void dcode_21() { if(!xfdump_check_state()) 19dca: 90 e0 ldi r25, 0x00 ; 0 19dcc: 80 e0 ldi r24, 0x00 ; 0 19dce: 0e 94 97 e3 call 0x1c72e ; 0x1c72e 19dd2: 81 11 cpse r24, r1 19dd4: 07 c0 rjmp .+14 ; 0x19de4 DBG(_N("no dump available\n")); 19dd6: 87 ed ldi r24, 0xD7 ; 215 19dd8: 97 e6 ldi r25, 0x67 ; 103 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19dda: 9f 93 push r25 19ddc: 8f 93 push r24 19dde: 0f 94 08 dc call 0x3b810 ; 0x3b810 19de2: 14 c0 rjmp .+40 ; 0x19e0c { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 19de4: 81 e0 ldi r24, 0x01 ; 1 19de6: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D21 - read crash dump\n")); 19dea: 80 ec ldi r24, 0xC0 ; 192 19dec: 97 e6 ldi r25, 0x67 ; 103 19dee: 9f 93 push r25 19df0: 8f 93 push r24 19df2: 0f 94 08 dc call 0x3b810 ; 0x3b810 print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 19df6: 03 e0 ldi r16, 0x03 ; 3 19df8: 20 e0 ldi r18, 0x00 ; 0 19dfa: 33 e2 ldi r19, 0x23 ; 35 19dfc: 40 e0 ldi r20, 0x00 ; 0 19dfe: 50 e0 ldi r21, 0x00 ; 0 19e00: 60 e0 ldi r22, 0x00 ; 0 19e02: 70 ed ldi r23, 0xD0 ; 208 19e04: 83 e0 ldi r24, 0x03 ; 3 19e06: 90 e0 ldi r25, 0x00 ; 0 19e08: 0f 94 94 86 call 0x30d28 ; 0x30d28 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19e0c: 0f 90 pop r0 19e0e: 0f 90 pop r0 19e10: 0c 94 f6 97 jmp 0x12fec ; 0x12fec } } void dcode_22() { if(!xfdump_check_state()) 19e14: 90 e0 ldi r25, 0x00 ; 0 19e16: 80 e0 ldi r24, 0x00 ; 0 19e18: 0e 94 97 e3 call 0x1c72e ; 0x1c72e 19e1c: 81 11 cpse r24, r1 19e1e: 03 c0 rjmp .+6 ; 0x19e26 DBG(_N("no dump available\n")); 19e20: 8d ea ldi r24, 0xAD ; 173 19e22: 97 e6 ldi r25, 0x67 ; 103 19e24: da cf rjmp .-76 ; 0x19dda SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 19e26: 8c e5 ldi r24, 0x5C ; 92 19e28: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 19e2a: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 19e2c: 0e 94 cf e3 call 0x1c79e ; 0x1c79e _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 19e30: 40 e0 ldi r20, 0x00 ; 0 19e32: 50 ed ldi r21, 0xD0 ; 208 19e34: 63 e0 ldi r22, 0x03 ; 3 19e36: 70 e0 ldi r23, 0x00 ; 0 19e38: 80 e2 ldi r24, 0x20 ; 32 19e3a: 0e 94 51 e3 call 0x1c6a2 ; 0x1c6a2 xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 19e3e: 0e 94 33 e3 call 0x1c666 ; 0x1c666 else { xfdump_reset(); DBG(_N("dump cleared\n")); 19e42: 8f e9 ldi r24, 0x9F ; 159 19e44: 97 e6 ldi r25, 0x67 ; 103 19e46: c9 cf rjmp .-110 ; 0x19dda } } else { SERIAL_ECHO_START; 19e48: 84 e1 ldi r24, 0x14 ; 20 19e4a: 9a ea ldi r25, 0xAA ; 170 19e4c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 19e50: 8f e9 ldi r24, 0x9F ; 159 19e52: 98 e6 ldi r25, 0x68 ; 104 19e54: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19e58: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 19e5c: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 19e60: 8d 57 subi r24, 0x7D ; 125 19e62: 9f 4e sbci r25, 0xEF ; 239 19e64: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_ECHOLNPGM("\"(2)"); 19e68: 82 e9 ldi r24, 0x92 ; 146 19e6a: 96 e8 ldi r25, 0x86 ; 134 19e6c: 0c 94 01 9a jmp 0x13402 ; 0x13402 #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 19e70: 2d ec ldi r18, 0xCD ; 205 19e72: 3c ec ldi r19, 0xCC ; 204 19e74: 4c ec ldi r20, 0xCC ; 204 19e76: 5d e3 ldi r21, 0x3D ; 61 19e78: c7 01 movw r24, r14 19e7a: b6 01 movw r22, r12 19e7c: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 19e80: 18 16 cp r1, r24 19e82: 14 f4 brge .+4 ; 0x19e88 19e84: 0c 94 3e 9b jmp 0x1367c ; 0x1367c 19e88: 0c 94 ac 9c jmp 0x13958 ; 0x13958 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; 19e8c: a3 01 movw r20, r6 19e8e: 92 01 movw r18, r4 19e90: 62 2d mov r22, r2 19e92: 73 2d mov r23, r3 19e94: 8e 2d mov r24, r14 19e96: 9f 2d mov r25, r15 19e98: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 19e9c: 18 16 cp r1, r24 19e9e: 14 f0 brlt .+4 ; 0x19ea4 19ea0: 0c 94 8d a4 jmp 0x1491a ; 0x1491a 19ea4: e5 e0 ldi r30, 0x05 ; 5 19ea6: ce 0e add r12, r30 19ea8: d1 1c adc r13, r1 19eaa: f2 e0 ldi r31, 0x02 ; 2 19eac: 8f 0e add r8, r31 19eae: 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; 19eb0: 85 01 movw r16, r10 19eb2: 0c 94 54 a4 jmp 0x148a8 ; 0x148a8 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 19eb6: 67 96 adiw r28, 0x17 ; 23 19eb8: 2f ad ldd r18, Y+63 ; 0x3f 19eba: 67 97 sbiw r28, 0x17 ; 23 19ebc: 8b 2d mov r24, r11 19ebe: 23 30 cpi r18, 0x03 ; 3 19ec0: 29 f0 breq .+10 ; 0x19ecc 19ec2: 91 e0 ldi r25, 0x01 ; 1 19ec4: 04 30 cpi r16, 0x04 ; 4 19ec6: 11 05 cpc r17, r1 19ec8: 09 f4 brne .+2 ; 0x19ecc 19eca: b3 cc rjmp .-1690 ; 0x19832 19ecc: 90 e0 ldi r25, 0x00 ; 0 19ece: b1 cc rjmp .-1694 ; 0x19832 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)); 19ed0: 85 e5 ldi r24, 0x55 ; 85 19ed2: 99 e3 ldi r25, 0x39 ; 57 19ed4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 19ed8: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_puts_at_P(0, 2, PSTR("")); 19edc: 45 ef ldi r20, 0xF5 ; 245 19ede: 55 e8 ldi r21, 0x85 ; 133 19ee0: 62 e0 ldi r22, 0x02 ; 2 19ee2: 80 e0 ldi r24, 0x00 ; 0 19ee4: 0e 94 ba 6f call 0xdf74 ; 0xdf74 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 19ee8: f8 01 movw r30, r16 19eea: 81 91 ld r24, Z+ 19eec: 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'; 19eee: 98 2f mov r25, r24 19ef0: 9f 7d andi r25, 0xDF ; 223 19ef2: 11 f4 brne .+4 ; 0x19ef8 19ef4: 0c 94 e8 b8 jmp 0x171d0 ; 0x171d0 19ef8: 97 ef ldi r25, 0xF7 ; 247 19efa: 98 0f add r25, r24 19efc: 92 30 cpi r25, 0x02 ; 2 19efe: 10 f4 brcc .+4 ; 0x19f04 19f00: 0c 94 e8 b8 jmp 0x171d0 ; 0x171d0 19f04: 8d 30 cpi r24, 0x0D ; 13 19f06: 11 f4 brne .+4 ; 0x19f0c 19f08: 0c 94 e8 b8 jmp 0x171d0 ; 0x171d0 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); 19f0c: 0e 94 95 6f call 0xdf2a ; 0xdf2a 19f10: eb cf rjmp .-42 ; 0x19ee8 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; 19f12: ce 01 movw r24, r28 19f14: 01 96 adiw r24, 0x01 ; 1 19f16: 0f 94 ae 47 call 0x28f5c ; 0x28f5c 19f1a: 0c 94 d7 ac jmp 0x159ae ; 0x159ae 00019f1e : uint8_t check_pinda_0() { return _PINDA?0:1; } 19f1e: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 19f22: 90 91 f7 03 lds r25, 0x03F7 ; 0x8003f7 19f26: 08 95 ret 00019f28 : 19f28: 81 50 subi r24, 0x01 ; 1 19f2a: 82 31 cpi r24, 0x12 ; 18 19f2c: 08 f0 brcs .+2 ; 0x19f30 19f2e: 5a c0 rjmp .+180 ; 0x19fe4 19f30: e8 2f mov r30, r24 19f32: f0 e0 ldi r31, 0x00 ; 0 19f34: 88 27 eor r24, r24 19f36: e0 56 subi r30, 0x60 ; 96 19f38: f0 43 sbci r31, 0x30 ; 48 19f3a: 8f 4f sbci r24, 0xFF ; 255 19f3c: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 19f40: c0 cf rjmp .-128 ; 0x19ec2 19f42: c4 cf rjmp .-120 ; 0x19ecc 19f44: b2 cf rjmp .-156 ; 0x19eaa 19f46: b8 cf rjmp .-144 ; 0x19eb8 19f48: bc cf rjmp .-136 ; 0x19ec2 19f4a: f2 cf rjmp .-28 ; 0x19f30 19f4c: c7 cf rjmp .-114 ; 0x19edc 19f4e: cd cf rjmp .-102 ; 0x19eea 19f50: d1 cf rjmp .-94 ; 0x19ef4 19f52: d7 cf rjmp .-82 ; 0x19f02 19f54: db cf rjmp .-74 ; 0x19f0c 19f56: df cf rjmp .-66 ; 0x19f16 19f58: e5 cf rjmp .-54 ; 0x19f24 19f5a: e9 cf rjmp .-46 ; 0x19f2e 19f5c: f2 cf rjmp .-28 ; 0x19f42 19f5e: ed cf rjmp .-38 ; 0x19f3a 19f60: f3 cf rjmp .-26 ; 0x19f48 19f62: f7 cf rjmp .-18 ; 0x19f52 19f64: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f68: 8f 77 andi r24, 0x7F ; 127 19f6a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f6e: 08 95 ret 19f70: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f74: 8f 7d andi r24, 0xDF ; 223 19f76: f9 cf rjmp .-14 ; 0x19f6a 19f78: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f7c: 87 7f andi r24, 0xF7 ; 247 19f7e: f5 cf rjmp .-22 ; 0x19f6a 19f80: 84 b5 in r24, 0x24 ; 36 19f82: 8f 77 andi r24, 0x7F ; 127 19f84: 84 bd out 0x24, r24 ; 36 19f86: 08 95 ret 19f88: 84 b5 in r24, 0x24 ; 36 19f8a: 8f 7d andi r24, 0xDF ; 223 19f8c: fb cf rjmp .-10 ; 0x19f84 19f8e: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f92: 8f 77 andi r24, 0x7F ; 127 19f94: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f98: 08 95 ret 19f9a: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f9e: 8f 7d andi r24, 0xDF ; 223 19fa0: f9 cf rjmp .-14 ; 0x19f94 19fa2: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19fa6: 8f 77 andi r24, 0x7F ; 127 19fa8: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19fac: 08 95 ret 19fae: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19fb2: 8f 7d andi r24, 0xDF ; 223 19fb4: f9 cf rjmp .-14 ; 0x19fa8 19fb6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19fba: 87 7f andi r24, 0xF7 ; 247 19fbc: f5 cf rjmp .-22 ; 0x19fa8 19fbe: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fc2: 8f 77 andi r24, 0x7F ; 127 19fc4: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fc8: 08 95 ret 19fca: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fce: 8f 7d andi r24, 0xDF ; 223 19fd0: f9 cf rjmp .-14 ; 0x19fc4 19fd2: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fd6: 87 7f andi r24, 0xF7 ; 247 19fd8: f5 cf rjmp .-22 ; 0x19fc4 19fda: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fde: 8f 77 andi r24, 0x7F ; 127 19fe0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fe4: 08 95 ret 19fe6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fea: 8f 7d andi r24, 0xDF ; 223 19fec: f9 cf rjmp .-14 ; 0x19fe0 19fee: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19ff2: 87 7f andi r24, 0xF7 ; 247 19ff4: f5 cf rjmp .-22 ; 0x19fe0 00019ff6 : 19ff6: 83 b1 in r24, 0x03 ; 3 19ff8: 82 95 swap r24 19ffa: 81 70 andi r24, 0x01 ; 1 19ffc: 08 95 ret 00019ffe : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19ffe: cf 92 push r12 1a000: df 92 push r13 1a002: ef 92 push r14 1a004: 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; 1a006: 20 91 f8 03 lds r18, 0x03F8 ; 0x8003f8 1a00a: b0 e0 ldi r27, 0x00 ; 0 1a00c: a0 e0 ldi r26, 0x00 ; 0 1a00e: c0 90 61 07 lds r12, 0x0761 ; 0x800761 1a012: d0 90 62 07 lds r13, 0x0762 ; 0x800762 1a016: e0 90 63 07 lds r14, 0x0763 ; 0x800763 1a01a: f0 90 64 07 lds r15, 0x0764 ; 0x800764 1a01e: 20 ff sbrs r18, 0 1a020: 42 c0 rjmp .+132 ; 0x1a0a6 1a022: c8 1a sub r12, r24 1a024: d9 0a sbc r13, r25 1a026: ea 0a sbc r14, r26 1a028: fb 0a sbc r15, r27 1a02a: c0 92 61 07 sts 0x0761, r12 ; 0x800761 1a02e: d0 92 62 07 sts 0x0762, r13 ; 0x800762 1a032: e0 92 63 07 sts 0x0763, r14 ; 0x800763 1a036: f0 92 64 07 sts 0x0764, r15 ; 0x800764 1a03a: cb 01 movw r24, r22 1a03c: b0 e0 ldi r27, 0x00 ; 0 1a03e: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1a040: c0 90 65 07 lds r12, 0x0765 ; 0x800765 1a044: d0 90 66 07 lds r13, 0x0766 ; 0x800766 1a048: e0 90 67 07 lds r14, 0x0767 ; 0x800767 1a04c: f0 90 68 07 lds r15, 0x0768 ; 0x800768 1a050: 21 ff sbrs r18, 1 1a052: 36 c0 rjmp .+108 ; 0x1a0c0 1a054: c8 1a sub r12, r24 1a056: d9 0a sbc r13, r25 1a058: ea 0a sbc r14, r26 1a05a: fb 0a sbc r15, r27 1a05c: c0 92 65 07 sts 0x0765, r12 ; 0x800765 1a060: d0 92 66 07 sts 0x0766, r13 ; 0x800766 1a064: e0 92 67 07 sts 0x0767, r14 ; 0x800767 1a068: f0 92 68 07 sts 0x0768, r15 ; 0x800768 1a06c: 70 e0 ldi r23, 0x00 ; 0 1a06e: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1a070: 80 91 69 07 lds r24, 0x0769 ; 0x800769 1a074: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 1a078: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 1a07c: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 1a080: 22 ff sbrs r18, 2 1a082: 2b c0 rjmp .+86 ; 0x1a0da 1a084: 84 1b sub r24, r20 1a086: 95 0b sbc r25, r21 1a088: a6 0b sbc r26, r22 1a08a: b7 0b sbc r27, r23 1a08c: 80 93 69 07 sts 0x0769, r24 ; 0x800769 1a090: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 1a094: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 1a098: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 1a09c: ff 90 pop r15 1a09e: ef 90 pop r14 1a0a0: df 90 pop r13 1a0a2: cf 90 pop r12 1a0a4: 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; 1a0a6: 8c 0d add r24, r12 1a0a8: 9d 1d adc r25, r13 1a0aa: ae 1d adc r26, r14 1a0ac: bf 1d adc r27, r15 1a0ae: 80 93 61 07 sts 0x0761, r24 ; 0x800761 1a0b2: 90 93 62 07 sts 0x0762, r25 ; 0x800762 1a0b6: a0 93 63 07 sts 0x0763, r26 ; 0x800763 1a0ba: b0 93 64 07 sts 0x0764, r27 ; 0x800764 1a0be: bd cf rjmp .-134 ; 0x1a03a if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1a0c0: 8c 0d add r24, r12 1a0c2: 9d 1d adc r25, r13 1a0c4: ae 1d adc r26, r14 1a0c6: bf 1d adc r27, r15 1a0c8: 80 93 65 07 sts 0x0765, r24 ; 0x800765 1a0cc: 90 93 66 07 sts 0x0766, r25 ; 0x800766 1a0d0: a0 93 67 07 sts 0x0767, r26 ; 0x800767 1a0d4: b0 93 68 07 sts 0x0768, r27 ; 0x800768 1a0d8: c9 cf rjmp .-110 ; 0x1a06c if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1a0da: 84 0f add r24, r20 1a0dc: 95 1f adc r25, r21 1a0de: a6 1f adc r26, r22 1a0e0: b7 1f adc r27, r23 1a0e2: d4 cf rjmp .-88 ; 0x1a08c 0001a0e4 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 1a0e4: fb 01 movw r30, r22 *v = 0; 1a0e6: 11 82 std Z+1, r1 ; 0x01 1a0e8: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 1a0ea: 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'; 1a0ec: dc 01 movw r26, r24 1a0ee: 2c 91 ld r18, X 1a0f0: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 1a0f2: 2a 30 cpi r18, 0x0A ; 10 1a0f4: a0 f4 brcc .+40 ; 0x1a11e *v *= 10; 1a0f6: 40 81 ld r20, Z 1a0f8: 51 81 ldd r21, Z+1 ; 0x01 1a0fa: 64 9f mul r22, r20 1a0fc: 90 01 movw r18, r0 1a0fe: 65 9f mul r22, r21 1a100: 30 0d add r19, r0 1a102: 11 24 eor r1, r1 1a104: 31 83 std Z+1, r19 ; 0x01 1a106: 20 83 st Z, r18 *v += *str - '0'; 1a108: 4d 91 ld r20, X+ 1a10a: cd 01 movw r24, r26 1a10c: 20 53 subi r18, 0x30 ; 48 1a10e: 31 09 sbc r19, r1 1a110: 24 0f add r18, r20 1a112: 31 1d adc r19, r1 1a114: 47 fd sbrc r20, 7 1a116: 3a 95 dec r19 1a118: 31 83 std Z+1, r19 ; 0x01 1a11a: 20 83 st Z, r18 1a11c: e7 cf rjmp .-50 ; 0x1a0ec ++str; } return str; } 1a11e: 08 95 ret 0001a120 : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 1a120: 85 e0 ldi r24, 0x05 ; 5 1a122: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 lcd_return_to_status(); 1a126: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 0001a12a : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 1a12a: 8f e3 ldi r24, 0x3F ; 63 1a12c: 9c e6 ldi r25, 0x6C ; 108 1a12e: 0e 94 17 7b call 0xf62e ; 0xf62e lcd_return_to_status(); 1a132: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 0001a136 : //! 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) { 1a136: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 1a13a: 81 30 cpi r24, 0x01 ; 1 1a13c: 21 f4 brne .+8 ; 0x1a146 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 1a13e: 8e e8 ldi r24, 0x8E ; 142 1a140: 9b e6 ldi r25, 0x6B ; 107 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 1a142: 0c 94 17 7b jmp 0xf62e ; 0xf62e 1a146: 8f e7 ldi r24, 0x7F ; 127 1a148: 9b e6 ldi r25, 0x6B ; 107 1a14a: fb cf rjmp .-10 ; 0x1a142 0001a14c : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1a14c: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1a150: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d #endif manage_heater(); 1a154: 0d 94 6c 4e jmp 0x29cd8 ; 0x29cd8 0001a158 : 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, 1a158: 1f 93 push r17 1a15a: cf 93 push r28 1a15c: df 93 push r29 1a15e: c8 2f mov r28, r24 1a160: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 1a162: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 1a166: 8b ee ldi r24, 0xEB ; 235 1a168: 93 e4 ldi r25, 0x43 ; 67 1a16a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a16e: ac 01 movw r20, r24 1a170: 60 e0 ldi r22, 0x00 ; 0 1a172: 80 e0 ldi r24, 0x00 ; 0 1a174: 0e 94 ba 6f call 0xdf74 ; 0xdf74 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)); 1a178: 81 e8 ldi r24, 0x81 ; 129 1a17a: 94 e4 ldi r25, 0x44 ; 68 1a17c: c1 11 cpse r28, r1 1a17e: 02 c0 rjmp .+4 ; 0x1a184 1a180: 84 e9 ldi r24, 0x94 ; 148 1a182: 94 e4 ldi r25, 0x44 ; 68 1a184: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a188: ac 01 movw r20, r24 1a18a: 61 e0 ldi r22, 0x01 ; 1 1a18c: 80 e0 ldi r24, 0x00 ; 0 1a18e: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_selftest_setfan(255); 1a192: 8f ef ldi r24, 0xFF ; 255 1a194: 0e 94 a6 d0 call 0x1a14c ; 0x1a14c break; } _delay(500); 1a198: 64 ef ldi r22, 0xF4 ; 244 1a19a: 71 e0 ldi r23, 0x01 ; 1 1a19c: 80 e0 ldi r24, 0x00 ; 0 1a19e: 90 e0 ldi r25, 0x00 ; 0 1a1a0: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 1a1a4: 80 ee ldi r24, 0xE0 ; 224 1a1a6: 93 e4 ldi r25, 0x43 ; 67 1a1a8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a1ac: ac 01 movw r20, r24 1a1ae: 62 e0 ldi r22, 0x02 ; 2 1a1b0: 81 e0 ldi r24, 0x01 ; 1 1a1b2: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_putc_at(0, 3, '>'); 1a1b6: 4e e3 ldi r20, 0x3E ; 62 1a1b8: 63 e0 ldi r22, 0x03 ; 3 1a1ba: 80 e0 ldi r24, 0x00 ; 0 1a1bc: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 1a1c0: 81 ed ldi r24, 0xD1 ; 209 1a1c2: 93 e4 ldi r25, 0x43 ; 67 1a1c4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a1c8: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_encoder = _default; 1a1cc: 6d 2f mov r22, r29 1a1ce: 70 e0 ldi r23, 0x00 ; 0 1a1d0: 70 93 35 05 sts 0x0535, r23 ; 0x800535 1a1d4: 60 93 34 05 sts 0x0534, r22 ; 0x800534 KEEPALIVE_STATE(PAUSED_FOR_USER); 1a1d8: 84 e0 ldi r24, 0x04 ; 4 1a1da: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 1a1de: 0e 94 be 71 call 0xe37c ; 0xe37c 1a1e2: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 1a1e4: 11 e0 ldi r17, 0x01 ; 1 1a1e6: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 1a1e8: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1a1ec: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1a1f0: 00 97 sbiw r24, 0x00 ; 0 1a1f2: 19 f1 breq .+70 ; 0x1a23a if (lcd_encoder < 0) { 1a1f4: 97 ff sbrs r25, 7 1a1f6: 0b c0 rjmp .+22 ; 0x1a20e _result = !check_opposite; 1a1f8: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 1a1fa: 4e e3 ldi r20, 0x3E ; 62 1a1fc: 62 e0 ldi r22, 0x02 ; 2 1a1fe: 80 e0 ldi r24, 0x00 ; 0 1a200: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_putc_at(0, 3, ' '); 1a204: 40 e2 ldi r20, 0x20 ; 32 1a206: 63 e0 ldi r22, 0x03 ; 3 1a208: 80 e0 ldi r24, 0x00 ; 0 1a20a: 0e 94 c6 6f call 0xdf8c ; 0xdf8c } if (lcd_encoder > 0) { 1a20e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1a212: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1a216: 18 16 cp r1, r24 1a218: 19 06 cpc r1, r25 1a21a: 5c f4 brge .+22 ; 0x1a232 _result = check_opposite; lcd_putc_at(0, 2, ' '); 1a21c: 40 e2 ldi r20, 0x20 ; 32 1a21e: 62 e0 ldi r22, 0x02 ; 2 1a220: 80 e0 ldi r24, 0x00 ; 0 1a222: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_putc_at(0, 3, '>'); 1a226: 4e e3 ldi r20, 0x3E ; 62 1a228: 63 e0 ldi r22, 0x03 ; 3 1a22a: 80 e0 ldi r24, 0x00 ; 0 1a22c: 0e 94 c6 6f call 0xdf8c ; 0xdf8c 1a230: dc 2f mov r29, r28 } lcd_encoder = 0; 1a232: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1a236: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } manage_heater(); 1a23a: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 1a23e: 81 e0 ldi r24, 0x01 ; 1 1a240: 0e 94 f3 8b call 0x117e6 ; 0x117e6 _delay(100); 1a244: 64 e6 ldi r22, 0x64 ; 100 1a246: 70 e0 ldi r23, 0x00 ; 0 1a248: 80 e0 ldi r24, 0x00 ; 0 1a24a: 90 e0 ldi r25, 0x00 ; 0 1a24c: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 } while (!lcd_clicked()); 1a250: 0e 94 c3 71 call 0xe386 ; 0xe386 1a254: 88 23 and r24, r24 1a256: 41 f2 breq .-112 ; 0x1a1e8 KEEPALIVE_STATE(IN_HANDLER); 1a258: 82 e0 ldi r24, 0x02 ; 2 1a25a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 setExtruderAutoFanState(0); // Turn off hotend fan 1a25e: 80 e0 ldi r24, 0x00 ; 0 1a260: 0e 94 e2 76 call 0xedc4 ; 0xedc4 lcd_selftest_setfan(0); // Turn off print fan 1a264: 80 e0 ldi r24, 0x00 ; 0 1a266: 0e 94 a6 d0 call 0x1a14c ; 0x1a14c return _result; } 1a26a: 8d 2f mov r24, r29 1a26c: df 91 pop r29 1a26e: cf 91 pop r28 1a270: 1f 91 pop r17 1a272: 08 95 ret 0001a274 : #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) { 1a274: cf 93 push r28 1a276: df 93 push r29 1a278: c8 2f mov r28, r24 1a27a: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 1a27c: c1 50 subi r28, 0x01 ; 1 1a27e: 98 f0 brcs .+38 ; 0x1a2a6 for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1a280: 4d e2 ldi r20, 0x2D ; 45 1a282: 6d 2f mov r22, r29 1a284: 82 e1 ldi r24, 0x12 ; 18 1a286: 0e 94 c6 6f call 0xdf8c ; 0xdf8c delay_keep_alive(1000 / sizeof(symbols)); 1a28a: 84 ef ldi r24, 0xF4 ; 244 1a28c: 91 e0 ldi r25, 0x01 ; 1 1a28e: 0e 94 98 8e call 0x11d30 ; 0x11d30 // 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]); 1a292: 4c e7 ldi r20, 0x7C ; 124 1a294: 6d 2f mov r22, r29 1a296: 82 e1 ldi r24, 0x12 ; 18 1a298: 0e 94 c6 6f call 0xdf8c ; 0xdf8c delay_keep_alive(1000 / sizeof(symbols)); 1a29c: 84 ef ldi r24, 0xF4 ; 244 1a29e: 91 e0 ldi r25, 0x01 ; 1 1a2a0: 0e 94 98 8e call 0x11d30 ; 0x11d30 1a2a4: eb cf rjmp .-42 ; 0x1a27c } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1a2a6: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 1a2aa: 60 93 99 17 sts 0x1799, r22 ; 0x801799 1a2ae: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 1a2b2: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 1a2b6: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c #endif fan_measuring = true; 1a2ba: 81 e0 ldi r24, 0x01 ; 1 1a2bc: 80 93 33 05 sts 0x0533, r24 ; 0x800533 while(fan_measuring) { 1a2c0: 80 91 33 05 lds r24, 0x0533 ; 0x800533 1a2c4: 88 23 and r24, r24 1a2c6: 29 f0 breq .+10 ; 0x1a2d2 delay_keep_alive(100); 1a2c8: 84 e6 ldi r24, 0x64 ; 100 1a2ca: 90 e0 ldi r25, 0x00 ; 0 1a2cc: 0e 94 98 8e call 0x11d30 ; 0x11d30 1a2d0: f7 cf rjmp .-18 ; 0x1a2c0 } gcode_M123(); } 1a2d2: df 91 pop r29 1a2d4: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 1a2d6: 0c 94 4a 67 jmp 0xce94 ; 0xce94 0001a2da : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 1a2da: cf 93 push r28 1a2dc: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1a2de: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 1a2e2: c0 e4 ldi r28, 0x40 ; 64 1a2e4: 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)); 1a2e6: 60 91 72 13 lds r22, 0x1372 ; 0x801372 1a2ea: 70 e0 ldi r23, 0x00 ; 0 1a2ec: 90 e0 ldi r25, 0x00 ; 0 1a2ee: 80 e0 ldi r24, 0x00 ; 0 1a2f0: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1a2f4: 9b 01 movw r18, r22 1a2f6: ac 01 movw r20, r24 1a2f8: 6c 85 ldd r22, Y+12 ; 0x0c 1a2fa: 7d 85 ldd r23, Y+13 ; 0x0d 1a2fc: 8e 85 ldd r24, Y+14 ; 0x0e 1a2fe: 9f 85 ldd r25, Y+15 ; 0x0f 1a300: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1a304: 6c 87 std Y+12, r22 ; 0x0c 1a306: 7d 87 std Y+13, r23 ; 0x0d 1a308: 8e 87 std Y+14, r24 ; 0x0e 1a30a: 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])); 1a30c: 62 e0 ldi r22, 0x02 ; 2 1a30e: 88 ea ldi r24, 0xA8 ; 168 1a310: 90 e9 ldi r25, 0x90 ; 144 } 1a312: df 91 pop r29 1a314: 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])); 1a316: 0d 94 e2 87 jmp 0x30fc4 ; 0x30fc4 0001a31a : 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) { 1a31a: 0f 93 push r16 1a31c: 1f 93 push r17 1a31e: cf 93 push r28 1a320: df 93 push r29 1a322: 98 2f mov r25, r24 1a324: 86 2f mov r24, r22 1a326: 14 2f mov r17, r20 1a328: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a32a: 69 2f mov r22, r25 1a32c: 0e 94 a6 6f call 0xdf4c ; 0xdf4c switch (_state) 1a330: 11 30 cpi r17, 0x01 ; 1 1a332: 21 f0 breq .+8 ; 0x1a33c 1a334: 12 30 cpi r17, 0x02 ; 2 1a336: 79 f0 breq .+30 ; 0x1a356 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a338: ce 01 movw r24, r28 1a33a: 15 c0 rjmp .+42 ; 0x1a366 { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a33c: ce 01 movw r24, r28 1a33e: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_putc(':'); 1a342: 8a e3 ldi r24, 0x3A ; 58 1a344: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_putc(_indicator); 1a348: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a34a: df 91 pop r29 1a34c: cf 91 pop r28 1a34e: 1f 91 pop r17 1a350: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a352: 0c 94 95 6f jmp 0xdf2a ; 0xdf2a break; case 2: lcd_puts_P(_name_PROGMEM); 1a356: ce 01 movw r24, r28 1a358: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_putc(':'); 1a35c: 8a e3 ldi r24, 0x3A ; 58 1a35e: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_puts_P(MSG_OK_CAPS); 1a362: 8d ee ldi r24, 0xED ; 237 1a364: 9b e6 ldi r25, 0x6B ; 107 break; default: lcd_puts_P(_name_PROGMEM); } } 1a366: df 91 pop r29 1a368: cf 91 pop r28 1a36a: 1f 91 pop r17 1a36c: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a36e: 0c 94 91 6f jmp 0xdf22 ; 0xdf22 0001a372 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 1a372: df 92 push r13 1a374: ef 92 push r14 1a376: ff 92 push r15 1a378: 0f 93 push r16 1a37a: 1f 93 push r17 1a37c: cf 93 push r28 1a37e: df 93 push r29 1a380: cd b7 in r28, 0x3d ; 61 1a382: de b7 in r29, 0x3e ; 62 1a384: 63 97 sbiw r28, 0x13 ; 19 1a386: 0f b6 in r0, 0x3f ; 63 1a388: f8 94 cli 1a38a: de bf out 0x3e, r29 ; 62 1a38c: 0f be out 0x3f, r0 ; 63 1a38e: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1a390: 30 91 15 05 lds r19, 0x0515 ; 0x800515 1a394: 20 91 14 05 lds r18, 0x0514 ; 0x800514 1a398: 32 13 cpse r19, r18 1a39a: 73 c0 rjmp .+230 ; 0x1a482 1a39c: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 1a39e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a3a2: 88 23 and r24, r24 1a3a4: 09 f4 brne .+2 ; 0x1a3a8 1a3a6: 45 c0 rjmp .+138 ; 0x1a432 //! //! @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)); 1a3a8: 89 ec ldi r24, 0xC9 ; 201 1a3aa: 93 e4 ldi r25, 0x43 ; 67 1a3ac: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a3b0: 9f 93 push r25 1a3b2: 8f 93 push r24 1a3b4: 87 e6 ldi r24, 0x67 ; 103 1a3b6: 90 e9 ldi r25, 0x90 ; 144 1a3b8: 9f 93 push r25 1a3ba: 8f 93 push r24 1a3bc: 8e 01 movw r16, r28 1a3be: 0f 5f subi r16, 0xFF ; 255 1a3c0: 1f 4f sbci r17, 0xFF ; 255 1a3c2: 1f 93 push r17 1a3c4: 0f 93 push r16 1a3c6: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba 1a3ca: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 1a3cc: 47 e0 ldi r20, 0x07 ; 7 1a3ce: 50 e0 ldi r21, 0x00 ; 0 1a3d0: b7 01 movw r22, r14 1a3d2: 80 0f add r24, r16 1a3d4: 91 2f mov r25, r17 1a3d6: 91 1d adc r25, r1 1a3d8: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c 1a3dc: 0f 90 pop r0 1a3de: 0f 90 pop r0 1a3e0: 0f 90 pop r0 1a3e2: 0f 90 pop r0 1a3e4: 0f 90 pop r0 1a3e6: 0f 90 pop r0 1a3e8: 20 e0 ldi r18, 0x00 ; 0 1a3ea: 82 2f mov r24, r18 1a3ec: 8d 0d add r24, r13 1a3ee: 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) 1a3f0: 27 30 cpi r18, 0x07 ; 7 1a3f2: 39 f0 breq .+14 ; 0x1a402 1a3f4: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 1a3f6: f8 01 movw r30, r16 1a3f8: e8 0f add r30, r24 1a3fa: f9 1f adc r31, r25 1a3fc: 30 81 ld r19, Z 1a3fe: 31 11 cpse r19, r1 1a400: f4 cf rjmp .-24 ; 0x1a3ea } buffer.c[index] = ']'; 1a402: f8 01 movw r30, r16 1a404: e8 0f add r30, r24 1a406: f9 1f adc r31, r25 1a408: 2d e5 ldi r18, 0x5D ; 93 1a40a: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 1a40c: 8c 0f add r24, r28 1a40e: 9d 1f adc r25, r29 1a410: fc 01 movw r30, r24 1a412: 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()); 1a414: 0f 94 87 cd call 0x39b0e ; 0x39b0e 1a418: 48 2f mov r20, r24 1a41a: 60 91 12 05 lds r22, 0x0512 ; 0x800512 1a41e: 80 e0 ldi r24, 0x00 ; 0 1a420: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_print_pad(buffer.c, LCD_WIDTH - 2); 1a424: 62 e1 ldi r22, 0x12 ; 18 1a426: c8 01 movw r24, r16 1a428: 0e 94 95 71 call 0xe32a ; 0xe32a lcd_putc(type_char); 1a42c: 80 e2 ldi r24, 0x20 ; 32 1a42e: 0e 94 95 6f call 0xdf2a ; 0xdf2a 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)) 1a432: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a436: 88 23 and r24, r24 1a438: 21 f1 breq .+72 ; 0x1a482 1a43a: 20 91 15 05 lds r18, 0x0515 ; 0x800515 1a43e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1a442: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1a446: 28 17 cp r18, r24 1a448: 19 06 cpc r1, r25 1a44a: d9 f4 brne .+54 ; 0x1a482 { lcd_update_enabled = 0; 1a44c: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 1a450: 8f ef ldi r24, 0xFF ; 255 1a452: 97 e7 ldi r25, 0x77 ; 119 1a454: 89 2b or r24, r25 1a456: 11 f0 breq .+4 ; 0x1a45c 1a458: 0e 94 ff 77 call 0xeffe ; 0xeffe lcd_update_enabled = 1; 1a45c: 81 e0 ldi r24, 0x01 ; 1 1a45e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 1a462: 0f 94 ab cd call 0x39b56 ; 0x39b56 return; } } menu_item++; } 1a466: 63 96 adiw r28, 0x13 ; 19 1a468: 0f b6 in r0, 0x3f ; 63 1a46a: f8 94 cli 1a46c: de bf out 0x3e, r29 ; 62 1a46e: 0f be out 0x3f, r0 ; 63 1a470: cd bf out 0x3d, r28 ; 61 1a472: df 91 pop r29 1a474: cf 91 pop r28 1a476: 1f 91 pop r17 1a478: 0f 91 pop r16 1a47a: ff 90 pop r15 1a47c: ef 90 pop r14 1a47e: df 90 pop r13 1a480: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 1a482: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a486: 8f 5f subi r24, 0xFF ; 255 1a488: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a48c: ec cf rjmp .-40 ; 0x1a466 0001a48e : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 1a48e: cf 92 push r12 1a490: df 92 push r13 1a492: ef 92 push r14 1a494: ff 92 push r15 1a496: 0f 93 push r16 1a498: 1f 93 push r17 1a49a: cf 93 push r28 1a49c: df 93 push r29 1a49e: 6c 01 movw r12, r24 1a4a0: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 1a4a2: c4 2f mov r28, r20 1a4a4: d0 e0 ldi r29, 0x00 ; 0 1a4a6: ae 01 movw r20, r28 1a4a8: 0f 94 25 db call 0x3b64a ; 0x3b64a 1a4ac: 89 2b or r24, r25 1a4ae: b9 f4 brne .+46 ; 0x1a4de Number(str + tagSize, v); 1a4b0: b8 01 movw r22, r16 1a4b2: c6 01 movw r24, r12 1a4b4: 8c 0f add r24, r28 1a4b6: 9d 1f adc r25, r29 1a4b8: 0e 94 72 d0 call 0x1a0e4 ; 0x1a0e4 *v |= tagMask; 1a4bc: f8 01 movw r30, r16 1a4be: 20 81 ld r18, Z 1a4c0: 31 81 ldd r19, Z+1 ; 0x01 1a4c2: 2e 29 or r18, r14 1a4c4: 3f 29 or r19, r15 1a4c6: 31 83 std Z+1, r19 ; 0x01 1a4c8: 20 83 st Z, r18 return true; 1a4ca: 81 e0 ldi r24, 0x01 ; 1 } return false; } 1a4cc: df 91 pop r29 1a4ce: cf 91 pop r28 1a4d0: 1f 91 pop r17 1a4d2: 0f 91 pop r16 1a4d4: ff 90 pop r15 1a4d6: ef 90 pop r14 1a4d8: df 90 pop r13 1a4da: cf 90 pop r12 1a4dc: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 1a4de: 80 e0 ldi r24, 0x00 ; 0 1a4e0: f5 cf rjmp .-22 ; 0x1a4cc 0001a4e2 : } #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); 1a4e2: 87 ea ldi r24, 0xA7 ; 167 1a4e4: 9c e0 ldi r25, 0x0C ; 12 1a4e6: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c if (value > 1) value = 1; 1a4ea: 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) 1a4ec: 82 30 cpi r24, 0x02 ; 2 1a4ee: 08 f4 brcc .+2 ; 0x1a4f2 1a4f0: 68 27 eor r22, r24 1a4f2: 87 ea ldi r24, 0xA7 ; 167 1a4f4: 9c e0 ldi r25, 0x0C ; 12 1a4f6: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0001a4fa : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 1a4fa: cf 93 push r28 1a4fc: df 93 push r29 1a4fe: c5 e1 ldi r28, 0x15 ; 21 1a500: 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++)); 1a502: fe 01 movw r30, r28 1a504: ef 5b subi r30, 0xBF ; 191 1a506: f0 48 sbci r31, 0x80 ; 128 1a508: 64 91 lpm r22, Z 1a50a: ce 01 movw r24, r28 1a50c: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 1a510: 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++) { 1a512: c9 32 cpi r28, 0x29 ; 41 1a514: 8d e0 ldi r24, 0x0D ; 13 1a516: d8 07 cpc r29, r24 1a518: a1 f7 brne .-24 ; 0x1a502 eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 1a51a: df 91 pop r29 1a51c: cf 91 pop r28 1a51e: 08 95 ret 0001a520 : 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); 1a520: 8a ea ldi r24, 0xAA ; 170 1a522: 9d e0 ldi r25, 0x0D ; 13 1a524: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 1a528: 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) { 1a52a: 83 30 cpi r24, 0x03 ; 3 1a52c: 21 f0 breq .+8 ; 0x1a536 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 1a52e: 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) { 1a530: 85 30 cpi r24, 0x05 ; 5 1a532: 09 f0 breq .+2 ; 0x1a536 case 1: mbl_z_probe_nr = 3; break; 1a534: 63 e0 ldi r22, 0x03 ; 3 1a536: 8a ea ldi r24, 0xAA ; 170 1a538: 9d e0 ldi r25, 0x0D ; 13 1a53a: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0001a53e : 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); 1a53e: 8b ea ldi r24, 0xAB ; 171 1a540: 9d e0 ldi r25, 0x0D ; 13 1a542: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 1a546: 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; 1a548: 83 30 cpi r24, 0x03 ; 3 1a54a: 09 f4 brne .+2 ; 0x1a54e 1a54c: 67 e0 ldi r22, 0x07 ; 7 1a54e: 8b ea ldi r24, 0xAB ; 171 1a550: 9d e0 ldi r25, 0x0D ; 13 1a552: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0001a556 : #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); 1a556: 8c ea ldi r24, 0xAC ; 172 1a558: 9d e0 ldi r25, 0x0D ; 13 1a55a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c magnet_elimination = !magnet_elimination; 1a55e: 61 e0 ldi r22, 0x01 ; 1 1a560: 81 11 cpse r24, r1 1a562: 60 e0 ldi r22, 0x00 ; 0 1a564: 8c ea ldi r24, 0xAC ; 172 1a566: 9d e0 ldi r25, 0x0D ; 13 1a568: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0001a56c : 1a56c: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1a570: 81 ea ldi r24, 0xA1 ; 161 1a572: 9d e0 ldi r25, 0x0D ; 13 1a574: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 //! @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(); 1a578: 0d 94 59 2a jmp 0x254b2 ; 0x254b2 0001a57c : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a57c: 0f 93 push r16 1a57e: 1f 93 push r17 1a580: cf 93 push r28 1a582: df 93 push r29 1a584: 00 d0 rcall .+0 ; 0x1a586 1a586: 00 d0 rcall .+0 ; 0x1a588 1a588: 1f 92 push r1 1a58a: 1f 92 push r1 1a58c: cd b7 in r28, 0x3d ; 61 1a58e: de b7 in r29, 0x3e ; 62 1a590: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a592: 8a e0 ldi r24, 0x0A ; 10 1a594: 90 e0 ldi r25, 0x00 ; 0 1a596: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 1a59a: 9a 83 std Y+2, r25 ; 0x02 1a59c: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a59e: 8c e0 ldi r24, 0x0C ; 12 1a5a0: 90 e0 ldi r25, 0x00 ; 0 1a5a2: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 1a5a6: 9c 83 std Y+4, r25 ; 0x04 1a5a8: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a5aa: 8e e0 ldi r24, 0x0E ; 14 1a5ac: 90 e0 ldi r25, 0x00 ; 0 1a5ae: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 1a5b2: 9e 83 std Y+6, r25 ; 0x06 1a5b4: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a5b6: 80 e1 ldi r24, 0x10 ; 16 1a5b8: 90 e0 ldi r25, 0x00 ; 0 1a5ba: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 1a5be: 98 87 std Y+8, r25 ; 0x08 1a5c0: 8f 83 std Y+7, r24 ; 0x07 1a5c2: c8 01 movw r24, r16 1a5c4: de 01 movw r26, r28 1a5c6: 11 96 adiw r26, 0x01 ; 1 1a5c8: be 01 movw r22, r28 1a5ca: 67 5f subi r22, 0xF7 ; 247 1a5cc: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a5ce: fc 01 movw r30, r24 1a5d0: 25 91 lpm r18, Z+ 1a5d2: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a5d4: 4d 91 ld r20, X+ 1a5d6: 5d 91 ld r21, X+ 1a5d8: 42 17 cp r20, r18 1a5da: 53 07 cpc r21, r19 1a5dc: 48 f0 brcs .+18 ; 0x1a5f0 return true; else if (v < ver_eeprom[i]) 1a5de: 24 17 cp r18, r20 1a5e0: 35 07 cpc r19, r21 1a5e2: 20 f0 brcs .+8 ; 0x1a5ec 1a5e4: 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) { 1a5e6: a6 17 cp r26, r22 1a5e8: b7 07 cpc r27, r23 1a5ea: 89 f7 brne .-30 ; 0x1a5ce return true; else if (v < ver_eeprom[i]) break; } return false; 1a5ec: 80 e0 ldi r24, 0x00 ; 0 1a5ee: 01 c0 rjmp .+2 ; 0x1a5f2 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; 1a5f0: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a5f2: 28 96 adiw r28, 0x08 ; 8 1a5f4: 0f b6 in r0, 0x3f ; 63 1a5f6: f8 94 cli 1a5f8: de bf out 0x3e, r29 ; 62 1a5fa: 0f be out 0x3f, r0 ; 63 1a5fc: cd bf out 0x3d, r28 ; 61 1a5fe: df 91 pop r29 1a600: cf 91 pop r28 1a602: 1f 91 pop r17 1a604: 0f 91 pop r16 1a606: 08 95 ret 0001a608 : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1a608: 0e 94 1f 8a call 0x1143e ; 0x1143e // M24: Start/resume SD print enquecommand_P(MSG_M24); 1a60c: 61 e0 ldi r22, 0x01 ; 1 1a60e: 89 e2 ldi r24, 0x29 ; 41 1a610: 91 e7 ldi r25, 0x71 ; 113 1a612: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_return_to_status(); 1a616: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 0001a61a : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a61a: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a61c: 81 e7 ldi r24, 0x71 ; 113 1a61e: 9d e3 ldi r25, 0x3D ; 61 1a620: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a624: ac 01 movw r20, r24 1a626: 60 e0 ldi r22, 0x00 ; 0 1a628: 80 e0 ldi r24, 0x00 ; 0 1a62a: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_putc_at(0, 1, '\n'); 1a62e: 4a e0 ldi r20, 0x0A ; 10 1a630: 61 e0 ldi r22, 0x01 ; 1 1a632: 80 e0 ldi r24, 0x00 ; 0 1a634: 0e 94 c6 6f call 0xdf8c ; 0xdf8c MENU_BEGIN(); 1a638: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1a63c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a640: 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(); 1a642: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a646: 84 30 cpi r24, 0x04 ; 4 1a648: 18 f5 brcc .+70 ; 0x1a690 1a64a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a64e: 81 11 cpse r24, r1 1a650: 02 c0 rjmp .+4 ; 0x1a656 1a652: c0 93 12 05 sts 0x0512, r28 ; 0x800512 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1a656: 8c e6 ldi r24, 0x6C ; 108 1a658: 9d e3 ldi r25, 0x3D ; 61 1a65a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a65e: 64 e5 ldi r22, 0x54 ; 84 1a660: 7b e3 ldi r23, 0x3B ; 59 1a662: 0f 94 42 ce call 0x39c84 ; 0x39c84 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a666: 86 e6 ldi r24, 0x66 ; 102 1a668: 9d e3 ldi r25, 0x3D ; 61 1a66a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a66e: 6e eb ldi r22, 0xBE ; 190 1a670: 7a e3 ldi r23, 0x3A ; 58 1a672: 0f 94 42 ce call 0x39c84 ; 0x39c84 MENU_END(); 1a676: 0f 94 99 ce call 0x39d32 ; 0x39d32 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a67a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a67e: 8f 5f subi r24, 0xFF ; 255 1a680: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a684: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a688: 8f 5f subi r24, 0xFF ; 255 1a68a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a68e: d9 cf rjmp .-78 ; 0x1a642 // 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(); } 1a690: cf 91 pop r28 1a692: 08 95 ret 0001a694 : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1a694: cf 93 push r28 1a696: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1a698: 84 ed ldi r24, 0xD4 ; 212 1a69a: 93 e0 ldi r25, 0x03 ; 3 1a69c: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1a6a0: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 1a6a4: 81 11 cpse r24, r1 1a6a6: 18 c0 rjmp .+48 ; 0x1a6d8 1a6a8: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 1a6ac: 81 11 cpse r24, r1 1a6ae: 14 c0 rjmp .+40 ; 0x1a6d8 1a6b0: c0 91 66 0e lds r28, 0x0E66 ; 0x800e66 1a6b4: d0 91 67 0e lds r29, 0x0E67 ; 0x800e67 1a6b8: 8a e3 ldi r24, 0x3A ; 58 1a6ba: ca 3d cpi r28, 0xDA ; 218 1a6bc: d8 07 cpc r29, r24 1a6be: 61 f0 breq .+24 ; 0x1a6d8 1a6c0: 8a e3 ldi r24, 0x3A ; 58 1a6c2: c6 3f cpi r28, 0xF6 ; 246 1a6c4: d8 07 cpc r29, r24 1a6c6: 41 f0 breq .+16 ; 0x1a6d8 1a6c8: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 1a6cc: 81 11 cpse r24, r1 1a6ce: 04 c0 rjmp .+8 ; 0x1a6d8 1a6d0: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a6d4: 88 23 and r24, r24 1a6d6: 31 f0 breq .+12 ; 0x1a6e4 { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1a6d8: 82 e0 ldi r24, 0x02 ; 2 1a6da: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a6de: df 91 pop r29 1a6e0: cf 91 pop r28 1a6e2: 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) 1a6e4: 8a e3 ldi r24, 0x3A ; 58 1a6e6: ca 32 cpi r28, 0x2A ; 42 1a6e8: d8 07 cpc r29, r24 1a6ea: 49 f4 brne .+18 ; 0x1a6fe { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1a6ec: 82 e0 ldi r24, 0x02 ; 2 1a6ee: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a6f2: 8a e2 ldi r24, 0x2A ; 42 1a6f4: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a6f6: df 91 pop r29 1a6f8: 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); 1a6fa: 0c 94 d0 77 jmp 0xefa0 ; 0xefa0 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); 1a6fe: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 1a702: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 return; } // explicitely listed menus which are allowed to rise the move-z or live-adj-z functions // The lists are not the same for both functions, so first decide which function is to be performed if (blocks_queued() || printJobOngoing()){ // long press as live-adj-z 1a706: 98 13 cpse r25, r24 1a708: 04 c0 rjmp .+8 ; 0x1a712 1a70a: 0e 94 56 68 call 0xd0ac ; 0xd0ac 1a70e: 88 23 and r24, r24 1a710: 61 f0 breq .+24 ; 0x1a72a if ( babystep_allowed_strict() 1a712: 0e 94 91 68 call 0xd122 ; 0xd122 && (menu_menu == lcd_status_screen // and in listed menus... 1a716: 81 11 cpse r24, r1 1a718: 10 c0 rjmp .+32 ; 0x1a73a Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1a71a: 82 e0 ldi r24, 0x02 ; 2 1a71c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1a720: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a722: df 91 pop r29 1a724: cf 91 pop r28 1a726: 0d 94 34 64 jmp 0x2c868 ; 0x2c868 menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1a72a: 89 e3 ldi r24, 0x39 ; 57 1a72c: cc 38 cpi r28, 0x8C ; 140 1a72e: d8 07 cpc r29, r24 1a730: e1 f4 brne .+56 ; 0x1a76a #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a732: 60 e0 ldi r22, 0x00 ; 0 1a734: 86 ef ldi r24, 0xF6 ; 246 1a736: 9a e3 ldi r25, 0x3A ; 58 1a738: 14 c0 rjmp .+40 ; 0x1a762 // 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... 1a73a: 89 e3 ldi r24, 0x39 ; 57 1a73c: cc 38 cpi r28, 0x8C ; 140 1a73e: d8 07 cpc r29, r24 1a740: 59 f0 breq .+22 ; 0x1a758 || menu_menu == lcd_main_menu 1a742: 84 ee ldi r24, 0xE4 ; 228 1a744: c1 3d cpi r28, 0xD1 ; 209 1a746: d8 07 cpc r29, r24 1a748: 39 f0 breq .+14 ; 0x1a758 || menu_menu == lcd_tune_menu 1a74a: 84 ed ldi r24, 0xD4 ; 212 1a74c: cb 3f cpi r28, 0xFB ; 251 1a74e: d8 07 cpc r29, r24 1a750: 19 f0 breq .+6 ; 0x1a758 || menu_menu == lcd_support_menu 1a752: c8 53 subi r28, 0x38 ; 56 1a754: db 43 sbci r29, 0x3B ; 59 1a756: 09 f7 brne .-62 ; 0x1a71a ) ){ lcd_clear(); 1a758: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 menu_submenu(lcd_babystep_z); 1a75c: 60 e0 ldi r22, 0x00 ; 0 1a75e: 8a ed ldi r24, 0xDA ; 218 1a760: 9a e3 ldi r25, 0x3A ; 58 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a762: df 91 pop r29 1a764: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a766: 0d 94 32 d0 jmp 0x3a064 ; 0x3a064 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1a76a: 84 ee ldi r24, 0xE4 ; 228 1a76c: c1 3d cpi r28, 0xD1 ; 209 1a76e: d8 07 cpc r29, r24 1a770: 01 f3 breq .-64 ; 0x1a732 || menu_menu == lcd_preheat_menu 1a772: 89 e3 ldi r24, 0x39 ; 57 1a774: c4 3c cpi r28, 0xC4 ; 196 1a776: d8 07 cpc r29, r24 1a778: e1 f2 breq .-72 ; 0x1a732 || menu_menu == lcd_sdcard_menu 1a77a: 89 e3 ldi r24, 0x39 ; 57 1a77c: c8 38 cpi r28, 0x88 ; 136 1a77e: d8 07 cpc r29, r24 1a780: c1 f2 breq .-80 ; 0x1a732 || menu_menu == lcd_settings_menu 1a782: 8a e3 ldi r24, 0x3A ; 58 1a784: c2 31 cpi r28, 0x12 ; 18 1a786: d8 07 cpc r29, r24 1a788: a1 f2 breq .-88 ; 0x1a732 || menu_menu == lcd_control_temperature_menu 1a78a: 84 ed ldi r24, 0xD4 ; 212 1a78c: cb 3d cpi r28, 0xDB ; 219 1a78e: d8 07 cpc r29, r24 1a790: 81 f2 breq .-96 ; 0x1a732 #if (LANG_MODE != 0) || menu_menu == lcd_language 1a792: 89 e3 ldi r24, 0x39 ; 57 1a794: c4 3d cpi r28, 0xD4 ; 212 1a796: d8 07 cpc r29, r24 1a798: 61 f2 breq .-104 ; 0x1a732 #endif || menu_menu == lcd_support_menu 1a79a: c8 53 subi r28, 0x38 ; 56 1a79c: db 43 sbci r29, 0x3B ; 59 1a79e: 09 f0 breq .+2 ; 0x1a7a2 1a7a0: bc cf rjmp .-136 ; 0x1a71a 1a7a2: c7 cf rjmp .-114 ; 0x1a732 0001a7a4 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a7a4: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1a7a8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a7ac: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a7b0: 84 30 cpi r24, 0x04 ; 4 1a7b2: 08 f0 brcs .+2 ; 0x1a7b6 1a7b4: 3f c0 rjmp .+126 ; 0x1a834 1a7b6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a7ba: 8d e3 ldi r24, 0x3D ; 61 1a7bc: 9b e3 ldi r25, 0x3B ; 59 1a7be: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a7c2: 0f 94 90 d1 call 0x3a320 ; 0x3a320 if(eeprom_is_sheet_initialized(selected_sheet)){ 1a7c6: 80 91 da 03 lds r24, 0x03DA ; 0x8003da 1a7ca: 0e 94 dd 77 call 0xefba ; 0xefba 1a7ce: 88 23 and r24, r24 1a7d0: 41 f0 breq .+16 ; 0x1a7e2 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a7d2: 84 e3 ldi r24, 0x34 ; 52 1a7d4: 9b e3 ldi r25, 0x3B ; 59 1a7d6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a7da: 6b e0 ldi r22, 0x0B ; 11 1a7dc: 79 ed ldi r23, 0xD9 ; 217 1a7de: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } if (lcd_commands_type == LcdCommands::Idle) 1a7e2: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1a7e6: 81 11 cpse r24, r1 1a7e8: 08 c0 rjmp .+16 ; 0x1a7fa { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a7ea: 81 e2 ldi r24, 0x21 ; 33 1a7ec: 9b e3 ldi r25, 0x3B ; 59 1a7ee: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a7f2: 66 eb ldi r22, 0xB6 ; 182 1a7f4: 72 ed ldi r23, 0xD2 ; 210 1a7f6: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a7fa: 88 e1 ldi r24, 0x18 ; 24 1a7fc: 9b e3 ldi r25, 0x3B ; 59 1a7fe: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a802: 6e ec ldi r22, 0xCE ; 206 1a804: 76 ed ldi r23, 0xD6 ; 214 1a806: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a80a: 80 e1 ldi r24, 0x10 ; 16 1a80c: 9b e3 ldi r25, 0x3B ; 59 1a80e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a812: 63 ef ldi r22, 0xF3 ; 243 1a814: 76 ee ldi r23, 0xE6 ; 230 1a816: 0f 94 42 ce call 0x39c84 ; 0x39c84 MENU_END(); 1a81a: 0f 94 99 ce call 0x39d32 ; 0x39d32 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a81e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a822: 8f 5f subi r24, 0xFF ; 255 1a824: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a828: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a82c: 8f 5f subi r24, 0xFF ; 255 1a82e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a832: bc cf rjmp .-136 ; 0x1a7ac } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a834: 08 95 ret 0001a836 () [clone .lto_priv.453]>: } template static void select_sheet_menu() { selected_sheet = number; 1a836: 87 e0 ldi r24, 0x07 ; 7 1a838: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a83c: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 0001a840 () [clone .lto_priv.452]>: } template static void select_sheet_menu() { selected_sheet = number; 1a840: 86 e0 ldi r24, 0x06 ; 6 1a842: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a846: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 0001a84a () [clone .lto_priv.451]>: } template static void select_sheet_menu() { selected_sheet = number; 1a84a: 85 e0 ldi r24, 0x05 ; 5 1a84c: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a850: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 0001a854 () [clone .lto_priv.450]>: } template static void select_sheet_menu() { selected_sheet = number; 1a854: 84 e0 ldi r24, 0x04 ; 4 1a856: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a85a: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 0001a85e () [clone .lto_priv.449]>: } template static void select_sheet_menu() { selected_sheet = number; 1a85e: 83 e0 ldi r24, 0x03 ; 3 1a860: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a864: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 0001a868 () [clone .lto_priv.448]>: } template static void select_sheet_menu() { selected_sheet = number; 1a868: 82 e0 ldi r24, 0x02 ; 2 1a86a: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a86e: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 0001a872 () [clone .lto_priv.447]>: } template static void select_sheet_menu() { selected_sheet = number; 1a872: 81 e0 ldi r24, 0x01 ; 1 1a874: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a878: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 0001a87c () [clone .lto_priv.446]>: } template static void select_sheet_menu() { selected_sheet = number; 1a87c: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_sheet_menu(); 1a880: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 0001a884 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a884: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1a888: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a88c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a890: 84 30 cpi r24, 0x04 ; 4 1a892: 08 f0 brcs .+2 ; 0x1a896 1a894: 8f c0 rjmp .+286 ; 0x1a9b4 1a896: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1a89a: 8c ea ldi r24, 0xAC ; 172 1a89c: 9d e3 ldi r25, 0x3D ; 61 1a89e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a8a2: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1a8a6: 82 ec ldi r24, 0xC2 ; 194 1a8a8: 9a e3 ldi r25, 0x3A ; 58 1a8aa: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a8ae: 6c ee ldi r22, 0xEC ; 236 1a8b0: 79 e3 ldi r23, 0x39 ; 57 1a8b2: 0f 94 42 ce call 0x39c84 ; 0x39c84 if (lcd_commands_type == LcdCommands::Idle) 1a8b6: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1a8ba: 81 11 cpse r24, r1 1a8bc: 08 c0 rjmp .+16 ; 0x1a8ce { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1a8be: 81 e2 ldi r24, 0x21 ; 33 1a8c0: 9b e3 ldi r25, 0x3B ; 59 1a8c2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a8c6: 6e ed ldi r22, 0xDE ; 222 1a8c8: 7a e3 ldi r23, 0x3A ; 58 1a8ca: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1a8ce: 81 e8 ldi r24, 0x81 ; 129 1a8d0: 99 e4 ldi r25, 0x49 ; 73 1a8d2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a8d6: 6b e5 ldi r22, 0x5B ; 91 1a8d8: 7c e6 ldi r23, 0x6C ; 108 1a8da: 0f 94 bb cd call 0x39b76 ; 0x39b76 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1a8de: 86 eb ldi r24, 0xB6 ; 182 1a8e0: 9a e3 ldi r25, 0x3A ; 58 1a8e2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a8e6: 6a e0 ldi r22, 0x0A ; 10 1a8e8: 7b e3 ldi r23, 0x3B ; 59 1a8ea: 0f 94 42 ce call 0x39c84 ; 0x39c84 #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1a8ee: 8b ea ldi r24, 0xAB ; 171 1a8f0: 9a e3 ldi r25, 0x3A ; 58 1a8f2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a8f6: 6c eb ldi r22, 0xBC ; 188 1a8f8: 7a e3 ldi r23, 0x3A ; 58 1a8fa: 0f 94 42 ce call 0x39c84 ; 0x39c84 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1a8fe: 8b e9 ldi r24, 0x9B ; 155 1a900: 9a e3 ldi r25, 0x3A ; 58 1a902: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a906: 68 ee ldi r22, 0xE8 ; 232 1a908: 79 e3 ldi r23, 0x39 ; 57 1a90a: 0f 94 42 ce call 0x39c84 ; 0x39c84 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1a90e: 8d e8 ldi r24, 0x8D ; 141 1a910: 9a e3 ldi r25, 0x3A ; 58 1a912: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a916: 6e e1 ldi r22, 0x1E ; 30 1a918: 7a e3 ldi r23, 0x3A ; 58 1a91a: 0f 94 42 ce call 0x39c84 ; 0x39c84 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1a91e: 89 e7 ldi r24, 0x79 ; 121 1a920: 9a e3 ldi r25, 0x3A ; 58 1a922: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a926: 60 e8 ldi r22, 0x80 ; 128 1a928: 7a e3 ldi r23, 0x3A ; 58 1a92a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1a92e: 85 e6 ldi r24, 0x65 ; 101 1a930: 9a e3 ldi r25, 0x3A ; 58 1a932: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a936: 62 e8 ldi r22, 0x82 ; 130 1a938: 79 e3 ldi r23, 0x39 ; 57 1a93a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1a93e: 83 e5 ldi r24, 0x53 ; 83 1a940: 9a e3 ldi r25, 0x3A ; 58 1a942: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a946: 66 eb ldi r22, 0xB6 ; 182 1a948: 7a e3 ldi r23, 0x3A ; 58 1a94a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #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")); 1a94e: 8f e3 ldi r24, 0x3F ; 63 1a950: 9a e3 ldi r25, 0x3A ; 58 1a952: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a956: 6a e5 ldi r22, 0x5A ; 90 1a958: 7b e8 ldi r23, 0x8B ; 139 1a95a: 0f 94 bb cd call 0x39b76 ; 0x39b76 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1a95e: 20 e0 ldi r18, 0x00 ; 0 1a960: 30 e0 ldi r19, 0x00 ; 0 1a962: 40 e2 ldi r20, 0x20 ; 32 1a964: 51 e4 ldi r21, 0x41 ; 65 1a966: 60 91 95 03 lds r22, 0x0395 ; 0x800395 1a96a: 70 91 96 03 lds r23, 0x0396 ; 0x800396 1a96e: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1a972: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1a976: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1a97a: 87 fd sbrc r24, 7 1a97c: 08 c0 rjmp .+16 ; 0x1a98e MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1a97e: 82 e3 ldi r24, 0x32 ; 50 1a980: 9a e3 ldi r25, 0x3A ; 58 1a982: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a986: 68 ed ldi r22, 0xD8 ; 216 1a988: 79 e3 ldi r23, 0x39 ; 57 1a98a: 0f 94 42 ce call 0x39c84 ; 0x39c84 #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1a98e: 60 e9 ldi r22, 0x90 ; 144 1a990: 70 ed ldi r23, 0xD0 ; 208 1a992: 82 e2 ldi r24, 0x22 ; 34 1a994: 9b e6 ldi r25, 0x6B ; 107 1a996: 0f 94 42 ce call 0x39c84 ; 0x39c84 #endif //THERMAL_MODEL MENU_END(); 1a99a: 0f 94 99 ce call 0x39d32 ; 0x39d32 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a99e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a9a2: 8f 5f subi r24, 0xFF ; 255 1a9a4: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a9a8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a9ac: 8f 5f subi r24, 0xFF ; 255 1a9ae: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a9b2: 6c cf rjmp .-296 ; 0x1a88c #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1a9b4: 08 95 ret 0001a9b6 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a9b6: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1a9ba: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a9be: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a9c2: 84 30 cpi r24, 0x04 ; 4 1a9c4: b8 f4 brcc .+46 ; 0x1a9f4 1a9c6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a9ca: 8b e5 ldi r24, 0x5B ; 91 1a9cc: 9d e3 ldi r25, 0x3D ; 61 1a9ce: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1a9d2: 0f 94 90 d1 call 0x3a320 ; 0x3a320 menuitems_temperature_common(); 1a9d6: 0f 94 ab 32 call 0x26556 ; 0x26556 MENU_END(); 1a9da: 0f 94 99 ce call 0x39d32 ; 0x39d32 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a9de: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a9e2: 8f 5f subi r24, 0xFF ; 255 1a9e4: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a9e8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a9ec: 8f 5f subi r24, 0xFF ; 255 1a9ee: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a9f2: e5 cf rjmp .-54 ; 0x1a9be MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1a9f4: 08 95 ret 0001a9f6 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1a9f6: ef 92 push r14 1a9f8: ff 92 push r15 1a9fa: 0f 93 push r16 1a9fc: 1f 93 push r17 1a9fe: cf 93 push r28 1aa00: df 93 push r29 1aa02: 80 91 94 02 lds r24, 0x0294 ; 0x800294 1aa06: 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) 1aa0a: 20 91 b2 03 lds r18, 0x03B2 ; 0x8003b2 1aa0e: 21 11 cpse r18, r1 1aa10: 97 c0 rjmp .+302 ; 0x1ab40 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1aa12: 21 e0 ldi r18, 0x01 ; 1 1aa14: 20 93 b2 03 sts 0x03B2, r18 ; 0x8003b2 _md->extrudemultiply = extrudemultiply; 1aa18: 90 93 b4 03 sts 0x03B4, r25 ; 0x8003b4 1aa1c: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 1aa20: 8f ef ldi r24, 0xFF ; 255 1aa22: 9f e0 ldi r25, 0x0F ; 15 1aa24: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1aa28: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 MENU_BEGIN(); 1aa2c: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1aa30: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1aa34: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1aa38: 84 30 cpi r24, 0x04 ; 4 1aa3a: 08 f0 brcs .+2 ; 0x1aa3e 1aa3c: 99 c0 rjmp .+306 ; 0x1ab70 1aa3e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1aa42: 0f 94 45 cd call 0x39a8a ; 0x39a8a 1aa46: 81 11 cpse r24, r1 1aa48: 0e 94 a9 65 call 0xcb52 ; 0xcb52 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1aa4c: 8c ea ldi r24, 0xAC ; 172 1aa4e: 9d e3 ldi r25, 0x3D ; 61 1aa50: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1aa54: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1aa58: 83 ee ldi r24, 0xE3 ; 227 1aa5a: 9c e3 ldi r25, 0x3C ; 60 1aa5c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1aa60: f1 2c mov r15, r1 1aa62: e1 2c mov r14, r1 1aa64: 07 ee ldi r16, 0xE7 ; 231 1aa66: 13 e0 ldi r17, 0x03 ; 3 1aa68: 2a e0 ldi r18, 0x0A ; 10 1aa6a: 30 e0 ldi r19, 0x00 ; 0 1aa6c: 40 e1 ldi r20, 0x10 ; 16 1aa6e: 69 e3 ldi r22, 0x39 ; 57 1aa70: 72 e0 ldi r23, 0x02 ; 2 1aa72: 0f 94 15 cf call 0x39e2a ; 0x39e2a menuitems_temperature_common(); 1aa76: 0f 94 ab 32 call 0x26556 ; 0x26556 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1aa7a: 8c ed ldi r24, 0xDC ; 220 1aa7c: 9c e3 ldi r25, 0x3C ; 60 1aa7e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1aa82: 2a e0 ldi r18, 0x0A ; 10 1aa84: 30 e0 ldi r19, 0x00 ; 0 1aa86: 40 e1 ldi r20, 0x10 ; 16 1aa88: 64 e9 ldi r22, 0x94 ; 148 1aa8a: 72 e0 ldi r23, 0x02 ; 2 1aa8c: 0f 94 15 cf call 0x39e2a ; 0x39e2a #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); 1aa90: 8a ec ldi r24, 0xCA ; 202 1aa92: 9c e3 ldi r25, 0x3C ; 60 1aa94: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1aa98: 6e ee ldi r22, 0xEE ; 238 1aa9a: 79 e3 ldi r23, 0x39 ; 57 1aa9c: 0f 94 42 ce call 0x39c84 ; 0x39c84 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1aaa0: 0e 94 4b 68 call 0xd096 ; 0xd096 1aaa4: 88 23 and r24, r24 1aaa6: 41 f0 breq .+16 ; 0x1aab8 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1aaa8: 81 e8 ldi r24, 0x81 ; 129 1aaaa: 99 e4 ldi r25, 0x49 ; 73 1aaac: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1aab0: 6e e5 ldi r22, 0x5E ; 94 1aab2: 7b e8 ldi r23, 0x8B ; 139 1aab4: 0f 94 bb cd call 0x39b76 ; 0x39b76 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1aab8: 8c eb ldi r24, 0xBC ; 188 1aaba: 9c e3 ldi r25, 0x3C ; 60 1aabc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1aac0: 60 ea ldi r22, 0xA0 ; 160 1aac2: 79 e3 ldi r23, 0x39 ; 57 1aac4: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1aac8: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1aacc: 81 30 cpi r24, 0x01 ; 1 1aace: 11 f4 brne .+4 ; 0x1aad4 { menuitems_MMU_settings_common(); 1aad0: 0f 94 48 33 call 0x26690 ; 0x26690 } SETTINGS_FANS_CHECK(); 1aad4: 0f 94 91 32 call 0x26522 ; 0x26522 SETTINGS_SILENT_MODE(); 1aad8: 0f 94 e4 32 call 0x265c8 ; 0x265c8 SETTINGS_SOUND; 1aadc: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1aae0: 82 30 cpi r24, 0x02 ; 2 1aae2: 09 f4 brne .+2 ; 0x1aae6 1aae4: 3f c0 rjmp .+126 ; 0x1ab64 1aae6: 83 30 cpi r24, 0x03 ; 3 1aae8: 09 f4 brne .+2 ; 0x1aaec 1aaea: 3f c0 rjmp .+126 ; 0x1ab6a 1aaec: 81 30 cpi r24, 0x01 ; 1 1aaee: b9 f1 breq .+110 ; 0x1ab5e 1aaf0: 85 eb ldi r24, 0xB5 ; 181 1aaf2: 9c e3 ldi r25, 0x3C ; 60 1aaf4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1aaf8: ec 01 movw r28, r24 1aafa: 8d ea ldi r24, 0xAD ; 173 1aafc: 9c e3 ldi r25, 0x3C ; 60 1aafe: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ab02: 22 e0 ldi r18, 0x02 ; 2 1ab04: 44 e3 ldi r20, 0x34 ; 52 1ab06: 5b e3 ldi r21, 0x3B ; 59 1ab08: be 01 movw r22, r28 1ab0a: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #ifdef LCD_BL_PIN if (backlightSupport) 1ab0e: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 1ab12: 88 23 and r24, r24 1ab14: 41 f0 breq .+16 ; 0x1ab26 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1ab16: 87 e8 ldi r24, 0x87 ; 135 1ab18: 9c e3 ldi r25, 0x3C ; 60 1ab1a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ab1e: 6b ea ldi r22, 0xAB ; 171 1ab20: 77 ed ldi r23, 0xD7 ; 215 1ab22: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } #endif //LCD_BL_PIN MENU_END(); 1ab26: 0f 94 99 ce call 0x39d32 ; 0x39d32 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1ab2a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1ab2e: 8f 5f subi r24, 0xFF ; 255 1ab30: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1ab34: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1ab38: 8f 5f subi r24, 0xFF ; 255 1ab3a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1ab3e: 7a cf rjmp .-268 ; 0x1aa34 { // 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) 1ab40: 20 91 b3 03 lds r18, 0x03B3 ; 0x8003b3 1ab44: 30 91 b4 03 lds r19, 0x03B4 ; 0x8003b4 1ab48: 28 17 cp r18, r24 1ab4a: 39 07 cpc r19, r25 1ab4c: 09 f4 brne .+2 ; 0x1ab50 1ab4e: 68 cf rjmp .-304 ; 0x1aa20 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1ab50: 90 93 b4 03 sts 0x03B4, r25 ; 0x8003b4 1ab54: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 calculate_extruder_multipliers(); 1ab58: 0e 94 7f 66 call 0xccfe ; 0xccfe 1ab5c: 61 cf rjmp .-318 ; 0x1aa20 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1ab5e: 86 ea ldi r24, 0xA6 ; 166 1ab60: 9c e3 ldi r25, 0x3C ; 60 1ab62: c8 cf rjmp .-112 ; 0x1aaf4 1ab64: 8d e9 ldi r24, 0x9D ; 157 1ab66: 9c e3 ldi r25, 0x3C ; 60 1ab68: c5 cf rjmp .-118 ; 0x1aaf4 1ab6a: 84 e9 ldi r24, 0x94 ; 148 1ab6c: 9c e3 ldi r25, 0x3C ; 60 1ab6e: c2 cf rjmp .-124 ; 0x1aaf4 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1ab70: df 91 pop r29 1ab72: cf 91 pop r28 1ab74: 1f 91 pop r17 1ab76: 0f 91 pop r16 1ab78: ff 90 pop r15 1ab7a: ef 90 pop r14 1ab7c: 08 95 ret 0001ab7e : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1ab7e: bf 92 push r11 1ab80: cf 92 push r12 1ab82: df 92 push r13 1ab84: ef 92 push r14 1ab86: ff 92 push r15 1ab88: 0f 93 push r16 1ab8a: 1f 93 push r17 1ab8c: cf 93 push r28 1ab8e: df 93 push r29 1ab90: c8 2f mov r28, r24 1ab92: f6 2e mov r15, r22 1ab94: e4 2e mov r14, r20 1ab96: b2 2e mov r11, r18 1ab98: 68 01 movw r12, r16 lcd_update_enable(false); 1ab9a: 80 e0 ldi r24, 0x00 ; 0 1ab9c: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1aba0: dc e7 ldi r29, 0x7C ; 124 1aba2: fe 14 cp r15, r14 1aba4: 08 f0 brcs .+2 ; 0x1aba8 1aba6: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1aba8: bb 20 and r11, r11 1abaa: 09 f1 breq .+66 ; 0x1abee lcd_clear(); 1abac: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1abb0: c1 11 cpse r28, r1 1abb2: 20 c0 rjmp .+64 ; 0x1abf4 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1abb4: 8b ee ldi r24, 0xEB ; 235 1abb6: 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)); 1abb8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1abbc: 0e 94 91 6f call 0xdf22 ; 0xdf22 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1abc0: 88 ef ldi r24, 0xF8 ; 248 1abc2: 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 1abc4: 82 30 cpi r24, 0x02 ; 2 1abc6: 78 f5 brcc .+94 ; 0x1ac26 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1abc8: 83 e9 ldi r24, 0x93 ; 147 1abca: 9f e3 ldi r25, 0x3F ; 63 1abcc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1abd0: 0e 94 91 6f call 0xdf22 ; 0xdf22 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)); 1abd4: 82 e7 ldi r24, 0x72 ; 114 1abd6: 9f e3 ldi r25, 0x3F ; 63 1abd8: cc 30 cpi r28, 0x0C ; 12 1abda: 49 f1 breq .+82 ; 0x1ac2e if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1abdc: 86 ef ldi r24, 0xF6 ; 246 1abde: 93 e4 ldi r25, 0x43 ; 67 1abe0: cd 30 cpi r28, 0x0D ; 13 1abe2: 29 f1 breq .+74 ; 0x1ac2e if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1abe4: ce 30 cpi r28, 0x0E ; 14 1abe6: 39 f5 brne .+78 ; 0x1ac36 1abe8: 8f e5 ldi r24, 0x5F ; 95 1abea: 9f e3 ldi r25, 0x3F ; 63 1abec: 20 c0 rjmp .+64 ; 0x1ac2e lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1abee: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 1abf2: de cf rjmp .-68 ; 0x1abb0 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1abf4: c1 30 cpi r28, 0x01 ; 1 1abf6: f1 f2 breq .-68 ; 0x1abb4 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1abf8: c2 30 cpi r28, 0x02 ; 2 1abfa: e1 f2 breq .-72 ; 0x1abb4 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1abfc: 8a ee ldi r24, 0xEA ; 234 1abfe: 9f e3 ldi r25, 0x3F ; 63 1ac00: c3 30 cpi r28, 0x03 ; 3 1ac02: d1 f2 breq .-76 ; 0x1abb8 if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1ac04: 88 ed ldi r24, 0xD8 ; 216 1ac06: 9f e3 ldi r25, 0x3F ; 63 1ac08: c4 30 cpi r28, 0x04 ; 4 1ac0a: b1 f2 breq .-84 ; 0x1abb8 if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1ac0c: 86 ec ldi r24, 0xC6 ; 198 1ac0e: 9f e3 ldi r25, 0x3F ; 63 1ac10: c5 30 cpi r28, 0x05 ; 5 1ac12: 91 f2 breq .-92 ; 0x1abb8 if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1ac14: 84 eb ldi r24, 0xB4 ; 180 1ac16: 9f e3 ldi r25, 0x3F ; 63 1ac18: c6 30 cpi r28, 0x06 ; 6 1ac1a: 71 f2 breq .-100 ; 0x1abb8 if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1ac1c: c7 30 cpi r28, 0x07 ; 7 1ac1e: 81 f6 brne .-96 ; 0x1abc0 1ac20: 85 ea ldi r24, 0xA5 ; 165 1ac22: 9f e3 ldi r25, 0x3F ; 63 1ac24: c9 cf rjmp .-110 ; 0x1abb8 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)); 1ac26: ca 30 cpi r28, 0x0A ; 10 1ac28: 99 f5 brne .+102 ; 0x1ac90 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1ac2a: 80 e8 ldi r24, 0x80 ; 128 1ac2c: 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)); 1ac2e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ac32: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1ac36: 41 e4 ldi r20, 0x41 ; 65 1ac38: 5c e8 ldi r21, 0x8C ; 140 1ac3a: 61 e0 ldi r22, 0x01 ; 1 1ac3c: 80 e0 ldi r24, 0x00 ; 0 1ac3e: 0e 94 ba 6f call 0xdf74 ; 0xdf74 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1ac42: c3 30 cpi r28, 0x03 ; 3 1ac44: 70 f5 brcc .+92 ; 0x1aca2 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1ac46: 81 e5 ldi r24, 0x51 ; 81 1ac48: 9f e3 ldi r25, 0x3F ; 63 1ac4a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ac4e: ac 01 movw r20, r24 1ac50: 62 e0 ldi r22, 0x02 ; 2 1ac52: 80 e0 ldi r24, 0x00 ; 0 1ac54: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(18, 2); 1ac58: 62 e0 ldi r22, 0x02 ; 2 1ac5a: 82 e1 ldi r24, 0x12 ; 18 1ac5c: 0e 94 a6 6f call 0xdf4c ; 0xdf4c (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1ac60: c1 11 cpse r28, r1 1ac62: 1a c0 rjmp .+52 ; 0x1ac98 1ac64: 8d 2f mov r24, r29 1ac66: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1ac6a: 84 e4 ldi r24, 0x44 ; 68 1ac6c: 9f e3 ldi r25, 0x3F ; 63 1ac6e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ac72: ac 01 movw r20, r24 1ac74: 63 e0 ldi r22, 0x03 ; 3 1ac76: 80 e0 ldi r24, 0x00 ; 0 1ac78: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(18, 3); 1ac7c: 63 e0 ldi r22, 0x03 ; 3 1ac7e: 82 e1 ldi r24, 0x12 ; 18 1ac80: 0e 94 a6 6f call 0xdf4c ; 0xdf4c (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1ac84: c2 30 cpi r28, 0x02 ; 2 1ac86: 19 f1 breq .+70 ; 0x1acce 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); 1ac88: 8d 2f mov r24, r29 1ac8a: 0e 94 95 6f call 0xdf2a ; 0xdf2a 1ac8e: 23 c0 rjmp .+70 ; 0x1acd6 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)); 1ac90: cb 30 cpi r28, 0x0B ; 11 1ac92: 09 f0 breq .+2 ; 0x1ac96 1ac94: 9f cf rjmp .-194 ; 0x1abd4 1ac96: c9 cf rjmp .-110 ; 0x1ac2a 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); 1ac98: 8d ee ldi r24, 0xED ; 237 1ac9a: 9b e6 ldi r25, 0x6B ; 107 1ac9c: 0e 94 91 6f call 0xdf22 ; 0xdf22 1aca0: e4 cf rjmp .-56 ; 0x1ac6a 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) 1aca2: 86 ef ldi r24, 0xF6 ; 246 1aca4: 8c 0f add r24, r28 1aca6: 82 30 cpi r24, 0x02 ; 2 1aca8: 80 f5 brcc .+96 ; 0x1ad0a { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1acaa: 8f e2 ldi r24, 0x2F ; 47 1acac: 94 e4 ldi r25, 0x44 ; 68 1acae: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1acb2: ac 01 movw r20, r24 1acb4: 62 e0 ldi r22, 0x02 ; 2 1acb6: 80 e0 ldi r24, 0x00 ; 0 1acb8: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_putc(':'); 1acbc: 8a e3 ldi r24, 0x3A ; 58 1acbe: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_set_cursor(18, 2); 1acc2: 62 e0 ldi r22, 0x02 ; 2 1acc4: 82 e1 ldi r24, 0x12 ; 18 1acc6: 0e 94 a6 6f call 0xdf4c ; 0xdf4c (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1acca: ca 30 cpi r28, 0x0A ; 10 1accc: e9 f2 breq .-70 ; 0x1ac88 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); 1acce: 8d ee ldi r24, 0xED ; 237 1acd0: 9b e6 ldi r25, 0x6B ; 107 1acd2: 0e 94 91 6f call 0xdf22 ; 0xdf22 _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); 1acd6: c1 14 cp r12, r1 1acd8: d1 04 cpc r13, r1 1acda: 19 f0 breq .+6 ; 0x1ace2 1acdc: c6 01 movw r24, r12 1acde: 0e 94 98 8e call 0x11d30 ; 0x11d30 _progress++; 1ace2: 81 e0 ldi r24, 0x01 ; 1 1ace4: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1ace6: 4e 2d mov r20, r14 1ace8: 50 e0 ldi r21, 0x00 ; 0 1acea: 44 0f add r20, r20 1acec: 55 1f adc r21, r21 1acee: 84 17 cp r24, r20 1acf0: 15 06 cpc r1, r21 1acf2: 0c f0 brlt .+2 ; 0x1acf6 1acf4: 80 e0 ldi r24, 0x00 ; 0 } 1acf6: df 91 pop r29 1acf8: cf 91 pop r28 1acfa: 1f 91 pop r17 1acfc: 0f 91 pop r16 1acfe: ff 90 pop r15 1ad00: ef 90 pop r14 1ad02: df 90 pop r13 1ad04: cf 90 pop r12 1ad06: bf 90 pop r11 1ad08: 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) 1ad0a: ca 30 cpi r28, 0x0A ; 10 1ad0c: 20 f7 brcc .-56 ; 0x1acd6 { //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); 1ad0e: 41 e0 ldi r20, 0x01 ; 1 1ad10: c4 30 cpi r28, 0x04 ; 4 1ad12: 21 f0 breq .+8 ; 0x1ad1c 1ad14: 42 e0 ldi r20, 0x02 ; 2 1ad16: c3 30 cpi r28, 0x03 ; 3 1ad18: 09 f4 brne .+2 ; 0x1ad1c 1ad1a: 40 e0 ldi r20, 0x00 ; 0 1ad1c: 0d 2f mov r16, r29 1ad1e: 2f e3 ldi r18, 0x3F ; 63 1ad20: 3c e8 ldi r19, 0x8C ; 140 1ad22: 62 e0 ldi r22, 0x02 ; 2 1ad24: 82 e0 ldi r24, 0x02 ; 2 1ad26: 0e 94 8d d1 call 0x1a31a ; 0x1a31a _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1ad2a: 41 e0 ldi r20, 0x01 ; 1 1ad2c: c5 30 cpi r28, 0x05 ; 5 1ad2e: 21 f0 breq .+8 ; 0x1ad38 1ad30: 42 e0 ldi r20, 0x02 ; 2 1ad32: c5 30 cpi r28, 0x05 ; 5 1ad34: 08 f4 brcc .+2 ; 0x1ad38 1ad36: 40 e0 ldi r20, 0x00 ; 0 1ad38: 0d 2f mov r16, r29 1ad3a: 2d e3 ldi r18, 0x3D ; 61 1ad3c: 3c e8 ldi r19, 0x8C ; 140 1ad3e: 68 e0 ldi r22, 0x08 ; 8 1ad40: 82 e0 ldi r24, 0x02 ; 2 1ad42: 0e 94 8d d1 call 0x1a31a ; 0x1a31a _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1ad46: 41 e0 ldi r20, 0x01 ; 1 1ad48: c6 30 cpi r28, 0x06 ; 6 1ad4a: 21 f0 breq .+8 ; 0x1ad54 1ad4c: 42 e0 ldi r20, 0x02 ; 2 1ad4e: c6 30 cpi r28, 0x06 ; 6 1ad50: 08 f4 brcc .+2 ; 0x1ad54 1ad52: 40 e0 ldi r20, 0x00 ; 0 1ad54: 0d 2f mov r16, r29 1ad56: 2b e3 ldi r18, 0x3B ; 59 1ad58: 3c e8 ldi r19, 0x8C ; 140 1ad5a: 6e e0 ldi r22, 0x0E ; 14 1ad5c: 82 e0 ldi r24, 0x02 ; 2 1ad5e: 0e 94 8d d1 call 0x1a31a ; 0x1a31a _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1ad62: 41 e0 ldi r20, 0x01 ; 1 1ad64: c7 30 cpi r28, 0x07 ; 7 1ad66: 21 f0 breq .+8 ; 0x1ad70 1ad68: 42 e0 ldi r20, 0x02 ; 2 1ad6a: c7 30 cpi r28, 0x07 ; 7 1ad6c: 08 f4 brcc .+2 ; 0x1ad70 1ad6e: 40 e0 ldi r20, 0x00 ; 0 1ad70: 0d 2f mov r16, r29 1ad72: 27 e3 ldi r18, 0x37 ; 55 1ad74: 3c e8 ldi r19, 0x8C ; 140 1ad76: 60 e0 ldi r22, 0x00 ; 0 1ad78: 83 e0 ldi r24, 0x03 ; 3 1ad7a: 0e 94 8d d1 call 0x1a31a ; 0x1a31a _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1ad7e: 41 e0 ldi r20, 0x01 ; 1 1ad80: c8 30 cpi r28, 0x08 ; 8 1ad82: 21 f0 breq .+8 ; 0x1ad8c 1ad84: 42 e0 ldi r20, 0x02 ; 2 1ad86: c8 30 cpi r28, 0x08 ; 8 1ad88: 08 f4 brcc .+2 ; 0x1ad8c 1ad8a: 40 e0 ldi r20, 0x00 ; 0 1ad8c: 0d 2f mov r16, r29 1ad8e: 20 e3 ldi r18, 0x30 ; 48 1ad90: 3c e8 ldi r19, 0x8C ; 140 1ad92: 69 e0 ldi r22, 0x09 ; 9 1ad94: 83 e0 ldi r24, 0x03 ; 3 1ad96: 0e 94 8d d1 call 0x1a31a ; 0x1a31a 1ad9a: 9d cf rjmp .-198 ; 0x1acd6 0001ad9c : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1ad9c: cf 93 push r28 1ad9e: 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) 1ada0: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 1ada4: 81 11 cpse r24, r1 1ada6: 18 c0 rjmp .+48 ; 0x1add8 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1ada8: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1adac: 8b e0 ldi r24, 0x0B ; 11 1adae: 68 9f mul r22, r24 1adb0: b0 01 movw r22, r0 1adb2: 11 24 eor r1, r1 1adb4: 67 5b subi r22, 0xB7 ; 183 1adb6: 72 4f sbci r23, 0xF2 ; 242 1adb8: 47 e0 ldi r20, 0x07 ; 7 1adba: 50 e0 ldi r21, 0x00 ; 0 1adbc: 87 ea ldi r24, 0xA7 ; 167 1adbe: 93 e0 ldi r25, 0x03 ; 3 1adc0: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c lcd_encoder = menuData->name[0]; 1adc4: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1adc8: 90 e0 ldi r25, 0x00 ; 0 1adca: 90 93 35 05 sts 0x0535, r25 ; 0x800535 1adce: 80 93 34 05 sts 0x0534, r24 ; 0x800534 menuData->initialized = true; 1add2: 81 e0 ldi r24, 0x01 ; 1 1add4: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1add8: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1addc: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1ade0: 80 97 sbiw r24, 0x20 ; 32 1ade2: 34 f4 brge .+12 ; 0x1adf0 1ade4: 80 e2 ldi r24, 0x20 ; 32 1ade6: 90 e0 ldi r25, 0x00 ; 0 1ade8: 90 93 35 05 sts 0x0535, r25 ; 0x800535 1adec: 80 93 34 05 sts 0x0534, r24 ; 0x800534 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1adf0: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1adf4: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1adf8: 8f 3f cpi r24, 0xFF ; 255 1adfa: 91 05 cpc r25, r1 1adfc: 39 f0 breq .+14 ; 0x1ae0c 1adfe: 34 f0 brlt .+12 ; 0x1ae0c 1ae00: 8f ef ldi r24, 0xFF ; 255 1ae02: 90 e0 ldi r25, 0x00 ; 0 1ae04: 90 93 35 05 sts 0x0535, r25 ; 0x800535 1ae08: 80 93 34 05 sts 0x0534, r24 ; 0x800534 menuData->name[menuData->selected] = lcd_encoder; 1ae0c: e0 91 a6 03 lds r30, 0x03A6 ; 0x8003a6 1ae10: f0 e0 ldi r31, 0x00 ; 0 1ae12: eb 55 subi r30, 0x5B ; 91 1ae14: fc 4f sbci r31, 0xFC ; 252 1ae16: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1ae1a: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1ae1c: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 1ae20: c7 ea ldi r28, 0xA7 ; 167 1ae22: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1ae24: 89 91 ld r24, Y+ 1ae26: 0e 94 95 6f call 0xdf2a ; 0xdf2a 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) 1ae2a: 83 e0 ldi r24, 0x03 ; 3 1ae2c: ce 3a cpi r28, 0xAE ; 174 1ae2e: d8 07 cpc r29, r24 1ae30: c9 f7 brne .-14 ; 0x1ae24 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1ae32: 4e e5 ldi r20, 0x5E ; 94 1ae34: 61 e0 ldi r22, 0x01 ; 1 1ae36: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 1ae3a: 0e 94 c6 6f call 0xdf8c ; 0xdf8c if (menuData->selected > 0) 1ae3e: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 1ae42: 88 23 and r24, r24 1ae44: 29 f0 breq .+10 ; 0x1ae50 { lcd_putc_at(menuData->selected-1, 1, ' '); 1ae46: 40 e2 ldi r20, 0x20 ; 32 1ae48: 61 e0 ldi r22, 0x01 ; 1 1ae4a: 81 50 subi r24, 0x01 ; 1 1ae4c: 0e 94 c6 6f call 0xdf8c ; 0xdf8c } if (lcd_clicked()) 1ae50: 0e 94 c3 71 call 0xe386 ; 0xe386 1ae54: 88 23 and r24, r24 1ae56: 99 f0 breq .+38 ; 0x1ae7e { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1ae58: e0 91 a6 03 lds r30, 0x03A6 ; 0x8003a6 1ae5c: 8e 2f mov r24, r30 1ae5e: 90 e0 ldi r25, 0x00 ; 0 1ae60: 01 96 adiw r24, 0x01 ; 1 1ae62: 07 97 sbiw r24, 0x07 ; 7 1ae64: 78 f4 brcc .+30 ; 0x1ae84 { lcd_encoder = menuData->name[++(menuData->selected)]; 1ae66: ef 5f subi r30, 0xFF ; 255 1ae68: e0 93 a6 03 sts 0x03A6, r30 ; 0x8003a6 1ae6c: f0 e0 ldi r31, 0x00 ; 0 1ae6e: eb 55 subi r30, 0x5B ; 91 1ae70: fc 4f sbci r31, 0xFC ; 252 1ae72: 82 81 ldd r24, Z+2 ; 0x02 1ae74: 90 e0 ldi r25, 0x00 ; 0 1ae76: 90 93 35 05 sts 0x0535, r25 ; 0x800535 1ae7a: 80 93 34 05 sts 0x0534, r24 ; 0x800534 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1ae7e: df 91 pop r29 1ae80: cf 91 pop r28 1ae82: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1ae84: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1ae88: 8b e0 ldi r24, 0x0B ; 11 1ae8a: 68 9f mul r22, r24 1ae8c: b0 01 movw r22, r0 1ae8e: 11 24 eor r1, r1 1ae90: 67 5b subi r22, 0xB7 ; 183 1ae92: 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); 1ae94: 47 e0 ldi r20, 0x07 ; 7 1ae96: 50 e0 ldi r21, 0x00 ; 0 1ae98: 87 ea ldi r24, 0xA7 ; 167 1ae9a: 93 e0 ldi r25, 0x03 ; 3 1ae9c: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1aea0: df 91 pop r29 1aea2: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1aea4: 0d 94 8d d1 jmp 0x3a31a ; 0x3a31a 0001aea8 : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1aea8: cf 93 push r28 1aeaa: df 93 push r29 current_position[axis] += 10; 1aeac: 94 e0 ldi r25, 0x04 ; 4 1aeae: 89 9f mul r24, r25 1aeb0: e0 01 movw r28, r0 1aeb2: 11 24 eor r1, r1 1aeb4: c0 5c subi r28, 0xC0 ; 192 1aeb6: d8 4f sbci r29, 0xF8 ; 248 1aeb8: 20 e0 ldi r18, 0x00 ; 0 1aeba: 30 e0 ldi r19, 0x00 ; 0 1aebc: 40 e2 ldi r20, 0x20 ; 32 1aebe: 51 e4 ldi r21, 0x41 ; 65 1aec0: 68 81 ld r22, Y 1aec2: 79 81 ldd r23, Y+1 ; 0x01 1aec4: 8a 81 ldd r24, Y+2 ; 0x02 1aec6: 9b 81 ldd r25, Y+3 ; 0x03 1aec8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1aecc: 68 83 st Y, r22 1aece: 79 83 std Y+1, r23 ; 0x01 1aed0: 8a 83 std Y+2, r24 ; 0x02 1aed2: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1aed4: 60 e0 ldi r22, 0x00 ; 0 1aed6: 70 e0 ldi r23, 0x00 ; 0 1aed8: 84 e3 ldi r24, 0x34 ; 52 1aeda: 92 e4 ldi r25, 0x42 ; 66 1aedc: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1aee0: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 crashdet_use_eeprom_setting(); } 1aee4: df 91 pop r29 1aee6: 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(); 1aee8: 0d 94 e0 3b jmp 0x277c0 ; 0x277c0 0001aeec : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1aeec: 0f 94 fd 7c call 0x2f9fa ; 0x2f9fa #endif menu_top = 0; 1aef0: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 lcd_encoder = 0; 1aef4: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1aef8: 10 92 34 05 sts 0x0534, r1 ; 0x800534 menu_data_reset(); //Forces reloading of cached variables. 1aefc: 0d 94 e7 ce jmp 0x39dce ; 0x39dce 0001af00 : } } void CardReader::updir() { if(workDirDepth > 0) 1af00: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 1af04: 88 23 and r24, r24 1af06: f9 f0 breq .+62 ; 0x1af46 { --workDirDepth; 1af08: 81 50 subi r24, 0x01 ; 1 1af0a: 80 93 0b 16 sts 0x160B, r24 ; 0x80160b workDir = workDirParents[0]; 1af0e: 93 e2 ldi r25, 0x23 ; 35 1af10: e9 e3 ldi r30, 0x39 ; 57 1af12: f5 e1 ldi r31, 0x15 ; 21 1af14: a6 e1 ldi r26, 0x16 ; 22 1af16: b5 e1 ldi r27, 0x15 ; 21 1af18: 01 90 ld r0, Z+ 1af1a: 0d 92 st X+, r0 1af1c: 9a 95 dec r25 1af1e: e1 f7 brne .-8 ; 0x1af18 1af20: 29 e3 ldi r18, 0x39 ; 57 1af22: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1af24: 90 e0 ldi r25, 0x00 ; 0 1af26: 98 17 cp r25, r24 1af28: 60 f4 brcc .+24 ; 0x1af42 { workDirParents[d] = workDirParents[d+1]; 1af2a: 43 e2 ldi r20, 0x23 ; 35 1af2c: f9 01 movw r30, r18 1af2e: b3 96 adiw r30, 0x23 ; 35 1af30: d9 01 movw r26, r18 1af32: 01 90 ld r0, Z+ 1af34: 0d 92 st X+, r0 1af36: 4a 95 dec r20 1af38: e1 f7 brne .-8 ; 0x1af32 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1af3a: 9f 5f subi r25, 0xFF ; 255 1af3c: 2d 5d subi r18, 0xDD ; 221 1af3e: 3f 4f sbci r19, 0xFF ; 255 1af40: f2 cf rjmp .-28 ; 0x1af26 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1af42: 0f 94 fd 7c call 0x2f9fa ; 0x2f9fa } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1af46: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 lcd_encoder = 0; 1af4a: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1af4e: 10 92 34 05 sts 0x0534, r1 ; 0x800534 menu_data_reset(); //Forces reloading of cached variables. 1af52: 0d 94 e7 ce jmp 0x39dce ; 0x39dce 0001af56 : } backlight_save(); } static void lcd_backlight_menu() { 1af56: ef 92 push r14 1af58: ff 92 push r15 1af5a: 0f 93 push r16 1af5c: 1f 93 push r17 1af5e: cf 93 push r28 1af60: df 93 push r29 MENU_BEGIN(); 1af62: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1af66: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1af6a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1af6e: 84 30 cpi r24, 0x04 ; 4 1af70: 08 f0 brcs .+2 ; 0x1af74 1af72: 63 c0 rjmp .+198 ; 0x1b03a 1af74: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1af78: 0f 94 45 cd call 0x39a8a ; 0x39a8a 1af7c: 81 11 cpse r24, r1 1af7e: 0e 94 73 8b call 0x116e6 ; 0x116e6 backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1af82: 8d e0 ldi r24, 0x0D ; 13 1af84: 90 e4 ldi r25, 0x40 ; 64 1af86: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1af8a: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1af8e: c0 91 f9 03 lds r28, 0x03F9 ; 0x8003f9 1af92: d0 e0 ldi r29, 0x00 ; 0 1af94: 8c e4 ldi r24, 0x4C ; 76 1af96: 9d e3 ldi r25, 0x3D ; 61 1af98: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1af9c: f1 2c mov r15, r1 1af9e: e1 2c mov r14, r1 1afa0: 0f ef ldi r16, 0xFF ; 255 1afa2: 10 e0 ldi r17, 0x00 ; 0 1afa4: 9e 01 movw r18, r28 1afa6: 48 e0 ldi r20, 0x08 ; 8 1afa8: 6a ef ldi r22, 0xFA ; 250 1afaa: 73 e0 ldi r23, 0x03 ; 3 1afac: 0f 94 15 cf call 0x39e2a ; 0x39e2a MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1afb0: 00 91 fa 03 lds r16, 0x03FA ; 0x8003fa 1afb4: 10 e0 ldi r17, 0x00 ; 0 1afb6: 8d e3 ldi r24, 0x3D ; 61 1afb8: 9d e3 ldi r25, 0x3D ; 61 1afba: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1afbe: 30 e0 ldi r19, 0x00 ; 0 1afc0: 20 e0 ldi r18, 0x00 ; 0 1afc2: 48 e0 ldi r20, 0x08 ; 8 1afc4: 69 ef ldi r22, 0xF9 ; 249 1afc6: 73 e0 ldi r23, 0x03 ; 3 1afc8: 0f 94 15 cf call 0x39e2a ; 0x39e2a 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); 1afcc: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1afd0: 81 30 cpi r24, 0x01 ; 1 1afd2: 59 f5 brne .+86 ; 0x1b02a 1afd4: 84 e3 ldi r24, 0x34 ; 52 1afd6: 9d e3 ldi r25, 0x3D ; 61 1afd8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1afdc: ec 01 movw r28, r24 1afde: 80 e2 ldi r24, 0x20 ; 32 1afe0: 9d e3 ldi r25, 0x3D ; 61 1afe2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1afe6: 22 e0 ldi r18, 0x02 ; 2 1afe8: 44 e2 ldi r20, 0x24 ; 36 1afea: 58 ed ldi r21, 0xD8 ; 216 1afec: be 01 movw r22, r28 1afee: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); 1aff2: 86 e1 ldi r24, 0x16 ; 22 1aff4: 9d e3 ldi r25, 0x3D ; 61 1aff6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1affa: f1 2c mov r15, r1 1affc: e1 2c mov r14, r1 1affe: 04 e8 ldi r16, 0x84 ; 132 1b000: 13 e0 ldi r17, 0x03 ; 3 1b002: 2f e0 ldi r18, 0x0F ; 15 1b004: 30 e0 ldi r19, 0x00 ; 0 1b006: 40 e1 ldi r20, 0x10 ; 16 1b008: 6d e4 ldi r22, 0x4D ; 77 1b00a: 72 e0 ldi r23, 0x02 ; 2 1b00c: 0f 94 15 cf call 0x39e2a ; 0x39e2a MENU_END(); 1b010: 0f 94 99 ce call 0x39d32 ; 0x39d32 backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1b014: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b018: 8f 5f subi r24, 0xFF ; 255 1b01a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b01e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b022: 8f 5f subi r24, 0xFF ; 255 1b024: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b028: a0 cf rjmp .-192 ; 0x1af6a ); 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); 1b02a: 81 11 cpse r24, r1 1b02c: 03 c0 rjmp .+6 ; 0x1b034 1b02e: 8e e2 ldi r24, 0x2E ; 46 1b030: 9d e3 ldi r25, 0x3D ; 61 1b032: d2 cf rjmp .-92 ; 0x1afd8 1b034: 87 e2 ldi r24, 0x27 ; 39 1b036: 9d e3 ldi r25, 0x3D ; 61 1b038: cf cf rjmp .-98 ; 0x1afd8 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); MENU_END(); } 1b03a: df 91 pop r29 1b03c: cf 91 pop r28 1b03e: 1f 91 pop r17 1b040: 0f 91 pop r16 1b042: ff 90 pop r15 1b044: ef 90 pop r14 1b046: 08 95 ret 0001b048 : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1b048: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1b04c: 88 23 and r24, r24 1b04e: 31 f0 breq .+12 ; 0x1b05c 1b050: 81 30 cpi r24, 0x01 ; 1 1b052: 41 f4 brne .+16 ; 0x1b064 { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1b054: 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(); 1b058: 0c 94 73 8b jmp 0x116e6 ; 0x116e6 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; 1b05c: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1b05e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1b062: fa cf rjmp .-12 ; 0x1b058 1b064: 81 e0 ldi r24, 0x01 ; 1 1b066: fb cf rjmp .-10 ; 0x1b05e 0001b068 : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 1b068: bf 92 push r11 1b06a: cf 92 push r12 1b06c: df 92 push r13 1b06e: ef 92 push r14 1b070: ff 92 push r15 1b072: 0f 93 push r16 1b074: 1f 93 push r17 1b076: cf 93 push r28 1b078: df 93 push r29 1b07a: 00 d0 rcall .+0 ; 0x1b07c 1b07c: 1f 92 push r1 1b07e: cd b7 in r28, 0x3d ; 61 1b080: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1b082: 8c ea ldi r24, 0xAC ; 172 1b084: 9d e0 ldi r25, 0x0D ; 13 1b086: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1b08a: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1b08c: 8b ea ldi r24, 0xAB ; 171 1b08e: 9d e0 ldi r25, 0x0D ; 13 1b090: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1b094: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1b096: 8a ea ldi r24, 0xAA ; 170 1b098: 9d e0 ldi r25, 0x0D ; 13 1b09a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1b09e: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1b0a0: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1b0a4: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 1b0a8: 80 e3 ldi r24, 0x30 ; 48 1b0aa: d8 2e mov r13, r24 1b0ac: df 0c add r13, r15 sToggle[1] = 'x'; 1b0ae: 98 e7 ldi r25, 0x78 ; 120 1b0b0: 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'; 1b0b2: 20 e3 ldi r18, 0x30 ; 48 1b0b4: e2 2e mov r14, r18 1b0b6: 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(); 1b0b8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b0bc: 84 30 cpi r24, 0x04 ; 4 1b0be: 08 f0 brcs .+2 ; 0x1b0c2 1b0c0: 56 c0 rjmp .+172 ; 0x1b16e 1b0c2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1b0c6: 0f 94 45 cd call 0x39a8a ; 0x39a8a 1b0ca: 88 23 and r24, r24 1b0cc: 31 f0 breq .+12 ; 0x1b0da 1b0ce: 87 e0 ldi r24, 0x07 ; 7 1b0d0: f8 12 cpse r15, r24 1b0d2: 03 c0 rjmp .+6 ; 0x1b0da 1b0d4: 81 e0 ldi r24, 0x01 ; 1 1b0d6: 0f 94 8e 67 call 0x2cf1c ; 0x2cf1c // 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)); 1b0da: 8b e5 ldi r24, 0x5B ; 91 1b0dc: 9d e3 ldi r25, 0x3D ; 61 1b0de: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b0e2: 0f 94 90 d1 call 0x3a320 ; 0x3a320 sToggle[0] = points_nr + '0'; 1b0e6: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1b0e8: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1b0ea: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1b0ec: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1b0ee: 8f e0 ldi r24, 0x0F ; 15 1b0f0: 9d e3 ldi r25, 0x3D ; 61 1b0f2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b0f6: 20 e0 ldi r18, 0x00 ; 0 1b0f8: 4f e9 ldi r20, 0x9F ; 159 1b0fa: 52 ed ldi r21, 0xD2 ; 210 1b0fc: be 01 movw r22, r28 1b0fe: 6f 5f subi r22, 0xFF ; 255 1b100: 7f 4f sbci r23, 0xFF ; 255 1b102: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 sToggle[0] = mbl_z_probe_nr + '0'; 1b106: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1b108: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1b10a: 81 e0 ldi r24, 0x01 ; 1 1b10c: 9d e3 ldi r25, 0x3D ; 61 1b10e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b112: 20 e0 ldi r18, 0x00 ; 0 1b114: 40 e9 ldi r20, 0x90 ; 144 1b116: 52 ed ldi r21, 0xD2 ; 210 1b118: be 01 movw r22, r28 1b11a: 6f 5f subi r22, 0xFF ; 255 1b11c: 7f 4f sbci r23, 0xFF ; 255 1b11e: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 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); 1b122: 87 e0 ldi r24, 0x07 ; 7 1b124: f8 12 cpse r15, r24 1b126: 20 c0 rjmp .+64 ; 0x1b168 1b128: 82 e8 ldi r24, 0x82 ; 130 1b12a: 9d e5 ldi r25, 0x5D ; 93 1b12c: c1 10 cpse r12, r1 1b12e: 02 c0 rjmp .+4 ; 0x1b134 1b130: 8c e7 ldi r24, 0x7C ; 124 1b132: 9d e5 ldi r25, 0x5D ; 93 1b134: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b138: 8c 01 movw r16, r24 1b13a: 8b ee ldi r24, 0xEB ; 235 1b13c: 9c e3 ldi r25, 0x3C ; 60 1b13e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b142: 22 e0 ldi r18, 0x02 ; 2 1b144: 4b ea ldi r20, 0xAB ; 171 1b146: 52 ed ldi r21, 0xD2 ; 210 1b148: b8 01 movw r22, r16 1b14a: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 MENU_END(); 1b14e: 0f 94 99 ce call 0x39d32 ; 0x39d32 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(); 1b152: 90 91 12 05 lds r25, 0x0512 ; 0x800512 1b156: 9f 5f subi r25, 0xFF ; 255 1b158: 90 93 12 05 sts 0x0512, r25 ; 0x800512 1b15c: 90 91 14 05 lds r25, 0x0514 ; 0x800514 1b160: 9f 5f subi r25, 0xFF ; 255 1b162: 90 93 14 05 sts 0x0514, r25 ; 0x800514 1b166: a8 cf rjmp .-176 ; 0x1b0b8 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); 1b168: 8b ef ldi r24, 0xFB ; 251 1b16a: 9c e3 ldi r25, 0x3C ; 60 1b16c: e3 cf rjmp .-58 ; 0x1b134 MENU_END(); } 1b16e: 0f 90 pop r0 1b170: 0f 90 pop r0 1b172: 0f 90 pop r0 1b174: 0f 90 pop r0 1b176: df 91 pop r29 1b178: cf 91 pop r28 1b17a: 1f 91 pop r17 1b17c: 0f 91 pop r16 1b17e: ff 90 pop r15 1b180: ef 90 pop r14 1b182: df 90 pop r13 1b184: cf 90 pop r12 1b186: bf 90 pop r11 1b188: 08 95 ret 0001b18a : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1b18a: cf 93 push r28 MENU_BEGIN(); 1b18c: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1b190: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b194: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b198: 84 30 cpi r24, 0x04 ; 4 1b19a: 60 f5 brcc .+88 ; 0x1b1f4 1b19c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b1a0: 8c ea ldi r24, 0xAC ; 172 1b1a2: 9d e3 ldi r25, 0x3D ; 61 1b1a4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b1a8: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1b1ac: 8e ed ldi r24, 0xDE ; 222 1b1ae: 9a e3 ldi r25, 0x3A ; 58 1b1b0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b1b4: 69 eb ldi r22, 0xB9 ; 185 1b1b6: 79 ed ldi r23, 0xD9 ; 217 1b1b8: 0f 94 42 ce call 0x39c84 ; 0x39c84 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b1bc: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1b1be: 83 ea ldi r24, 0xA3 ; 163 1b1c0: 9b e3 ldi r25, 0x3B ; 59 1b1c2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b1c6: 61 e3 ldi r22, 0x31 ; 49 1b1c8: 6c 0f add r22, r28 1b1ca: 2c 2f mov r18, r28 1b1cc: 48 ec ldi r20, 0xC8 ; 200 1b1ce: 59 ed ldi r21, 0xD9 ; 217 1b1d0: 0f 94 eb cd call 0x39bd6 ; 0x39bd6 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++) 1b1d4: cf 5f subi r28, 0xFF ; 255 1b1d6: c5 30 cpi r28, 0x05 ; 5 1b1d8: 91 f7 brne .-28 ; 0x1b1be MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1b1da: 0f 94 99 ce call 0x39d32 ; 0x39d32 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1b1de: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b1e2: 8f 5f subi r24, 0xFF ; 255 1b1e4: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b1e8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b1ec: 8f 5f subi r24, 0xFF ; 255 1b1ee: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b1f2: d0 cf rjmp .-96 ; 0x1b194 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(); } 1b1f4: cf 91 pop r28 1b1f6: 08 95 ret 0001b1f8 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1b1f8: 84 e0 ldi r24, 0x04 ; 4 1b1fa: 0d 94 cb 69 jmp 0x2d396 ; 0x2d396 0001b1fe : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1b1fe: 85 e0 ldi r24, 0x05 ; 5 1b200: 0d 94 cb 69 jmp 0x2d396 ; 0x2d396 0001b204 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1b204: 86 e0 ldi r24, 0x06 ; 6 1b206: 0d 94 cb 69 jmp 0x2d396 ; 0x2d396 0001b20a : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1b20a: 87 e0 ldi r24, 0x07 ; 7 1b20c: 0d 94 cb 69 jmp 0x2d396 ; 0x2d396 0001b210 : 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); 1b210: 88 e0 ldi r24, 0x08 ; 8 1b212: 0d 94 cb 69 jmp 0x2d396 ; 0x2d396 0001b216 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1b216: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1b21a: 81 ea ldi r24, 0xA1 ; 161 1b21c: 9d e0 ldi r25, 0x0D ; 13 1b21e: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1b222: 83 e0 ldi r24, 0x03 ; 3 1b224: 0d 94 71 d1 jmp 0x3a2e2 ; 0x3a2e2 0001b228 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1b228: cf 93 push r28 MENU_BEGIN(); 1b22a: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1b22e: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b232: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b236: 84 30 cpi r24, 0x04 ; 4 1b238: 88 f5 brcc .+98 ; 0x1b29c 1b23a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1b23e: 0f 94 45 cd call 0x39a8a ; 0x39a8a 1b242: 81 11 cpse r24, r1 1b244: 0f 94 c4 36 call 0x26d88 ; 0x26d88 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b248: 8c ea ldi r24, 0xAC ; 172 1b24a: 9d e3 ldi r25, 0x3D ; 61 1b24c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b250: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1b254: 8e ed ldi r24, 0xDE ; 222 1b256: 9a e3 ldi r25, 0x3A ; 58 1b258: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b25c: 62 ed ldi r22, 0xD2 ; 210 1b25e: 7a e3 ldi r23, 0x3A ; 58 1b260: 0f 94 42 ce call 0x39c84 ; 0x39c84 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b264: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1b266: 83 ea ldi r24, 0xA3 ; 163 1b268: 9b e3 ldi r25, 0x3B ; 59 1b26a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b26e: 61 e3 ldi r22, 0x31 ; 49 1b270: 6c 0f add r22, r28 1b272: 2c 2f mov r18, r28 1b274: 42 e3 ldi r20, 0x32 ; 50 1b276: 5b e3 ldi r21, 0x3B ; 59 1b278: 0f 94 eb cd call 0x39bd6 ; 0x39bd6 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++) 1b27c: cf 5f subi r28, 0xFF ; 255 1b27e: c5 30 cpi r28, 0x05 ; 5 1b280: 91 f7 brne .-28 ; 0x1b266 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1b282: 0f 94 99 ce call 0x39d32 ; 0x39d32 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1b286: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b28a: 8f 5f subi r24, 0xFF ; 255 1b28c: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b290: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b294: 8f 5f subi r24, 0xFF ; 255 1b296: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b29a: cb cf rjmp .-106 ; 0x1b232 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(); } 1b29c: cf 91 pop r28 1b29e: 08 95 ret 0001b2a0 : } // 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)) { 1b2a0: ef 92 push r14 1b2a2: ff 92 push r15 1b2a4: 0f 93 push r16 1b2a6: 1f 93 push r17 1b2a8: cf 93 push r28 1b2aa: 8c 01 movw r16, r24 1b2ac: 7b 01 movw r14, r22 MENU_BEGIN(); 1b2ae: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1b2b2: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b2b6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b2ba: 84 30 cpi r24, 0x04 ; 4 1b2bc: 28 f5 brcc .+74 ; 0x1b308 1b2be: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1b2c2: 0f 94 45 cd call 0x39a8a ; 0x39a8a 1b2c6: 81 11 cpse r24, r1 1b2c8: 0f 94 c4 36 call 0x26d88 ; 0x26d88 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b2cc: 8c ea ldi r24, 0xAC ; 172 1b2ce: 9d e3 ldi r25, 0x3D ; 61 1b2d0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b2d4: 0f 94 90 d1 call 0x3a320 ; 0x3a320 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b2d8: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1b2da: 61 e3 ldi r22, 0x31 ; 49 1b2dc: 6c 0f add r22, r28 1b2de: 2c 2f mov r18, r28 1b2e0: a7 01 movw r20, r14 1b2e2: c8 01 movw r24, r16 1b2e4: 0f 94 eb cd call 0x39bd6 ; 0x39bd6 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b2e8: cf 5f subi r28, 0xFF ; 255 1b2ea: c5 30 cpi r28, 0x05 ; 5 1b2ec: b1 f7 brne .-20 ; 0x1b2da MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1b2ee: 0f 94 99 ce call 0x39d32 ; 0x39d32 // 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(); 1b2f2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b2f6: 8f 5f subi r24, 0xFF ; 255 1b2f8: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b2fc: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b300: 8f 5f subi r24, 0xFF ; 255 1b302: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b306: d7 cf rjmp .-82 ; 0x1b2b6 ); 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(); } 1b308: cf 91 pop r28 1b30a: 1f 91 pop r17 1b30c: 0f 91 pop r16 1b30e: ff 90 pop r15 1b310: ef 90 pop r14 1b312: 08 95 ret 0001b314 : 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); 1b314: 80 e9 ldi r24, 0x90 ; 144 1b316: 9c e5 ldi r25, 0x5C ; 92 1b318: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b31c: 62 ea ldi r22, 0xA2 ; 162 1b31e: 79 ed ldi r23, 0xD9 ; 217 1b320: 0c 94 50 d9 jmp 0x1b2a0 ; 0x1b2a0 0001b324 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1b324: 8f e9 ldi r24, 0x9F ; 159 1b326: 9c e5 ldi r25, 0x5C ; 92 1b328: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b32c: 6e ea ldi r22, 0xAE ; 174 1b32e: 79 ed ldi r23, 0xD9 ; 217 1b330: 0c 94 50 d9 jmp 0x1b2a0 ; 0x1b2a0 0001b334 : 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); 1b334: 83 ea ldi r24, 0xA3 ; 163 1b336: 9b e3 ldi r25, 0x3B ; 59 1b338: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1b33c: 66 e7 ldi r22, 0x76 ; 118 1b33e: 7b e3 ldi r23, 0x3B ; 59 1b340: 0c 94 50 d9 jmp 0x1b2a0 ; 0x1b2a0 0001b344 : 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){ 1b344: cf 93 push r28 1b346: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1b348: 0f 94 0b 88 call 0x31016 ; 0x31016 1b34c: 88 23 and r24, r24 1b34e: 21 f0 breq .+8 ; 0x1b358 1b350: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1b352: cf 91 pop r28 1b354: 0d 94 fa a0 jmp 0x341f4 ; 0x341f4 1b358: cf 91 pop r28 1b35a: 08 95 ret 0001b35c : 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) { 1b35c: cf 93 push r28 1b35e: c8 2f mov r28, r24 menu_back(); 1b360: 0f 94 8d d1 call 0x3a31a ; 0x3a31a MMU2::mmu2.eject_filament(filament, true); 1b364: 61 e0 ldi r22, 0x01 ; 1 1b366: 8c 2f mov r24, r28 1b368: 0f 94 7d a0 call 0x340fa ; 0x340fa // Clear the filament action clearFilamentAction(); } 1b36c: 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(); 1b36e: 0d 94 c4 36 jmp 0x26d88 ; 0x26d88 0001b372 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.load_filament(i); 1b372: 80 e0 ldi r24, 0x00 ; 0 1b374: 0f 94 3a a0 call 0x34074 ; 0x34074 1b378: 81 e0 ldi r24, 0x01 ; 1 1b37a: 0f 94 3a a0 call 0x34074 ; 0x34074 1b37e: 82 e0 ldi r24, 0x02 ; 2 1b380: 0f 94 3a a0 call 0x34074 ; 0x34074 1b384: 83 e0 ldi r24, 0x03 ; 3 1b386: 0f 94 3a a0 call 0x34074 ; 0x34074 1b38a: 84 e0 ldi r24, 0x04 ; 4 1b38c: 0d 94 3a a0 jmp 0x34074 ; 0x34074 0001b390 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1b390: 0d 94 3a a0 jmp 0x34074 ; 0x34074 0001b394 : //! //! @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) 1b394: 4f 92 push r4 1b396: 5f 92 push r5 1b398: 6f 92 push r6 1b39a: 7f 92 push r7 1b39c: 8f 92 push r8 1b39e: 9f 92 push r9 1b3a0: af 92 push r10 1b3a2: bf 92 push r11 1b3a4: cf 92 push r12 1b3a6: df 92 push r13 1b3a8: ef 92 push r14 1b3aa: ff 92 push r15 1b3ac: 0f 93 push r16 1b3ae: 1f 93 push r17 1b3b0: cf 93 push r28 1b3b2: df 93 push r29 1b3b4: 6c 01 movw r12, r24 1b3b6: 7b 01 movw r14, r22 1b3b8: 80 91 95 13 lds r24, 0x1395 ; 0x801395 { //following code should handle 3 to 127 number of items well const int8_t items_no = last_item?(MMU2::mmu2.Enabled()?6:5):(MMU2::mmu2.Enabled()?5:4); 1b3bc: 67 2b or r22, r23 1b3be: 29 f0 breq .+10 ; 0x1b3ca 1b3c0: 06 e0 ldi r16, 0x06 ; 6 1b3c2: 81 30 cpi r24, 0x01 ; 1 1b3c4: 29 f0 breq .+10 ; 0x1b3d0 1b3c6: 05 e0 ldi r16, 0x05 ; 5 1b3c8: 03 c0 rjmp .+6 ; 0x1b3d0 1b3ca: 04 e0 ldi r16, 0x04 ; 4 1b3cc: 81 30 cpi r24, 0x01 ; 1 1b3ce: d9 f3 breq .-10 ; 0x1b3c6 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1b3d0: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 KEEPALIVE_STATE(PAUSED_FOR_USER); 1b3d4: 84 e0 ldi r24, 0x04 ; 4 1b3d6: 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; 1b3da: 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; 1b3dc: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1b3de: 03 50 subi r16, 0x03 ; 3 1b3e0: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1b3e2: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 1b3e6: 81 e0 ldi r24, 0x01 ; 1 1b3e8: 0e 94 f3 8b call 0x117e6 ; 0x117e6 if (lcd_encoder) 1b3ec: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1b3f0: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1b3f4: 00 97 sbiw r24, 0x00 ; 0 1b3f6: 09 f4 brne .+2 ; 0x1b3fa 1b3f8: 9d c0 rjmp .+314 ; 0x1b534 { if (lcd_encoder < 0) 1b3fa: 97 ff sbrs r25, 7 1b3fc: 88 c0 rjmp .+272 ; 0x1b50e { cursor_pos--; 1b3fe: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1b400: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1b404: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } if (cursor_pos > 3) 1b408: c4 30 cpi r28, 0x04 ; 4 1b40a: 0c f4 brge .+2 ; 0x1b40e 1b40c: 86 c0 rjmp .+268 ; 0x1b51a { cursor_pos = 3; if (first < items_no - 3) 1b40e: 88 2d mov r24, r8 1b410: 08 2c mov r0, r8 1b412: 00 0c add r0, r0 1b414: 99 0b sbc r25, r25 1b416: 80 17 cp r24, r16 1b418: 91 07 cpc r25, r17 1b41a: 0c f0 brlt .+2 ; 0x1b41e 1b41c: 7a c0 rjmp .+244 ; 0x1b512 { first++; 1b41e: 83 94 inc r8 lcd_clear(); 1b420: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1b424: 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); 1b426: c1 14 cp r12, r1 1b428: d1 04 cpc r13, r1 1b42a: 29 f0 breq .+10 ; 0x1b436 1b42c: a6 01 movw r20, r12 1b42e: 60 e0 ldi r22, 0x00 ; 0 1b430: 80 e0 ldi r24, 0x00 ; 0 1b432: 0e 94 ba 6f call 0xdf74 ; 0xdf74 const bool last_visible = (first == items_no - 3); 1b436: a8 2c mov r10, r8 1b438: 08 2c mov r0, r8 1b43a: 00 0c add r0, r0 1b43c: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1b43e: e1 14 cp r14, r1 1b440: f1 04 cpc r15, r1 1b442: 29 f0 breq .+10 ; 0x1b44e 1b444: 82 e0 ldi r24, 0x02 ; 2 1b446: 98 2e mov r9, r24 1b448: a0 16 cp r10, r16 1b44a: b1 06 cpc r11, r17 1b44c: 11 f0 breq .+4 ; 0x1b452 1b44e: 93 e0 ldi r25, 0x03 ; 3 1b450: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1b452: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1b454: df 5f subi r29, 0xFF ; 255 1b456: 47 e4 ldi r20, 0x47 ; 71 1b458: 5e e6 ldi r21, 0x6E ; 110 1b45a: 6d 2f mov r22, r29 1b45c: 81 e0 ldi r24, 0x01 ; 1 1b45e: 0e 94 ba 6f call 0xdf74 ; 0xdf74 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++) 1b462: 9d 12 cpse r9, r29 1b464: f7 cf rjmp .-18 ; 0x1b454 1b466: 48 2c mov r4, r8 1b468: 08 2c mov r0, r8 1b46a: 00 0c add r0, r0 1b46c: 55 08 sbc r5, r5 1b46e: 66 08 sbc r6, r6 1b470: 77 08 sbc r7, r7 1b472: 8f ef ldi r24, 0xFF ; 255 1b474: 48 1a sub r4, r24 1b476: 58 0a sbc r5, r24 1b478: 68 0a sbc r6, r24 1b47a: 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++) 1b47c: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1b47e: 93 94 inc r9 1b480: 69 2d mov r22, r9 1b482: 8a e0 ldi r24, 0x0A ; 10 1b484: 0e 94 a6 6f call 0xdf4c ; 0xdf4c 1b488: c3 01 movw r24, r6 1b48a: b2 01 movw r22, r4 1b48c: 0e 94 5f 71 call 0xe2be ; 0xe2be 1b490: 8f ef ldi r24, 0xFF ; 255 1b492: 48 1a sub r4, r24 1b494: 58 0a sbc r5, r24 1b496: 68 0a sbc r6, r24 1b498: 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++) 1b49a: d9 11 cpse r29, r9 1b49c: f0 cf rjmp .-32 ; 0x1b47e { 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); 1b49e: e1 14 cp r14, r1 1b4a0: f1 04 cpc r15, r1 1b4a2: 41 f0 breq .+16 ; 0x1b4b4 1b4a4: a0 16 cp r10, r16 1b4a6: b1 06 cpc r11, r17 1b4a8: 29 f4 brne .+10 ; 0x1b4b4 1b4aa: a7 01 movw r20, r14 1b4ac: 63 e0 ldi r22, 0x03 ; 3 1b4ae: 81 e0 ldi r24, 0x01 ; 1 1b4b0: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1b4b4: 48 eb ldi r20, 0xB8 ; 184 1b4b6: 50 e9 ldi r21, 0x90 ; 144 1b4b8: 61 e0 ldi r22, 0x01 ; 1 1b4ba: 80 e0 ldi r24, 0x00 ; 0 1b4bc: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_putc_at(0, cursor_pos, '>'); 1b4c0: 4e e3 ldi r20, 0x3E ; 62 1b4c2: 6c 2f mov r22, r28 1b4c4: 80 e0 ldi r24, 0x00 ; 0 1b4c6: 0e 94 c6 6f call 0xdf8c ; 0xdf8c _delay(100); 1b4ca: 64 e6 ldi r22, 0x64 ; 100 1b4cc: 70 e0 ldi r23, 0x00 ; 0 1b4ce: 80 e0 ldi r24, 0x00 ; 0 1b4d0: 90 e0 ldi r25, 0x00 ; 0 1b4d2: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 if (lcd_clicked()) 1b4d6: 0e 94 c3 71 call 0xe386 ; 0xe386 1b4da: 88 23 and r24, r24 1b4dc: 09 f4 brne .+2 ; 0x1b4e0 1b4de: 81 cf rjmp .-254 ; 0x1b3e2 { KEEPALIVE_STATE(IN_HANDLER); 1b4e0: 82 e0 ldi r24, 0x02 ; 2 1b4e2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(cursor_pos + first - 1); 1b4e6: 8f ef ldi r24, 0xFF ; 255 1b4e8: 8c 0f add r24, r28 1b4ea: 88 0d add r24, r8 } } } 1b4ec: df 91 pop r29 1b4ee: cf 91 pop r28 1b4f0: 1f 91 pop r17 1b4f2: 0f 91 pop r16 1b4f4: ff 90 pop r15 1b4f6: ef 90 pop r14 1b4f8: df 90 pop r13 1b4fa: cf 90 pop r12 1b4fc: bf 90 pop r11 1b4fe: af 90 pop r10 1b500: 9f 90 pop r9 1b502: 8f 90 pop r8 1b504: 7f 90 pop r7 1b506: 6f 90 pop r6 1b508: 5f 90 pop r5 1b50a: 4f 90 pop r4 1b50c: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b50e: cf 5f subi r28, 0xFF ; 255 1b510: 77 cf rjmp .-274 ; 0x1b400 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); 1b512: 87 e0 ldi r24, 0x07 ; 7 1b514: 0f 94 34 64 call 0x2c868 ; 0x2c868 1b518: 85 cf rjmp .-246 ; 0x1b424 } } if (cursor_pos < 1) 1b51a: c1 11 cpse r28, r1 1b51c: 84 cf rjmp .-248 ; 0x1b426 { cursor_pos = 1; if (first > 0) 1b51e: 18 14 cp r1, r8 1b520: 2c f4 brge .+10 ; 0x1b52c { first--; 1b522: 8a 94 dec r8 lcd_clear(); 1b524: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 } } if (cursor_pos < 1) { cursor_pos = 1; 1b528: c1 e0 ldi r28, 0x01 ; 1 1b52a: 7d cf rjmp .-262 ; 0x1b426 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b52c: 87 e0 ldi r24, 0x07 ; 7 1b52e: 0f 94 34 64 call 0x2c868 ; 0x2c868 1b532: fa cf rjmp .-12 ; 0x1b528 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1b534: c4 30 cpi r28, 0x04 ; 4 1b536: 0c f0 brlt .+2 ; 0x1b53a 1b538: 6a cf rjmp .-300 ; 0x1b40e 1b53a: 75 cf rjmp .-278 ; 0x1b426 0001b53c : } #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) { 1b53c: 4f 92 push r4 1b53e: 5f 92 push r5 1b540: 6f 92 push r6 1b542: 7f 92 push r7 1b544: af 92 push r10 1b546: bf 92 push r11 1b548: cf 92 push r12 1b54a: df 92 push r13 1b54c: ef 92 push r14 1b54e: ff 92 push r15 1b550: 0f 93 push r16 1b552: 1f 93 push r17 1b554: cf 93 push r28 1b556: df 93 push r29 1b558: 24 e0 ldi r18, 0x04 ; 4 1b55a: 30 e0 ldi r19, 0x00 ; 0 1b55c: 41 e0 ldi r20, 0x01 ; 1 1b55e: 50 e0 ldi r21, 0x00 ; 0 1b560: d9 01 movw r26, r18 1b562: a6 52 subi r26, 0x26 ; 38 1b564: b5 47 sbci r27, 0x75 ; 117 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 1b566: fd 01 movw r30, r26 1b568: 65 91 lpm r22, Z+ 1b56a: 74 91 lpm r23, Z 1b56c: 86 17 cp r24, r22 1b56e: 97 07 cpc r25, r23 1b570: 0c f0 brlt .+2 ; 0x1b574 1b572: 66 c0 rjmp .+204 ; 0x1b640 { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b574: 41 50 subi r20, 0x01 ; 1 1b576: 51 09 sbc r21, r1 1b578: 44 0f add r20, r20 1b57a: 55 1f adc r21, r21 1b57c: 44 0f add r20, r20 1b57e: 55 1f adc r21, r21 1b580: ea 01 movw r28, r20 1b582: c4 52 subi r28, 0x24 ; 36 1b584: d5 47 sbci r29, 0x75 ; 117 1b586: fe 01 movw r30, r28 1b588: 05 91 lpm r16, Z+ 1b58a: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 1b58c: 46 52 subi r20, 0x26 ; 38 1b58e: 55 47 sbci r21, 0x75 ; 117 1b590: fa 01 movw r30, r20 1b592: 65 91 lpm r22, Z+ 1b594: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b596: f9 01 movw r30, r18 1b598: e4 52 subi r30, 0x24 ; 36 1b59a: f5 47 sbci r31, 0x75 ; 117 1b59c: e5 90 lpm r14, Z+ 1b59e: f4 90 lpm r15, Z 1b5a0: fe 01 movw r30, r28 1b5a2: c5 90 lpm r12, Z+ 1b5a4: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 1b5a6: fd 01 movw r30, r26 1b5a8: c5 91 lpm r28, Z+ 1b5aa: d4 91 lpm r29, Z 1b5ac: fa 01 movw r30, r20 1b5ae: a5 90 lpm r10, Z+ 1b5b0: 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])) * 1b5b2: 86 1b sub r24, r22 1b5b4: 97 0b sbc r25, r23 1b5b6: bc 01 movw r22, r24 1b5b8: 99 0f add r25, r25 1b5ba: 88 0b sbc r24, r24 1b5bc: 99 0b sbc r25, r25 1b5be: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1b5c2: 2b 01 movw r4, r22 1b5c4: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b5c6: b7 01 movw r22, r14 1b5c8: 6c 19 sub r22, r12 1b5ca: 7d 09 sbc r23, r13 1b5cc: 07 2e mov r0, r23 1b5ce: 00 0c add r0, r0 1b5d0: 88 0b sbc r24, r24 1b5d2: 99 0b sbc r25, r25 1b5d4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1b5d8: 9b 01 movw r18, r22 1b5da: 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])) * 1b5dc: c3 01 movw r24, r6 1b5de: b2 01 movw r22, r4 1b5e0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b5e4: 6b 01 movw r12, r22 1b5e6: 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])); 1b5e8: be 01 movw r22, r28 1b5ea: 6a 19 sub r22, r10 1b5ec: 7b 09 sbc r23, r11 1b5ee: 07 2e mov r0, r23 1b5f0: 00 0c add r0, r0 1b5f2: 88 0b sbc r24, r24 1b5f4: 99 0b sbc r25, r25 1b5f6: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1b5fa: 9b 01 movw r18, r22 1b5fc: 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])) / 1b5fe: c7 01 movw r24, r14 1b600: b6 01 movw r22, r12 1b602: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1b606: 6b 01 movw r12, r22 1b608: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b60a: b8 01 movw r22, r16 1b60c: 11 0f add r17, r17 1b60e: 88 0b sbc r24, r24 1b610: 99 0b sbc r25, r25 1b612: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1b616: 9b 01 movw r18, r22 1b618: ac 01 movw r20, r24 1b61a: c7 01 movw r24, r14 1b61c: b6 01 movw r22, r12 1b61e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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; } 1b622: df 91 pop r29 1b624: cf 91 pop r28 1b626: 1f 91 pop r17 1b628: 0f 91 pop r16 1b62a: ff 90 pop r15 1b62c: ef 90 pop r14 1b62e: df 90 pop r13 1b630: cf 90 pop r12 1b632: bf 90 pop r11 1b634: af 90 pop r10 1b636: 7f 90 pop r7 1b638: 6f 90 pop r6 1b63a: 5f 90 pop r5 1b63c: 4f 90 pop r4 1b63e: 08 95 ret 1b640: 4f 5f subi r20, 0xFF ; 255 1b642: 5f 4f sbci r21, 0xFF ; 255 1b644: 2c 5f subi r18, 0xFC ; 252 1b646: 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 1b64e: 88 cf rjmp .-240 ; 0x1b560 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 1b650: e8 e5 ldi r30, 0x58 ; 88 1b652: fb e8 ldi r31, 0x8B ; 139 1b654: 65 91 lpm r22, Z+ 1b656: 74 91 lpm r23, Z 1b658: 07 2e mov r0, r23 1b65a: 00 0c add r0, r0 1b65c: 88 0b sbc r24, r24 1b65e: 99 0b sbc r25, r25 1b660: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1b664: de cf rjmp .-68 ; 0x1b622 0001b666 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1b666: 1f 93 push r17 1b668: cf 93 push r28 1b66a: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1b66c: e1 e0 ldi r30, 0x01 ; 1 1b66e: f1 e0 ldi r31, 0x01 ; 1 1b670: 80 81 ld r24, Z 1b672: 8e 7f andi r24, 0xFE ; 254 1b674: 80 83 st Z, r24 PORTH |= 0x01; 1b676: e2 e0 ldi r30, 0x02 ; 2 1b678: f1 e0 ldi r31, 0x01 ; 1 1b67a: 80 81 ld r24, Z 1b67c: 81 60 ori r24, 0x01 ; 1 1b67e: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1b680: ef e1 ldi r30, 0x1F ; 31 1b682: f5 e0 ldi r31, 0x05 ; 5 1b684: 90 e1 ldi r25, 0x10 ; 16 1b686: 90 83 st Z, r25 ptr[1] = 0; 1b688: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1b68a: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1b68c: e0 ed ldi r30, 0xD0 ; 208 1b68e: f0 e0 ldi r31, 0x00 ; 0 1b690: 80 81 ld r24, Z 1b692: 82 60 ori r24, 0x02 ; 2 1b694: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1b696: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1b69a: e1 ed ldi r30, 0xD1 ; 209 1b69c: f0 e0 ldi r31, 0x00 ; 0 1b69e: 88 e1 ldi r24, 0x18 ; 24 1b6a0: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1b6a2: 80 81 ld r24, Z 1b6a4: 80 68 ori r24, 0x80 ; 128 1b6a6: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1b6a8: ef e6 ldi r30, 0x6F ; 111 1b6aa: f2 e1 ldi r31, 0x12 ; 18 1b6ac: 80 e6 ldi r24, 0x60 ; 96 1b6ae: 9b e3 ldi r25, 0x3B ; 59 1b6b0: 91 87 std Z+9, r25 ; 0x09 1b6b2: 80 87 std Z+8, r24 ; 0x08 1b6b4: 84 ef ldi r24, 0xF4 ; 244 1b6b6: 9a e3 ldi r25, 0x3A ; 58 1b6b8: 93 87 std Z+11, r25 ; 0x0b 1b6ba: 82 87 std Z+10, r24 ; 0x0a 1b6bc: 13 e0 ldi r17, 0x03 ; 3 1b6be: 13 83 std Z+3, r17 ; 0x03 1b6c0: 15 86 std Z+13, r1 ; 0x0d 1b6c2: 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); 1b6c4: 9f b7 in r25, 0x3f ; 63 1b6c6: f8 94 cli 1b6c8: e5 e0 ldi r30, 0x05 ; 5 1b6ca: f1 e0 ldi r31, 0x01 ; 1 1b6cc: 80 81 ld r24, Z 1b6ce: 80 62 ori r24, 0x20 ; 32 1b6d0: 80 83 st Z, r24 1b6d2: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1b6d4: e4 e0 ldi r30, 0x04 ; 4 1b6d6: f1 e0 ldi r31, 0x01 ; 1 1b6d8: 80 81 ld r24, Z 1b6da: 80 62 ori r24, 0x20 ; 32 1b6dc: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1b6de: 0f 94 ce c2 call 0x3859c ; 0x3859c mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1b6e2: 83 e6 ldi r24, 0x63 ; 99 1b6e4: 0f 94 8a 87 call 0x30f14 ; 0x30f14 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1b6e8: 86 e3 ldi r24, 0x36 ; 54 1b6ea: 96 ea ldi r25, 0xA6 ; 166 1b6ec: 0e 94 17 7b call 0xf62e ; 0xf62e retryAttempts = MAX_RETRIES; 1b6f0: c6 e2 ldi r28, 0x26 ; 38 1b6f2: d3 e1 ldi r29, 0x13 ; 19 1b6f4: 10 93 7a 13 sts 0x137A, r17 ; 0x80137a } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1b6f8: 87 eb ldi r24, 0xB7 ; 183 1b6fa: 99 ea ldi r25, 0xA9 ; 169 1b6fc: 0e 94 17 7b call 0xf62e ; 0xf62e /// @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; } 1b700: 8a e0 ldi r24, 0x0A ; 10 1b702: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1b704: 82 e0 ldi r24, 0x02 ; 2 1b706: 80 93 95 13 sts 0x1395, r24 ; 0x801395 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1b70a: 81 e0 ldi r24, 0x01 ; 1 1b70c: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1b70e: 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; 1b710: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1b712: 86 e0 ldi r24, 0x06 ; 6 1b714: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1b716: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1b718: df 91 pop r29 1b71a: cf 91 pop r28 1b71c: 1f 91 pop r17 1b71e: 0d 94 5d 98 jmp 0x330ba ; 0x330ba 0001b722 : useU2X = false; } #endif // set up the first (original serial port) if (useU2X) { M_UCSRxA = 1 << M_U2Xx; 1b722: 22 e0 ldi r18, 0x02 ; 2 1b724: 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; 1b728: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> M_UBRRxL = baud_setting; 1b72c: 90 e1 ldi r25, 0x10 ; 16 1b72e: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> sbi(M_UCSRxB, M_RXENx); 1b732: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b736: 80 61 ori r24, 0x10 ; 16 1b738: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_TXENx); 1b73c: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b740: 88 60 ori r24, 0x08 ; 8 1b742: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_RXCIEx); 1b746: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b74a: 80 68 ori r24, 0x80 ; 128 1b74c: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> if (selectedSerialPort == 1) { //set up also the second serial port 1b750: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 1b754: 81 30 cpi r24, 0x01 ; 1 1b756: a9 f4 brne .+42 ; 0x1b782 if (useU2X) { UCSR1A = 1 << U2X1; 1b758: 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; 1b75c: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> UBRR1L = baud_setting; 1b760: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> sbi(UCSR1B, RXEN1); 1b764: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b768: 80 61 ori r24, 0x10 ; 16 1b76a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, TXEN1); 1b76e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b772: 88 60 ori r24, 0x08 ; 8 1b774: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, RXCIE1); 1b778: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b77c: 80 68 ori r24, 0x80 ; 128 1b77e: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> } } 1b782: 08 95 ret 0001b784 : { 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) 1b784: 2f 92 push r2 1b786: 3f 92 push r3 1b788: 4f 92 push r4 1b78a: 5f 92 push r5 1b78c: 6f 92 push r6 1b78e: 7f 92 push r7 1b790: 8f 92 push r8 1b792: 9f 92 push r9 1b794: af 92 push r10 1b796: bf 92 push r11 1b798: cf 92 push r12 1b79a: df 92 push r13 1b79c: ef 92 push r14 1b79e: ff 92 push r15 1b7a0: 0f 93 push r16 1b7a2: 1f 93 push r17 1b7a4: cf 93 push r28 1b7a6: df 93 push r29 1b7a8: 00 d0 rcall .+0 ; 0x1b7aa 1b7aa: 00 d0 rcall .+0 ; 0x1b7ac 1b7ac: 1f 92 push r1 1b7ae: cd b7 in r28, 0x3d ; 61 1b7b0: de b7 in r29, 0x3e ; 62 1b7b2: 69 83 std Y+1, r22 ; 0x01 1b7b4: 49 01 movw r8, r18 1b7b6: 5a 01 movw r10, r20 1b7b8: 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; 1b7ba: 68 2f mov r22, r24 1b7bc: 70 e0 ldi r23, 0x00 ; 0 1b7be: 90 e0 ldi r25, 0x00 ; 0 1b7c0: 80 e0 ldi r24, 0x00 ; 0 1b7c2: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1b7c6: 24 e0 ldi r18, 0x04 ; 4 1b7c8: 32 e0 ldi r19, 0x02 ; 2 1b7ca: 41 e0 ldi r20, 0x01 ; 1 1b7cc: 5c e3 ldi r21, 0x3C ; 60 1b7ce: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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] 1b7d2: 20 91 b5 12 lds r18, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 1b7d6: 30 91 b6 12 lds r19, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 1b7da: 40 91 b7 12 lds r20, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 1b7de: 50 91 b8 12 lds r21, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 1b7e2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b7e6: 6b 01 movw r12, r22 1b7e8: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1b7ea: 20 91 b9 12 lds r18, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 1b7ee: 30 91 ba 12 lds r19, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 1b7f2: 40 91 bb 12 lds r20, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 1b7f6: 50 91 bc 12 lds r21, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 1b7fa: c5 01 movw r24, r10 1b7fc: b4 01 movw r22, r8 1b7fe: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b802: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 1b806: 30 91 be 12 lds r19, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 1b80a: 40 91 bf 12 lds r20, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 1b80e: 50 91 c0 12 lds r21, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 1b812: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1b816: a7 01 movw r20, r14 1b818: 96 01 movw r18, r12 1b81a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b81e: 6b 01 movw r12, r22 1b820: 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; 1b822: 20 91 0b 13 lds r18, 0x130B ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 1b826: 30 91 0c 13 lds r19, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 1b82a: 40 91 0d 13 lds r20, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 1b82e: 50 91 0e 13 lds r21, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1b832: c8 01 movw r24, r16 1b834: b2 01 movw r22, r4 1b836: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1b83a: 9b 01 movw r18, r22 1b83c: 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 1b83e: c5 01 movw r24, r10 1b840: b4 01 movw r22, r8 1b842: 0f 94 6d de call 0x3bcda ; 0x3bcda <__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) 1b846: 39 81 ldd r19, Y+1 ; 0x01 1b848: 24 e0 ldi r18, 0x04 ; 4 1b84a: 32 9f mul r19, r18 1b84c: f0 01 movw r30, r0 1b84e: 11 24 eor r1, r1 1b850: e5 53 subi r30, 0x35 ; 53 1b852: 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 1b854: 20 81 ld r18, Z 1b856: 31 81 ldd r19, Z+1 ; 0x01 1b858: 42 81 ldd r20, Z+2 ; 0x02 1b85a: 53 81 ldd r21, Z+3 ; 0x03 1b85c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1b860: 9b 01 movw r18, r22 1b862: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1b864: c7 01 movw r24, r14 1b866: b6 01 movw r22, r12 1b868: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1b86c: 20 91 18 13 lds r18, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 1b870: 30 91 19 13 lds r19, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 1b874: 40 91 1a 13 lds r20, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 1b878: 50 91 1b 13 lds r21, 0x131B ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> 1b87c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b880: 6f 83 std Y+7, r22 ; 0x07 1b882: 79 83 std Y+1, r23 ; 0x01 1b884: 18 2f mov r17, r24 1b886: 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); 1b888: 20 91 ac 12 lds r18, 0x12AC ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> 1b88c: e2 2f mov r30, r18 1b88e: f0 e0 ldi r31, 0x00 ; 0 1b890: 80 91 ab 12 lds r24, 0x12AB ; 0x8012ab <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 1b894: 81 50 subi r24, 0x01 ; 1 1b896: 99 0b sbc r25, r25 1b898: e8 17 cp r30, r24 1b89a: f9 07 cpc r31, r25 1b89c: 09 f4 brne .+2 ; 0x1b8a0 1b89e: f4 c0 rjmp .+488 ; 0x1ba88 1b8a0: 2f 5f subi r18, 0xFF ; 255 1b8a2: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1b8a4: 5e 81 ldd r21, Y+6 ; 0x06 1b8a6: 44 e0 ldi r20, 0x04 ; 4 1b8a8: 54 9f mul r21, r20 1b8aa: 10 01 movw r2, r0 1b8ac: 11 24 eor r1, r1 1b8ae: d1 01 movw r26, r2 1b8b0: a5 57 subi r26, 0x75 ; 117 1b8b2: bd 4e sbci r27, 0xED ; 237 1b8b4: 2d 91 ld r18, X+ 1b8b6: 3d 91 ld r19, X+ 1b8b8: 4d 91 ld r20, X+ 1b8ba: 5c 91 ld r21, X 1b8bc: 2a 83 std Y+2, r18 ; 0x02 1b8be: 3b 83 std Y+3, r19 ; 0x03 1b8c0: 4c 83 std Y+4, r20 ; 0x04 1b8c2: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1b8c4: ee 0f add r30, r30 1b8c6: ff 1f adc r31, r31 1b8c8: ee 0f add r30, r30 1b8ca: ff 1f adc r31, r31 1b8cc: e5 57 subi r30, 0x75 ; 117 1b8ce: fd 4e sbci r31, 0xED ; 237 1b8d0: 40 80 ld r4, Z 1b8d2: 51 80 ldd r5, Z+1 ; 0x01 1b8d4: 62 80 ldd r6, Z+2 ; 0x02 1b8d6: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1b8d8: c0 90 c5 12 lds r12, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 1b8dc: d0 90 c6 12 lds r13, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 1b8e0: e0 90 c7 12 lds r14, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 1b8e4: f0 90 c8 12 lds r15, 0x12C8 ; 0x8012c8 <_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; 1b8e8: 92 01 movw r18, r4 1b8ea: a3 01 movw r20, r6 1b8ec: b2 01 movw r22, r4 1b8ee: c3 01 movw r24, r6 1b8f0: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 1b8f4: 88 23 and r24, r24 1b8f6: 21 f0 breq .+8 ; 0x1b900 1b8f8: 4f 80 ldd r4, Y+7 ; 0x07 1b8fa: 59 80 ldd r5, Y+1 ; 0x01 1b8fc: 61 2e mov r6, r17 1b8fe: 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; 1b900: a1 01 movw r20, r2 1b902: 45 57 subi r20, 0x75 ; 117 1b904: 5d 4e sbci r21, 0xED ; 237 1b906: 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); 1b908: a7 01 movw r20, r14 1b90a: 96 01 movw r18, r12 1b90c: 60 e0 ldi r22, 0x00 ; 0 1b90e: 70 e0 ldi r23, 0x00 ; 0 1b910: 80 e8 ldi r24, 0x80 ; 128 1b912: 9f e3 ldi r25, 0x3F ; 63 1b914: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1b918: 92 01 movw r18, r4 1b91a: a3 01 movw r20, r6 1b91c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b920: 2b 01 movw r4, r22 1b922: 3c 01 movw r6, r24 1b924: a7 01 movw r20, r14 1b926: 96 01 movw r18, r12 1b928: 6f 81 ldd r22, Y+7 ; 0x07 1b92a: 79 81 ldd r23, Y+1 ; 0x01 1b92c: 81 2f mov r24, r17 1b92e: 90 2f mov r25, r16 1b930: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b934: 9b 01 movw r18, r22 1b936: ac 01 movw r20, r24 1b938: c3 01 movw r24, r6 1b93a: b2 01 movw r22, r4 1b93c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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; 1b940: f1 01 movw r30, r2 1b942: 60 83 st Z, r22 1b944: 71 83 std Z+1, r23 ; 0x01 1b946: 82 83 std Z+2, r24 ; 0x02 1b948: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1b94a: fe 81 ldd r31, Y+6 ; 0x06 1b94c: f0 93 ac 12 sts 0x12AC, r31 ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; 1b950: 20 91 b1 12 lds r18, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 1b954: 30 91 b2 12 lds r19, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 1b958: 40 91 b3 12 lds r20, 0x12B3 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 1b95c: 50 91 b4 12 lds r21, 0x12B4 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> 1b960: c5 01 movw r24, r10 1b962: b4 01 movw r22, r8 1b964: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1b968: 2a 81 ldd r18, Y+2 ; 0x02 1b96a: 3b 81 ldd r19, Y+3 ; 0x03 1b96c: 4c 81 ldd r20, Y+4 ; 0x04 1b96e: 5d 81 ldd r21, Y+5 ; 0x05 1b970: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1b974: 2b 01 movw r4, r22 1b976: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1b978: c0 90 ad 12 lds r12, 0x12AD ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 1b97c: d0 90 ae 12 lds r13, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 1b980: e0 90 af 12 lds r14, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 1b984: f0 90 b0 12 lds r15, 0x12B0 ; 0x8012b0 <_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; 1b988: a7 01 movw r20, r14 1b98a: 96 01 movw r18, r12 1b98c: c7 01 movw r24, r14 1b98e: b6 01 movw r22, r12 1b990: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 1b994: 88 23 and r24, r24 1b996: 19 f0 breq .+6 ; 0x1b99e 1b998: c1 2c mov r12, r1 1b99a: d1 2c mov r13, r1 1b99c: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1b99e: 23 e3 ldi r18, 0x33 ; 51 1b9a0: 33 e3 ldi r19, 0x33 ; 51 1b9a2: 43 e7 ldi r20, 0x73 ; 115 1b9a4: 5f e3 ldi r21, 0x3F ; 63 1b9a6: c7 01 movw r24, r14 1b9a8: b6 01 movw r22, r12 1b9aa: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b9ae: 6b 01 movw r12, r22 1b9b0: 7c 01 movw r14, r24 1b9b2: 2d ec ldi r18, 0xCD ; 205 1b9b4: 3c ec ldi r19, 0xCC ; 204 1b9b6: 4c e4 ldi r20, 0x4C ; 76 1b9b8: 5d e3 ldi r21, 0x3D ; 61 1b9ba: c3 01 movw r24, r6 1b9bc: b2 01 movw r22, r4 1b9be: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1b9c2: 9b 01 movw r18, r22 1b9c4: ac 01 movw r20, r24 1b9c6: c7 01 movw r24, r14 1b9c8: b6 01 movw r22, r12 1b9ca: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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; 1b9ce: 80 92 b1 12 sts 0x12B1, r8 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 1b9d2: 90 92 b2 12 sts 0x12B2, r9 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 1b9d6: a0 92 b3 12 sts 0x12B3, r10 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 1b9da: b0 92 b4 12 sts 0x12B4, r11 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> dT_err_prev = dT_err_f; 1b9de: 60 93 ad 12 sts 0x12AD, r22 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 1b9e2: 70 93 ae 12 sts 0x12AE, r23 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 1b9e6: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 1b9ea: 90 93 b0 12 sts 0x12B0, r25 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> // check and trigger errors flag_bits.error = (fabsf(dT_err_f) > err_s); 1b9ee: 6b 01 movw r12, r22 1b9f0: 7c 01 movw r14, r24 1b9f2: e8 94 clt 1b9f4: f7 f8 bld r15, 7 1b9f6: 21 e0 ldi r18, 0x01 ; 1 1b9f8: 29 83 std Y+1, r18 ; 0x01 1b9fa: 20 91 20 13 lds r18, 0x1320 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 1b9fe: 30 91 21 13 lds r19, 0x1321 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 1ba02: 40 91 22 13 lds r20, 0x1322 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 1ba06: 50 91 23 13 lds r21, 0x1323 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> 1ba0a: c7 01 movw r24, r14 1ba0c: b6 01 movw r22, r12 1ba0e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1ba12: 18 16 cp r1, r24 1ba14: 0c f0 brlt .+2 ; 0x1ba18 1ba16: 19 82 std Y+1, r1 ; 0x01 1ba18: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 1ba1c: 39 81 ldd r19, Y+1 ; 0x01 1ba1e: 30 fb bst r19, 0 1ba20: 81 f9 bld r24, 1 1ba22: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1ba26: 41 e0 ldi r20, 0x01 ; 1 1ba28: 49 83 std Y+1, r20 ; 0x01 1ba2a: 20 91 1c 13 lds r18, 0x131C ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 1ba2e: 30 91 1d 13 lds r19, 0x131D ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 1ba32: 40 91 1e 13 lds r20, 0x131E ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 1ba36: 50 91 1f 13 lds r21, 0x131F ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> 1ba3a: c7 01 movw r24, r14 1ba3c: b6 01 movw r22, r12 1ba3e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1ba42: 18 16 cp r1, r24 1ba44: 0c f0 brlt .+2 ; 0x1ba48 1ba46: 19 82 std Y+1, r1 ; 0x01 1ba48: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 1ba4c: 59 81 ldd r21, Y+1 ; 0x01 1ba4e: 50 fb bst r21, 0 1ba50: 82 f9 bld r24, 2 1ba52: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> } 1ba56: 27 96 adiw r28, 0x07 ; 7 1ba58: 0f b6 in r0, 0x3f ; 63 1ba5a: f8 94 cli 1ba5c: de bf out 0x3e, r29 ; 62 1ba5e: 0f be out 0x3f, r0 ; 63 1ba60: cd bf out 0x3d, r28 ; 61 1ba62: df 91 pop r29 1ba64: cf 91 pop r28 1ba66: 1f 91 pop r17 1ba68: 0f 91 pop r16 1ba6a: ff 90 pop r15 1ba6c: ef 90 pop r14 1ba6e: df 90 pop r13 1ba70: cf 90 pop r12 1ba72: bf 90 pop r11 1ba74: af 90 pop r10 1ba76: 9f 90 pop r9 1ba78: 8f 90 pop r8 1ba7a: 7f 90 pop r7 1ba7c: 6f 90 pop r6 1ba7e: 5f 90 pop r5 1ba80: 4f 90 pop r4 1ba82: 3f 90 pop r3 1ba84: 2f 90 pop r2 1ba86: 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); 1ba88: 1e 82 std Y+6, r1 ; 0x06 1ba8a: 0c cf rjmp .-488 ; 0x1b8a4 0001ba8c : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1ba8c: 2f 92 push r2 1ba8e: 3f 92 push r3 1ba90: 4f 92 push r4 1ba92: 5f 92 push r5 1ba94: 6f 92 push r6 1ba96: 7f 92 push r7 1ba98: 8f 92 push r8 1ba9a: 9f 92 push r9 1ba9c: af 92 push r10 1ba9e: bf 92 push r11 1baa0: cf 92 push r12 1baa2: df 92 push r13 1baa4: ef 92 push r14 1baa6: ff 92 push r15 1baa8: 0f 93 push r16 1baaa: 1f 93 push r17 1baac: cf 93 push r28 1baae: df 93 push r29 1bab0: cd b7 in r28, 0x3d ; 61 1bab2: de b7 in r29, 0x3e ; 62 1bab4: a4 97 sbiw r28, 0x24 ; 36 1bab6: 0f b6 in r0, 0x3f ; 63 1bab8: f8 94 cli 1baba: de bf out 0x3e, r29 ; 62 1babc: 0f be out 0x3f, r0 ; 63 1babe: cd bf out 0x3d, r28 ; 61 1bac0: 9b 8f std Y+27, r25 ; 0x1b 1bac2: 8a 8f std Y+26, r24 ; 0x1a 1bac4: 7a 8b std Y+18, r23 ; 0x12 1bac6: 69 8b std Y+17, r22 ; 0x11 1bac8: 2b 8b std Y+19, r18 ; 0x13 1baca: 3c 8b std Y+20, r19 ; 0x14 1bacc: 4d 8b std Y+21, r20 ; 0x15 1bace: 5e 8b std Y+22, r21 ; 0x16 1bad0: 0c 8f std Y+28, r16 ; 0x1c 1bad2: cd 8e std Y+29, r12 ; 0x1d 1bad4: de 8e std Y+30, r13 ; 0x1e 1bad6: ef 8e std Y+31, r14 ; 0x1f 1bad8: 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; 1bada: 20 91 1d 05 lds r18, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> 1bade: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1bae0: 80 e0 ldi r24, 0x00 ; 0 1bae2: 0f 94 6f 48 call 0x290de ; 0x290de float orig = *var; 1bae6: a9 89 ldd r26, Y+17 ; 0x11 1bae8: ba 89 ldd r27, Y+18 ; 0x12 1baea: 8d 91 ld r24, X+ 1baec: 9d 91 ld r25, X+ 1baee: 0d 90 ld r0, X+ 1baf0: bc 91 ld r27, X 1baf2: a0 2d mov r26, r0 1baf4: 89 a3 std Y+33, r24 ; 0x21 1baf6: 9a a3 std Y+34, r25 ; 0x22 1baf8: ab a3 std Y+35, r26 ; 0x23 1bafa: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1bafc: 80 e0 ldi r24, 0x00 ; 0 1bafe: 90 e0 ldi r25, 0x00 ; 0 1bb00: a0 ea ldi r26, 0xA0 ; 160 1bb02: b0 e4 ldi r27, 0x40 ; 64 1bb04: 89 83 std Y+1, r24 ; 0x01 1bb06: 9a 83 std Y+2, r25 ; 0x02 1bb08: ab 83 std Y+3, r26 ; 0x03 1bb0a: bc 83 std Y+4, r27 ; 0x04 1bb0c: 8b 89 ldd r24, Y+19 ; 0x13 1bb0e: 9c 89 ldd r25, Y+20 ; 0x14 1bb10: ad 89 ldd r26, Y+21 ; 0x15 1bb12: be 89 ldd r27, Y+22 ; 0x16 1bb14: 8d 83 std Y+5, r24 ; 0x05 1bb16: 9e 83 std Y+6, r25 ; 0x06 1bb18: af 83 std Y+7, r26 ; 0x07 1bb1a: 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]); 1bb1c: 20 e0 ldi r18, 0x00 ; 0 1bb1e: 30 e0 ldi r19, 0x00 ; 0 1bb20: 40 ea ldi r20, 0xA0 ; 160 1bb22: 50 e4 ldi r21, 0x40 ; 64 1bb24: bc 01 movw r22, r24 1bb26: cd 01 movw r24, r26 1bb28: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1bb2c: 2a e7 ldi r18, 0x7A ; 122 1bb2e: 37 e3 ldi r19, 0x37 ; 55 1bb30: 4e e1 ldi r20, 0x1E ; 30 1bb32: 5f e3 ldi r21, 0x3F ; 63 1bb34: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1bb38: 6b 01 movw r12, r22 1bb3a: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 1bb3c: 20 e0 ldi r18, 0x00 ; 0 1bb3e: 30 e0 ldi r19, 0x00 ; 0 1bb40: 40 ea ldi r20, 0xA0 ; 160 1bb42: 50 e4 ldi r21, 0x40 ; 64 1bb44: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1bb48: 69 87 std Y+9, r22 ; 0x09 1bb4a: 7a 87 std Y+10, r23 ; 0x0a 1bb4c: 8b 87 std Y+11, r24 ; 0x0b 1bb4e: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1bb50: a7 01 movw r20, r14 1bb52: 96 01 movw r18, r12 1bb54: 6b 89 ldd r22, Y+19 ; 0x13 1bb56: 7c 89 ldd r23, Y+20 ; 0x14 1bb58: 8d 89 ldd r24, Y+21 ; 0x15 1bb5a: 9e 89 ldd r25, Y+22 ; 0x16 1bb5c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1bb60: 6d 87 std Y+13, r22 ; 0x0d 1bb62: 7e 87 std Y+14, r23 ; 0x0e 1bb64: 8f 87 std Y+15, r24 ; 0x0f 1bb66: 98 8b std Y+16, r25 ; 0x10 1bb68: 31 2c mov r3, r1 1bb6a: 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); 1bb6c: 29 85 ldd r18, Y+9 ; 0x09 1bb6e: 3a 85 ldd r19, Y+10 ; 0x0a 1bb70: 4b 85 ldd r20, Y+11 ; 0x0b 1bb72: 5c 85 ldd r21, Y+12 ; 0x0c 1bb74: cd 8c ldd r12, Y+29 ; 0x1d 1bb76: de 8c ldd r13, Y+30 ; 0x1e 1bb78: ef 8c ldd r14, Y+31 ; 0x1f 1bb7a: f8 a0 ldd r15, Y+32 ; 0x20 1bb7c: 0c 8d ldd r16, Y+28 ; 0x1c 1bb7e: 69 89 ldd r22, Y+17 ; 0x11 1bb80: 7a 89 ldd r23, Y+18 ; 0x12 1bb82: 8a 8d ldd r24, Y+26 ; 0x1a 1bb84: 9b 8d ldd r25, Y+27 ; 0x1b 1bb86: 0f 94 bc 42 call 0x28578 ; 0x28578 1bb8a: 4b 01 movw r8, r22 1bb8c: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1bb8e: 2d 85 ldd r18, Y+13 ; 0x0d 1bb90: 3e 85 ldd r19, Y+14 ; 0x0e 1bb92: 4f 85 ldd r20, Y+15 ; 0x0f 1bb94: 58 89 ldd r21, Y+16 ; 0x10 1bb96: cd 8c ldd r12, Y+29 ; 0x1d 1bb98: de 8c ldd r13, Y+30 ; 0x1e 1bb9a: ef 8c ldd r14, Y+31 ; 0x1f 1bb9c: f8 a0 ldd r15, Y+32 ; 0x20 1bb9e: 0c 8d ldd r16, Y+28 ; 0x1c 1bba0: 69 89 ldd r22, Y+17 ; 0x11 1bba2: 7a 89 ldd r23, Y+18 ; 0x12 1bba4: 8a 8d ldd r24, Y+26 ; 0x1a 1bba6: 9b 8d ldd r25, Y+27 ; 0x1b 1bba8: 0f 94 bc 42 call 0x28578 ; 0x28578 1bbac: 9b 01 movw r18, r22 1bbae: ac 01 movw r20, r24 bool dir = (c2 < c1); 1bbb0: 11 e0 ldi r17, 0x01 ; 1 1bbb2: c5 01 movw r24, r10 1bbb4: b4 01 movw r22, r8 1bbb6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1bbba: 18 16 cp r1, r24 1bbbc: 0c f0 brlt .+2 ; 0x1bbc0 1bbbe: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1bbc0: 01 e0 ldi r16, 0x01 ; 1 1bbc2: 01 27 eor r16, r17 1bbc4: 80 2f mov r24, r16 1bbc6: 90 e0 ldi r25, 0x00 ; 0 1bbc8: e1 2f mov r30, r17 1bbca: f0 e0 ldi r31, 0x00 ; 0 1bbcc: ee 0f add r30, r30 1bbce: ff 1f adc r31, r31 1bbd0: ee 0f add r30, r30 1bbd2: ff 1f adc r31, r31 1bbd4: 41 e0 ldi r20, 0x01 ; 1 1bbd6: 50 e0 ldi r21, 0x00 ; 0 1bbd8: 4c 0f add r20, r28 1bbda: 5d 1f adc r21, r29 1bbdc: 4e 0f add r20, r30 1bbde: 5f 1f adc r21, r31 1bbe0: 8c 01 movw r16, r24 1bbe2: 00 0f add r16, r16 1bbe4: 11 1f adc r17, r17 1bbe6: 00 0f add r16, r16 1bbe8: 11 1f adc r17, r17 1bbea: a1 e0 ldi r26, 0x01 ; 1 1bbec: b0 e0 ldi r27, 0x00 ; 0 1bbee: ac 0f add r26, r28 1bbf0: bd 1f adc r27, r29 1bbf2: 0a 0f add r16, r26 1bbf4: 1b 1f adc r17, r27 1bbf6: f8 01 movw r30, r16 1bbf8: 38 96 adiw r30, 0x08 ; 8 1bbfa: f8 8f std Y+24, r31 ; 0x18 1bbfc: ef 8b std Y+23, r30 ; 0x17 1bbfe: f8 01 movw r30, r16 1bc00: 80 85 ldd r24, Z+8 ; 0x08 1bc02: 91 85 ldd r25, Z+9 ; 0x09 1bc04: a2 85 ldd r26, Z+10 ; 0x0a 1bc06: b3 85 ldd r27, Z+11 ; 0x0b 1bc08: fa 01 movw r30, r20 1bc0a: 80 83 st Z, r24 1bc0c: 91 83 std Z+1, r25 ; 0x01 1bc0e: a2 83 std Z+2, r26 ; 0x02 1bc10: 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]); 1bc12: 8d 80 ldd r8, Y+5 ; 0x05 1bc14: 9e 80 ldd r9, Y+6 ; 0x06 1bc16: af 80 ldd r10, Y+7 ; 0x07 1bc18: b8 84 ldd r11, Y+8 ; 0x08 1bc1a: c9 80 ldd r12, Y+1 ; 0x01 1bc1c: da 80 ldd r13, Y+2 ; 0x02 1bc1e: eb 80 ldd r14, Y+3 ; 0x03 1bc20: fc 80 ldd r15, Y+4 ; 0x04 1bc22: a7 01 movw r20, r14 1bc24: 96 01 movw r18, r12 1bc26: c5 01 movw r24, r10 1bc28: b4 01 movw r22, r8 1bc2a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1bc2e: 2a e7 ldi r18, 0x7A ; 122 1bc30: 37 e3 ldi r19, 0x37 ; 55 1bc32: 4e e1 ldi r20, 0x1E ; 30 1bc34: 5f e3 ldi r21, 0x3F ; 63 1bc36: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1bc3a: 2b 01 movw r4, r22 1bc3c: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1bc3e: ac 01 movw r20, r24 1bc40: 9b 01 movw r18, r22 1bc42: c7 01 movw r24, r14 1bc44: b6 01 movw r22, r12 1bc46: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1bc4a: 69 87 std Y+9, r22 ; 0x09 1bc4c: 7a 87 std Y+10, r23 ; 0x0a 1bc4e: 8b 87 std Y+11, r24 ; 0x0b 1bc50: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1bc52: a3 01 movw r20, r6 1bc54: 92 01 movw r18, r4 1bc56: c5 01 movw r24, r10 1bc58: b4 01 movw r22, r8 1bc5a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1bc5e: 6d 87 std Y+13, r22 ; 0x0d 1bc60: 7e 87 std Y+14, r23 ; 0x0e 1bc62: 8f 87 std Y+15, r24 ; 0x0f 1bc64: 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]; 1bc66: d8 01 movw r26, r16 1bc68: 18 96 adiw r26, 0x08 ; 8 1bc6a: 4c 90 ld r4, X 1bc6c: ef 89 ldd r30, Y+23 ; 0x17 1bc6e: f8 8d ldd r31, Y+24 ; 0x18 1bc70: 51 80 ldd r5, Z+1 ; 0x01 1bc72: 62 80 ldd r6, Z+2 ; 0x02 1bc74: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1bc76: a5 01 movw r20, r10 1bc78: 94 01 movw r18, r8 1bc7a: c7 01 movw r24, r14 1bc7c: b6 01 movw r22, r12 1bc7e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1bc82: 24 2d mov r18, r4 1bc84: 35 2d mov r19, r5 1bc86: 46 2d mov r20, r6 1bc88: 57 2d mov r21, r7 1bc8a: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1bc8e: 9f 77 andi r25, 0x7F ; 127 1bc90: 2c e0 ldi r18, 0x0C ; 12 1bc92: 31 e9 ldi r19, 0x91 ; 145 1bc94: 43 ec ldi r20, 0xC3 ; 195 1bc96: 5e e3 ldi r21, 0x3E ; 62 1bc98: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1bc9c: 6b 01 movw r12, r22 1bc9e: 7c 01 movw r14, r24 1bca0: 5b 01 movw r10, r22 1bca2: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1bca4: ff 92 push r15 1bca6: 8f 93 push r24 1bca8: df 92 push r13 1bcaa: 6f 93 push r22 1bcac: 7f 92 push r7 1bcae: 6f 92 push r6 1bcb0: 5f 92 push r5 1bcb2: 4f 92 push r4 1bcb4: 3f 92 push r3 1bcb6: 2f 92 push r2 1bcb8: 2e e8 ldi r18, 0x8E ; 142 1bcba: 30 e9 ldi r19, 0x90 ; 144 1bcbc: 3f 93 push r19 1bcbe: 2f 93 push r18 1bcc0: 0f 94 08 dc call 0x3b810 ; 0x3b810 if(e < thr) { 1bcc4: 0f b6 in r0, 0x3f ; 63 1bcc6: f8 94 cli 1bcc8: de bf out 0x3e, r29 ; 62 1bcca: 0f be out 0x3f, r0 ; 63 1bccc: cd bf out 0x3d, r28 ; 61 1bcce: 2a e0 ldi r18, 0x0A ; 10 1bcd0: 37 ed ldi r19, 0xD7 ; 215 1bcd2: 43 e2 ldi r20, 0x23 ; 35 1bcd4: 5c e3 ldi r21, 0x3C ; 60 1bcd6: 6c 2d mov r22, r12 1bcd8: 7d 2d mov r23, r13 1bcda: 8e 2d mov r24, r14 1bcdc: 9f 2d mov r25, r15 1bcde: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1bce2: 87 ff sbrs r24, 7 1bce4: 42 c0 rjmp .+132 ; 0x1bd6a if(x == min || x == max) { 1bce6: 20 e0 ldi r18, 0x00 ; 0 1bce8: 30 e0 ldi r19, 0x00 ; 0 1bcea: 40 ea ldi r20, 0xA0 ; 160 1bcec: 50 e4 ldi r21, 0x40 ; 64 1bcee: 64 2d mov r22, r4 1bcf0: 75 2d mov r23, r5 1bcf2: 86 2d mov r24, r6 1bcf4: 97 2d mov r25, r7 1bcf6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1bcfa: 88 23 and r24, r24 1bcfc: f1 f1 breq .+124 ; 0x1bd7a 1bcfe: 24 2d mov r18, r4 1bd00: 35 2d mov r19, r5 1bd02: 46 2d mov r20, r6 1bd04: 57 2d mov r21, r7 1bd06: 6b 89 ldd r22, Y+19 ; 0x13 1bd08: 7c 89 ldd r23, Y+20 ; 0x14 1bd0a: 8d 89 ldd r24, Y+21 ; 0x15 1bd0c: 9e 89 ldd r25, Y+22 ; 0x16 1bd0e: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1bd12: 88 23 and r24, r24 1bd14: 91 f1 breq .+100 ; 0x1bd7a // real value likely outside of the search boundaries break; } *var = x; 1bd16: 84 2d mov r24, r4 1bd18: 95 2d mov r25, r5 1bd1a: a6 2d mov r26, r6 1bd1c: b7 2d mov r27, r7 1bd1e: e9 89 ldd r30, Y+17 ; 0x11 1bd20: fa 89 ldd r31, Y+18 ; 0x12 1bd22: 80 83 st Z, r24 1bd24: 91 83 std Z+1, r25 ; 0x01 1bd26: a2 83 std Z+2, r26 ; 0x02 1bd28: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bd2a: 89 8d ldd r24, Y+25 ; 0x19 1bd2c: 0f 94 6f 48 call 0x290de ; 0x290de SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1bd30: 6a 2d mov r22, r10 1bd32: 7b 2d mov r23, r11 1bd34: 80 2f mov r24, r16 1bd36: 91 2f mov r25, r17 1bd38: a4 96 adiw r28, 0x24 ; 36 1bd3a: 0f b6 in r0, 0x3f ; 63 1bd3c: f8 94 cli 1bd3e: de bf out 0x3e, r29 ; 62 1bd40: 0f be out 0x3f, r0 ; 63 1bd42: cd bf out 0x3d, r28 ; 61 1bd44: df 91 pop r29 1bd46: cf 91 pop r28 1bd48: 1f 91 pop r17 1bd4a: 0f 91 pop r16 1bd4c: ff 90 pop r15 1bd4e: ef 90 pop r14 1bd50: df 90 pop r13 1bd52: cf 90 pop r12 1bd54: bf 90 pop r11 1bd56: af 90 pop r10 1bd58: 9f 90 pop r9 1bd5a: 8f 90 pop r8 1bd5c: 7f 90 pop r7 1bd5e: 6f 90 pop r6 1bd60: 5f 90 pop r5 1bd62: 4f 90 pop r4 1bd64: 3f 90 pop r3 1bd66: 2f 90 pop r2 1bd68: 08 95 ret 1bd6a: ff ef ldi r31, 0xFF ; 255 1bd6c: 2f 1a sub r2, r31 1bd6e: 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) { 1bd70: 2e e1 ldi r18, 0x1E ; 30 1bd72: 22 16 cp r2, r18 1bd74: 31 04 cpc r3, r1 1bd76: 09 f0 breq .+2 ; 0x1bd7a 1bd78: f9 ce rjmp .-526 ; 0x1bb6c thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1bd7a: 8f e6 ldi r24, 0x6F ; 111 1bd7c: 90 e9 ldi r25, 0x90 ; 144 1bd7e: 0e 94 17 7b call 0xf62e ; 0xf62e *var = orig; 1bd82: 89 a1 ldd r24, Y+33 ; 0x21 1bd84: 9a a1 ldd r25, Y+34 ; 0x22 1bd86: ab a1 ldd r26, Y+35 ; 0x23 1bd88: bc a1 ldd r27, Y+36 ; 0x24 1bd8a: e9 89 ldd r30, Y+17 ; 0x11 1bd8c: fa 89 ldd r31, Y+18 ; 0x12 1bd8e: 80 83 st Z, r24 1bd90: 91 83 std Z+1, r25 ; 0x01 1bd92: a2 83 std Z+2, r26 ; 0x02 1bd94: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bd96: 89 8d ldd r24, Y+25 ; 0x19 1bd98: 0f 94 6f 48 call 0x290de ; 0x290de return NAN; 1bd9c: a1 2c mov r10, r1 1bd9e: b1 2c mov r11, r1 1bda0: 00 ec ldi r16, 0xC0 ; 192 1bda2: 1f e7 ldi r17, 0x7F ; 127 1bda4: c5 cf rjmp .-118 ; 0x1bd30 0001bda6 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1bda6: ef 92 push r14 1bda8: ff 92 push r15 1bdaa: 0f 93 push r16 1bdac: 1f 93 push r17 1bdae: cf 93 push r28 1bdb0: df 93 push r29 1bdb2: 00 d0 rcall .+0 ; 0x1bdb4 1bdb4: 1f 92 push r1 1bdb6: 1f 92 push r1 1bdb8: cd b7 in r28, 0x3d ; 61 1bdba: de b7 in r29, 0x3e ; 62 1bdbc: 08 2f mov r16, r24 1bdbe: 16 2f mov r17, r22 1bdc0: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1bdc2: 0f 94 0b 88 call 0x31016 ; 0x31016 1bdc6: 88 23 and r24, r24 1bdc8: d9 f0 breq .+54 ; 0x1be00 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) { 1bdca: 0b 30 cpi r16, 0x0B ; 11 1bdcc: 29 f1 breq .+74 ; 0x1be18 1bdce: 04 31 cpi r16, 0x14 ; 20 1bdd0: 31 f1 breq .+76 ; 0x1be1e /// @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()) { 1bdd2: 87 e5 ldi r24, 0x57 ; 87 1bdd4: e8 2e mov r14, r24 1bdd6: e9 82 std Y+1, r14 ; 0x01 1bdd8: 0a 83 std Y+2, r16 ; 0x02 1bdda: 1b 83 std Y+3, r17 ; 0x03 1bddc: fc 82 std Y+4, r15 ; 0x04 1bdde: ce 01 movw r24, r28 1bde0: 01 96 adiw r24, 0x01 ; 1 1bde2: 0f 94 9d c2 call 0x3853a ; 0x3853a 1bde6: 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)); 1bde8: 47 e5 ldi r20, 0x57 ; 87 1bdea: 50 2f mov r21, r16 1bdec: 61 2f mov r22, r17 1bdee: 7f 2d mov r23, r15 1bdf0: 0f 94 33 98 call 0x33066 ; 0x33066 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)); 1bdf4: 60 e0 ldi r22, 0x00 ; 0 1bdf6: 80 e0 ldi r24, 0x00 ; 0 1bdf8: 0f 94 57 9f call 0x33eae ; 0x33eae 1bdfc: 88 23 and r24, r24 1bdfe: 59 f3 breq .-42 ; 0x1bdd6 return true; } 1be00: 0f 90 pop r0 1be02: 0f 90 pop r0 1be04: 0f 90 pop r0 1be06: 0f 90 pop r0 1be08: 0f 90 pop r0 1be0a: df 91 pop r29 1be0c: cf 91 pop r28 1be0e: 1f 91 pop r17 1be10: 0f 91 pop r16 1be12: ff 90 pop r15 1be14: ef 90 pop r14 1be16: 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); 1be18: 10 93 72 13 sts 0x1372, r17 ; 0x801372 1be1c: da cf rjmp .-76 ; 0x1bdd2 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1be1e: 10 93 73 13 sts 0x1373, r17 ; 0x801373 1be22: d7 cf rjmp .-82 ; 0x1bdd2 0001be24 : #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) 1be24: 82 30 cpi r24, 0x02 ; 2 1be26: 91 05 cpc r25, r1 1be28: 38 f0 brcs .+14 ; 0x1be38 // 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 1be2a: 88 0f add r24, r24 1be2c: 99 1f adc r25, r25 1be2e: 88 0f add r24, r24 1be30: 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, 1be32: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1be34: 01 97 sbiw r24, 0x01 ; 1 1be36: f1 f7 brne .-4 ; 0x1be34 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1be38: 08 95 ret 0001be3a : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1be3a: cf 93 push r28 1be3c: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1be3e: 28 2f mov r18, r24 1be40: 30 e0 ldi r19, 0x00 ; 0 1be42: f9 01 movw r30, r18 1be44: ee 56 subi r30, 0x6E ; 110 1be46: f1 47 sbci r31, 0x71 ; 113 1be48: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1be4a: f9 01 movw r30, r18 1be4c: e4 5c subi r30, 0xC4 ; 196 1be4e: f1 47 sbci r31, 0x71 ; 113 1be50: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1be52: f9 01 movw r30, r18 1be54: ea 51 subi r30, 0x1A ; 26 1be56: f2 47 sbci r31, 0x72 ; 114 1be58: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1be5a: cc 23 and r28, r28 1be5c: a1 f0 breq .+40 ; 0x1be86 // 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); 1be5e: 81 11 cpse r24, r1 1be60: 0e 94 94 cf call 0x19f28 ; 0x19f28 if (*portInputRegister(port) & bit) return HIGH; 1be64: ec 2f mov r30, r28 1be66: f0 e0 ldi r31, 0x00 ; 0 1be68: ee 0f add r30, r30 1be6a: ff 1f adc r31, r31 1be6c: e4 53 subi r30, 0x34 ; 52 1be6e: f2 47 sbci r31, 0x72 ; 114 1be70: a5 91 lpm r26, Z+ 1be72: b4 91 lpm r27, Z 1be74: ec 91 ld r30, X 1be76: ed 23 and r30, r29 1be78: 81 e0 ldi r24, 0x01 ; 1 1be7a: 90 e0 ldi r25, 0x00 ; 0 1be7c: 09 f4 brne .+2 ; 0x1be80 1be7e: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1be80: df 91 pop r29 1be82: cf 91 pop r28 1be84: 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; 1be86: 80 e0 ldi r24, 0x00 ; 0 1be88: 90 e0 ldi r25, 0x00 ; 0 1be8a: fa cf rjmp .-12 ; 0x1be80 0001be8c : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1be8c: 1f 93 push r17 1be8e: cf 93 push r28 1be90: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1be92: 28 2f mov r18, r24 1be94: 30 e0 ldi r19, 0x00 ; 0 1be96: f9 01 movw r30, r18 1be98: ee 56 subi r30, 0x6E ; 110 1be9a: f1 47 sbci r31, 0x71 ; 113 1be9c: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1be9e: f9 01 movw r30, r18 1bea0: e4 5c subi r30, 0xC4 ; 196 1bea2: f1 47 sbci r31, 0x71 ; 113 1bea4: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1bea6: f9 01 movw r30, r18 1bea8: ea 51 subi r30, 0x1A ; 26 1beaa: f2 47 sbci r31, 0x72 ; 114 1beac: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1beae: cc 23 and r28, r28 1beb0: a9 f0 breq .+42 ; 0x1bedc 1beb2: 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); 1beb4: 81 11 cpse r24, r1 1beb6: 0e 94 94 cf call 0x19f28 ; 0x19f28 out = portOutputRegister(port); 1beba: ec 2f mov r30, r28 1bebc: f0 e0 ldi r31, 0x00 ; 0 1bebe: ee 0f add r30, r30 1bec0: ff 1f adc r31, r31 1bec2: ee 54 subi r30, 0x4E ; 78 1bec4: f2 47 sbci r31, 0x72 ; 114 1bec6: a5 91 lpm r26, Z+ 1bec8: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1beca: 8f b7 in r24, 0x3f ; 63 cli(); 1becc: f8 94 cli if (val == LOW) { *out &= ~bit; 1bece: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1bed0: 11 11 cpse r17, r1 1bed2: 08 c0 rjmp .+16 ; 0x1bee4 *out &= ~bit; 1bed4: d0 95 com r29 1bed6: de 23 and r29, r30 } else { *out |= bit; 1bed8: dc 93 st X, r29 } SREG = oldSREG; 1beda: 8f bf out 0x3f, r24 ; 63 } 1bedc: df 91 pop r29 1bede: cf 91 pop r28 1bee0: 1f 91 pop r17 1bee2: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1bee4: de 2b or r29, r30 1bee6: f8 cf rjmp .-16 ; 0x1bed8 0001bee8 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1bee8: cf 93 push r28 1beea: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1beec: 90 e0 ldi r25, 0x00 ; 0 1beee: fc 01 movw r30, r24 1bef0: e4 5c subi r30, 0xC4 ; 196 1bef2: f1 47 sbci r31, 0x71 ; 113 1bef4: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1bef6: 8a 51 subi r24, 0x1A ; 26 1bef8: 92 47 sbci r25, 0x72 ; 114 1befa: fc 01 movw r30, r24 1befc: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1befe: 88 23 and r24, r24 1bf00: d1 f0 breq .+52 ; 0x1bf36 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1bf02: 90 e0 ldi r25, 0x00 ; 0 1bf04: 88 0f add r24, r24 1bf06: 99 1f adc r25, r25 1bf08: fc 01 movw r30, r24 1bf0a: e8 56 subi r30, 0x68 ; 104 1bf0c: f2 47 sbci r31, 0x72 ; 114 1bf0e: a5 91 lpm r26, Z+ 1bf10: b4 91 lpm r27, Z out = portOutputRegister(port); 1bf12: fc 01 movw r30, r24 1bf14: ee 54 subi r30, 0x4E ; 78 1bf16: f2 47 sbci r31, 0x72 ; 114 1bf18: c5 91 lpm r28, Z+ 1bf1a: d4 91 lpm r29, Z if (mode == INPUT) { 1bf1c: 61 11 cpse r22, r1 1bf1e: 0e c0 rjmp .+28 ; 0x1bf3c uint8_t oldSREG = SREG; 1bf20: 9f b7 in r25, 0x3f ; 63 cli(); 1bf22: f8 94 cli *reg &= ~bit; 1bf24: 8c 91 ld r24, X 1bf26: e2 2f mov r30, r18 1bf28: e0 95 com r30 1bf2a: 8e 23 and r24, r30 1bf2c: 8c 93 st X, r24 *out &= ~bit; 1bf2e: 28 81 ld r18, Y 1bf30: e2 23 and r30, r18 1bf32: e8 83 st Y, r30 SREG = oldSREG; 1bf34: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1bf36: df 91 pop r29 1bf38: cf 91 pop r28 1bf3a: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1bf3c: 8f b7 in r24, 0x3f ; 63 cli(); 1bf3e: f8 94 cli *reg |= bit; 1bf40: ec 91 ld r30, X 1bf42: e2 2b or r30, r18 1bf44: ec 93 st X, r30 SREG = oldSREG; 1bf46: 8f bf out 0x3f, r24 ; 63 1bf48: f6 cf rjmp .-20 ; 0x1bf36 0001bf4a : // 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) { 1bf4a: 1f 93 push r17 1bf4c: cf 93 push r28 1bf4e: df 93 push r29 1bf50: 18 2f mov r17, r24 1bf52: 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); 1bf54: 61 e0 ldi r22, 0x01 ; 1 1bf56: 0e 94 74 df call 0x1bee8 ; 0x1bee8 if (val == 0) 1bf5a: 20 97 sbiw r28, 0x00 ; 0 1bf5c: 39 f4 brne .+14 ; 0x1bf6c { digitalWrite(pin, LOW); 1bf5e: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1bf60: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1bf62: df 91 pop r29 1bf64: cf 91 pop r28 1bf66: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1bf68: 0c 94 46 df jmp 0x1be8c ; 0x1be8c pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1bf6c: cf 3f cpi r28, 0xFF ; 255 1bf6e: d1 05 cpc r29, r1 1bf70: 11 f4 brne .+4 ; 0x1bf76 { digitalWrite(pin, HIGH); 1bf72: 61 e0 ldi r22, 0x01 ; 1 1bf74: f5 cf rjmp .-22 ; 0x1bf60 } else { switch(digitalPinToTimer(pin)) 1bf76: e1 2f mov r30, r17 1bf78: f0 e0 ldi r31, 0x00 ; 0 1bf7a: ee 56 subi r30, 0x6E ; 110 1bf7c: f1 47 sbci r31, 0x71 ; 113 1bf7e: e4 91 lpm r30, Z 1bf80: e1 50 subi r30, 0x01 ; 1 1bf82: e2 31 cpi r30, 0x12 ; 18 1bf84: 08 f0 brcs .+2 ; 0x1bf88 1bf86: b3 c0 rjmp .+358 ; 0x1c0ee 1bf88: f0 e0 ldi r31, 0x00 ; 0 1bf8a: 88 27 eor r24, r24 1bf8c: e5 53 subi r30, 0x35 ; 53 1bf8e: f0 42 sbci r31, 0x20 ; 32 1bf90: 8f 4f sbci r24, 0xFF ; 255 1bf92: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 1bf96: dd df rcall .-70 ; 0x1bf52 1bf98: e5 df rcall .-54 ; 0x1bf64 1bf9a: ea df rcall .-44 ; 0x1bf70 1bf9c: f4 df rcall .-24 ; 0x1bf86 1bf9e: fe df rcall .-4 ; 0x1bf9c 1bfa0: 77 e0 ldi r23, 0x07 ; 7 1bfa2: 08 e0 ldi r16, 0x08 ; 8 1bfa4: 10 e0 ldi r17, 0x00 ; 0 1bfa6: 18 e0 ldi r17, 0x08 ; 8 1bfa8: 22 e0 ldi r18, 0x02 ; 2 1bfaa: 2c e0 ldi r18, 0x0C ; 12 1bfac: 36 e0 ldi r19, 0x06 ; 6 1bfae: 45 e0 ldi r20, 0x05 ; 5 1bfb0: 4f e0 ldi r20, 0x0F ; 15 1bfb2: 77 e0 ldi r23, 0x07 ; 7 1bfb4: 59 e0 ldi r21, 0x09 ; 9 1bfb6: 63 e0 ldi r22, 0x03 ; 3 1bfb8: 6d e0 ldi r22, 0x0D ; 13 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1bfba: 84 b5 in r24, 0x24 ; 36 1bfbc: 80 68 ori r24, 0x80 ; 128 1bfbe: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1bfc0: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1bfc2: df 91 pop r29 1bfc4: cf 91 pop r28 1bfc6: 1f 91 pop r17 1bfc8: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1bfca: 84 b5 in r24, 0x24 ; 36 1bfcc: 80 62 ori r24, 0x20 ; 32 1bfce: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1bfd0: c8 bd out 0x28, r28 ; 40 1bfd2: f7 cf rjmp .-18 ; 0x1bfc2 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1bfd4: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bfd8: 80 68 ori r24, 0x80 ; 128 1bfda: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1bfde: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1bfe2: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1bfe6: ed cf rjmp .-38 ; 0x1bfc2 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1bfe8: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bfec: 80 62 ori r24, 0x20 ; 32 1bfee: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1bff2: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1bff6: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1bffa: e3 cf rjmp .-58 ; 0x1bfc2 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1bffc: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1c000: 88 60 ori r24, 0x08 ; 8 1c002: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1c006: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1c00a: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1c00e: d9 cf rjmp .-78 ; 0x1bfc2 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1c010: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1c014: 80 68 ori r24, 0x80 ; 128 1c016: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1c01a: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1c01e: d1 cf rjmp .-94 ; 0x1bfc2 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1c020: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1c024: 80 62 ori r24, 0x20 ; 32 1c026: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1c02a: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1c02e: c9 cf rjmp .-110 ; 0x1bfc2 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1c030: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c034: 80 68 ori r24, 0x80 ; 128 1c036: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1c03a: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1c03e: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1c042: bf cf rjmp .-130 ; 0x1bfc2 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1c044: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c048: 80 62 ori r24, 0x20 ; 32 1c04a: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1c04e: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1c052: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1c056: b5 cf rjmp .-150 ; 0x1bfc2 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1c058: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c05c: 88 60 ori r24, 0x08 ; 8 1c05e: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1c062: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1c066: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1c06a: ab cf rjmp .-170 ; 0x1bfc2 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1c06c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c070: 80 68 ori r24, 0x80 ; 128 1c072: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1c076: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c07a: 8f 7b andi r24, 0xBF ; 191 1c07c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1c080: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1c084: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1c088: 9c cf rjmp .-200 ; 0x1bfc2 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1c08a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c08e: 80 62 ori r24, 0x20 ; 32 1c090: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1c094: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1c098: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1c09c: 92 cf rjmp .-220 ; 0x1bfc2 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1c09e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c0a2: 88 60 ori r24, 0x08 ; 8 1c0a4: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1c0a8: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1c0ac: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1c0b0: 88 cf rjmp .-240 ; 0x1bfc2 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1c0b2: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c0b6: 80 68 ori r24, 0x80 ; 128 1c0b8: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1c0bc: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1c0c0: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1c0c4: 7e cf rjmp .-260 ; 0x1bfc2 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1c0c6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c0ca: 80 62 ori r24, 0x20 ; 32 1c0cc: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1c0d0: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1c0d4: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1c0d8: 74 cf rjmp .-280 ; 0x1bfc2 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1c0da: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c0de: 88 60 ori r24, 0x08 ; 8 1c0e0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1c0e4: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1c0e8: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1c0ec: 6a cf rjmp .-300 ; 0x1bfc2 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1c0ee: c0 38 cpi r28, 0x80 ; 128 1c0f0: d1 05 cpc r29, r1 1c0f2: 0c f0 brlt .+2 ; 0x1c0f6 1c0f4: 3e cf rjmp .-388 ; 0x1bf72 1c0f6: 33 cf rjmp .-410 ; 0x1bf5e 0001c0f8 : } } /// 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){ 1c0f8: 4f 92 push r4 1c0fa: 5f 92 push r5 1c0fc: 6f 92 push r6 1c0fe: 7f 92 push r7 1c100: 8f 92 push r8 1c102: 9f 92 push r9 1c104: af 92 push r10 1c106: bf 92 push r11 1c108: cf 92 push r12 1c10a: df 92 push r13 1c10c: ef 92 push r14 1c10e: ff 92 push r15 1c110: 0f 93 push r16 1c112: 1f 93 push r17 1c114: cf 93 push r28 1c116: 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 1c118: 86 b9 out 0x06, r24 ; 6 1c11a: fa 01 movw r30, r20 1c11c: e0 80 ld r14, Z 1c11e: 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){ 1c120: 16 16 cp r1, r22 1c122: 17 06 cpc r1, r23 1c124: b4 f4 brge .+44 ; 0x1c152 1c126: e2 16 cp r14, r18 1c128: f3 06 cpc r15, r19 1c12a: 99 f4 brne .+38 ; 0x1c152 delayMicroseconds(delay_us); 1c12c: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1c12e: df 91 pop r29 1c130: cf 91 pop r28 1c132: 1f 91 pop r17 1c134: 0f 91 pop r16 1c136: ff 90 pop r15 1c138: ef 90 pop r14 1c13a: df 90 pop r13 1c13c: cf 90 pop r12 1c13e: bf 90 pop r11 1c140: af 90 pop r10 1c142: 9f 90 pop r9 1c144: 8f 90 pop r8 1c146: 7f 90 pop r7 1c148: 6f 90 pop r6 1c14a: 5f 90 pop r5 1c14c: 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); 1c14e: 0c 94 12 df jmp 0x1be24 ; 0x1be24 1c152: 89 01 movw r16, r18 1c154: 6a 01 movw r12, r20 1c156: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1c158: b7 01 movw r22, r14 1c15a: 90 e0 ldi r25, 0x00 ; 0 1c15c: 80 e0 ldi r24, 0x00 ; 0 1c15e: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 1c162: 2d eb ldi r18, 0xBD ; 189 1c164: 37 e3 ldi r19, 0x37 ; 55 1c166: 46 e8 ldi r20, 0x86 ; 134 1c168: 55 e3 ldi r21, 0x35 ; 53 1c16a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1c16e: 4b 01 movw r8, r22 1c170: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1c172: be 01 movw r22, r28 1c174: 0d 2e mov r0, r29 1c176: 00 0c add r0, r0 1c178: 88 0b sbc r24, r24 1c17a: 99 0b sbc r25, r25 1c17c: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1c180: a5 01 movw r20, r10 1c182: 94 01 movw r18, r8 1c184: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1c188: 2b 01 movw r4, r22 1c18a: 3c 01 movw r6, r24 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 6d df call 0x3beda ; 0x3beda <__divsf3> 1c19c: 9b 01 movw r18, r22 1c19e: ac 01 movw r20, r24 1c1a0: c3 01 movw r24, r6 1c1a2: b2 01 movw r22, r4 1c1a4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1c1a8: 4b 01 movw r8, r22 1c1aa: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1c1ac: 2a e0 ldi r18, 0x0A ; 10 1c1ae: 37 ed ldi r19, 0xD7 ; 215 1c1b0: 43 e2 ldi r20, 0x23 ; 35 1c1b2: 5e e3 ldi r21, 0x3E ; 62 1c1b4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1c1b8: 18 16 cp r1, r24 1c1ba: dc f5 brge .+118 ; 0x1c232 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)); 1c1bc: a5 01 movw r20, r10 1c1be: 94 01 movw r18, r8 1c1c0: 6a e0 ldi r22, 0x0A ; 10 1c1c2: 77 ed ldi r23, 0xD7 ; 215 1c1c4: 83 e2 ldi r24, 0x23 ; 35 1c1c6: 9c e3 ldi r25, 0x3C ; 60 1c1c8: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1c1cc: 20 e0 ldi r18, 0x00 ; 0 1c1ce: 34 e2 ldi r19, 0x24 ; 36 1c1d0: 44 e7 ldi r20, 0x74 ; 116 1c1d2: 59 e4 ldi r21, 0x49 ; 73 1c1d4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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); 1c1d8: 20 e0 ldi r18, 0x00 ; 0 1c1da: 30 e0 ldi r19, 0x00 ; 0 1c1dc: 40 e0 ldi r20, 0x00 ; 0 1c1de: 5f e3 ldi r21, 0x3F ; 63 1c1e0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1c1e4: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 1c1e8: 5b 01 movw r10, r22 1c1ea: 60 17 cp r22, r16 1c1ec: 71 07 cpc r23, r17 1c1ee: 08 f4 brcc .+2 ; 0x1c1f2 1c1f0: 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){ 1c1f2: ea 14 cp r14, r10 1c1f4: fb 04 cpc r15, r11 1c1f6: 31 f4 brne .+12 ; 0x1c204 1c1f8: 20 97 sbiw r28, 0x00 ; 0 1c1fa: 21 f0 breq .+8 ; 0x1c204 if (acc > 0) 1c1fc: fc f0 brlt .+62 ; 0x1c23c t1--; 1c1fe: f1 e0 ldi r31, 0x01 ; 1 1c200: af 1a sub r10, r31 1c202: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1c204: c5 01 movw r24, r10 1c206: 0e 94 12 df call 0x1be24 ; 0x1be24 delay_us = t1; 1c20a: f6 01 movw r30, r12 1c20c: b1 82 std Z+1, r11 ; 0x01 1c20e: a0 82 st Z, r10 } 1c210: df 91 pop r29 1c212: cf 91 pop r28 1c214: 1f 91 pop r17 1c216: 0f 91 pop r16 1c218: ff 90 pop r15 1c21a: ef 90 pop r14 1c21c: df 90 pop r13 1c21e: cf 90 pop r12 1c220: bf 90 pop r11 1c222: af 90 pop r10 1c224: 9f 90 pop r9 1c226: 8f 90 pop r8 1c228: 7f 90 pop r7 1c22a: 6f 90 pop r6 1c22c: 5f 90 pop r5 1c22e: 4f 90 pop r4 1c230: 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 1c232: 80 e1 ldi r24, 0x10 ; 16 1c234: a8 2e mov r10, r24 1c236: 87 e2 ldi r24, 0x27 ; 39 1c238: b8 2e mov r11, r24 1c23a: db cf rjmp .-74 ; 0x1c1f2 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1c23c: 8f ef ldi r24, 0xFF ; 255 1c23e: a8 1a sub r10, r24 1c240: b8 0a sbc r11, r24 1c242: e0 cf rjmp .-64 ; 0x1c204 0001c244 : /// 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){ 1c244: 2f 92 push r2 1c246: 3f 92 push r3 1c248: 4f 92 push r4 1c24a: 5f 92 push r5 1c24c: 6f 92 push r6 1c24e: 7f 92 push r7 1c250: 8f 92 push r8 1c252: 9f 92 push r9 1c254: af 92 push r10 1c256: bf 92 push r11 1c258: cf 92 push r12 1c25a: df 92 push r13 1c25c: ef 92 push r14 1c25e: ff 92 push r15 1c260: 0f 93 push r16 1c262: 1f 93 push r17 1c264: cf 93 push r28 1c266: df 93 push r29 1c268: 00 d0 rcall .+0 ; 0x1c26a 1c26a: cd b7 in r28, 0x3d ; 61 1c26c: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1c26e: f9 01 movw r30, r18 1c270: e0 80 ld r14, Z 1c272: f1 80 ldd r15, Z+1 ; 0x01 1c274: e1 14 cp r14, r1 1c276: f1 04 cpc r15, r1 1c278: 09 f4 brne .+2 ; 0x1c27c 1c27a: 6b c0 rjmp .+214 ; 0x1c352 1c27c: 16 16 cp r1, r22 1c27e: 17 06 cpc r1, r23 1c280: 0c f0 brlt .+2 ; 0x1c284 1c282: 67 c0 rjmp .+206 ; 0x1c352 1c284: 19 01 movw r2, r18 1c286: 5b 83 std Y+3, r21 ; 0x03 1c288: 4a 83 std Y+2, r20 ; 0x02 1c28a: 6b 01 movw r12, r22 1c28c: 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)); 1c28e: fa 01 movw r30, r20 1c290: 00 81 ld r16, Z 1c292: 11 81 ldd r17, Z+1 ; 0x01 1c294: b8 01 movw r22, r16 1c296: 90 e0 ldi r25, 0x00 ; 0 1c298: 80 e0 ldi r24, 0x00 ; 0 1c29a: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 1c29e: 4b 01 movw r8, r22 1c2a0: 5c 01 movw r10, r24 1c2a2: b6 01 movw r22, r12 1c2a4: 0d 2c mov r0, r13 1c2a6: 00 0c add r0, r0 1c2a8: 88 0b sbc r24, r24 1c2aa: 99 0b sbc r25, r25 1c2ac: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1c2b0: 2b 01 movw r4, r22 1c2b2: 3c 01 movw r6, r24 1c2b4: a5 01 movw r20, r10 1c2b6: 94 01 movw r18, r8 1c2b8: c5 01 movw r24, r10 1c2ba: b4 01 movw r22, r8 1c2bc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1c2c0: 9b 01 movw r18, r22 1c2c2: ac 01 movw r20, r24 1c2c4: c3 01 movw r24, r6 1c2c6: b2 01 movw r22, r4 1c2c8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1c2cc: 9b 01 movw r18, r22 1c2ce: ac 01 movw r20, r24 1c2d0: 6a e0 ldi r22, 0x0A ; 10 1c2d2: 77 ed ldi r23, 0xD7 ; 215 1c2d4: 83 ea ldi r24, 0xA3 ; 163 1c2d6: 9b e3 ldi r25, 0x3B ; 59 1c2d8: 0f 94 6d df call 0x3beda ; 0x3beda <__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); 1c2dc: 20 e0 ldi r18, 0x00 ; 0 1c2de: 30 e0 ldi r19, 0x00 ; 0 1c2e0: 40 e0 ldi r20, 0x00 ; 0 1c2e2: 5f e3 ldi r21, 0x3F ; 63 1c2e4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1c2e8: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__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){ 1c2ec: 6e 15 cp r22, r14 1c2ee: 7f 05 cpc r23, r15 1c2f0: 28 f5 brcc .+74 ; 0x1c33c 1c2f2: f9 81 ldd r31, Y+1 ; 0x01 1c2f4: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1c2f6: ea 81 ldd r30, Y+2 ; 0x02 1c2f8: fb 81 ldd r31, Y+3 ; 0x03 1c2fa: 80 81 ld r24, Z 1c2fc: 91 81 ldd r25, Z+1 ; 0x01 1c2fe: 0e 94 12 df call 0x1be24 ; 0x1be24 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1c302: f1 01 movw r30, r2 1c304: 80 81 ld r24, Z 1c306: 91 81 ldd r25, Z+1 ; 0x01 1c308: 01 97 sbiw r24, 0x01 ; 1 1c30a: 91 83 std Z+1, r25 ; 0x01 1c30c: 80 83 st Z, r24 return true; 1c30e: 81 e0 ldi r24, 0x01 ; 1 } 1c310: 0f 90 pop r0 1c312: 0f 90 pop r0 1c314: 0f 90 pop r0 1c316: df 91 pop r29 1c318: cf 91 pop r28 1c31a: 1f 91 pop r17 1c31c: 0f 91 pop r16 1c31e: ff 90 pop r15 1c320: ef 90 pop r14 1c322: df 90 pop r13 1c324: cf 90 pop r12 1c326: bf 90 pop r11 1c328: af 90 pop r10 1c32a: 9f 90 pop r9 1c32c: 8f 90 pop r8 1c32e: 7f 90 pop r7 1c330: 6f 90 pop r6 1c332: 5f 90 pop r5 1c334: 4f 90 pop r4 1c336: 3f 90 pop r3 1c338: 2f 90 pop r2 1c33a: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1c33c: 66 27 eor r22, r22 1c33e: 77 27 eor r23, r23 1c340: 6c 19 sub r22, r12 1c342: 7d 09 sbc r23, r13 1c344: 98 01 movw r18, r16 1c346: 4a 81 ldd r20, Y+2 ; 0x02 1c348: 5b 81 ldd r21, Y+3 ; 0x03 1c34a: 89 81 ldd r24, Y+1 ; 0x01 1c34c: 0e 94 7c e0 call 0x1c0f8 ; 0x1c0f8 1c350: d8 cf rjmp .-80 ; 0x1c302 /// 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; 1c352: 80 e0 ldi r24, 0x00 ; 0 1c354: dd cf rjmp .-70 ; 0x1c310 0001c356 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1c356: 0f 93 push r16 1c358: 1f 93 push r17 1c35a: cf 93 push r28 1c35c: df 93 push r29 1c35e: 18 2f mov r17, r24 1c360: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c362: d1 e0 ldi r29, 0x01 ; 1 1c364: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1c366: 81 2f mov r24, r17 1c368: 8d 23 and r24, r29 1c36a: 29 f0 breq .+10 ; 0x1c376 sm4_set_dir(i, dir & mask); 1c36c: 60 2f mov r22, r16 1c36e: 6d 23 and r22, r29 1c370: 8c 2f mov r24, r28 1c372: 0f 94 2c 6b call 0x2d658 ; 0x2d658 } } } 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) { 1c376: cf 5f subi r28, 0xFF ; 255 1c378: dd 0f add r29, r29 1c37a: c3 30 cpi r28, 0x03 ; 3 1c37c: a1 f7 brne .-24 ; 0x1c366 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1c37e: df 91 pop r29 1c380: cf 91 pop r28 1c382: 1f 91 pop r17 1c384: 0f 91 pop r16 1c386: 08 95 ret 0001c388 : //@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) { 1c388: 8f 92 push r8 1c38a: 9f 92 push r9 1c38c: af 92 push r10 1c38e: bf 92 push r11 1c390: cf 92 push r12 1c392: df 92 push r13 1c394: ef 92 push r14 1c396: ff 92 push r15 1c398: 30 e0 ldi r19, 0x00 ; 0 1c39a: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c39c: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1c39e: 48 2f mov r20, r24 1c3a0: 49 23 and r20, r25 1c3a2: 19 f1 breq .+70 ; 0x1c3ea count_position[i] += dir & mask ? -1L : 1L; 1c3a4: a9 01 movw r20, r18 1c3a6: 44 0f add r20, r20 1c3a8: 55 1f adc r21, r21 1c3aa: 44 0f add r20, r20 1c3ac: 55 1f adc r21, r21 1c3ae: fa 01 movw r30, r20 1c3b0: ef 59 subi r30, 0x9F ; 159 1c3b2: f8 4f sbci r31, 0xF8 ; 248 1c3b4: c0 80 ld r12, Z 1c3b6: d1 80 ldd r13, Z+1 ; 0x01 1c3b8: e2 80 ldd r14, Z+2 ; 0x02 1c3ba: f3 80 ldd r15, Z+3 ; 0x03 1c3bc: 76 2f mov r23, r22 1c3be: 79 23 and r23, r25 1c3c0: 81 2c mov r8, r1 1c3c2: 91 2c mov r9, r1 1c3c4: 54 01 movw r10, r8 1c3c6: 83 94 inc r8 1c3c8: 77 23 and r23, r23 1c3ca: 21 f0 breq .+8 ; 0x1c3d4 1c3cc: 88 24 eor r8, r8 1c3ce: 8a 94 dec r8 1c3d0: 98 2c mov r9, r8 1c3d2: 54 01 movw r10, r8 1c3d4: c8 0c add r12, r8 1c3d6: d9 1c adc r13, r9 1c3d8: ea 1c adc r14, r10 1c3da: fb 1c adc r15, r11 1c3dc: 4f 59 subi r20, 0x9F ; 159 1c3de: 58 4f sbci r21, 0xF8 ; 248 1c3e0: fa 01 movw r30, r20 1c3e2: c0 82 st Z, r12 1c3e4: d1 82 std Z+1, r13 ; 0x01 1c3e6: e2 82 std Z+2, r14 ; 0x02 1c3e8: 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) { 1c3ea: 99 0f add r25, r25 1c3ec: 2f 5f subi r18, 0xFF ; 255 1c3ee: 3f 4f sbci r19, 0xFF ; 255 1c3f0: 23 30 cpi r18, 0x03 ; 3 1c3f2: 31 05 cpc r19, r1 1c3f4: a1 f6 brne .-88 ; 0x1c39e if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1c3f6: ff 90 pop r15 1c3f8: ef 90 pop r14 1c3fa: df 90 pop r13 1c3fc: cf 90 pop r12 1c3fe: bf 90 pop r11 1c400: af 90 pop r10 1c402: 9f 90 pop r9 1c404: 8f 90 pop r8 1c406: 08 95 ret 0001c408 : /// 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) { 1c408: 2f 92 push r2 1c40a: 3f 92 push r3 1c40c: 4f 92 push r4 1c40e: 5f 92 push r5 1c410: 6f 92 push r6 1c412: 7f 92 push r7 1c414: 8f 92 push r8 1c416: 9f 92 push r9 1c418: af 92 push r10 1c41a: bf 92 push r11 1c41c: cf 92 push r12 1c41e: df 92 push r13 1c420: ef 92 push r14 1c422: ff 92 push r15 1c424: 0f 93 push r16 1c426: 1f 93 push r17 1c428: cf 93 push r28 1c42a: df 93 push r29 1c42c: 00 d0 rcall .+0 ; 0x1c42e 1c42e: 00 d0 rcall .+0 ; 0x1c430 1c430: cd b7 in r28, 0x3d ; 61 1c432: 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]; 1c434: c0 90 61 07 lds r12, 0x0761 ; 0x800761 1c438: d0 90 62 07 lds r13, 0x0762 ; 0x800762 1c43c: e0 90 63 07 lds r14, 0x0763 ; 0x800763 1c440: f0 90 64 07 lds r15, 0x0764 ; 0x800764 1c444: 7c 01 movw r14, r24 1c446: ec 18 sub r14, r12 1c448: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1c44a: 80 91 65 07 lds r24, 0x0765 ; 0x800765 1c44e: 90 91 66 07 lds r25, 0x0766 ; 0x800766 1c452: a0 91 67 07 lds r26, 0x0767 ; 0x800767 1c456: b0 91 68 07 lds r27, 0x0768 ; 0x800768 1c45a: 68 1b sub r22, r24 1c45c: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1c45e: 80 91 69 07 lds r24, 0x0769 ; 0x800769 1c462: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 1c466: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 1c46a: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 1c46e: fa 01 movw r30, r20 1c470: e8 1b sub r30, r24 1c472: f9 0b sbc r31, r25 1c474: fa 83 std Y+2, r31 ; 0x02 1c476: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1c478: fb 01 movw r30, r22 1c47a: ff 0f add r31, r31 1c47c: ee 0b sbc r30, r30 1c47e: ff 0f add r31, r31 1c480: fe 2f mov r31, r30 1c482: ee 1f adc r30, r30 1c484: e2 70 andi r30, 0x02 ; 2 1c486: 89 81 ldd r24, Y+1 ; 0x01 1c488: 9a 81 ldd r25, Y+2 ; 0x02 1c48a: 88 e0 ldi r24, 0x08 ; 8 1c48c: 98 02 muls r25, r24 1c48e: 81 2d mov r24, r1 1c490: 99 0b sbc r25, r25 1c492: 11 24 eor r1, r1 1c494: 84 70 andi r24, 0x04 ; 4 1c496: e8 2b or r30, r24 1c498: 8f 2d mov r24, r15 1c49a: 88 1f adc r24, r24 1c49c: 88 27 eor r24, r24 1c49e: 88 1f adc r24, r24 1c4a0: e8 2b or r30, r24 1c4a2: e0 93 f8 03 sts 0x03F8, r30 ; 0x8003f8 asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1c4a6: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1c4aa: 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; 1c4ac: 8a e0 ldi r24, 0x0A ; 10 1c4ae: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1c4b0: e0 fd sbrc r30, 0 1c4b2: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1c4b4: e1 fd sbrc r30, 1 1c4b6: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1c4b8: e2 fd sbrc r30, 2 1c4ba: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1c4bc: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1c4be: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1c4c2: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1c4c4: 8b ef ldi r24, 0xFB ; 251 1c4c6: 9f ec ldi r25, 0xCF ; 207 1c4c8: 01 11 cpse r16, r1 1c4ca: 02 c0 rjmp .+4 ; 0x1c4d0 1c4cc: 90 e0 ldi r25, 0x00 ; 0 1c4ce: 80 e0 ldi r24, 0x00 ; 0 1c4d0: 90 93 66 05 sts 0x0566, r25 ; 0x800566 1c4d4: 80 93 65 05 sts 0x0565, r24 ; 0x800565 xyzcal_sm4_delay = delay_us; 1c4d8: 30 93 f7 03 sts 0x03F7, r19 ; 0x8003f7 1c4dc: 20 93 f6 03 sts 0x03F6, r18 ; 0x8003f6 // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1c4e0: 29 81 ldd r18, Y+1 ; 0x01 1c4e2: 3a 81 ldd r19, Y+2 ; 0x02 1c4e4: 3e 83 std Y+6, r19 ; 0x06 1c4e6: 2d 83 std Y+5, r18 ; 0x05 1c4e8: 37 ff sbrs r19, 7 1c4ea: 05 c0 rjmp .+10 ; 0x1c4f6 1c4ec: 31 95 neg r19 1c4ee: 21 95 neg r18 1c4f0: 31 09 sbc r19, r1 1c4f2: 3e 83 std Y+6, r19 ; 0x06 1c4f4: 2d 83 std Y+5, r18 ; 0x05 1c4f6: 8b 01 movw r16, r22 1c4f8: 77 ff sbrs r23, 7 1c4fa: 03 c0 rjmp .+6 ; 0x1c502 1c4fc: 11 95 neg r17 1c4fe: 01 95 neg r16 1c500: 11 09 sbc r17, r1 1c502: f7 fe sbrs r15, 7 1c504: 03 c0 rjmp .+6 ; 0x1c50c 1c506: f1 94 neg r15 1c508: e1 94 neg r14 1c50a: 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); 1c50c: 98 01 movw r18, r16 1c50e: d8 01 movw r26, r16 1c510: 0f 94 5e de call 0x3bcbc ; 0x3bcbc <__mulhisi3> 1c514: 4b 01 movw r8, r22 1c516: 5c 01 movw r10, r24 1c518: 2d 81 ldd r18, Y+5 ; 0x05 1c51a: 3e 81 ldd r19, Y+6 ; 0x06 1c51c: d9 01 movw r26, r18 1c51e: 0f 94 5e de call 0x3bcbc ; 0x3bcbc <__mulhisi3> 1c522: 86 0e add r8, r22 1c524: 97 1e adc r9, r23 1c526: a8 1e adc r10, r24 1c528: b9 1e adc r11, r25 1c52a: 97 01 movw r18, r14 1c52c: d7 01 movw r26, r14 1c52e: 0f 94 5e de call 0x3bcbc ; 0x3bcbc <__mulhisi3> 1c532: 68 0d add r22, r8 1c534: 79 1d adc r23, r9 1c536: 8a 1d adc r24, r10 1c538: 9b 1d adc r25, r11 1c53a: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 1c53e: 0f 94 3c e2 call 0x3c478 ; 0x3c478 1c542: 20 e0 ldi r18, 0x00 ; 0 1c544: 30 e0 ldi r19, 0x00 ; 0 1c546: 40 e0 ldi r20, 0x00 ; 0 1c548: 5f e3 ldi r21, 0x3F ; 63 1c54a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1c54e: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 1c552: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1c554: 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; 1c556: 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; 1c558: 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; 1c55a: 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; 1c55c: 1c 82 std Y+4, r1 ; 0x04 1c55e: 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; 1c560: 31 2c mov r3, r1 1c562: 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; 1c564: 1a 82 std Y+2, r1 ; 0x02 1c566: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1c568: 61 14 cp r6, r1 1c56a: 71 04 cpc r7, r1 1c56c: 09 f4 brne .+2 ; 0x1c570 1c56e: 47 c0 rjmp .+142 ; 0x1c5fe if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1c570: e0 91 65 05 lds r30, 0x0565 ; 0x800565 1c574: f0 91 66 05 lds r31, 0x0566 ; 0x800566 1c578: 30 97 sbiw r30, 0x00 ; 0 1c57a: e9 f5 brne .+122 ; 0x1c5f6 uint8_t sm = 0; //step mask 1c57c: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1c57e: ec 14 cp r14, r12 1c580: fd 04 cpc r15, r13 1c582: 40 f0 brcs .+16 ; 0x1c594 sm |= 1; cx += dd; 1c584: c4 0c add r12, r4 1c586: d5 1c adc r13, r5 x++; 1c588: 89 81 ldd r24, Y+1 ; 0x01 1c58a: 9a 81 ldd r25, Y+2 ; 0x02 1c58c: 01 96 adiw r24, 0x01 ; 1 1c58e: 9a 83 std Y+2, r25 ; 0x02 1c590: 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; 1c592: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1c594: 0a 15 cp r16, r10 1c596: 1b 05 cpc r17, r11 1c598: 30 f0 brcs .+12 ; 0x1c5a6 sm |= 2; 1c59a: 82 60 ori r24, 0x02 ; 2 cy += dd; 1c59c: a4 0c add r10, r4 1c59e: b5 1c adc r11, r5 y++; 1c5a0: 9f ef ldi r25, 0xFF ; 255 1c5a2: 29 1a sub r2, r25 1c5a4: 39 0a sbc r3, r25 } if (cz <= dz){ 1c5a6: ed 81 ldd r30, Y+5 ; 0x05 1c5a8: fe 81 ldd r31, Y+6 ; 0x06 1c5aa: e8 15 cp r30, r8 1c5ac: f9 05 cpc r31, r9 1c5ae: 48 f0 brcs .+18 ; 0x1c5c2 sm |= 4; 1c5b0: 84 60 ori r24, 0x04 ; 4 cz += dd; 1c5b2: 84 0c add r8, r4 1c5b4: 95 1c adc r9, r5 z++; 1c5b6: 2b 81 ldd r18, Y+3 ; 0x03 1c5b8: 3c 81 ldd r19, Y+4 ; 0x04 1c5ba: 2f 5f subi r18, 0xFF ; 255 1c5bc: 3f 4f sbci r19, 0xFF ; 255 1c5be: 3c 83 std Y+4, r19 ; 0x04 1c5c0: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1c5c2: ce 18 sub r12, r14 1c5c4: df 08 sbc r13, r15 cy -= dy; 1c5c6: a0 1a sub r10, r16 1c5c8: b1 0a sbc r11, r17 cz -= dz; 1c5ca: ed 81 ldd r30, Y+5 ; 0x05 1c5cc: fe 81 ldd r31, Y+6 ; 0x06 1c5ce: 8e 1a sub r8, r30 1c5d0: 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 1c5d2: 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); 1c5d4: e0 91 61 05 lds r30, 0x0561 ; 0x800561 1c5d8: f0 91 62 05 lds r31, 0x0562 ; 0x800562 1c5dc: 30 97 sbiw r30, 0x00 ; 0 1c5de: d1 f1 breq .+116 ; 0x1c654 1c5e0: b2 01 movw r22, r4 1c5e2: c3 01 movw r24, r6 1c5e4: 19 95 eicall if (delay) delayMicroseconds(delay); 1c5e6: 00 97 sbiw r24, 0x00 ; 0 1c5e8: 11 f0 breq .+4 ; 0x1c5ee 1c5ea: 0e 94 12 df call 0x1be24 ; 0x1be24 nd--; 1c5ee: f1 e0 ldi r31, 0x01 ; 1 1c5f0: 6f 1a sub r6, r31 1c5f2: 71 08 sbc r7, r1 1c5f4: b9 cf rjmp .-142 ; 0x1c568 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; 1c5f6: 19 95 eicall 1c5f8: 88 23 and r24, r24 1c5fa: 09 f4 brne .+2 ; 0x1c5fe 1c5fc: bf cf rjmp .-130 ; 0x1c57c 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) 1c5fe: e0 91 63 05 lds r30, 0x0563 ; 0x800563 1c602: f0 91 64 05 lds r31, 0x0564 ; 0x800564 1c606: 30 97 sbiw r30, 0x00 ; 0 1c608: 41 f0 breq .+16 ; 0x1c61a (*sm4_update_pos_cb)(x, y, z, 0); 1c60a: 30 e0 ldi r19, 0x00 ; 0 1c60c: 20 e0 ldi r18, 0x00 ; 0 1c60e: 4b 81 ldd r20, Y+3 ; 0x03 1c610: 5c 81 ldd r21, Y+4 ; 0x04 1c612: b1 01 movw r22, r2 1c614: 89 81 ldd r24, Y+1 ; 0x01 1c616: 9a 81 ldd r25, Y+2 ; 0x02 1c618: 19 95 eicall 1c61a: 81 e0 ldi r24, 0x01 ; 1 1c61c: 67 28 or r6, r7 1c61e: 09 f4 brne .+2 ; 0x1c622 1c620: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1c622: 26 96 adiw r28, 0x06 ; 6 1c624: 0f b6 in r0, 0x3f ; 63 1c626: f8 94 cli 1c628: de bf out 0x3e, r29 ; 62 1c62a: 0f be out 0x3f, r0 ; 63 1c62c: cd bf out 0x3d, r28 ; 61 1c62e: df 91 pop r29 1c630: cf 91 pop r28 1c632: 1f 91 pop r17 1c634: 0f 91 pop r16 1c636: ff 90 pop r15 1c638: ef 90 pop r14 1c63a: df 90 pop r13 1c63c: cf 90 pop r12 1c63e: bf 90 pop r11 1c640: af 90 pop r10 1c642: 9f 90 pop r9 1c644: 8f 90 pop r8 1c646: 7f 90 pop r7 1c648: 6f 90 pop r6 1c64a: 5f 90 pop r5 1c64c: 4f 90 pop r4 1c64e: 3f 90 pop r3 1c650: 2f 90 pop r2 1c652: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1c654: 84 ef ldi r24, 0xF4 ; 244 1c656: 91 e0 ldi r25, 0x01 ; 1 1c658: c8 cf rjmp .-112 ; 0x1c5ea 0001c65a : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1c65a: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1c65c: 0d b4 in r0, 0x2d ; 45 1c65e: 07 fe sbrs r0, 7 1c660: fd cf rjmp .-6 ; 0x1c65c return SPDR; 1c662: 8e b5 in r24, 0x2e ; 46 } 1c664: 08 95 ret 0001c666 : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1c666: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1c668: 85 e0 ldi r24, 0x05 ; 5 1c66a: 0e 94 2d e3 call 0x1c65a ; 0x1c65a uint8_t val = _SPI_RX(); // receive value 1c66e: 8f ef ldi r24, 0xFF ; 255 1c670: 0e 94 2d e3 call 0x1c65a ; 0x1c65a _CS_HIGH(); 1c674: 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) ; 1c676: 80 fd sbrc r24, 0 1c678: f6 cf rjmp .-20 ; 0x1c666 } 1c67a: 08 95 ret 0001c67c : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1c67c: 1f 93 push r17 1c67e: cf 93 push r28 1c680: df 93 push r29 1c682: ea 01 movw r28, r20 1c684: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1c686: 0e 94 2d e3 call 0x1c65a ; 0x1c65a _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1c68a: 81 2f mov r24, r17 1c68c: 0e 94 2d e3 call 0x1c65a ; 0x1c65a _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1c690: 8d 2f mov r24, r29 1c692: 0e 94 2d e3 call 0x1c65a ; 0x1c65a _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1c696: 8c 2f mov r24, r28 } 1c698: df 91 pop r29 1c69a: cf 91 pop r28 1c69c: 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 1c69e: 0c 94 2d e3 jmp 0x1c65a ; 0x1c65a 0001c6a2 : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1c6a2: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1c6a4: 0e 94 3e e3 call 0x1c67c ; 0x1c67c _CS_HIGH(); 1c6a8: 45 9a sbi 0x08, 5 ; 8 } 1c6aa: 08 95 ret 0001c6ac : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1c6ac: ef 92 push r14 1c6ae: ff 92 push r15 1c6b0: 0f 93 push r16 1c6b2: 1f 93 push r17 1c6b4: cf 93 push r28 1c6b6: df 93 push r29 1c6b8: 7a 01 movw r14, r20 1c6ba: 89 01 movw r16, r18 _CS_LOW(); 1c6bc: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c6be: ab 01 movw r20, r22 1c6c0: bc 01 movw r22, r24 1c6c2: 82 e0 ldi r24, 0x02 ; 2 1c6c4: 0e 94 3e e3 call 0x1c67c ; 0x1c67c 1c6c8: e7 01 movw r28, r14 1c6ca: 0e 0d add r16, r14 1c6cc: 1f 1d adc r17, r15 while (cnt--) // send data 1c6ce: c0 17 cp r28, r16 1c6d0: d1 07 cpc r29, r17 1c6d2: 41 f4 brne .+16 ; 0x1c6e4 _SPI_TX(*(data++)); _CS_HIGH(); 1c6d4: 45 9a sbi 0x08, 5 ; 8 } 1c6d6: df 91 pop r29 1c6d8: cf 91 pop r28 1c6da: 1f 91 pop r17 1c6dc: 0f 91 pop r16 1c6de: ff 90 pop r15 1c6e0: ef 90 pop r14 1c6e2: 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++)); 1c6e4: 89 91 ld r24, Y+ 1c6e6: 0e 94 2d e3 call 0x1c65a ; 0x1c65a 1c6ea: f1 cf rjmp .-30 ; 0x1c6ce 0001c6ec : _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) { 1c6ec: ef 92 push r14 1c6ee: ff 92 push r15 1c6f0: 0f 93 push r16 1c6f2: 1f 93 push r17 1c6f4: cf 93 push r28 1c6f6: df 93 push r29 1c6f8: 7a 01 movw r14, r20 1c6fa: 89 01 movw r16, r18 _CS_LOW(); 1c6fc: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1c6fe: ab 01 movw r20, r22 1c700: bc 01 movw r22, r24 1c702: 83 e0 ldi r24, 0x03 ; 3 1c704: 0e 94 3e e3 call 0x1c67c ; 0x1c67c 1c708: e7 01 movw r28, r14 1c70a: 0e 0d add r16, r14 1c70c: 1f 1d adc r17, r15 while (cnt--) // receive data 1c70e: c0 17 cp r28, r16 1c710: d1 07 cpc r29, r17 1c712: 41 f4 brne .+16 ; 0x1c724 *(data++) = _SPI_RX(); _CS_HIGH(); 1c714: 45 9a sbi 0x08, 5 ; 8 } 1c716: df 91 pop r29 1c718: cf 91 pop r28 1c71a: 1f 91 pop r17 1c71c: 0f 91 pop r16 1c71e: ff 90 pop r15 1c720: ef 90 pop r14 1c722: 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(); 1c724: 8f ef ldi r24, 0xFF ; 255 1c726: 0e 94 2d e3 call 0x1c65a ; 0x1c65a 1c72a: 89 93 st Y+, r24 1c72c: f0 cf rjmp .-32 ; 0x1c70e 0001c72e : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1c72e: 0f 93 push r16 1c730: 1f 93 push r17 1c732: cf 93 push r28 1c734: df 93 push r29 1c736: 00 d0 rcall .+0 ; 0x1c738 1c738: 1f 92 push r1 1c73a: cd b7 in r28, 0x3d ; 61 1c73c: de b7 in r29, 0x3e ; 62 1c73e: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c740: 8c e5 ldi r24, 0x5C ; 92 1c742: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c744: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1c746: 24 e0 ldi r18, 0x04 ; 4 1c748: 30 e0 ldi r19, 0x00 ; 0 1c74a: ae 01 movw r20, r28 1c74c: 4f 5f subi r20, 0xFF ; 255 1c74e: 5f 4f sbci r21, 0xFF ; 255 1c750: 60 e0 ldi r22, 0x00 ; 0 1c752: 70 ed ldi r23, 0xD0 ; 208 1c754: 83 e0 ldi r24, 0x03 ; 3 1c756: 90 e0 ldi r25, 0x00 ; 0 1c758: 0e 94 76 e3 call 0x1c6ec ; 0x1c6ec (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1c75c: 89 81 ldd r24, Y+1 ; 0x01 1c75e: 9a 81 ldd r25, Y+2 ; 0x02 1c760: ab 81 ldd r26, Y+3 ; 0x03 1c762: bc 81 ldd r27, Y+4 ; 0x04 1c764: 87 34 cpi r24, 0x47 ; 71 1c766: 95 45 sbci r25, 0x55 ; 85 1c768: a2 45 sbci r26, 0x52 ; 82 1c76a: b5 45 sbci r27, 0x55 ; 85 1c76c: 71 f4 brne .+28 ; 0x1c78a return false; if (reason) 1c76e: 01 15 cp r16, r1 1c770: 11 05 cpc r17, r1 1c772: 49 f0 breq .+18 ; 0x1c786 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1c774: 21 e0 ldi r18, 0x01 ; 1 1c776: 30 e0 ldi r19, 0x00 ; 0 1c778: a8 01 movw r20, r16 1c77a: 65 e0 ldi r22, 0x05 ; 5 1c77c: 70 ed ldi r23, 0xD0 ; 208 1c77e: 83 e0 ldi r24, 0x03 ; 3 1c780: 90 e0 ldi r25, 0x00 ; 0 1c782: 0e 94 76 e3 call 0x1c6ec ; 0x1c6ec (uint8_t*)reason, sizeof(*reason)); } return true; 1c786: 81 e0 ldi r24, 0x01 ; 1 1c788: 01 c0 rjmp .+2 ; 0x1c78c XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1c78a: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1c78c: 0f 90 pop r0 1c78e: 0f 90 pop r0 1c790: 0f 90 pop r0 1c792: 0f 90 pop r0 1c794: df 91 pop r29 1c796: cf 91 pop r28 1c798: 1f 91 pop r17 1c79a: 0f 91 pop r16 1c79c: 08 95 ret 0001c79e : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1c79e: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1c7a0: 86 e0 ldi r24, 0x06 ; 6 1c7a2: 0e 94 2d e3 call 0x1c65a ; 0x1c65a _CS_HIGH(); 1c7a6: 45 9a sbi 0x08, 5 ; 8 } 1c7a8: 08 95 ret 0001c7aa : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1c7aa: 4f 92 push r4 1c7ac: 5f 92 push r5 1c7ae: 6f 92 push r6 1c7b0: 7f 92 push r7 1c7b2: 8f 92 push r8 1c7b4: 9f 92 push r9 1c7b6: af 92 push r10 1c7b8: bf 92 push r11 1c7ba: ef 92 push r14 1c7bc: ff 92 push r15 1c7be: 0f 93 push r16 1c7c0: 1f 93 push r17 1c7c2: cf 93 push r28 1c7c4: df 93 push r29 1c7c6: 7c 01 movw r14, r24 1c7c8: 4a 01 movw r8, r20 1c7ca: 5b 01 movw r10, r22 1c7cc: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c7ce: 8c e5 ldi r24, 0x5C ; 92 1c7d0: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c7d2: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1c7d4: 41 2c mov r4, r1 1c7d6: 80 ed ldi r24, 0xD0 ; 208 1c7d8: 58 2e mov r5, r24 1c7da: 83 e0 ldi r24, 0x03 ; 3 1c7dc: 68 2e mov r6, r24 1c7de: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1c7e0: 0e 94 cf e3 call 0x1c79e ; 0x1c79e _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1c7e4: b3 01 movw r22, r6 1c7e6: a2 01 movw r20, r4 1c7e8: 80 e2 ldi r24, 0x20 ; 32 1c7ea: 0e 94 51 e3 call 0x1c6a2 ; 0x1c6a2 xflash_sector_erase(addr); xflash_wait_busy(); 1c7ee: 0e 94 33 e3 call 0x1c666 ; 0x1c666 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1c7f2: 80 e1 ldi r24, 0x10 ; 16 1c7f4: 58 0e add r5, r24 1c7f6: 61 1c adc r6, r1 1c7f8: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1c7fa: 41 14 cp r4, r1 1c7fc: 51 04 cpc r5, r1 1c7fe: e4 e0 ldi r30, 0x04 ; 4 1c800: 6e 06 cpc r6, r30 1c802: 71 04 cpc r7, r1 1c804: 69 f7 brne .-38 ; 0x1c7e0 // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1c806: 8d b7 in r24, 0x3d ; 61 1c808: 9e b7 in r25, 0x3e ; 62 1c80a: f7 01 movw r30, r14 1c80c: 93 87 std Z+11, r25 ; 0x0b 1c80e: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1c810: 00 d0 rcall .+0 ; 0x1c812 1c812: 8f 91 pop r24 1c814: 9f 91 pop r25 1c816: af 91 pop r26 hdr.pc = GETPC(); 1c818: b0 e0 ldi r27, 0x00 ; 0 1c81a: 86 83 std Z+6, r24 ; 0x06 1c81c: 97 83 std Z+7, r25 ; 0x07 1c81e: a0 87 std Z+8, r26 ; 0x08 1c820: 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(); 1c822: 0e 94 cf e3 call 0x1c79e ; 0x1c79e xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1c826: 2c e0 ldi r18, 0x0C ; 12 1c828: 30 e0 ldi r19, 0x00 ; 0 1c82a: a7 01 movw r20, r14 1c82c: 60 e0 ldi r22, 0x00 ; 0 1c82e: 70 ed ldi r23, 0xD0 ; 208 1c830: 83 e0 ldi r24, 0x03 ; 3 1c832: 90 e0 ldi r25, 0x00 ; 0 1c834: 0e 94 56 e3 call 0x1c6ac ; 0x1c6ac xflash_wait_busy(); 1c838: 0e 94 33 e3 call 0x1c666 ; 0x1c666 void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1c83c: 0e 94 cf e3 call 0x1c79e ; 0x1c79e _CS_LOW(); 1c840: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c842: b5 01 movw r22, r10 1c844: a4 01 movw r20, r8 1c846: 82 e0 ldi r24, 0x02 ; 2 1c848: 0e 94 3e e3 call 0x1c67c ; 0x1c67c 1c84c: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1c84e: 21 96 adiw r28, 0x01 ; 1 1c850: 80 81 ld r24, Z 1c852: 0e 94 2d e3 call 0x1c65a ; 0x1c65a if(!--cnt || !(++addr & 0xFF)) 1c856: 01 50 subi r16, 0x01 ; 1 1c858: 11 09 sbc r17, r1 1c85a: 41 f0 breq .+16 ; 0x1c86c 1c85c: ff ef ldi r31, 0xFF ; 255 1c85e: 8f 1a sub r8, r31 1c860: 9f 0a sbc r9, r31 1c862: af 0a sbc r10, r31 1c864: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1c866: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1c868: 81 10 cpse r8, r1 1c86a: f1 cf rjmp .-30 ; 0x1c84e { // on a page boundary or end of write _CS_HIGH(); 1c86c: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1c86e: 0e 94 33 e3 call 0x1c666 ; 0x1c666 _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1c872: 01 15 cp r16, r1 1c874: 11 05 cpc r17, r1 1c876: 11 f7 brne .-60 ; 0x1c83c // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1c878: df 91 pop r29 1c87a: cf 91 pop r28 1c87c: 1f 91 pop r17 1c87e: 0f 91 pop r16 1c880: ff 90 pop r15 1c882: ef 90 pop r14 1c884: bf 90 pop r11 1c886: af 90 pop r10 1c888: 9f 90 pop r9 1c88a: 8f 90 pop r8 1c88c: 7f 90 pop r7 1c88e: 6f 90 pop r6 1c890: 5f 90 pop r5 1c892: 4f 90 pop r4 1c894: 08 95 ret 0001c896 : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1c896: cf 93 push r28 1c898: df 93 push r29 1c89a: cd b7 in r28, 0x3d ; 61 1c89c: de b7 in r29, 0x3e ; 62 1c89e: 2c 97 sbiw r28, 0x0c ; 12 1c8a0: 0f b6 in r0, 0x3f ; 63 1c8a2: f8 94 cli 1c8a4: de bf out 0x3e, r29 ; 62 1c8a6: 0f be out 0x3f, r0 ; 63 1c8a8: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c8aa: 47 e4 ldi r20, 0x47 ; 71 1c8ac: 55 e5 ldi r21, 0x55 ; 85 1c8ae: 62 e5 ldi r22, 0x52 ; 82 1c8b0: 75 e5 ldi r23, 0x55 ; 85 1c8b2: 49 83 std Y+1, r20 ; 0x01 1c8b4: 5a 83 std Y+2, r21 ; 0x02 1c8b6: 6b 83 std Y+3, r22 ; 0x03 1c8b8: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1c8ba: 91 e0 ldi r25, 0x01 ; 1 1c8bc: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1c8be: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1c8c0: f8 94 cli 1c8c2: 88 e1 ldi r24, 0x18 ; 24 1c8c4: 9d e0 ldi r25, 0x0D ; 13 1c8c6: 0f b6 in r0, 0x3f ; 63 1c8c8: f8 94 cli 1c8ca: a8 95 wdr 1c8cc: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1c8d0: 0f be out 0x3f, r0 ; 63 1c8d2: 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); 1c8d6: 00 e0 ldi r16, 0x00 ; 0 1c8d8: 12 e2 ldi r17, 0x22 ; 34 1c8da: 30 e0 ldi r19, 0x00 ; 0 1c8dc: 20 e0 ldi r18, 0x00 ; 0 1c8de: 40 e0 ldi r20, 0x00 ; 0 1c8e0: 51 ed ldi r21, 0xD1 ; 209 1c8e2: 63 e0 ldi r22, 0x03 ; 3 1c8e4: 70 e0 ldi r23, 0x00 ; 0 1c8e6: ce 01 movw r24, r28 1c8e8: 01 96 adiw r24, 0x01 ; 1 1c8ea: 0e 94 d5 e3 call 0x1c7aa ; 0x1c7aa // force a reset even sooner softReset(); 1c8ee: 0e 94 12 68 call 0xd024 ; 0xd024 0001c8f2 : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1c8f2: 0f 93 push r16 1c8f4: 1f 93 push r17 1c8f6: cf 93 push r28 1c8f8: df 93 push r29 1c8fa: cd b7 in r28, 0x3d ; 61 1c8fc: de b7 in r29, 0x3e ; 62 1c8fe: 2c 97 sbiw r28, 0x0c ; 12 1c900: 0f b6 in r0, 0x3f ; 63 1c902: f8 94 cli 1c904: de bf out 0x3e, r29 ; 62 1c906: 0f be out 0x3f, r0 ; 63 1c908: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c90a: 87 e4 ldi r24, 0x47 ; 71 1c90c: 95 e5 ldi r25, 0x55 ; 85 1c90e: a2 e5 ldi r26, 0x52 ; 82 1c910: b5 e5 ldi r27, 0x55 ; 85 1c912: 89 83 std Y+1, r24 ; 0x01 1c914: 9a 83 std Y+2, r25 ; 0x02 1c916: ab 83 std Y+3, r26 ; 0x03 1c918: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1c91a: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1c91c: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1c91e: 00 e0 ldi r16, 0x00 ; 0 1c920: 10 e2 ldi r17, 0x20 ; 32 1c922: 20 e0 ldi r18, 0x00 ; 0 1c924: 32 e0 ldi r19, 0x02 ; 2 1c926: 40 e0 ldi r20, 0x00 ; 0 1c928: 53 ed ldi r21, 0xD3 ; 211 1c92a: 63 e0 ldi r22, 0x03 ; 3 1c92c: 70 e0 ldi r23, 0x00 ; 0 1c92e: ce 01 movw r24, r28 1c930: 01 96 adiw r24, 0x01 ; 1 1c932: 0e 94 d5 e3 call 0x1c7aa ; 0x1c7aa (uint8_t*)RAMSTART, RAMSIZE); } 1c936: 2c 96 adiw r28, 0x0c ; 12 1c938: 0f b6 in r0, 0x3f ; 63 1c93a: f8 94 cli 1c93c: de bf out 0x3e, r29 ; 62 1c93e: 0f be out 0x3f, r0 ; 63 1c940: cd bf out 0x3d, r28 ; 61 1c942: df 91 pop r29 1c944: cf 91 pop r28 1c946: 1f 91 pop r17 1c948: 0f 91 pop r16 1c94a: 08 95 ret 0001c94c : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1c94c: cf 93 push r28 _CS_HIGH(); 1c94e: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1c950: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c952: 8c e5 ldi r24, 0x5C ; 92 1c954: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c956: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1c958: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1c95a: 80 e9 ldi r24, 0x90 ; 144 1c95c: 0e 94 2d e3 call 0x1c65a ; 0x1c65a uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1c960: 80 e0 ldi r24, 0x00 ; 0 1c962: 0e 94 2d e3 call 0x1c65a ; 0x1c65a 1c966: 80 e0 ldi r24, 0x00 ; 0 1c968: 0e 94 2d e3 call 0x1c65a ; 0x1c65a 1c96c: 80 e0 ldi r24, 0x00 ; 0 1c96e: 0e 94 2d e3 call 0x1c65a ; 0x1c65a uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1c972: 8f ef ldi r24, 0xFF ; 255 1c974: 0e 94 2d e3 call 0x1c65a ; 0x1c65a 1c978: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1c97a: 8f ef ldi r24, 0xFF ; 255 1c97c: 0e 94 2d e3 call 0x1c65a ; 0x1c65a 1c980: 98 2f mov r25, r24 _CS_HIGH(); 1c982: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1c984: cf 3e cpi r28, 0xEF ; 239 1c986: 11 f0 breq .+4 ; 0x1c98c 1c988: c8 3c cpi r28, 0xC8 ; 200 1c98a: 19 f4 brne .+6 ; 0x1c992 1c98c: 81 e0 ldi r24, 0x01 ; 1 1c98e: 91 31 cpi r25, 0x11 ; 17 1c990: 09 f0 breq .+2 ; 0x1c994 int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1c992: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1c994: cf 91 pop r28 1c996: 08 95 ret 0001c998 : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 1c998: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1c99c: 80 95 com r24 1c99e: 81 70 andi r24, 0x01 ; 1 1c9a0: 08 95 ret 0001c9a2 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1c9a2: 1f 93 push r17 1c9a4: cf 93 push r28 1c9a6: df 93 push r29 MENU_BEGIN(); 1c9a8: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 1c9ac: 10 92 12 05 sts 0x0512, r1 ; 0x800512 #endif //SDSUPPORT if(!farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1c9b0: 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 1c9b2: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1c9b4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c9b8: 84 30 cpi r24, 0x04 ; 4 1c9ba: 08 f0 brcs .+2 ; 0x1c9be 1c9bc: 02 c2 rjmp .+1028 ; 0x1cdc2 1c9be: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1c9c2: 89 e7 ldi r24, 0x79 ; 121 1c9c4: 9c e3 ldi r25, 0x3C ; 60 1c9c6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1c9ca: 0f 94 90 d1 call 0x3a320 ; 0x3a320 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)) { 1c9ce: 0e 94 a7 68 call 0xd14e ; 0xd14e 1c9d2: 81 11 cpse r24, r1 1c9d4: 19 c0 rjmp .+50 ; 0x1ca08 1c9d6: 0e 94 41 68 call 0xd082 ; 0xd082 1c9da: 81 11 cpse r24, r1 1c9dc: 15 c0 rjmp .+42 ; 0x1ca08 1c9de: 80 91 db 03 lds r24, 0x03DB ; 0x8003db 1c9e2: 81 11 cpse r24, r1 1c9e4: 11 c0 rjmp .+34 ; 0x1ca08 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1c9e6: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.397> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1c9ea: 83 30 cpi r24, 0x03 ; 3 1c9ec: 09 f0 breq .+2 ; 0x1c9f0 1c9ee: 51 c0 rjmp .+162 ; 0x1ca92 1c9f0: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 1c9f4: 88 23 and r24, r24 1c9f6: 41 f0 breq .+16 ; 0x1ca08 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1c9f8: 8f e6 ldi r24, 0x6F ; 111 1c9fa: 9c e3 ldi r25, 0x3C ; 60 1c9fc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ca00: 64 e0 ldi r22, 0x04 ; 4 1ca02: 73 ed ldi r23, 0xD3 ; 211 } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) { MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1ca04: 0f 94 42 ce call 0x39c84 ; 0x39c84 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1ca08: 0e 94 91 68 call 0xd122 ; 0xd122 1ca0c: 88 23 and r24, r24 1ca0e: 81 f0 breq .+32 ; 0x1ca30 1ca10: 0e 94 56 68 call 0xd0ac ; 0xd0ac 1ca14: 81 11 cpse r24, r1 1ca16: 04 c0 rjmp .+8 ; 0x1ca20 1ca18: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1ca1c: 84 30 cpi r24, 0x04 ; 4 1ca1e: 41 f4 brne .+16 ; 0x1ca30 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1ca20: 8f e5 ldi r24, 0x5F ; 95 1ca22: 9c e3 ldi r25, 0x3C ; 60 1ca24: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ca28: 6a ed ldi r22, 0xDA ; 218 1ca2a: 7a e3 ldi r23, 0x3A ; 58 1ca2c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1ca30: 0e 94 41 68 call 0xd082 ; 0xd082 1ca34: 81 11 cpse r24, r1 1ca36: 61 c0 rjmp .+194 ; 0x1cafa } //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); 1ca38: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 1ca3c: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 1ca40: 89 1b sub r24, r25 1ca42: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1ca44: a9 f5 brne .+106 ; 0x1cab0 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1ca46: 0e 94 a7 68 call 0xd14e ; 0xd14e 1ca4a: 81 11 cpse r24, r1 1ca4c: 31 c0 rjmp .+98 ; 0x1cab0 #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1ca4e: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1ca52: 82 30 cpi r24, 0x02 ; 2 1ca54: 69 f1 breq .+90 ; 0x1cab0 #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1ca56: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ca5a: 81 11 cpse r24, r1 1ca5c: 31 c0 rjmp .+98 ; 0x1cac0 MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1ca5e: 8e e4 ldi r24, 0x4E ; 78 1ca60: 9c e3 ldi r25, 0x3C ; 60 1ca62: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ca66: 64 ec ldi r22, 0xC4 ; 196 1ca68: 79 e3 ldi r23, 0x39 ; 57 1ca6a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 if (M79_timer_get_status()) { 1ca6e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL9M79_timer.lto_priv.465> 1ca72: 88 23 and r24, r24 1ca74: 29 f1 breq .+74 ; 0x1cac0 #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1ca76: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 1ca7a: 81 30 cpi r24, 0x01 ; 1 1ca7c: 09 f0 breq .+2 ; 0x1ca80 1ca7e: 7e c0 rjmp .+252 ; 0x1cb7c MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1ca80: 8e e3 ldi r24, 0x3E ; 62 1ca82: 9c e3 ldi r25, 0x3C ; 60 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1ca84: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ca88: 6b e9 ldi r22, 0x9B ; 155 1ca8a: 70 ed ldi r23, 0xD0 ; 208 1ca8c: 0f 94 42 ce call 0x39c84 ; 0x39c84 1ca90: 17 c0 rjmp .+46 ; 0x1cac0 // 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()) { 1ca92: 84 30 cpi r24, 0x04 ; 4 1ca94: 09 f0 breq .+2 ; 0x1ca98 1ca96: b8 cf rjmp .-144 ; 0x1ca08 1ca98: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL9M79_timer.lto_priv.465> 1ca9c: 88 23 and r24, r24 1ca9e: 09 f4 brne .+2 ; 0x1caa2 1caa0: b3 cf rjmp .-154 ; 0x1ca08 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1caa2: 8f e6 ldi r24, 0x6F ; 111 1caa4: 9c e3 ldi r25, 0x3C ; 60 1caa6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1caaa: 65 e9 ldi r22, 0x95 ; 149 1caac: 70 ed ldi r23, 0xD0 ; 208 1caae: aa cf rjmp .-172 ; 0x1ca04 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); 1cab0: 88 e5 ldi r24, 0x58 ; 88 1cab2: 9c e3 ldi r25, 0x3C ; 60 1cab4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cab8: 6b ef ldi r22, 0xFB ; 251 1caba: 74 ed ldi r23, 0xD4 ; 212 1cabc: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #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) { 1cac0: c0 91 56 0e lds r28, 0x0E56 ; 0x800e56 1cac4: 0e 94 4b 68 call 0xd096 ; 0xd096 1cac8: c1 11 cpse r28, r1 1caca: 17 c0 rjmp .+46 ; 0x1cafa 1cacc: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 1cad0: 91 11 cpse r25, r1 1cad2: 13 c0 rjmp .+38 ; 0x1cafa 1cad4: 81 11 cpse r24, r1 1cad6: 15 c0 rjmp .+42 ; 0x1cb02 1cad8: 80 91 9f 03 lds r24, 0x039F ; 0x80039f 1cadc: 81 11 cpse r24, r1 1cade: 0d c0 rjmp .+26 ; 0x1cafa if (usb_timer.running()) { 1cae0: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1cae4: 88 23 and r24, r24 1cae6: 09 f4 brne .+2 ; 0x1caea 1cae8: 4c c0 rjmp .+152 ; 0x1cb82 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1caea: 84 e2 ldi r24, 0x24 ; 36 1caec: 9c e3 ldi r25, 0x3C ; 60 1caee: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1caf2: 6c ed ldi r22, 0xDC ; 220 1caf4: 79 e3 ldi r23, 0x39 ; 57 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1caf6: 0f 94 42 ce call 0x39c84 ; 0x39c84 } } } if (printingIsPaused() 1cafa: 0e 94 4b 68 call 0xd096 ; 0xd096 && !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) { 1cafe: 88 23 and r24, r24 1cb00: f1 f0 breq .+60 ; 0x1cb3e temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1cb02: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 1cb06: 81 11 cpse r24, r1 1cb08: 1a c0 rjmp .+52 ; 0x1cb3e #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cb0a: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1cb0e: 82 30 cpi r24, 0x02 ; 2 1cb10: b1 f0 breq .+44 ; 0x1cb3e #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1cb12: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1cb16: 82 30 cpi r24, 0x02 ; 2 1cb18: 21 f4 brne .+8 ; 0x1cb22 1cb1a: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 1cb1e: 99 23 and r25, r25 1cb20: 71 f0 breq .+28 ; 0x1cb3e && custom_message_type != CustomMsg::Resuming) { 1cb22: 90 91 72 07 lds r25, 0x0772 ; 0x800772 1cb26: 98 30 cpi r25, 0x08 ; 8 1cb28: 51 f0 breq .+20 ; 0x1cb3e if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1cb2a: 81 11 cpse r24, r1 1cb2c: 36 c0 rjmp .+108 ; 0x1cb9a MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1cb2e: 85 e1 ldi r24, 0x15 ; 21 1cb30: 9c e3 ldi r25, 0x3C ; 60 1cb32: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cb36: 62 e9 ldi r22, 0x92 ; 146 1cb38: 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); 1cb3a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1cb3e: 0e 94 56 68 call 0xd0ac ; 0xd0ac && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1cb42: 81 11 cpse r24, r1 1cb44: 08 c0 rjmp .+16 ; 0x1cb56 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())) 1cb46: 0e 94 4b 68 call 0xd096 ; 0xd096 1cb4a: 81 11 cpse r24, r1 1cb4c: 04 c0 rjmp .+8 ; 0x1cb56 1cb4e: 0e 94 41 68 call 0xd082 ; 0xd082 1cb52: 88 23 and r24, r24 1cb54: 41 f0 breq .+16 ; 0x1cb66 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1cb56: 80 91 72 07 lds r24, 0x0772 ; 0x800772 1cb5a: 81 30 cpi r24, 0x01 ; 1 1cb5c: 21 f0 breq .+8 ; 0x1cb66 1cb5e: 80 91 9f 03 lds r24, 0x039F ; 0x80039f 1cb62: 88 23 and r24, r24 1cb64: 39 f1 breq .+78 ; 0x1cbb4 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1cb66: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1cb6a: 88 23 and r24, r24 1cb6c: 59 f1 breq .+86 ; 0x1cbc4 MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1cb6e: 84 e0 ldi r24, 0x04 ; 4 1cb70: 9c e3 ldi r25, 0x3C ; 60 1cb72: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cb76: 6e eb ldi r22, 0xBE ; 190 1cb78: 7a e3 ldi r23, 0x3A ; 58 1cb7a: 22 c0 rjmp .+68 ; 0x1cbc0 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); 1cb7c: 82 e3 ldi r24, 0x32 ; 50 1cb7e: 9c e3 ldi r25, 0x3C ; 60 1cb80: 81 cf rjmp .-254 ; 0x1ca84 } } 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) { 1cb82: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 1cb86: 88 23 and r24, r24 1cb88: 09 f4 brne .+2 ; 0x1cb8c 1cb8a: b7 cf rjmp .-146 ; 0x1cafa MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1cb8c: 84 e2 ldi r24, 0x24 ; 36 1cb8e: 9c e3 ldi r25, 0x3C ; 60 1cb90: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cb94: 6a ee ldi r22, 0xEA ; 234 1cb96: 7a e3 ldi r23, 0x3A ; 58 1cb98: ae cf rjmp .-164 ; 0x1caf6 #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())) { 1cb9a: 81 30 cpi r24, 0x01 ; 1 1cb9c: 81 f6 brne .-96 ; 0x1cb3e 1cb9e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL9M79_timer.lto_priv.465> 1cba2: 88 23 and r24, r24 1cba4: 61 f2 breq .-104 ; 0x1cb3e MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1cba6: 85 e1 ldi r24, 0x15 ; 21 1cba8: 9c e3 ldi r25, 0x3C ; 60 1cbaa: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cbae: 6a e4 ldi r22, 0x4A ; 74 1cbb0: 7a e3 ldi r23, 0x3A ; 58 1cbb2: c3 cf rjmp .-122 ; 0x1cb3a } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1cbb4: 81 e7 ldi r24, 0x71 ; 113 1cbb6: 9d e3 ldi r25, 0x3D ; 61 1cbb8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cbbc: 6d e0 ldi r22, 0x0D ; 13 1cbbe: 73 ed ldi r23, 0xD3 ; 211 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1cbc0: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1cbc4: 0e 94 41 68 call 0xd082 ; 0xd082 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cbc8: 81 11 cpse r24, r1 1cbca: 91 c0 rjmp .+290 ; 0x1ccee 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() 1cbcc: 0e 94 a7 68 call 0xd14e ; 0xd14e 1cbd0: 81 11 cpse r24, r1 1cbd2: 8d c0 rjmp .+282 ; 0x1ccee 1cbd4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 1cbd8: 81 11 cpse r24, r1 1cbda: 89 c0 rjmp .+274 ; 0x1ccee #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cbdc: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1cbe0: 82 30 cpi r24, 0x02 ; 2 1cbe2: 09 f4 brne .+2 ; 0x1cbe6 1cbe4: 84 c0 rjmp .+264 ; 0x1ccee #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1cbe6: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 1cbea: 81 11 cpse r24, r1 1cbec: 05 c0 rjmp .+10 ; 0x1cbf8 || lcd_commands_type != LcdCommands::Idle) { 1cbee: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1cbf2: 88 23 and r24, r24 1cbf4: 09 f4 brne .+2 ; 0x1cbf8 1cbf6: ac c0 rjmp .+344 ; 0x1cd50 if (!card.isFileOpen()) { 1cbf8: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1cbfc: 81 11 cpse r24, r1 1cbfe: 12 c0 rjmp .+36 ; 0x1cc24 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1cc00: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1cc04: 81 11 cpse r24, r1 1cc06: 0e c0 rjmp .+28 ; 0x1cc24 1cc08: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1cc0c: 81 11 cpse r24, r1 1cc0e: 0a c0 rjmp .+20 ; 0x1cc24 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1cc10: d0 93 d9 03 sts 0x03D9, r29 ; 0x8003d9 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1cc14: 84 ef ldi r24, 0xF4 ; 244 1cc16: 9b e3 ldi r25, 0x3B ; 59 1cc18: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cc1c: 68 e8 ldi r22, 0x88 ; 136 1cc1e: 79 e3 ldi r23, 0x39 ; 57 1cc20: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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)); 1cc24: 81 ea ldi r24, 0xA1 ; 161 1cc26: 9d e0 ldi r25, 0x0D ; 13 1cc28: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1cc2c: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1cc2e: 0e 94 eb 77 call 0xefd6 ; 0xefd6 if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1cc32: 87 fd sbrc r24, 7 1cc34: 09 c0 rjmp .+18 ; 0x1cc48 1cc36: c8 17 cp r28, r24 1cc38: 39 f0 breq .+14 ; 0x1cc48 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1cc3a: c1 02 muls r28, r17 1cc3c: c0 01 movw r24, r0 1cc3e: 11 24 eor r1, r1 1cc40: 87 5b subi r24, 0xB7 ; 183 1cc42: 92 4f sbci r25, 0xF2 ; 242 1cc44: 0e 94 b9 d1 call 0x1a372 ; 0x1a372 SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1cc48: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1cc4c: 81 11 cpse r24, r1 1cc4e: 4f c0 rjmp .+158 ; 0x1ccee 1cc50: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1cc54: 81 11 cpse r24, r1 1cc56: 4b c0 rjmp .+150 ; 0x1ccee if (MMU2::mmu2.Enabled()) { 1cc58: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1cc5c: 81 30 cpi r24, 0x01 ; 1 1cc5e: 09 f0 breq .+2 ; 0x1cc62 1cc60: 80 c0 rjmp .+256 ; 0x1cd62 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1cc62: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1cc66: 81 11 cpse r24, r1 1cc68: 0c c0 rjmp .+24 ; 0x1cc82 1cc6a: 0e 94 cc e4 call 0x1c998 ; 0x1c998 1cc6e: 81 11 cpse r24, r1 1cc70: 08 c0 rjmp .+16 ; 0x1cc82 // 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); 1cc72: 86 ed ldi r24, 0xD6 ; 214 1cc74: 9b e3 ldi r25, 0x3B ; 59 1cc76: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cc7a: 65 ec ldi r22, 0xC5 ; 197 1cc7c: 78 ed ldi r23, 0xD8 ; 216 1cc7e: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1cc82: 85 ec ldi r24, 0xC5 ; 197 1cc84: 9b e3 ldi r25, 0x3B ; 59 1cc86: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cc8a: 6c ef ldi r22, 0xFC ; 252 1cc8c: 78 ed ldi r23, 0xD8 ; 216 1cc8e: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1cc92: 83 eb ldi r24, 0xB3 ; 179 1cc94: 9b e3 ldi r25, 0x3B ; 59 1cc96: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cc9a: 6f ef ldi r22, 0xFF ; 255 1cc9c: 78 ed ldi r23, 0xD8 ; 216 1cc9e: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1cca2: 8f e9 ldi r24, 0x9F ; 159 1cca4: 9c e5 ldi r25, 0x5C ; 92 1cca6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ccaa: 62 e0 ldi r22, 0x02 ; 2 1ccac: 79 ed ldi r23, 0xD9 ; 217 1ccae: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1ccb2: 8e ec ldi r24, 0xCE ; 206 1ccb4: 9e e0 ldi r25, 0x0E ; 14 1ccb6: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1ccba: 88 23 and r24, r24 1ccbc: 41 f0 breq .+16 ; 0x1ccce MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1ccbe: 80 e9 ldi r24, 0x90 ; 144 1ccc0: 9c e5 ldi r25, 0x5C ; 92 1ccc2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ccc6: 65 e0 ldi r22, 0x05 ; 5 1ccc8: 79 ed ldi r23, 0xD9 ; 217 } #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); 1ccca: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1ccce: 8b e5 ldi r24, 0x5B ; 91 1ccd0: 9d e3 ldi r25, 0x3D ; 61 1ccd2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ccd6: 62 e1 ldi r22, 0x12 ; 18 1ccd8: 7a e3 ldi r23, 0x3A ; 58 1ccda: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1ccde: 81 e8 ldi r24, 0x81 ; 129 1cce0: 9b e3 ldi r25, 0x3B ; 59 1cce2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cce6: 62 e4 ldi r22, 0x42 ; 66 1cce8: 74 ed ldi r23, 0xD4 ; 212 1ccea: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1ccee: 84 e7 ldi r24, 0x74 ; 116 1ccf0: 9b e3 ldi r25, 0x3B ; 59 1ccf2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1ccf6: 6a ec ldi r22, 0xCA ; 202 1ccf8: 79 e3 ldi r23, 0x39 ; 57 1ccfa: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1ccfe: 87 e6 ldi r24, 0x67 ; 103 1cd00: 9b e3 ldi r25, 0x3B ; 59 1cd02: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cd06: 68 ea ldi r22, 0xA8 ; 168 1cd08: 7a e3 ldi r23, 0x3A ; 58 1cd0a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #endif if (MMU2::mmu2.Enabled()) { 1cd0e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1cd12: 81 30 cpi r24, 0x01 ; 1 1cd14: 41 f4 brne .+16 ; 0x1cd26 MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1cd16: 86 e5 ldi r24, 0x56 ; 86 1cd18: 9b e3 ldi r25, 0x3B ; 59 1cd1a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cd1e: 62 ec ldi r22, 0xC2 ; 194 1cd20: 79 e3 ldi r23, 0x39 ; 57 1cd22: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 1cd26: 8c e4 ldi r24, 0x4C ; 76 1cd28: 9b e3 ldi r25, 0x3B ; 59 1cd2a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cd2e: 68 e3 ldi r22, 0x38 ; 56 1cd30: 7b e3 ldi r23, 0x3B ; 59 1cd32: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_END(); 1cd36: 0f 94 99 ce call 0x39d32 ; 0x39d32 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1cd3a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1cd3e: 8f 5f subi r24, 0xFF ; 255 1cd40: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1cd44: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1cd48: 8f 5f subi r24, 0xFF ; 255 1cd4a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1cd4e: 32 ce rjmp .-924 ; 0x1c9b4 #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 1cd50: d0 93 d9 03 sts 0x03D9, r29 ; 0x8003d9 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1cd54: 87 ee ldi r24, 0xE7 ; 231 1cd56: 9b e3 ldi r25, 0x3B ; 59 1cd58: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cd5c: 0f 94 90 d1 call 0x3a320 ; 0x3a320 1cd60: 61 cf rjmp .-318 ; 0x1cc24 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1cd62: 80 91 85 17 lds r24, 0x1785 ; 0x801785 1cd66: 88 23 and r24, r24 1cd68: 19 f1 breq .+70 ; 0x1cdb0 if (!fsensor.getAutoLoadEnabled()) { 1cd6a: 80 91 86 17 lds r24, 0x1786 ; 0x801786 1cd6e: 81 11 cpse r24, r1 1cd70: 08 c0 rjmp .+16 ; 0x1cd82 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1cd72: 83 ea ldi r24, 0xA3 ; 163 1cd74: 9b e3 ldi r25, 0x3B ; 59 1cd76: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cd7a: 6c ea ldi r22, 0xAC ; 172 1cd7c: 79 e3 ldi r23, 0x39 ; 57 1cd7e: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } if (fsensor.getFilamentPresent()) { 1cd82: 0e 94 cc e4 call 0x1c998 ; 0x1c998 1cd86: 88 23 and r24, r24 1cd88: 39 f0 breq .+14 ; 0x1cd98 } #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); 1cd8a: 83 eb ldi r24, 0xB3 ; 179 1cd8c: 9b e3 ldi r25, 0x3B ; 59 1cd8e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cd92: 6e e4 ldi r22, 0x4E ; 78 1cd94: 7a e3 ldi r23, 0x3A ; 58 1cd96: 99 cf rjmp .-206 ; 0x1ccca if (fsensor.getFilamentPresent()) { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } #ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY else { if (fsensor.getAutoLoadEnabled()) { 1cd98: 80 91 86 17 lds r24, 0x1786 ; 0x801786 1cd9c: 88 23 and r24, r24 1cd9e: 09 f4 brne .+2 ; 0x1cda2 1cda0: 96 cf rjmp .-212 ; 0x1ccce MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1cda2: 8f e8 ldi r24, 0x8F ; 143 1cda4: 9b e3 ldi r25, 0x3B ; 59 1cda6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cdaa: 6a e1 ldi r22, 0x1A ; 26 1cdac: 7b e3 ldi r23, 0x3B ; 59 1cdae: 8d cf rjmp .-230 ; 0x1ccca } } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1cdb0: 83 ea ldi r24, 0xA3 ; 163 1cdb2: 9b e3 ldi r25, 0x3B ; 59 1cdb4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cdb8: 6c ea ldi r22, 0xAC ; 172 1cdba: 79 e3 ldi r23, 0x39 ; 57 1cdbc: 0f 94 43 d1 call 0x3a286 ; 0x3a286 1cdc0: e4 cf rjmp .-56 ; 0x1cd8a #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1cdc2: df 91 pop r29 1cdc4: cf 91 pop r28 1cdc6: 1f 91 pop r17 1cdc8: 08 95 ret 0001cdca : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1cdca: cf 93 push r28 1cdcc: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1cdce: 86 ea ldi r24, 0xA6 ; 166 1cdd0: 9c e0 ldi r25, 0x0C ; 12 1cdd2: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c status &= ~components; 1cdd6: c0 95 com r28 1cdd8: 6c 2f mov r22, r28 1cdda: 68 23 and r22, r24 1cddc: 86 ea ldi r24, 0xA6 ; 166 1cdde: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1cde0: cf 91 pop r28 1cde2: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0001cde6 : } } } static void lcd_reset_sheet() { 1cde6: 1f 93 push r17 1cde8: cf 93 push r28 1cdea: df 93 push r29 1cdec: 00 d0 rcall .+0 ; 0x1cdee 1cdee: 00 d0 rcall .+0 ; 0x1cdf0 1cdf0: 1f 92 push r1 1cdf2: 1f 92 push r1 1cdf4: cd b7 in r28, 0x3d ; 61 1cdf6: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1cdf8: be 01 movw r22, r28 1cdfa: 6f 5f subi r22, 0xFF ; 255 1cdfc: 7f 4f sbci r23, 0xFF ; 255 1cdfe: 80 91 da 03 lds r24, 0x03DA ; 0x8003da 1ce02: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1ce06: 80 91 da 03 lds r24, 0x03DA ; 0x8003da 1ce0a: 1b e0 ldi r17, 0x0B ; 11 1ce0c: 81 9f mul r24, r17 1ce0e: c0 01 movw r24, r0 1ce10: 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); 1ce12: 6f ef ldi r22, 0xFF ; 255 1ce14: 7f ef ldi r23, 0xFF ; 255 1ce16: 80 5b subi r24, 0xB0 ; 176 1ce18: 92 4f sbci r25, 0xF2 ; 242 1ce1a: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1ce1e: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1ce22: 61 9f mul r22, r17 1ce24: b0 01 movw r22, r0 1ce26: 11 24 eor r1, r1 1ce28: 67 5b subi r22, 0xB7 ; 183 1ce2a: 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); 1ce2c: 47 e0 ldi r20, 0x07 ; 7 1ce2e: 50 e0 ldi r21, 0x00 ; 0 1ce30: ce 01 movw r24, r28 1ce32: 01 96 adiw r24, 0x01 ; 1 1ce34: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1ce38: 81 ea ldi r24, 0xA1 ; 161 1ce3a: 9d e0 ldi r25, 0x0D ; 13 1ce3c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1ce40: 90 91 da 03 lds r25, 0x03DA ; 0x8003da 1ce44: 89 13 cpse r24, r25 1ce46: 0a c0 rjmp .+20 ; 0x1ce5c { eeprom_switch_to_next_sheet(); 1ce48: 0e 94 ff 77 call 0xeffe ; 0xeffe if (-1 == eeprom_next_initialized_sheet(0)) 1ce4c: 80 e0 ldi r24, 0x00 ; 0 1ce4e: 0e 94 eb 77 call 0xefd6 ; 0xefd6 1ce52: 8f 3f cpi r24, 0xFF ; 255 1ce54: 19 f4 brne .+6 ; 0x1ce5c calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1ce56: 80 e1 ldi r24, 0x10 ; 16 1ce58: 0e 94 e5 e6 call 0x1cdca ; 0x1cdca } menu_back(); 1ce5c: 0f 94 8d d1 call 0x3a31a ; 0x3a31a } 1ce60: 28 96 adiw r28, 0x08 ; 8 1ce62: 0f b6 in r0, 0x3f ; 63 1ce64: f8 94 cli 1ce66: de bf out 0x3e, r29 ; 62 1ce68: 0f be out 0x3f, r0 ; 63 1ce6a: cd bf out 0x3d, r28 ; 61 1ce6c: df 91 pop r29 1ce6e: cf 91 pop r28 1ce70: 1f 91 pop r17 1ce72: 08 95 ret 0001ce74 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1ce74: cf 93 push r28 1ce76: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1ce78: 86 ea ldi r24, 0xA6 ; 166 1ce7a: 9c e0 ldi r25, 0x0C ; 12 1ce7c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c status |= components; 1ce80: 68 2f mov r22, r24 1ce82: 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); 1ce84: 86 ea ldi r24, 0xA6 ; 166 1ce86: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1ce88: cf 91 pop r28 1ce8a: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0001ce8e : //! @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) 1ce8e: 2f 92 push r2 1ce90: 3f 92 push r3 1ce92: 4f 92 push r4 1ce94: 5f 92 push r5 1ce96: 6f 92 push r6 1ce98: 7f 92 push r7 1ce9a: 8f 92 push r8 1ce9c: 9f 92 push r9 1ce9e: af 92 push r10 1cea0: bf 92 push r11 1cea2: cf 92 push r12 1cea4: df 92 push r13 1cea6: ef 92 push r14 1cea8: ff 92 push r15 1ceaa: 0f 93 push r16 1ceac: 1f 93 push r17 1ceae: cf 93 push r28 1ceb0: df 93 push r29 1ceb2: cd b7 in r28, 0x3d ; 61 1ceb4: de b7 in r29, 0x3e ; 62 1ceb6: ce 5c subi r28, 0xCE ; 206 1ceb8: d1 09 sbc r29, r1 1ceba: 0f b6 in r0, 0x3f ; 63 1cebc: f8 94 cli 1cebe: de bf out 0x3e, r29 ; 62 1cec0: 0f be out 0x3f, r0 ; 63 1cec2: cd bf out 0x3d, r28 ; 61 1cec4: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 1cec6: 81 e0 ldi r24, 0x01 ; 1 1cec8: 0e 94 76 67 call 0xceec ; 0xceec #endif // TMC2130 FORCE_BL_ON_START; 1cecc: 81 e0 ldi r24, 0x01 ; 1 1cece: 0e 94 8d 8b call 0x1171a ; 0x1171a // Only Z calibration? if (!onlyZ) 1ced2: 11 11 cpse r17, r1 1ced4: 04 c0 rjmp .+8 ; 0x1cede { disable_heater(); 1ced6: 0f 94 27 45 call 0x28a4e ; 0x28a4e eeprom_adjust_bed_reset(); //reset bed level correction 1ceda: 0e 94 34 78 call 0xf068 ; 0xf068 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 1cede: 80 e0 ldi r24, 0x00 ; 0 1cee0: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 // Let the planner use the uncorrected coordinates. mbl.reset(); 1cee4: 0f 94 d4 8b call 0x317a8 ; 0x317a8 // 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(); 1cee8: 0f 94 65 cb call 0x396ca ; 0x396ca babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 1ceec: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.515+0x1> 1cef0: 10 92 67 05 sts 0x0567, r1 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.515> // 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)); 1cef4: ed e3 ldi r30, 0x3D ; 61 1cef6: f7 e0 ldi r31, 0x07 ; 7 1cef8: 83 e0 ldi r24, 0x03 ; 3 1cefa: df 01 movw r26, r30 1cefc: 1d 92 st X+, r1 1cefe: 8a 95 dec r24 1cf00: e9 f7 brne .-6 ; 0x1cefc // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 1cf02: 81 e0 ldi r24, 0x01 ; 1 1cf04: 0e 94 ae 67 call 0xcf5c ; 0xcf5c 1cf08: c7 55 subi r28, 0x57 ; 87 1cf0a: df 4f sbci r29, 0xFF ; 255 1cf0c: 99 83 std Y+1, r25 ; 0x01 1cf0e: 88 83 st Y, r24 1cf10: c9 5a subi r28, 0xA9 ; 169 1cf12: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 1cf14: 81 e8 ldi r24, 0x81 ; 129 1cf16: 99 e4 ldi r25, 0x49 ; 73 1cf18: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cf1c: 0f 94 55 35 call 0x26aaa ; 0x26aaa raise_z_above(MESH_HOME_Z_SEARCH); 1cf20: 60 e0 ldi r22, 0x00 ; 0 1cf22: 70 e0 ldi r23, 0x00 ; 0 1cf24: 80 ea ldi r24, 0xA0 ; 160 1cf26: 90 e4 ldi r25, 0x40 ; 64 1cf28: 0e 94 26 6f call 0xde4c ; 0xde4c } /**/ void home_xy() { set_destination_to_current(); 1cf2c: 0e 94 00 69 call 0xd200 ; 0xd200 homeaxis(X_AXIS); 1cf30: 50 e0 ldi r21, 0x00 ; 0 1cf32: 40 e0 ldi r20, 0x00 ; 0 1cf34: 61 e0 ldi r22, 0x01 ; 1 1cf36: 80 e0 ldi r24, 0x00 ; 0 1cf38: 0e 94 07 7c call 0xf80e ; 0xf80e homeaxis(Y_AXIS); 1cf3c: 50 e0 ldi r21, 0x00 ; 0 1cf3e: 40 e0 ldi r20, 0x00 ; 0 1cf40: 61 e0 ldi r22, 0x01 ; 1 1cf42: 81 e0 ldi r24, 0x01 ; 1 1cf44: 0e 94 07 7c call 0xf80e ; 0xf80e plan_set_position_curposXYZE(); 1cf48: 0f 94 08 b9 call 0x37210 ; 0x37210 endstops_hit_on_purpose(); 1cf4c: 0f 94 2b 64 call 0x2c856 ; 0x2c856 1cf50: 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; 1cf54: 20 e0 ldi r18, 0x00 ; 0 1cf56: 30 e0 ldi r19, 0x00 ; 0 1cf58: 40 ea ldi r20, 0xA0 ; 160 1cf5a: 50 e4 ldi r21, 0x40 ; 64 1cf5c: 60 91 40 07 lds r22, 0x0740 ; 0x800740 1cf60: 70 91 41 07 lds r23, 0x0741 ; 0x800741 1cf64: 80 91 42 07 lds r24, 0x0742 ; 0x800742 1cf68: 90 91 43 07 lds r25, 0x0743 ; 0x800743 1cf6c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1cf70: 60 93 40 07 sts 0x0740, r22 ; 0x800740 1cf74: 70 93 41 07 sts 0x0741, r23 ; 0x800741 1cf78: 80 93 42 07 sts 0x0742, r24 ; 0x800742 1cf7c: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] += 5; 1cf80: 20 e0 ldi r18, 0x00 ; 0 1cf82: 30 e0 ldi r19, 0x00 ; 0 1cf84: 40 ea ldi r20, 0xA0 ; 160 1cf86: 50 e4 ldi r21, 0x40 ; 64 1cf88: 60 91 44 07 lds r22, 0x0744 ; 0x800744 1cf8c: 70 91 45 07 lds r23, 0x0745 ; 0x800745 1cf90: 80 91 46 07 lds r24, 0x0746 ; 0x800746 1cf94: 90 91 47 07 lds r25, 0x0747 ; 0x800747 1cf98: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1cf9c: 60 93 44 07 sts 0x0744, r22 ; 0x800744 1cfa0: 70 93 45 07 sts 0x0745, r23 ; 0x800745 1cfa4: 80 93 46 07 sts 0x0746, r24 ; 0x800746 1cfa8: 90 93 47 07 sts 0x0747, r25 ; 0x800747 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1cfac: 60 e0 ldi r22, 0x00 ; 0 1cfae: 70 e0 ldi r23, 0x00 ; 0 1cfb0: 80 ea ldi r24, 0xA0 ; 160 1cfb2: 91 e4 ldi r25, 0x41 ; 65 1cfb4: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1cfb8: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 1cfbc: 0e 94 04 74 call 0xe808 ; 0xe808 1cfc0: e5 96 adiw r28, 0x35 ; 53 1cfc2: 8f af std Y+63, r24 ; 0x3f 1cfc4: e5 97 sbiw r28, 0x35 ; 53 1cfc6: 81 11 cpse r24, r1 1cfc8: 04 c0 rjmp .+8 ; 0x1cfd2 //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 1cfca: e5 96 adiw r28, 0x35 ; 53 1cfcc: 1f ae std Y+63, r1 ; 0x3f 1cfce: e5 97 sbiw r28, 0x35 ; 53 1cfd0: 0d c3 rjmp .+1562 ; 0x1d5ec { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 1cfd2: 85 e4 ldi r24, 0x45 ; 69 1cfd4: 99 e4 ldi r25, 0x49 ; 73 1cfd6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cfda: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 if(onlyZ){ 1cfde: 11 23 and r17, r17 1cfe0: 09 f4 brne .+2 ; 0x1cfe4 1cfe2: df c2 rjmp .+1470 ; 0x1d5a2 prompt_steel_sheet_on_bed(true); 1cfe4: 81 e0 ldi r24, 0x01 ; 1 1cfe6: 0f 94 71 67 call 0x2cee2 ; 0x2cee2 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 1cfea: 83 e1 ldi r24, 0x13 ; 19 1cfec: 99 e4 ldi r25, 0x49 ; 73 1cfee: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1cff2: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_puts_at_P(0,3,_n("1/9")); 1cff6: 4d ec ldi r20, 0xCD ; 205 1cff8: 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")); 1cffa: 63 e0 ldi r22, 0x03 ; 3 1cffc: 80 e0 ldi r24, 0x00 ; 0 1cffe: 0e 94 ba 6f call 0xdf74 ; 0xdf74 } refresh_cmd_timeout(); 1d002: 0e 94 89 67 call 0xcf12 ; 0xcf12 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 1d006: 11 11 cpse r17, r1 1d008: 1b c0 rjmp .+54 ; 0x1d040 { KEEPALIVE_STATE(PAUSED_FOR_USER); 1d00a: 84 e0 ldi r24, 0x04 ; 4 1d00c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 prompt_steel_sheet_on_bed(false); 1d010: 80 e0 ldi r24, 0x00 ; 0 1d012: 0f 94 71 67 call 0x2cee2 ; 0x2cee2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 1d016: 89 e5 ldi r24, 0x59 ; 89 1d018: 98 e4 ldi r25, 0x48 ; 72 1d01a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1d01e: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 KEEPALIVE_STATE(IN_HANDLER); 1d022: 82 e0 ldi r24, 0x02 ; 2 1d024: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 1d028: 81 ef ldi r24, 0xF1 ; 241 1d02a: 98 e4 ldi r25, 0x48 ; 72 1d02c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1d030: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_puts_at_P(0,3,_n("1/4")); 1d034: 45 ec ldi r20, 0xC5 ; 197 1d036: 5e e6 ldi r21, 0x6E ; 110 1d038: 63 e0 ldi r22, 0x03 ; 3 1d03a: 80 e0 ldi r24, 0x00 ; 0 1d03c: 0e 94 ba 6f call 0xdf74 ; 0xdf74 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 1d040: 00 91 8f 02 lds r16, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 1d044: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 1d048: 60 e0 ldi r22, 0x00 ; 0 1d04a: 70 e0 ldi r23, 0x00 ; 0 1d04c: 80 e8 ldi r24, 0x80 ; 128 1d04e: 9f eb ldi r25, 0xBF ; 191 1d050: 0e 94 a7 6e call 0xdd4e ; 0xdd4e // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1d054: c1 2c mov r12, r1 1d056: d1 2c mov r13, r1 1d058: b0 ea ldi r27, 0xA0 ; 160 1d05a: eb 2e mov r14, r27 1d05c: b0 e4 ldi r27, 0x40 ; 64 1d05e: fb 2e mov r15, r27 1d060: c0 92 48 07 sts 0x0748, r12 ; 0x800748 1d064: d0 92 49 07 sts 0x0749, r13 ; 0x800749 1d068: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 1d06c: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b 1d070: 81 e0 ldi r24, 0x01 ; 1 1d072: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 1d076: 84 e0 ldi r24, 0x04 ; 4 1d078: 0f 94 63 3b call 0x276c6 ; 0x276c6 #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1d07c: 60 e0 ldi r22, 0x00 ; 0 1d07e: 70 e0 ldi r23, 0x00 ; 0 1d080: 80 ea ldi r24, 0xA0 ; 160 1d082: 91 e4 ldi r25, 0x41 ; 65 1d084: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1d088: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 #ifdef TMC2130 tmc2130_home_exit(); 1d08c: 0f 94 34 3b call 0x27668 ; 0x27668 1d090: 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)) && 1d094: 82 e0 ldi r24, 0x02 ; 2 1d096: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 1d09a: 2d ec ldi r18, 0xCD ; 205 1d09c: 3c ec ldi r19, 0xCC ; 204 1d09e: 44 ea ldi r20, 0xA4 ; 164 1d0a0: 50 e4 ldi r21, 0x40 ; 64 1d0a2: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1d0a6: 18 16 cp r1, r24 1d0a8: 0c f4 brge .+2 ; 0x1d0ac 1d0aa: 84 c2 rjmp .+1288 ; 0x1d5b4 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 1d0ac: 82 e0 ldi r24, 0x02 ; 2 1d0ae: 0f 94 cd 58 call 0x2b19a ; 0x2b19a #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)) && 1d0b2: 23 e3 ldi r18, 0x33 ; 51 1d0b4: 33 e3 ldi r19, 0x33 ; 51 1d0b6: 4b e9 ldi r20, 0x9B ; 155 1d0b8: 50 e4 ldi r21, 0x40 ; 64 1d0ba: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1d0be: 87 fd sbrc r24, 7 1d0c0: 79 c2 rjmp .+1266 ; 0x1d5b4 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 1d0c2: 11 11 cpse r17, r1 1d0c4: 7c c2 rjmp .+1272 ; 0x1d5be } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1d0c6: 80 e1 ldi r24, 0x10 ; 16 1d0c8: 0e 94 e5 e6 call 0x1cdca ; 0x1cdca eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1d0cc: 81 ea ldi r24, 0xA1 ; 161 1d0ce: 9d e0 ldi r25, 0x0D ; 13 1d0d0: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1d0d4: bb e0 ldi r27, 0x0B ; 11 1d0d6: 8b 9f mul r24, r27 1d0d8: c0 01 movw r24, r0 1d0da: 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); 1d0dc: 70 e0 ldi r23, 0x00 ; 0 1d0de: 60 e0 ldi r22, 0x00 ; 0 1d0e0: 80 5b subi r24, 0xB0 ; 176 1d0e2: 92 4f sbci r25, 0xF2 ; 242 1d0e4: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 } 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(); 1d0e8: 0e 94 89 67 call 0xcf12 ; 0xcf12 // 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); 1d0ec: ee e9 ldi r30, 0x9E ; 158 1d0ee: f3 e1 ldi r31, 0x13 ; 19 1d0f0: 84 ec ldi r24, 0xC4 ; 196 1d0f2: df 01 movw r26, r30 1d0f4: 1d 92 st X+, r1 1d0f6: 8a 95 dec r24 1d0f8: e9 f7 brne .-6 ; 0x1d0f4 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 1d0fa: 85 e7 ldi r24, 0x75 ; 117 1d0fc: 92 e9 ldi r25, 0x92 ; 146 1d0fe: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 MYSERIAL.println(int(iteration + 1)); 1d102: 81 e0 ldi r24, 0x01 ; 1 1d104: 90 e0 ldi r25, 0x00 ; 0 1d106: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c 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)); 1d10a: 81 ef ldi r24, 0xF1 ; 241 1d10c: 98 e4 ldi r25, 0x48 ; 72 1d10e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1d112: 0f 94 55 35 call 0x26aaa ; 0x26aaa #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; 1d116: c0 92 48 07 sts 0x0748, r12 ; 0x800748 1d11a: d0 92 49 07 sts 0x0749, r13 ; 0x800749 1d11e: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 1d122: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b 1d126: b2 e0 ldi r27, 0x02 ; 2 1d128: e1 96 adiw r28, 0x31 ; 49 1d12a: bf af std Y+63, r27 ; 0x3f 1d12c: e1 97 sbiw r28, 0x31 ; 49 1d12e: 20 e5 ldi r18, 0x50 ; 80 1d130: 32 e9 ldi r19, 0x92 ; 146 1d132: cd 56 subi r28, 0x6D ; 109 1d134: df 4f sbci r29, 0xFF ; 255 1d136: 39 83 std Y+1, r19 ; 0x01 1d138: 28 83 st Y, r18 1d13a: c3 59 subi r28, 0x93 ; 147 1d13c: d0 40 sbci r29, 0x00 ; 0 1d13e: 4d e9 ldi r20, 0x9D ; 157 1d140: 53 e1 ldi r21, 0x13 ; 19 1d142: cf 56 subi r28, 0x6F ; 111 1d144: df 4f sbci r29, 0xFF ; 255 1d146: 59 83 std Y+1, r21 ; 0x01 1d148: 48 83 st Y, r20 1d14a: c1 59 subi r28, 0x91 ; 145 1d14c: d0 40 sbci r29, 0x00 ; 0 1d14e: a0 96 adiw r28, 0x20 ; 32 1d150: 5f af std Y+63, r21 ; 0x3f 1d152: 4e af std Y+62, r20 ; 0x3e 1d154: a0 97 sbiw r28, 0x20 ; 32 1d156: e0 96 adiw r28, 0x30 ; 48 1d158: 3f af std Y+63, r19 ; 0x3f 1d15a: 2e af std Y+62, r18 ; 0x3e 1d15c: 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; 1d15e: a7 96 adiw r28, 0x27 ; 39 1d160: 1f ae std Y+63, r1 ; 0x3f 1d162: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 1d164: 31 2c mov r3, r1 1d166: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 1d168: 0e 94 89 67 call 0xcf12 ; 0xcf12 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 1d16c: 63 e0 ldi r22, 0x03 ; 3 1d16e: 80 e0 ldi r24, 0x00 ; 0 1d170: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%d/4"),(k+1)); 1d174: bf ef ldi r27, 0xFF ; 255 1d176: 2b 1a sub r2, r27 1d178: 3b 0a sbc r3, r27 1d17a: 3f 92 push r3 1d17c: 2f 92 push r2 1d17e: e0 e7 ldi r30, 0x70 ; 112 1d180: f2 e9 ldi r31, 0x92 ; 146 1d182: ff 93 push r31 1d184: ef 93 push r30 1d186: 0e 94 7f 6f call 0xdefe ; 0xdefe } #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); 1d18a: 65 e5 ldi r22, 0x55 ; 85 1d18c: 75 e5 ldi r23, 0x55 ; 85 1d18e: 85 e5 ldi r24, 0x55 ; 85 1d190: 91 e4 ldi r25, 0x41 ; 65 1d192: 0f 94 05 c3 call 0x3860a ; 0x3860a 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); 1d196: e0 96 adiw r28, 0x30 ; 48 1d198: ee ad ldd r30, Y+62 ; 0x3e 1d19a: ff ad ldd r31, Y+63 ; 0x3f 1d19c: e0 97 sbiw r28, 0x30 ; 48 1d19e: 85 91 lpm r24, Z+ 1d1a0: 95 91 lpm r25, Z+ 1d1a2: a5 91 lpm r26, Z+ 1d1a4: b4 91 lpm r27, Z 1d1a6: 80 93 40 07 sts 0x0740, r24 ; 0x800740 1d1aa: 90 93 41 07 sts 0x0741, r25 ; 0x800741 1d1ae: a0 93 42 07 sts 0x0742, r26 ; 0x800742 1d1b2: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 1d1b6: e0 96 adiw r28, 0x30 ; 48 1d1b8: ee ad ldd r30, Y+62 ; 0x3e 1d1ba: ff ad ldd r31, Y+63 ; 0x3f 1d1bc: e0 97 sbiw r28, 0x30 ; 48 1d1be: 34 96 adiw r30, 0x04 ; 4 1d1c0: 85 91 lpm r24, Z+ 1d1c2: 95 91 lpm r25, Z+ 1d1c4: a5 91 lpm r26, Z+ 1d1c6: b4 91 lpm r27, Z 1d1c8: 80 93 44 07 sts 0x0744, r24 ; 0x800744 1d1cc: 90 93 45 07 sts 0x0745, r25 ; 0x800745 1d1d0: a0 93 46 07 sts 0x0746, r26 ; 0x800746 1d1d4: b0 93 47 07 sts 0x0747, r27 ; 0x800747 MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 1d1d8: 60 e0 ldi r22, 0x00 ; 0 1d1da: 70 e0 ldi r23, 0x00 ; 0 1d1dc: 88 e4 ldi r24, 0x48 ; 72 1d1de: 92 e4 ldi r25, 0x42 ; 66 1d1e0: 0f 94 05 c3 call 0x3860a ; 0x3860a return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 1d1e4: 45 ed ldi r20, 0xD5 ; 213 1d1e6: 50 e9 ldi r21, 0x90 ; 144 1d1e8: 5f 93 push r21 1d1ea: 4f 93 push r20 1d1ec: 0f 94 08 dc call 0x3b810 ; 0x3b810 lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 1d1f0: 44 ec ldi r20, 0xC4 ; 196 1d1f2: 50 e9 ldi r21, 0x90 ; 144 1d1f4: 63 e0 ldi r22, 0x03 ; 3 1d1f6: 84 e0 ldi r24, 0x04 ; 4 1d1f8: 0e 94 ba 6f call 0xdf74 ; 0xdf74 // disable heaters and stop motion before we initialize sm4 disable_heater(); 1d1fc: 0f 94 27 45 call 0x28a4e ; 0x28a4e st_synchronize(); 1d200: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 1d204: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d208: 8d 7f andi r24, 0xFD ; 253 1d20a: 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" ); 1d20e: 0f b6 in r0, 0x3f ; 63 1d210: f8 94 cli 1d212: a8 95 wdr 1d214: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d218: 88 61 ori r24, 0x18 ; 24 1d21a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d21e: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d222: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 1d224: 10 92 66 05 sts 0x0566, r1 ; 0x800566 1d228: 10 92 65 05 sts 0x0565, r1 ; 0x800565 sm4_update_pos_cb = xyzcal_update_pos; 1d22c: 8f ef ldi r24, 0xFF ; 255 1d22e: 9f ec ldi r25, 0xCF ; 207 1d230: 90 93 64 05 sts 0x0564, r25 ; 0x800564 1d234: 80 93 63 05 sts 0x0563, r24 ; 0x800563 sm4_calc_delay_cb = xyzcal_calc_delay; 1d238: af e8 ldi r26, 0x8F ; 143 1d23a: bf ec ldi r27, 0xCF ; 207 1d23c: b0 93 62 05 sts 0x0562, r27 ; 0x800562 1d240: a0 93 61 05 sts 0x0561, r26 ; 0x800561 const uint16_t xyzcal_point_pattern_10[12] PROGMEM = {0x000, 0x0f0, 0x1f8, 0x3fc, 0x7fe, 0x7fe, 0x7fe, 0x7fe, 0x3fc, 0x1f8, 0x0f0, 0x000}; const uint16_t xyzcal_point_pattern_08[12] PROGMEM = {0x000, 0x000, 0x0f0, 0x1f8, 0x3fc, 0x3fc, 0x3fc, 0x3fc, 0x1f8, 0x0f0, 0x000, 0x000}; bool xyzcal_searchZ(void) { //@size=118 DBG(_n("xyzcal_searchZ x=%ld y=%ld z=%ld\n"), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]); 1d244: 00 91 69 07 lds r16, 0x0769 ; 0x800769 1d248: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 1d24c: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 1d250: 30 91 6c 07 lds r19, 0x076C ; 0x80076c 1d254: 40 91 65 07 lds r20, 0x0765 ; 0x800765 1d258: 50 91 66 07 lds r21, 0x0766 ; 0x800766 1d25c: 60 91 67 07 lds r22, 0x0767 ; 0x800767 1d260: 70 91 68 07 lds r23, 0x0768 ; 0x800768 1d264: 80 91 61 07 lds r24, 0x0761 ; 0x800761 1d268: 90 91 62 07 lds r25, 0x0762 ; 0x800762 1d26c: a0 91 63 07 lds r26, 0x0763 ; 0x800763 1d270: b0 91 64 07 lds r27, 0x0764 ; 0x800764 1d274: 3f 93 push r19 1d276: 2f 93 push r18 1d278: 1f 93 push r17 1d27a: 0f 93 push r16 1d27c: 7f 93 push r23 1d27e: 6f 93 push r22 1d280: 5f 93 push r21 1d282: 4f 93 push r20 1d284: bf 93 push r27 1d286: af 93 push r26 1d288: 9f 93 push r25 1d28a: 8f 93 push r24 1d28c: e4 e7 ldi r30, 0x74 ; 116 1d28e: f1 e9 ldi r31, 0x91 ; 145 1d290: ff 93 push r31 1d292: ef 93 push r30 1d294: 0f 94 08 dc call 0x3b810 ; 0x3b810 int16_t x0 = _X; 1d298: 40 90 61 07 lds r4, 0x0761 ; 0x800761 1d29c: 50 90 62 07 lds r5, 0x0762 ; 0x800762 1d2a0: 60 90 63 07 lds r6, 0x0763 ; 0x800763 1d2a4: 70 90 64 07 lds r7, 0x0764 ; 0x800764 1d2a8: b4 2c mov r11, r4 1d2aa: a5 2c mov r10, r5 int16_t y0 = _Y; 1d2ac: 80 91 65 07 lds r24, 0x0765 ; 0x800765 1d2b0: 90 91 66 07 lds r25, 0x0766 ; 0x800766 1d2b4: a0 91 67 07 lds r26, 0x0767 ; 0x800767 1d2b8: b0 91 68 07 lds r27, 0x0768 ; 0x800768 1d2bc: a6 96 adiw r28, 0x26 ; 38 1d2be: 8c af std Y+60, r24 ; 0x3c 1d2c0: 9d af std Y+61, r25 ; 0x3d 1d2c2: ae af std Y+62, r26 ; 0x3e 1d2c4: bf af std Y+63, r27 ; 0x3f 1d2c6: a6 97 sbiw r28, 0x26 ; 38 1d2c8: a3 96 adiw r28, 0x23 ; 35 1d2ca: 9f ac ldd r9, Y+63 ; 0x3f 1d2cc: a3 97 sbiw r28, 0x23 ; 35 1d2ce: a4 96 adiw r28, 0x24 ; 36 1d2d0: 8f ac ldd r8, Y+63 ; 0x3f 1d2d2: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 1d2d4: c0 90 69 07 lds r12, 0x0769 ; 0x800769 1d2d8: d0 90 6a 07 lds r13, 0x076A ; 0x80076a 1d2dc: e0 90 6b 07 lds r14, 0x076B ; 0x80076b 1d2e0: f0 90 6c 07 lds r15, 0x076C ; 0x80076c 1d2e4: 0f b6 in r0, 0x3f ; 63 1d2e6: f8 94 cli 1d2e8: de bf out 0x3e, r29 ; 62 1d2ea: 0f be out 0x3f, r0 ; 63 1d2ec: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 1d2ee: b5 e0 ldi r27, 0x05 ; 5 1d2f0: cb 16 cp r12, r27 1d2f2: b7 ef ldi r27, 0xF7 ; 247 1d2f4: db 06 cpc r13, r27 1d2f6: 0c f4 brge .+2 ; 0x1d2fa 1d2f8: d9 c1 rjmp .+946 ; 0x1d6ac } 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; 1d2fa: 1a 82 std Y+2, r1 ; 0x02 1d2fc: 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); 1d2fe: 1f 92 push r1 1d300: 1f 92 push r1 1d302: e3 e0 ldi r30, 0x03 ; 3 1d304: ef 93 push r30 1d306: f4 e8 ldi r31, 0x84 ; 132 1d308: ff 93 push r31 1d30a: 1f 92 push r1 1d30c: 24 e6 ldi r18, 0x64 ; 100 1d30e: 2f 93 push r18 1d310: df 92 push r13 1d312: cf 92 push r12 1d314: 8f 92 push r8 1d316: 9f 92 push r9 1d318: af 92 push r10 1d31a: bf 92 push r11 1d31c: 4b ee ldi r20, 0xEB ; 235 1d31e: 50 e9 ldi r21, 0x90 ; 144 1d320: 5f 93 push r21 1d322: 4f 93 push r20 1d324: 0f 94 08 dc call 0x3b810 ; 0x3b810 if (!ret && (ad < 720)) 1d328: 0f b6 in r0, 0x3f ; 63 1d32a: f8 94 cli 1d32c: de bf out 0x3e, r29 ; 62 1d32e: 0f be out 0x3f, r0 ; 63 1d330: cd bf out 0x3d, r28 ; 61 1d332: 89 81 ldd r24, Y+1 ; 0x01 1d334: 9a 81 ldd r25, Y+2 ; 0x02 1d336: 80 3d cpi r24, 0xD0 ; 208 1d338: 92 40 sbci r25, 0x02 ; 2 1d33a: 08 f4 brcc .+2 ; 0x1d33e 1d33c: 82 c1 rjmp .+772 ; 0x1d642 if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 1d33e: 89 81 ldd r24, Y+1 ; 0x01 1d340: 9a 81 ldd r25, Y+2 ; 0x02 1d342: 80 3a cpi r24, 0xA0 ; 160 1d344: 95 40 sbci r25, 0x05 ; 5 1d346: 10 f0 brcs .+4 ; 0x1d34c 1d348: 0c 94 a1 f8 jmp 0x1f142 ; 0x1f142 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 1d34c: 9e 01 movw r18, r28 1d34e: 2f 5f subi r18, 0xFF ; 255 1d350: 3f 4f sbci r19, 0xFF ; 255 1d352: 79 01 movw r14, r18 1d354: 10 e0 ldi r17, 0x00 ; 0 1d356: 00 e0 ldi r16, 0x00 ; 0 1d358: 2c e7 ldi r18, 0x7C ; 124 1d35a: 3c ef ldi r19, 0xFC ; 252 1d35c: a6 01 movw r20, r12 1d35e: 44 56 subi r20, 0x64 ; 100 1d360: 51 09 sbc r21, r1 1d362: 69 2d mov r22, r9 1d364: 78 2d mov r23, r8 1d366: 8b 2d mov r24, r11 1d368: 9a 2d mov r25, r10 1d36a: 0f 94 cc 94 call 0x32998 ; 0x32998 1d36e: 88 23 and r24, r24 1d370: 11 f4 brne .+4 ; 0x1d376 1d372: 0c 94 a1 f8 jmp 0x1f142 ; 0x1f142 ad += 720; 1d376: 89 81 ldd r24, Y+1 ; 0x01 1d378: 9a 81 ldd r25, Y+2 ; 0x02 1d37a: 80 53 subi r24, 0x30 ; 48 1d37c: 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); 1d37e: c0 90 69 07 lds r12, 0x0769 ; 0x800769 1d382: d0 90 6a 07 lds r13, 0x076A ; 0x80076a 1d386: e0 90 6b 07 lds r14, 0x076B ; 0x80076b 1d38a: f0 90 6c 07 lds r15, 0x076C ; 0x80076c 1d38e: 00 91 65 07 lds r16, 0x0765 ; 0x800765 1d392: 10 91 66 07 lds r17, 0x0766 ; 0x800766 1d396: 20 91 67 07 lds r18, 0x0767 ; 0x800767 1d39a: 30 91 68 07 lds r19, 0x0768 ; 0x800768 1d39e: 40 91 61 07 lds r20, 0x0761 ; 0x800761 1d3a2: 50 91 62 07 lds r21, 0x0762 ; 0x800762 1d3a6: 60 91 63 07 lds r22, 0x0763 ; 0x800763 1d3aa: 70 91 64 07 lds r23, 0x0764 ; 0x800764 1d3ae: 9f 93 push r25 1d3b0: 8f 93 push r24 1d3b2: df 92 push r13 1d3b4: cf 92 push r12 1d3b6: 1f 93 push r17 1d3b8: 0f 93 push r16 1d3ba: 5f 93 push r21 1d3bc: 4f 93 push r20 1d3be: 80 e5 ldi r24, 0x50 ; 80 1d3c0: 91 e9 ldi r25, 0x91 ; 145 1d3c2: 9f 93 push r25 1d3c4: 8f 93 push r24 1d3c6: 0f 94 08 dc call 0x3b810 ; 0x3b810 /// 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); 1d3ca: 40 91 69 07 lds r20, 0x0769 ; 0x800769 1d3ce: 50 91 6a 07 lds r21, 0x076A ; 0x80076a 1d3d2: 60 91 6b 07 lds r22, 0x076B ; 0x80076b 1d3d6: 70 91 6c 07 lds r23, 0x076C ; 0x80076c 1d3da: 48 54 subi r20, 0x48 ; 72 1d3dc: 51 09 sbc r21, r1 1d3de: 00 e0 ldi r16, 0x00 ; 0 1d3e0: 28 ec ldi r18, 0xC8 ; 200 1d3e2: 30 e0 ldi r19, 0x00 ; 0 1d3e4: a3 96 adiw r28, 0x23 ; 35 1d3e6: 6f ad ldd r22, Y+63 ; 0x3f 1d3e8: a3 97 sbiw r28, 0x23 ; 35 1d3ea: a4 96 adiw r28, 0x24 ; 36 1d3ec: 7f ad ldd r23, Y+63 ; 0x3f 1d3ee: a4 97 sbiw r28, 0x24 ; 36 1d3f0: c2 01 movw r24, r4 1d3f2: 0e 94 04 e2 call 0x1c408 ; 0x1c408 /// 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; 1d3f6: 20 91 61 07 lds r18, 0x0761 ; 0x800761 1d3fa: 30 91 62 07 lds r19, 0x0762 ; 0x800762 1d3fe: 40 91 63 07 lds r20, 0x0763 ; 0x800763 1d402: 50 91 64 07 lds r21, 0x0764 ; 0x800764 1d406: 6e 96 adiw r28, 0x1e ; 30 1d408: 2c af std Y+60, r18 ; 0x3c 1d40a: 3d af std Y+61, r19 ; 0x3d 1d40c: 4e af std Y+62, r20 ; 0x3e 1d40e: 5f af std Y+63, r21 ; 0x3f 1d410: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 1d412: 80 91 65 07 lds r24, 0x0765 ; 0x800765 1d416: 90 91 66 07 lds r25, 0x0766 ; 0x800766 1d41a: a0 91 67 07 lds r26, 0x0767 ; 0x800767 1d41e: b0 91 68 07 lds r27, 0x0768 ; 0x800768 1d422: ae 96 adiw r28, 0x2e ; 46 1d424: 8c af std Y+60, r24 ; 0x3c 1d426: 9d af std Y+61, r25 ; 0x3d 1d428: ae af std Y+62, r26 ; 0x3e 1d42a: bf af std Y+63, r27 ; 0x3f 1d42c: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 1d42e: 20 91 69 07 lds r18, 0x0769 ; 0x800769 1d432: 30 91 6a 07 lds r19, 0x076A ; 0x80076a 1d436: 40 91 6b 07 lds r20, 0x076B ; 0x80076b 1d43a: 50 91 6c 07 lds r21, 0x076C ; 0x80076c 1d43e: e9 96 adiw r28, 0x39 ; 57 1d440: 2c af std Y+60, r18 ; 0x3c 1d442: 3d af std Y+61, r19 ; 0x3d 1d444: 4e af std Y+62, r20 ; 0x3e 1d446: 5f af std Y+63, r21 ; 0x3f 1d448: e9 97 sbiw r28, 0x39 ; 57 1d44a: a3 e7 ldi r26, 0x73 ; 115 1d44c: bb e0 ldi r27, 0x0B ; 11 1d44e: 0f b6 in r0, 0x3f ; 63 1d450: f8 94 cli 1d452: de bf out 0x3e, r29 ; 62 1d454: 0f be out 0x3f, r0 ; 63 1d456: cd bf out 0x3d, r28 ; 61 1d458: 90 e0 ldi r25, 0x00 ; 0 1d45a: 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)); 1d45c: fc 01 movw r30, r24 1d45e: e5 51 subi r30, 0x15 ; 21 1d460: fe 46 sbci r31, 0x6E ; 110 1d462: 25 91 lpm r18, Z+ 1d464: 34 91 lpm r19, Z 1d466: 2d 93 st X+, r18 1d468: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 1d46a: fc 01 movw r30, r24 1d46c: ed 52 subi r30, 0x2D ; 45 1d46e: fe 46 sbci r31, 0x6E ; 110 1d470: 25 91 lpm r18, Z+ 1d472: 34 91 lpm r19, Z 1d474: 57 96 adiw r26, 0x17 ; 23 1d476: 3c 93 st X, r19 1d478: 2e 93 st -X, r18 1d47a: 56 97 sbiw r26, 0x16 ; 22 1d47c: 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++){ 1d47e: 88 31 cpi r24, 0x18 ; 24 1d480: 91 05 cpc r25, r1 1d482: 61 f7 brne .-40 ; 0x1d45c 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); 1d484: e7 96 adiw r28, 0x37 ; 55 1d486: 4e ad ldd r20, Y+62 ; 0x3e 1d488: 5f ad ldd r21, Y+63 ; 0x3f 1d48a: e7 97 sbiw r28, 0x37 ; 55 1d48c: ac 96 adiw r28, 0x2c ; 44 1d48e: 6e ad ldd r22, Y+62 ; 0x3e 1d490: 7f ad ldd r23, Y+63 ; 0x3f 1d492: ac 97 sbiw r28, 0x2c ; 44 1d494: 6c 96 adiw r28, 0x1c ; 28 1d496: 8e ad ldd r24, Y+62 ; 0x3e 1d498: 9f ad ldd r25, Y+63 ; 0x3f 1d49a: 6c 97 sbiw r28, 0x1c ; 28 1d49c: 0f 94 54 91 call 0x322a8 ; 0x322a8 1d4a0: 23 e7 ldi r18, 0x73 ; 115 1d4a2: 37 e0 ldi r19, 0x07 ; 7 1d4a4: a4 96 adiw r28, 0x24 ; 36 1d4a6: 3f af std Y+63, r19 ; 0x3f 1d4a8: 2e af std Y+62, r18 ; 0x3e 1d4aa: a4 97 sbiw r28, 0x24 ; 36 1d4ac: 79 01 movw r14, r18 1d4ae: f0 e2 ldi r31, 0x20 ; 32 1d4b0: 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]); 1d4b2: a6 e9 ldi r26, 0x96 ; 150 1d4b4: ca 2e mov r12, r26 1d4b6: a1 e9 ldi r26, 0x91 ; 145 1d4b8: da 2e mov r13, r26 } DBG(endl); 1d4ba: 00 e2 ldi r16, 0x20 ; 32 1d4bc: 15 ea ldi r17, 0xA5 ; 165 for (uint8_t i = 0; i < 12; i++){ pattern08[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_08 + i)); pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); } xyzcal_scan_pixels_32x32_Zhop(x, y, z, 2400, 200, matrix32); 1d4be: 57 01 movw r10, r14 1d4c0: e0 e2 ldi r30, 0x20 ; 32 1d4c2: 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]); 1d4c4: d5 01 movw r26, r10 1d4c6: 8d 91 ld r24, X+ 1d4c8: 5d 01 movw r10, r26 1d4ca: 1f 92 push r1 1d4cc: 8f 93 push r24 1d4ce: df 92 push r13 1d4d0: cf 92 push r12 1d4d2: 0f 94 08 dc call 0x3b810 ; 0x3b810 1d4d6: 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){ 1d4d8: 0f 90 pop r0 1d4da: 0f 90 pop r0 1d4dc: 0f 90 pop r0 1d4de: 0f 90 pop r0 1d4e0: 81 10 cpse r8, r1 1d4e2: f0 cf rjmp .-32 ; 0x1d4c4 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 1d4e4: 1f 93 push r17 1d4e6: 0f 93 push r16 1d4e8: 0f 94 08 dc call 0x3b810 ; 0x3b810 1d4ec: 9a 94 dec r9 1d4ee: b0 e2 ldi r27, 0x20 ; 32 1d4f0: eb 0e add r14, r27 1d4f2: 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){ 1d4f4: 0f 90 pop r0 1d4f6: 0f 90 pop r0 1d4f8: 91 10 cpse r9, r1 1d4fa: e1 cf rjmp .-62 ; 0x1d4be for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 1d4fc: 1f 93 push r17 1d4fe: 0f 93 push r16 1d500: 0f 94 08 dc call 0x3b810 ; 0x3b810 1d504: 63 e7 ldi r22, 0x73 ; 115 1d506: 7b e0 ldi r23, 0x0B ; 11 1d508: 0f 90 pop r0 1d50a: 0f 90 pop r0 1d50c: e3 e7 ldi r30, 0x73 ; 115 1d50e: 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; 1d510: 90 e0 ldi r25, 0x00 ; 0 1d512: 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; 1d514: 50 e0 ldi r21, 0x00 ; 0 1d516: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 1d518: 21 91 ld r18, Z+ 1d51a: 21 11 cpse r18, r1 1d51c: 07 c3 rjmp .+1550 ; 0x1db2c ++mins; 1d51e: 4f 5f subi r20, 0xFF ; 255 1d520: 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){ 1d522: 6e 17 cp r22, r30 1d524: 7f 07 cpc r23, r31 1d526: c1 f7 brne .-16 ; 0x1d518 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 1d528: 9a 01 movw r18, r20 1d52a: 28 0f add r18, r24 1d52c: 39 1f adc r19, r25 1d52e: 25 38 cpi r18, 0x85 ; 133 1d530: 33 40 sbci r19, 0x03 ; 3 1d532: a4 f0 brlt .+40 ; 0x1d55c && mins > threshold_extreme 1d534: 43 33 cpi r20, 0x33 ; 51 1d536: 51 05 cpc r21, r1 1d538: 8c f0 brlt .+34 ; 0x1d55c && maxs > threshold_extreme 1d53a: 83 33 cpi r24, 0x33 ; 51 1d53c: 91 05 cpc r25, r1 1d53e: 74 f0 brlt .+28 ; 0x1d55c ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 1d540: 20 e0 ldi r18, 0x00 ; 0 1d542: 34 e0 ldi r19, 0x04 ; 4 1d544: 24 1b sub r18, r20 1d546: 35 0b sbc r19, r21 1d548: 28 1b sub r18, r24 1d54a: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 1d54c: 24 17 cp r18, r20 1d54e: 35 07 cpc r19, r21 1d550: 2c f4 brge .+10 ; 0x1d55c } 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; 1d552: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 1d554: 28 17 cp r18, r24 1d556: 39 07 cpc r19, r25 1d558: 0c f4 brge .+2 ; 0x1d55c 1d55a: d8 c0 rjmp .+432 ; 0x1d70c } /// 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; 1d55c: 66 96 adiw r28, 0x16 ; 22 1d55e: 1f ae std Y+63, r1 ; 0x3f 1d560: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 1d562: 62 96 adiw r28, 0x12 ; 18 1d564: 1f ae std Y+63, r1 ; 0x3f 1d566: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 1d568: 22 96 adiw r28, 0x02 ; 2 1d56a: 1f ae std Y+63, r1 ; 0x3f 1d56c: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 1d56e: 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) 1d570: 83 e7 ldi r24, 0x73 ; 115 1d572: 97 e0 ldi r25, 0x07 ; 7 1d574: 89 2b or r24, r25 1d576: 99 f0 breq .+38 ; 0x1d59e 1d578: 83 e7 ldi r24, 0x73 ; 115 1d57a: 9b e0 ldi r25, 0x0B ; 11 return -1; 1d57c: 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) 1d57e: 00 97 sbiw r24, 0x00 ; 0 1d580: 49 f0 breq .+18 ; 0x1d594 1d582: ae 01 movw r20, r28 1d584: 4f 5a subi r20, 0xAF ; 175 1d586: 5f 4f sbci r21, 0xFF ; 255 1d588: be 01 movw r22, r28 1d58a: 6b 5a subi r22, 0xAB ; 171 1d58c: 7f 4f sbci r23, 0xFF ; 255 1d58e: 0f 94 77 90 call 0x320ee ; 0x320ee 1d592: 08 2f mov r16, r24 1d594: 8b e8 ldi r24, 0x8B ; 139 1d596: 9b e0 ldi r25, 0x0B ; 11 1d598: 89 2b or r24, r25 1d59a: 09 f0 breq .+2 ; 0x1d59e 1d59c: cc c2 rjmp .+1432 ; 0x1db36 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; 1d59e: 8f ef ldi r24, 0xFF ; 255 1d5a0: dc c2 rjmp .+1464 ; 0x1db5a 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)); 1d5a2: 81 ef ldi r24, 0xF1 ; 241 1d5a4: 98 e4 ldi r25, 0x48 ; 72 1d5a6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1d5aa: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_puts_at_P(0,3,_n("1/4")); 1d5ae: 49 ec ldi r20, 0xC9 ; 201 1d5b0: 5e e6 ldi r21, 0x6E ; 110 1d5b2: 23 cd rjmp .-1466 ; 0x1cffa } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 1d5b4: 81 e8 ldi r24, 0x81 ; 129 1d5b6: 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); 1d5b8: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 1d5bc: 06 cd rjmp .-1524 ; 0x1cfca 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); 1d5be: c7 55 subi r28, 0x57 ; 87 1d5c0: df 4f sbci r29, 0xFF ; 255 1d5c2: 88 81 ld r24, Y 1d5c4: 99 81 ldd r25, Y+1 ; 0x01 1d5c6: c9 5a subi r28, 0xA9 ; 169 1d5c8: d0 40 sbci r29, 0x00 ; 0 1d5ca: 0e 94 94 67 call 0xcf28 ; 0xcf28 // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 1d5ce: 0f 94 ca cb call 0x39794 ; 0x39794 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 1d5d2: 0f 94 68 c9 call 0x392d0 ; 0x392d0 //FIXME bool result = sample_mesh_and_store_reference(); 1d5d6: 0f 94 77 c7 call 0x38eee ; 0x38eee 1d5da: e5 96 adiw r28, 0x35 ; 53 1d5dc: 8f af std Y+63, r24 ; 0x3f 1d5de: e5 97 sbiw r28, 0x35 ; 53 if (result) 1d5e0: 88 23 and r24, r24 1d5e2: 09 f4 brne .+2 ; 0x1d5e6 1d5e4: f2 cc rjmp .-1564 ; 0x1cfca { calibration_status_set(CALIBRATION_STATUS_Z); 1d5e6: 84 e0 ldi r24, 0x04 ; 4 1d5e8: 0e 94 3a e7 call 0x1ce74 ; 0x1ce74 } else { // Timeouted. } lcd_update_enable(true); 1d5ec: 81 e0 ldi r24, 0x01 ; 1 1d5ee: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 #ifdef TMC2130 FORCE_HIGH_POWER_END; 1d5f2: 80 e0 ldi r24, 0x00 ; 0 1d5f4: 0e 94 76 67 call 0xceec ; 0xceec #endif // TMC2130 FORCE_BL_ON_END; 1d5f8: 80 e0 ldi r24, 0x00 ; 0 1d5fa: 0e 94 8d 8b call 0x1171a ; 0x1171a return final_result; } 1d5fe: e5 96 adiw r28, 0x35 ; 53 1d600: 8f ad ldd r24, Y+63 ; 0x3f 1d602: e5 97 sbiw r28, 0x35 ; 53 1d604: c2 53 subi r28, 0x32 ; 50 1d606: df 4f sbci r29, 0xFF ; 255 1d608: 0f b6 in r0, 0x3f ; 63 1d60a: f8 94 cli 1d60c: de bf out 0x3e, r29 ; 62 1d60e: 0f be out 0x3f, r0 ; 63 1d610: cd bf out 0x3d, r28 ; 61 1d612: df 91 pop r29 1d614: cf 91 pop r28 1d616: 1f 91 pop r17 1d618: 0f 91 pop r16 1d61a: ff 90 pop r15 1d61c: ef 90 pop r14 1d61e: df 90 pop r13 1d620: cf 90 pop r12 1d622: bf 90 pop r11 1d624: af 90 pop r10 1d626: 9f 90 pop r9 1d628: 8f 90 pop r8 1d62a: 7f 90 pop r7 1d62c: 6f 90 pop r6 1d62e: 5f 90 pop r5 1d630: 4f 90 pop r4 1d632: 3f 90 pop r3 1d634: 2f 90 pop r2 1d636: 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) { 1d638: e1 e0 ldi r30, 0x01 ; 1 1d63a: e1 96 adiw r28, 0x31 ; 49 1d63c: ef af std Y+63, r30 ; 0x3f 1d63e: e1 97 sbiw r28, 0x31 ; 49 1d640: 76 cd rjmp .-1300 ; 0x1d12e 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) 1d642: fe 01 movw r30, r28 1d644: 31 96 adiw r30, 0x01 ; 1 1d646: 7f 01 movw r14, r30 1d648: 10 e0 ldi r17, 0x00 ; 0 1d64a: 00 e0 ldi r16, 0x00 ; 0 1d64c: 24 e8 ldi r18, 0x84 ; 132 1d64e: 33 e0 ldi r19, 0x03 ; 3 1d650: a6 01 movw r20, r12 1d652: 69 2d mov r22, r9 1d654: 78 2d mov r23, r8 1d656: 8b 2d mov r24, r11 1d658: 9a 2d mov r25, r10 1d65a: 0f 94 cc 94 call 0x32998 ; 0x32998 ad += 0; if (!ret && (ad < 1440)) 1d65e: 88 23 and r24, r24 1d660: 09 f4 brne .+2 ; 0x1d664 1d662: 6d ce rjmp .-806 ; 0x1d33e 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; 1d664: 89 81 ldd r24, Y+1 ; 0x01 1d666: 9a 81 ldd r25, Y+2 ; 0x02 1d668: 8a ce rjmp .-748 ; 0x1d37e 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)) 1d66a: 89 81 ldd r24, Y+1 ; 0x01 1d66c: 9a 81 ldd r25, Y+2 ; 0x02 1d66e: 80 34 cpi r24, 0x40 ; 64 1d670: 9b 40 sbci r25, 0x0B ; 11 1d672: b8 f4 brcc .+46 ; 0x1d6a2 if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 1d674: ce 01 movw r24, r28 1d676: 01 96 adiw r24, 0x01 ; 1 1d678: 7c 01 movw r14, r24 1d67a: 04 eb ldi r16, 0xB4 ; 180 1d67c: 10 e0 ldi r17, 0x00 ; 0 1d67e: 2c e7 ldi r18, 0x7C ; 124 1d680: 3c ef ldi r19, 0xFC ; 252 1d682: a6 01 movw r20, r12 1d684: 4c 52 subi r20, 0x2C ; 44 1d686: 51 40 sbci r21, 0x01 ; 1 1d688: 69 2d mov r22, r9 1d68a: 78 2d mov r23, r8 1d68c: 8b 2d mov r24, r11 1d68e: 9a 2d mov r25, r10 1d690: 0f 94 cc 94 call 0x32998 ; 0x32998 1d694: 88 23 and r24, r24 1d696: 29 f0 breq .+10 ; 0x1d6a2 ad += 2160; 1d698: 89 81 ldd r24, Y+1 ; 0x01 1d69a: 9a 81 ldd r25, Y+2 ; 0x02 1d69c: 80 59 subi r24, 0x90 ; 144 1d69e: 97 4f sbci r25, 0xF7 ; 247 1d6a0: 6e ce rjmp .-804 ; 0x1d37e /// 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; 1d6a2: 90 e9 ldi r25, 0x90 ; 144 1d6a4: c9 1a sub r12, r25 1d6a6: 91 e0 ldi r25, 0x01 ; 1 1d6a8: d9 0a sbc r13, r25 1d6aa: 21 ce rjmp .-958 ; 0x1d2ee } //@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]); 1d6ac: 00 91 69 07 lds r16, 0x0769 ; 0x800769 1d6b0: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 1d6b4: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 1d6b8: 30 91 6c 07 lds r19, 0x076C ; 0x80076c 1d6bc: 40 91 65 07 lds r20, 0x0765 ; 0x800765 1d6c0: 50 91 66 07 lds r21, 0x0766 ; 0x800766 1d6c4: 60 91 67 07 lds r22, 0x0767 ; 0x800767 1d6c8: 70 91 68 07 lds r23, 0x0768 ; 0x800768 1d6cc: 80 91 61 07 lds r24, 0x0761 ; 0x800761 1d6d0: 90 91 62 07 lds r25, 0x0762 ; 0x800762 1d6d4: a0 91 63 07 lds r26, 0x0763 ; 0x800763 1d6d8: b0 91 64 07 lds r27, 0x0764 ; 0x800764 1d6dc: 3f 93 push r19 1d6de: 2f 93 push r18 1d6e0: 1f 93 push r17 1d6e2: 0f 93 push r16 1d6e4: 7f 93 push r23 1d6e6: 6f 93 push r22 1d6e8: 5f 93 push r21 1d6ea: 4f 93 push r20 1d6ec: bf 93 push r27 1d6ee: af 93 push r26 1d6f0: 9f 93 push r25 1d6f2: 8f 93 push r24 1d6f4: 83 e2 ldi r24, 0x23 ; 35 1d6f6: 91 e9 ldi r25, 0x91 ; 145 1d6f8: 9f 93 push r25 1d6fa: 8f 93 push r24 1d6fc: 0f 94 08 dc call 0x3b810 ; 0x3b810 1d700: 0f b6 in r0, 0x3f ; 63 1d702: f8 94 cli 1d704: de bf out 0x3e, r29 ; 62 1d706: 0f be out 0x3f, r0 ; 63 1d708: 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; 1d70a: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 1d70c: 83 e0 ldi r24, 0x03 ; 3 1d70e: 92 e9 ldi r25, 0x92 ; 146 1d710: 9f 93 push r25 1d712: 8f 93 push r24 1d714: 0f 94 08 dc call 0x3b810 ; 0x3b810 lcd_set_cursor(4,3); 1d718: 63 e0 ldi r22, 0x03 ; 3 1d71a: 84 e0 ldi r24, 0x04 ; 4 1d71c: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_space(16); 1d720: 80 e1 ldi r24, 0x10 ; 16 1d722: 0e 94 9c 6f call 0xdf38 ; 0xdf38 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 1d726: 0f 94 7b ba call 0x374f6 ; 0x374f6 : "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" ); 1d72a: 88 e1 ldi r24, 0x18 ; 24 1d72c: 98 e2 ldi r25, 0x28 ; 40 1d72e: 0f b6 in r0, 0x3f ; 63 1d730: f8 94 cli 1d732: a8 95 wdr 1d734: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d738: 0f be out 0x3f, r0 ; 63 1d73a: 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); 1d73e: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d742: 80 64 ori r24, 0x40 ; 64 1d744: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 1d748: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d74c: 82 60 ori r24, 0x02 ; 2 1d74e: 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){ 1d752: 0f 90 pop r0 1d754: 0f 90 pop r0 1d756: 1d 3f cpi r17, 0xFD ; 253 1d758: 09 f4 brne .+2 ; 0x1d75c 1d75a: 64 c3 rjmp .+1736 ; 0x1de24 1d75c: 1f 3f cpi r17, 0xFF ; 255 1d75e: 11 f4 brne .+4 ; 0x1d764 1d760: 0c 94 5d f8 jmp 0x1f0ba ; 0x1f0ba 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); 1d764: 20 e0 ldi r18, 0x00 ; 0 1d766: 30 e0 ldi r19, 0x00 ; 0 1d768: a9 01 movw r20, r18 1d76a: a0 96 adiw r28, 0x20 ; 32 1d76c: ee ad ldd r30, Y+62 ; 0x3e 1d76e: ff ad ldd r31, Y+63 ; 0x3f 1d770: a0 97 sbiw r28, 0x20 ; 32 1d772: 61 81 ldd r22, Z+1 ; 0x01 1d774: 72 81 ldd r23, Z+2 ; 0x02 1d776: 83 81 ldd r24, Z+3 ; 0x03 1d778: 94 81 ldd r25, Z+4 ; 0x04 1d77a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 1d77e: 20 91 40 07 lds r18, 0x0740 ; 0x800740 1d782: 30 91 41 07 lds r19, 0x0741 ; 0x800741 1d786: 40 91 42 07 lds r20, 0x0742 ; 0x800742 1d78a: 50 91 43 07 lds r21, 0x0743 ; 0x800743 1d78e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1d792: a0 96 adiw r28, 0x20 ; 32 1d794: ae ad ldd r26, Y+62 ; 0x3e 1d796: bf ad ldd r27, Y+63 ; 0x3f 1d798: a0 97 sbiw r28, 0x20 ; 32 1d79a: 11 96 adiw r26, 0x01 ; 1 1d79c: 6d 93 st X+, r22 1d79e: 7d 93 st X+, r23 1d7a0: 8d 93 st X+, r24 1d7a2: 9c 93 st X, r25 1d7a4: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d7a6: c0 90 44 07 lds r12, 0x0744 ; 0x800744 1d7aa: d0 90 45 07 lds r13, 0x0745 ; 0x800745 1d7ae: e0 90 46 07 lds r14, 0x0746 ; 0x800746 1d7b2: f0 90 47 07 lds r15, 0x0747 ; 0x800747 MYSERIAL.println(current_position[Y_AXIS]); } #endif // SUPPORT_VERBOSITY pt[0] = (pt[0] * iteration) / (iteration + 1); pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average pt[1] = (pt[1] * iteration) / (iteration + 1); 1d7b6: 20 e0 ldi r18, 0x00 ; 0 1d7b8: 30 e0 ldi r19, 0x00 ; 0 1d7ba: a9 01 movw r20, r18 1d7bc: 15 96 adiw r26, 0x05 ; 5 1d7be: 6d 91 ld r22, X+ 1d7c0: 7d 91 ld r23, X+ 1d7c2: 8d 91 ld r24, X+ 1d7c4: 9c 91 ld r25, X 1d7c6: 18 97 sbiw r26, 0x08 ; 8 1d7c8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d7cc: a7 01 movw r20, r14 1d7ce: 96 01 movw r18, r12 1d7d0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1d7d4: a0 96 adiw r28, 0x20 ; 32 1d7d6: ee ad ldd r30, Y+62 ; 0x3e 1d7d8: ff ad ldd r31, Y+63 ; 0x3f 1d7da: a0 97 sbiw r28, 0x20 ; 32 1d7dc: 65 83 std Z+5, r22 ; 0x05 1d7de: 76 83 std Z+6, r23 ; 0x06 1d7e0: 87 83 std Z+7, r24 ; 0x07 1d7e2: 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) 1d7e4: 20 e0 ldi r18, 0x00 ; 0 1d7e6: 30 e0 ldi r19, 0x00 ; 0 1d7e8: 40 e8 ldi r20, 0x80 ; 128 1d7ea: 50 ec ldi r21, 0xC0 ; 192 1d7ec: c7 01 movw r24, r14 1d7ee: b6 01 movw r22, r12 1d7f0: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1d7f4: 87 ff sbrs r24, 7 1d7f6: 0c c0 rjmp .+24 ; 0x1d810 current_position[Y_AXIS] = Y_MIN_POS; 1d7f8: 80 e0 ldi r24, 0x00 ; 0 1d7fa: 90 e0 ldi r25, 0x00 ; 0 1d7fc: a0 e8 ldi r26, 0x80 ; 128 1d7fe: b0 ec ldi r27, 0xC0 ; 192 1d800: 80 93 44 07 sts 0x0744, r24 ; 0x800744 1d804: 90 93 45 07 sts 0x0745, r25 ; 0x800745 1d808: a0 93 46 07 sts 0x0746, r26 ; 0x800746 1d80c: b0 93 47 07 sts 0x0747, r27 ; 0x800747 // Start searching for the other points at 3mm above the last point. current_position[Z_AXIS] += 3.f + FIND_BED_INDUCTION_SENSOR_POINT_Z_STEP * iteration * 0.3; 1d810: 20 e0 ldi r18, 0x00 ; 0 1d812: 30 e0 ldi r19, 0x00 ; 0 1d814: 40 e4 ldi r20, 0x40 ; 64 1d816: 50 e4 ldi r21, 0x40 ; 64 1d818: 60 91 48 07 lds r22, 0x0748 ; 0x800748 1d81c: 70 91 49 07 lds r23, 0x0749 ; 0x800749 1d820: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 1d824: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 1d828: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1d82c: 60 93 48 07 sts 0x0748, r22 ; 0x800748 1d830: 70 93 49 07 sts 0x0749, r23 ; 0x800749 1d834: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 1d838: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b 1d83c: e0 96 adiw r28, 0x30 ; 48 1d83e: 2e ad ldd r18, Y+62 ; 0x3e 1d840: 3f ad ldd r19, Y+63 ; 0x3f 1d842: e0 97 sbiw r28, 0x30 ; 48 1d844: 28 5f subi r18, 0xF8 ; 248 1d846: 3f 4f sbci r19, 0xFF ; 255 1d848: e0 96 adiw r28, 0x30 ; 48 1d84a: 3f af std Y+63, r19 ; 0x3f 1d84c: 2e af std Y+62, r18 ; 0x3e 1d84e: e0 97 sbiw r28, 0x30 ; 48 1d850: a0 96 adiw r28, 0x20 ; 32 1d852: 4e ad ldd r20, Y+62 ; 0x3e 1d854: 5f ad ldd r21, Y+63 ; 0x3f 1d856: a0 97 sbiw r28, 0x20 ; 32 1d858: 48 5f subi r20, 0xF8 ; 248 1d85a: 5f 4f sbci r21, 0xFF ; 255 1d85c: a0 96 adiw r28, 0x20 ; 32 1d85e: 5f af std Y+63, r21 ; 0x3f 1d860: 4e af std Y+62, r20 ; 0x3e 1d862: 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) { 1d864: 54 e0 ldi r21, 0x04 ; 4 1d866: 25 16 cp r2, r21 1d868: 31 04 cpc r3, r1 1d86a: 09 f0 breq .+2 ; 0x1d86e 1d86c: 7d cc rjmp .-1798 ; 0x1d168 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 1d86e: a7 96 adiw r28, 0x27 ; 39 1d870: 6f ad ldd r22, Y+63 ; 0x3f 1d872: a7 97 sbiw r28, 0x27 ; 39 1d874: 66 23 and r22, r22 1d876: 31 f0 breq .+12 ; 0x1d884 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) { 1d878: e1 96 adiw r28, 0x31 ; 49 1d87a: 8f ad ldd r24, Y+63 ; 0x3f 1d87c: e1 97 sbiw r28, 0x31 ; 49 1d87e: 81 30 cpi r24, 0x01 ; 1 1d880: 09 f0 breq .+2 ; 0x1d884 1d882: da ce rjmp .-588 ; 0x1d638 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 1d884: 84 ea ldi r24, 0xA4 ; 164 1d886: 9e e6 ldi r25, 0x6E ; 110 1d888: 9f 93 push r25 1d88a: 8f 93 push r24 1d88c: 0f 94 08 dc call 0x3b810 ; 0x3b810 delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 1d890: 90 e0 ldi r25, 0x00 ; 0 1d892: 80 e0 ldi r24, 0x00 ; 0 1d894: 0e 94 98 8e call 0x11d30 ; 0x11d30 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) { 1d898: 0f 90 pop r0 1d89a: 0f 90 pop r0 1d89c: 20 e0 ldi r18, 0x00 ; 0 1d89e: 30 e0 ldi r19, 0x00 ; 0 1d8a0: 40 e9 ldi r20, 0x90 ; 144 1d8a2: 50 ec ldi r21, 0xC0 ; 192 1d8a4: 60 91 a2 13 lds r22, 0x13A2 ; 0x8013a2 1d8a8: 70 91 a3 13 lds r23, 0x13A3 ; 0x8013a3 1d8ac: 80 91 a4 13 lds r24, 0x13A4 ; 0x8013a4 1d8b0: 90 91 a5 13 lds r25, 0x13A5 ; 0x8013a5 1d8b4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1d8b8: 87 ff sbrs r24, 7 1d8ba: bb c2 rjmp .+1398 ; 0x1de32 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 1d8bc: 8f e4 ldi r24, 0x4F ; 79 1d8be: 92 e9 ldi r25, 0x92 ; 146 1d8c0: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 1d8c4: 8d e1 ldi r24, 0x1D ; 29 1d8c6: 92 e9 ldi r25, 0x92 ; 146 1d8c8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1d8cc: 60 91 a2 13 lds r22, 0x13A2 ; 0x8013a2 1d8d0: 70 91 a3 13 lds r23, 0x13A3 ; 0x8013a3 1d8d4: 80 91 a4 13 lds r24, 0x13A4 ; 0x8013a4 1d8d8: 90 91 a5 13 lds r25, 0x13A5 ; 0x8013a5 1d8dc: 42 e0 ldi r20, 0x02 ; 2 1d8de: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 1d8e2: 89 e1 ldi r24, 0x19 ; 25 1d8e4: 92 e9 ldi r25, 0x92 ; 146 1d8e6: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 1d8ea: 60 e0 ldi r22, 0x00 ; 0 1d8ec: 70 e0 ldi r23, 0x00 ; 0 1d8ee: 80 e9 ldi r24, 0x90 ; 144 1d8f0: 90 ec ldi r25, 0xC0 ; 192 1d8f2: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a 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 1d8f6: 92 e0 ldi r25, 0x02 ; 2 1d8f8: af 96 adiw r28, 0x2f ; 47 1d8fa: 9f af std Y+63, r25 ; 0x3f 1d8fc: 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; 1d8fe: 10 92 ce 13 sts 0x13CE, r1 ; 0x8013ce 1d902: 10 92 cf 13 sts 0x13CF, r1 ; 0x8013cf 1d906: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 1d90a: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 cntr[1] = 0.f; 1d90e: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 1d912: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1d916: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 1d91a: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 1d91e: a4 e6 ldi r26, 0x64 ; 100 1d920: e6 96 adiw r28, 0x36 ; 54 1d922: af af std Y+63, r26 ; 0x3f 1d924: 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; 1d926: a2 96 adiw r28, 0x22 ; 34 1d928: 1c ae std Y+60, r1 ; 0x3c 1d92a: 1d ae std Y+61, r1 ; 0x3d 1d92c: 1e ae std Y+62, r1 ; 0x3e 1d92e: 1f ae std Y+63, r1 ; 0x3f 1d930: 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; 1d932: a6 96 adiw r28, 0x26 ; 38 1d934: 1c ae std Y+60, r1 ; 0x3c 1d936: 1d ae std Y+61, r1 ; 0x3d 1d938: 1e ae std Y+62, r1 ; 0x3e 1d93a: 1f ae std Y+63, r1 ; 0x3f 1d93c: 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 }; 1d93e: fe 01 movw r30, r28 1d940: 31 96 adiw r30, 0x01 ; 1 1d942: 68 96 adiw r28, 0x18 ; 24 1d944: ff af std Y+63, r31 ; 0x3f 1d946: ee af std Y+62, r30 ; 0x3e 1d948: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 1d94a: 9e 01 movw r18, r28 1d94c: 2f 5b subi r18, 0xBF ; 191 1d94e: 3f 4f sbci r19, 0xFF ; 255 1d950: 6a 96 adiw r28, 0x1a ; 26 1d952: 3f af std Y+63, r19 ; 0x3f 1d954: 2e af std Y+62, r18 ; 0x3e 1d956: 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; 1d958: a6 96 adiw r28, 0x26 ; 38 1d95a: 6c ad ldd r22, Y+60 ; 0x3c 1d95c: 7d ad ldd r23, Y+61 ; 0x3d 1d95e: 8e ad ldd r24, Y+62 ; 0x3e 1d960: 9f ad ldd r25, Y+63 ; 0x3f 1d962: a6 97 sbiw r28, 0x26 ; 38 1d964: 0f 94 68 df call 0x3bed0 ; 0x3bed0 1d968: 6e 96 adiw r28, 0x1e ; 30 1d96a: 6c af std Y+60, r22 ; 0x3c 1d96c: 7d af std Y+61, r23 ; 0x3d 1d96e: 8e af std Y+62, r24 ; 0x3e 1d970: 9f af std Y+63, r25 ; 0x3f 1d972: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 1d974: a6 96 adiw r28, 0x26 ; 38 1d976: 6c ad ldd r22, Y+60 ; 0x3c 1d978: 7d ad ldd r23, Y+61 ; 0x3d 1d97a: 8e ad ldd r24, Y+62 ; 0x3e 1d97c: 9f ad ldd r25, Y+63 ; 0x3f 1d97e: a6 97 sbiw r28, 0x26 ; 38 1d980: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 1d984: cb 57 subi r28, 0x7B ; 123 1d986: df 4f sbci r29, 0xFF ; 255 1d988: 68 83 st Y, r22 1d98a: 79 83 std Y+1, r23 ; 0x01 1d98c: 8a 83 std Y+2, r24 ; 0x02 1d98e: 9b 83 std Y+3, r25 ; 0x03 1d990: c5 58 subi r28, 0x85 ; 133 1d992: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 1d994: a2 96 adiw r28, 0x22 ; 34 1d996: 6c ad ldd r22, Y+60 ; 0x3c 1d998: 7d ad ldd r23, Y+61 ; 0x3d 1d99a: 8e ad ldd r24, Y+62 ; 0x3e 1d99c: 9f ad ldd r25, Y+63 ; 0x3f 1d99e: a2 97 sbiw r28, 0x22 ; 34 1d9a0: 0f 94 68 df call 0x3bed0 ; 0x3bed0 1d9a4: c7 57 subi r28, 0x77 ; 119 1d9a6: df 4f sbci r29, 0xFF ; 255 1d9a8: 68 83 st Y, r22 1d9aa: 79 83 std Y+1, r23 ; 0x01 1d9ac: 8a 83 std Y+2, r24 ; 0x02 1d9ae: 9b 83 std Y+3, r25 ; 0x03 1d9b0: c9 58 subi r28, 0x89 ; 137 1d9b2: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 1d9b4: a2 96 adiw r28, 0x22 ; 34 1d9b6: 6c ad ldd r22, Y+60 ; 0x3c 1d9b8: 7d ad ldd r23, Y+61 ; 0x3d 1d9ba: 8e ad ldd r24, Y+62 ; 0x3e 1d9bc: 9f ad ldd r25, Y+63 ; 0x3f 1d9be: a2 97 sbiw r28, 0x22 ; 34 1d9c0: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 1d9c4: cb 56 subi r28, 0x6B ; 107 1d9c6: df 4f sbci r29, 0xFF ; 255 1d9c8: 68 83 st Y, r22 1d9ca: 79 83 std Y+1, r23 ; 0x01 1d9cc: 8a 83 std Y+2, r24 ; 0x02 1d9ce: 9b 83 std Y+3, r25 ; 0x03 1d9d0: c5 59 subi r28, 0x95 ; 149 1d9d2: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 1d9d4: 68 96 adiw r28, 0x18 ; 24 1d9d6: ae ad ldd r26, Y+62 ; 0x3e 1d9d8: bf ad ldd r27, Y+63 ; 0x3f 1d9da: 68 97 sbiw r28, 0x18 ; 24 1d9dc: e0 e4 ldi r30, 0x40 ; 64 1d9de: 1d 92 st X+, r1 1d9e0: ea 95 dec r30 1d9e2: e9 f7 brne .-6 ; 0x1d9de float b[4] = { 0.f }; 1d9e4: 80 e1 ldi r24, 0x10 ; 16 1d9e6: 6a 96 adiw r28, 0x1a ; 26 1d9e8: ae ad ldd r26, Y+62 ; 0x3e 1d9ea: bf ad ldd r27, Y+63 ; 0x3f 1d9ec: 6a 97 sbiw r28, 0x1a ; 26 1d9ee: 1d 92 st X+, r1 1d9f0: 8a 95 dec r24 1d9f2: e9 f7 brne .-6 ; 0x1d9ee float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 1d9f4: 90 e0 ldi r25, 0x00 ; 0 1d9f6: 80 e0 ldi r24, 0x00 ; 0 1d9f8: 0e 94 98 8e call 0x11d30 ; 0x11d30 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); 1d9fc: 20 91 ce 13 lds r18, 0x13CE ; 0x8013ce 1da00: 30 91 cf 13 lds r19, 0x13CF ; 0x8013cf 1da04: 40 91 d0 13 lds r20, 0x13D0 ; 0x8013d0 1da08: 50 91 d1 13 lds r21, 0x13D1 ; 0x8013d1 1da0c: c5 55 subi r28, 0x55 ; 85 1da0e: df 4f sbci r29, 0xFF ; 255 1da10: 28 83 st Y, r18 1da12: 39 83 std Y+1, r19 ; 0x01 1da14: 4a 83 std Y+2, r20 ; 0x02 1da16: 5b 83 std Y+3, r21 ; 0x03 1da18: cb 5a subi r28, 0xAB ; 171 1da1a: 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); 1da1c: 80 91 d2 13 lds r24, 0x13D2 ; 0x8013d2 1da20: 90 91 d3 13 lds r25, 0x13D3 ; 0x8013d3 1da24: a0 91 d4 13 lds r26, 0x13D4 ; 0x8013d4 1da28: b0 91 d5 13 lds r27, 0x13D5 ; 0x8013d5 1da2c: c1 55 subi r28, 0x51 ; 81 1da2e: df 4f sbci r29, 0xFF ; 255 1da30: 88 83 st Y, r24 1da32: 99 83 std Y+1, r25 ; 0x01 1da34: aa 83 std Y+2, r26 ; 0x02 1da36: bb 83 std Y+3, r27 ; 0x03 1da38: cf 5a subi r28, 0xAF ; 175 1da3a: d0 40 sbci r29, 0x00 ; 0 1da3c: de 01 movw r26, r28 1da3e: af 5b subi r26, 0xBF ; 191 1da40: bf 4f sbci r27, 0xFF ; 255 1da42: c7 56 subi r28, 0x67 ; 103 1da44: df 4f sbci r29, 0xFF ; 255 1da46: b9 83 std Y+1, r27 ; 0x01 1da48: a8 83 st Y, r26 1da4a: c9 59 subi r28, 0x99 ; 153 1da4c: d0 40 sbci r29, 0x00 ; 0 1da4e: fe 01 movw r30, r28 1da50: 31 96 adiw r30, 0x01 ; 1 1da52: ac 96 adiw r28, 0x2c ; 44 1da54: ff af std Y+63, r31 ; 0x3f 1da56: ee af std Y+62, r30 ; 0x3e 1da58: 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) { 1da5a: 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])); 1da5c: cb 56 subi r28, 0x6B ; 107 1da5e: df 4f sbci r29, 0xFF ; 255 1da60: 28 81 ld r18, Y 1da62: 39 81 ldd r19, Y+1 ; 0x01 1da64: 4a 81 ldd r20, Y+2 ; 0x02 1da66: 5b 81 ldd r21, Y+3 ; 0x03 1da68: c5 59 subi r28, 0x95 ; 149 1da6a: d0 40 sbci r29, 0x00 ; 0 1da6c: 50 58 subi r21, 0x80 ; 128 1da6e: ed 96 adiw r28, 0x3d ; 61 1da70: 2c af std Y+60, r18 ; 0x3c 1da72: 3d af std Y+61, r19 ; 0x3d 1da74: 4e af std Y+62, r20 ; 0x3e 1da76: 5f af std Y+63, r21 ; 0x3f 1da78: 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])); 1da7a: c7 57 subi r28, 0x77 ; 119 1da7c: df 4f sbci r29, 0xFF ; 255 1da7e: 88 81 ld r24, Y 1da80: 99 81 ldd r25, Y+1 ; 0x01 1da82: aa 81 ldd r26, Y+2 ; 0x02 1da84: bb 81 ldd r27, Y+3 ; 0x03 1da86: c9 58 subi r28, 0x89 ; 137 1da88: d0 40 sbci r29, 0x00 ; 0 1da8a: b0 58 subi r27, 0x80 ; 128 1da8c: c3 58 subi r28, 0x83 ; 131 1da8e: df 4f sbci r29, 0xFF ; 255 1da90: 88 83 st Y, r24 1da92: 99 83 std Y+1, r25 ; 0x01 1da94: aa 83 std Y+2, r26 ; 0x02 1da96: bb 83 std Y+3, r27 ; 0x03 1da98: cd 57 subi r28, 0x7D ; 125 1da9a: 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]) : 1da9c: cb 57 subi r28, 0x7B ; 123 1da9e: df 4f sbci r29, 0xFF ; 255 1daa0: 28 81 ld r18, Y 1daa2: 39 81 ldd r19, Y+1 ; 0x01 1daa4: 4a 81 ldd r20, Y+2 ; 0x02 1daa6: 5b 81 ldd r21, Y+3 ; 0x03 1daa8: c5 58 subi r28, 0x85 ; 133 1daaa: d0 40 sbci r29, 0x00 ; 0 1daac: 50 58 subi r21, 0x80 ; 128 1daae: cf 57 subi r28, 0x7F ; 127 1dab0: df 4f sbci r29, 0xFF ; 255 1dab2: 28 83 st Y, r18 1dab4: 39 83 std Y+1, r19 ; 0x01 1dab6: 4a 83 std Y+2, r20 ; 0x02 1dab8: 5b 83 std Y+3, r21 ; 0x03 1daba: c1 58 subi r28, 0x81 ; 129 1dabc: 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) { 1dabe: ac 96 adiw r28, 0x2c ; 44 1dac0: 2e ac ldd r2, Y+62 ; 0x3e 1dac2: 3f ac ldd r3, Y+63 ; 0x3f 1dac4: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 1dac6: 10 e0 ldi r17, 0x00 ; 0 1dac8: 6d e9 ldi r22, 0x9D ; 157 1daca: 46 2e mov r4, r22 1dacc: 63 e1 ldi r22, 0x13 ; 19 1dace: 56 2e mov r5, r22 1dad0: 74 e0 ldi r23, 0x04 ; 4 1dad2: 77 2e mov r7, r23 acc = 0; 1dad4: c1 2c mov r12, r1 1dad6: d1 2c mov r13, r1 1dad8: 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) { 1dada: 01 30 cpi r16, 0x01 ; 1 1dadc: 11 f4 brne .+4 ; 0x1dae2 1dade: 0c 94 15 f9 jmp 0x1f22a ; 0x1f22a 1dae2: 11 30 cpi r17, 0x01 ; 1 1dae4: 11 f4 brne .+4 ; 0x1daea 1dae6: 0c 94 c3 f8 jmp 0x1f186 ; 0x1f186 float a = (r == 0) ? 1.f : 1daea: 00 23 and r16, r16 1daec: 11 f4 brne .+4 ; 0x1daf2 1daee: 0c 94 03 f9 jmp 0x1f206 ; 0x1f206 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1daf2: 02 30 cpi r16, 0x02 ; 2 1daf4: 09 f0 breq .+2 ; 0x1daf8 1daf6: a1 c1 rjmp .+834 ; 0x1de3a 1daf8: d2 01 movw r26, r4 1dafa: 11 96 adiw r26, 0x01 ; 1 1dafc: 2d 91 ld r18, X+ 1dafe: 3d 91 ld r19, X+ 1db00: 4d 91 ld r20, X+ 1db02: 5c 91 ld r21, X 1db04: 14 97 sbiw r26, 0x04 ; 4 1db06: cf 57 subi r28, 0x7F ; 127 1db08: df 4f sbci r29, 0xFF ; 255 1db0a: 68 81 ld r22, Y 1db0c: 79 81 ldd r23, Y+1 ; 0x01 1db0e: 8a 81 ldd r24, Y+2 ; 0x02 1db10: 9b 81 ldd r25, Y+3 ; 0x03 1db12: c1 58 subi r28, 0x81 ; 129 1db14: d0 40 sbci r29, 0x00 ; 0 1db16: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1db1a: 4b 01 movw r8, r22 1db1c: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1db1e: 11 11 cpse r17, r1 1db20: 9a c1 rjmp .+820 ; 0x1de56 1db22: 60 e0 ldi r22, 0x00 ; 0 1db24: 70 e0 ldi r23, 0x00 ; 0 1db26: 80 e8 ldi r24, 0x80 ; 128 1db28: 9f e3 ldi r25, 0x3F ; 63 1db2a: aa c1 rjmp .+852 ; 0x1de80 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 1db2c: 2f 3f cpi r18, 0xFF ; 255 1db2e: 09 f0 breq .+2 ; 0x1db32 1db30: f8 cc rjmp .-1552 ; 0x1d522 ++maxs; 1db32: 01 96 adiw r24, 0x01 ; 1 1db34: f6 cc rjmp .-1556 ; 0x1d522 1db36: ae 01 movw r20, r28 1db38: 4f 5f subi r20, 0xFF ; 255 1db3a: 5f 4f sbci r21, 0xFF ; 255 1db3c: be 01 movw r22, r28 1db3e: 6f 5b subi r22, 0xBF ; 191 1db40: 7f 4f sbci r23, 0xFF ; 255 1db42: 8b e8 ldi r24, 0x8B ; 139 1db44: 9b e0 ldi r25, 0x0B ; 11 1db46: 0f 94 77 90 call 0x320ee ; 0x320ee 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; 1db4a: 66 96 adiw r28, 0x16 ; 22 1db4c: 6f ad ldd r22, Y+63 ; 0x3f 1db4e: 66 97 sbiw r28, 0x16 ; 22 row = r08; 1db50: 62 96 adiw r28, 0x12 ; 18 1db52: 1f ad ldd r17, Y+63 ; 0x3f 1db54: 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){ 1db56: 80 17 cp r24, r16 1db58: 28 f0 brcs .+10 ; 0x1db64 col = c08; row = r08; return match08; } col = c10; 1db5a: 22 96 adiw r28, 0x02 ; 2 1db5c: 6f ad ldd r22, Y+63 ; 0x3f 1db5e: 22 97 sbiw r28, 0x02 ; 2 row = r10; 1db60: 19 81 ldd r17, Y+1 ; 0x01 1db62: 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){ 1db64: 08 35 cpi r16, 0x58 ; 88 1db66: 08 f4 brcc .+2 ; 0x1db6a 1db68: 5b c1 rjmp .+694 ; 0x1de20 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 1db6a: 70 e0 ldi r23, 0x00 ; 0 1db6c: 90 e0 ldi r25, 0x00 ; 0 1db6e: 80 e0 ldi r24, 0x00 ; 0 1db70: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1db74: 20 e0 ldi r18, 0x00 ; 0 1db76: 30 e0 ldi r19, 0x00 ; 0 1db78: 40 eb ldi r20, 0xB0 ; 176 1db7a: 50 e4 ldi r21, 0x40 ; 64 1db7c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1db80: 2b 01 movw r4, r22 1db82: 3c 01 movw r6, r24 1db84: 65 96 adiw r28, 0x15 ; 21 1db86: 4c ae std Y+60, r4 ; 0x3c 1db88: 5d ae std Y+61, r5 ; 0x3d 1db8a: 6e ae std Y+62, r6 ; 0x3e 1db8c: 7f ae std Y+63, r7 ; 0x3f 1db8e: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 1db90: 61 2f mov r22, r17 1db92: 70 e0 ldi r23, 0x00 ; 0 1db94: 90 e0 ldi r25, 0x00 ; 0 1db96: 80 e0 ldi r24, 0x00 ; 0 1db98: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1db9c: 20 e0 ldi r18, 0x00 ; 0 1db9e: 30 e0 ldi r19, 0x00 ; 0 1dba0: 40 eb ldi r20, 0xB0 ; 176 1dba2: 50 e4 ldi r21, 0x40 ; 64 1dba4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1dba8: 4b 01 movw r8, r22 1dbaa: 5c 01 movw r10, r24 1dbac: 25 96 adiw r28, 0x05 ; 5 1dbae: 8c ae std Y+60, r8 ; 0x3c 1dbb0: 9d ae std Y+61, r9 ; 0x3d 1dbb2: ae ae std Y+62, r10 ; 0x3e 1dbb4: bf ae std Y+63, r11 ; 0x3f 1dbb6: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 1dbb8: 20 e0 ldi r18, 0x00 ; 0 1dbba: 30 e0 ldi r19, 0x00 ; 0 1dbbc: 40 e9 ldi r20, 0x90 ; 144 1dbbe: 50 e4 ldi r21, 0x40 ; 64 1dbc0: 29 83 std Y+1, r18 ; 0x01 1dbc2: 3a 83 std Y+2, r19 ; 0x02 1dbc4: 4b 83 std Y+3, r20 ; 0x03 1dbc6: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 1dbc8: ae 01 movw r20, r28 1dbca: 4f 5f subi r20, 0xFF ; 255 1dbcc: 5f 4f sbci r21, 0xFF ; 255 1dbce: be 01 movw r22, r28 1dbd0: 6f 5b subi r22, 0xBF ; 191 1dbd2: 7f 4f sbci r23, 0xFF ; 255 1dbd4: ce 01 movw r24, r28 1dbd6: 8f 5a subi r24, 0xAF ; 175 1dbd8: 9f 4f sbci r25, 0xFF ; 255 1dbda: 0f 94 2c 8d call 0x31a58 ; 0x31a58 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 1dbde: a3 01 movw r20, r6 1dbe0: 92 01 movw r18, r4 1dbe2: 65 96 adiw r28, 0x15 ; 21 1dbe4: 6c ad ldd r22, Y+60 ; 0x3c 1dbe6: 7d ad ldd r23, Y+61 ; 0x3d 1dbe8: 8e ad ldd r24, Y+62 ; 0x3e 1dbea: 9f ad ldd r25, Y+63 ; 0x3f 1dbec: 65 97 sbiw r28, 0x15 ; 21 1dbee: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1dbf2: 6b 01 movw r12, r22 1dbf4: 7c 01 movw r14, r24 1dbf6: 9f 77 andi r25, 0x7F ; 127 1dbf8: 20 e0 ldi r18, 0x00 ; 0 1dbfa: 30 e0 ldi r19, 0x00 ; 0 1dbfc: 40 e4 ldi r20, 0x40 ; 64 1dbfe: 50 e4 ldi r21, 0x40 ; 64 1dc00: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1dc04: 18 16 cp r1, r24 1dc06: 34 f1 brlt .+76 ; 0x1dc54 1dc08: a5 01 movw r20, r10 1dc0a: 94 01 movw r18, r8 1dc0c: 25 96 adiw r28, 0x05 ; 5 1dc0e: 6c ad ldd r22, Y+60 ; 0x3c 1dc10: 7d ad ldd r23, Y+61 ; 0x3d 1dc12: 8e ad ldd r24, Y+62 ; 0x3e 1dc14: 9f ad ldd r25, Y+63 ; 0x3f 1dc16: 25 97 sbiw r28, 0x05 ; 5 1dc18: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1dc1c: 9f 77 andi r25, 0x7F ; 127 1dc1e: 20 e0 ldi r18, 0x00 ; 0 1dc20: 30 e0 ldi r19, 0x00 ; 0 1dc22: 40 e4 ldi r20, 0x40 ; 64 1dc24: 50 e4 ldi r21, 0x40 ; 64 1dc26: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1dc2a: 18 16 cp r1, r24 1dc2c: 9c f0 brlt .+38 ; 0x1dc54 1dc2e: 20 e0 ldi r18, 0x00 ; 0 1dc30: 30 e0 ldi r19, 0x00 ; 0 1dc32: 40 ea ldi r20, 0xA0 ; 160 1dc34: 50 e4 ldi r21, 0x40 ; 64 1dc36: 69 81 ldd r22, Y+1 ; 0x01 1dc38: 7a 81 ldd r23, Y+2 ; 0x02 1dc3a: 8b 81 ldd r24, Y+3 ; 0x03 1dc3c: 9c 81 ldd r25, Y+4 ; 0x04 1dc3e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1dc42: 9f 77 andi r25, 0x7F ; 127 1dc44: 20 e0 ldi r18, 0x00 ; 0 1dc46: 30 e0 ldi r19, 0x00 ; 0 1dc48: 40 e4 ldi r20, 0x40 ; 64 1dc4a: 50 e4 ldi r21, 0x40 ; 64 1dc4c: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1dc50: 18 16 cp r1, r24 1dc52: bc f5 brge .+110 ; 0x1dcc2 //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 1dc54: 20 e0 ldi r18, 0x00 ; 0 1dc56: 30 e0 ldi r19, 0x00 ; 0 1dc58: 40 ea ldi r20, 0xA0 ; 160 1dc5a: 50 e4 ldi r21, 0x40 ; 64 1dc5c: 69 81 ldd r22, Y+1 ; 0x01 1dc5e: 7a 81 ldd r23, Y+2 ; 0x02 1dc60: 8b 81 ldd r24, Y+3 ; 0x03 1dc62: 9c 81 ldd r25, Y+4 ; 0x04 1dc64: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1dc68: 9f 93 push r25 1dc6a: 8f 93 push r24 1dc6c: 7f 93 push r23 1dc6e: 6f 93 push r22 1dc70: a5 01 movw r20, r10 1dc72: 94 01 movw r18, r8 1dc74: 25 96 adiw r28, 0x05 ; 5 1dc76: 6c ad ldd r22, Y+60 ; 0x3c 1dc78: 7d ad ldd r23, Y+61 ; 0x3d 1dc7a: 8e ad ldd r24, Y+62 ; 0x3e 1dc7c: 9f ad ldd r25, Y+63 ; 0x3f 1dc7e: 25 97 sbiw r28, 0x05 ; 5 1dc80: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1dc84: 9f 93 push r25 1dc86: 8f 93 push r24 1dc88: 7f 93 push r23 1dc8a: 6f 93 push r22 1dc8c: ff 92 push r15 1dc8e: ef 92 push r14 1dc90: df 92 push r13 1dc92: cf 92 push r12 1dc94: 87 eb ldi r24, 0xB7 ; 183 1dc96: 91 e9 ldi r25, 0x91 ; 145 1dc98: 9f 93 push r25 1dc9a: 8f 93 push r24 1dc9c: 0f 94 08 dc call 0x3b810 ; 0x3b810 /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 1dca0: 65 96 adiw r28, 0x15 ; 21 1dca2: 4c ae std Y+60, r4 ; 0x3c 1dca4: 5d ae std Y+61, r5 ; 0x3d 1dca6: 6e ae std Y+62, r6 ; 0x3e 1dca8: 7f ae std Y+63, r7 ; 0x3f 1dcaa: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 1dcac: 25 96 adiw r28, 0x05 ; 5 1dcae: 8c ae std Y+60, r8 ; 0x3c 1dcb0: 9d ae std Y+61, r9 ; 0x3d 1dcb2: ae ae std Y+62, r10 ; 0x3e 1dcb4: bf ae std Y+63, r11 ; 0x3f 1dcb6: 25 97 sbiw r28, 0x05 ; 5 1dcb8: 0f b6 in r0, 0x3f ; 63 1dcba: f8 94 cli 1dcbc: de bf out 0x3e, r29 ; 62 1dcbe: 0f be out 0x3f, r0 ; 63 1dcc0: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 1dcc2: 20 e0 ldi r18, 0x00 ; 0 1dcc4: 30 e0 ldi r19, 0x00 ; 0 1dcc6: 48 e7 ldi r20, 0x78 ; 120 1dcc8: 51 e4 ldi r21, 0x41 ; 65 1dcca: 65 96 adiw r28, 0x15 ; 21 1dccc: 6c ad ldd r22, Y+60 ; 0x3c 1dcce: 7d ad ldd r23, Y+61 ; 0x3d 1dcd0: 8e ad ldd r24, Y+62 ; 0x3e 1dcd2: 9f ad ldd r25, Y+63 ; 0x3f 1dcd4: 65 97 sbiw r28, 0x15 ; 21 1dcd6: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1dcda: 20 e0 ldi r18, 0x00 ; 0 1dcdc: 30 e0 ldi r19, 0x00 ; 0 1dcde: 40 e8 ldi r20, 0x80 ; 128 1dce0: 52 e4 ldi r21, 0x42 ; 66 1dce2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1dce6: 6b 01 movw r12, r22 1dce8: 7c 01 movw r14, r24 1dcea: 6c 96 adiw r28, 0x1c ; 28 1dcec: ae ad ldd r26, Y+62 ; 0x3e 1dcee: bf ad ldd r27, Y+63 ; 0x3f 1dcf0: 6c 97 sbiw r28, 0x1c ; 28 1dcf2: bd 01 movw r22, r26 1dcf4: bb 0f add r27, r27 1dcf6: 88 0b sbc r24, r24 1dcf8: 99 0b sbc r25, r25 1dcfa: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1dcfe: 9b 01 movw r18, r22 1dd00: ac 01 movw r20, r24 1dd02: c7 01 movw r24, r14 1dd04: b6 01 movw r22, r12 1dd06: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1dd0a: 6b 01 movw r12, r22 1dd0c: 7c 01 movw r14, r24 1dd0e: 65 96 adiw r28, 0x15 ; 21 1dd10: cc ae std Y+60, r12 ; 0x3c 1dd12: dd ae std Y+61, r13 ; 0x3d 1dd14: ee ae std Y+62, r14 ; 0x3e 1dd16: ff ae std Y+63, r15 ; 0x3f 1dd18: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 1dd1a: 20 e0 ldi r18, 0x00 ; 0 1dd1c: 30 e0 ldi r19, 0x00 ; 0 1dd1e: 48 e7 ldi r20, 0x78 ; 120 1dd20: 51 e4 ldi r21, 0x41 ; 65 1dd22: 25 96 adiw r28, 0x05 ; 5 1dd24: 6c ad ldd r22, Y+60 ; 0x3c 1dd26: 7d ad ldd r23, Y+61 ; 0x3d 1dd28: 8e ad ldd r24, Y+62 ; 0x3e 1dd2a: 9f ad ldd r25, Y+63 ; 0x3f 1dd2c: 25 97 sbiw r28, 0x05 ; 5 1dd2e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1dd32: 20 e0 ldi r18, 0x00 ; 0 1dd34: 30 e0 ldi r19, 0x00 ; 0 1dd36: 40 e8 ldi r20, 0x80 ; 128 1dd38: 52 e4 ldi r21, 0x42 ; 66 1dd3a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1dd3e: 4b 01 movw r8, r22 1dd40: 5c 01 movw r10, r24 1dd42: ac 96 adiw r28, 0x2c ; 44 1dd44: ee ad ldd r30, Y+62 ; 0x3e 1dd46: ff ad ldd r31, Y+63 ; 0x3f 1dd48: ac 97 sbiw r28, 0x2c ; 44 1dd4a: bf 01 movw r22, r30 1dd4c: ff 0f add r31, r31 1dd4e: 88 0b sbc r24, r24 1dd50: 99 0b sbc r25, r25 1dd52: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 1dd56: 9b 01 movw r18, r22 1dd58: ac 01 movw r20, r24 1dd5a: c5 01 movw r24, r10 1dd5c: b4 01 movw r22, r8 1dd5e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1dd62: 25 96 adiw r28, 0x05 ; 5 1dd64: 6c af std Y+60, r22 ; 0x3c 1dd66: 7d af std Y+61, r23 ; 0x3d 1dd68: 8e af std Y+62, r24 ; 0x3e 1dd6a: 9f af std Y+63, r25 ; 0x3f 1dd6c: 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; 1dd6e: 2a e0 ldi r18, 0x0A ; 10 1dd70: 37 ed ldi r19, 0xD7 ; 215 1dd72: 43 e2 ldi r20, 0x23 ; 35 1dd74: 5c e3 ldi r21, 0x3C ; 60 1dd76: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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)); 1dd7a: 9f 93 push r25 1dd7c: 8f 93 push r24 1dd7e: 7f 93 push r23 1dd80: 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; 1dd82: 2a e0 ldi r18, 0x0A ; 10 1dd84: 37 ed ldi r19, 0xD7 ; 215 1dd86: 43 e2 ldi r20, 0x23 ; 35 1dd88: 5c e3 ldi r21, 0x3C ; 60 1dd8a: c7 01 movw r24, r14 1dd8c: b6 01 movw r22, r12 1dd8e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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)); 1dd92: 9f 93 push r25 1dd94: 8f 93 push r24 1dd96: 7f 93 push r23 1dd98: 6f 93 push r22 1dd9a: 8b e9 ldi r24, 0x9B ; 155 1dd9c: 91 e9 ldi r25, 0x91 ; 145 1dd9e: 9f 93 push r25 1dda0: 8f 93 push r24 1dda2: 0f 94 08 dc call 0x3b810 ; 0x3b810 uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 1dda6: 20 e0 ldi r18, 0x00 ; 0 1dda8: 30 e0 ldi r19, 0x00 ; 0 1ddaa: 40 e0 ldi r20, 0x00 ; 0 1ddac: 5f e3 ldi r21, 0x3F ; 63 1ddae: 25 96 adiw r28, 0x05 ; 5 1ddb0: 6c ad ldd r22, Y+60 ; 0x3c 1ddb2: 7d ad ldd r23, Y+61 ; 0x3d 1ddb4: 8e ad ldd r24, Y+62 ; 0x3e 1ddb6: 9f ad ldd r25, Y+63 ; 0x3f 1ddb8: 25 97 sbiw r28, 0x05 ; 5 1ddba: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1ddbe: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 1ddc2: 6b 01 movw r12, r22 1ddc4: 20 e0 ldi r18, 0x00 ; 0 1ddc6: 30 e0 ldi r19, 0x00 ; 0 1ddc8: 40 e0 ldi r20, 0x00 ; 0 1ddca: 5f e3 ldi r21, 0x3F ; 63 1ddcc: 65 96 adiw r28, 0x15 ; 21 1ddce: 6c ad ldd r22, Y+60 ; 0x3c 1ddd0: 7d ad ldd r23, Y+61 ; 0x3d 1ddd2: 8e ad ldd r24, Y+62 ; 0x3e 1ddd4: 9f ad ldd r25, Y+63 ; 0x3f 1ddd6: 65 97 sbiw r28, 0x15 ; 21 1ddd8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1dddc: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 1dde0: 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); 1dde2: 00 e0 ldi r16, 0x00 ; 0 1dde4: 28 ec ldi r18, 0xC8 ; 200 1dde6: 30 e0 ldi r19, 0x00 ; 0 1dde8: e7 96 adiw r28, 0x37 ; 55 1ddea: 4e ad ldd r20, Y+62 ; 0x3e 1ddec: 5f ad ldd r21, Y+63 ; 0x3f 1ddee: e7 97 sbiw r28, 0x37 ; 55 1ddf0: b6 01 movw r22, r12 1ddf2: 0e 94 04 e2 call 0x1c408 ; 0x1c408 1ddf6: 0f b6 in r0, 0x3f ; 63 1ddf8: f8 94 cli 1ddfa: de bf out 0x3e, r29 ; 62 1ddfc: 0f be out 0x3f, r0 ; 63 1ddfe: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 1de00: 10 e0 ldi r17, 0x00 ; 0 1de02: 83 e5 ldi r24, 0x53 ; 83 1de04: 9e e0 ldi r25, 0x0E ; 14 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 1de06: a4 96 adiw r28, 0x24 ; 36 1de08: ae ad ldd r26, Y+62 ; 0x3e 1de0a: bf ad ldd r27, Y+63 ; 0x3f 1de0c: a4 97 sbiw r28, 0x24 ; 36 1de0e: 1d 92 st X+, r1 1de10: a4 96 adiw r28, 0x24 ; 36 1de12: bf af std Y+63, r27 ; 0x3f 1de14: ae af std Y+62, r26 ; 0x3e 1de16: 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++) 1de18: 8a 17 cp r24, r26 1de1a: 9b 07 cpc r25, r27 1de1c: a1 f7 brne .-24 ; 0x1de06 1de1e: 76 cc rjmp .-1812 ; 0x1d70c /// 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; 1de20: 1f ef ldi r17, 0xFF ; 255 1de22: ef cf rjmp .-34 ; 0x1de02 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; 1de24: e5 96 adiw r28, 0x35 ; 53 1de26: bf ad ldd r27, Y+63 ; 0x3f 1de28: e5 97 sbiw r28, 0x35 ; 53 1de2a: a7 96 adiw r28, 0x27 ; 39 1de2c: bf af std Y+63, r27 ; 0x3f 1de2e: a7 97 sbiw r28, 0x27 ; 39 1de30: 99 cc rjmp .-1742 ; 0x1d764 // 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; 1de32: af 96 adiw r28, 0x2f ; 47 1de34: 1f ae std Y+63, r1 ; 0x3f 1de36: af 97 sbiw r28, 0x2f ; 47 1de38: 62 cd rjmp .-1340 ; 0x1d8fe 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]) : 1de3a: f2 01 movw r30, r4 1de3c: 25 81 ldd r18, Z+5 ; 0x05 1de3e: 36 81 ldd r19, Z+6 ; 0x06 1de40: 47 81 ldd r20, Z+7 ; 0x07 1de42: 50 85 ldd r21, Z+8 ; 0x08 1de44: c3 58 subi r28, 0x83 ; 131 1de46: df 4f sbci r29, 0xFF ; 255 1de48: 68 81 ld r22, Y 1de4a: 79 81 ldd r23, Y+1 ; 0x01 1de4c: 8a 81 ldd r24, Y+2 ; 0x02 1de4e: 9b 81 ldd r25, Y+3 ; 0x03 1de50: cd 57 subi r28, 0x7D ; 125 1de52: d0 40 sbci r29, 0x00 ; 0 1de54: 60 ce rjmp .-832 ; 0x1db16 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 1de56: 12 30 cpi r17, 0x02 ; 2 1de58: 11 f0 breq .+4 ; 0x1de5e 1de5a: 0c 94 04 f8 jmp 0x1f008 ; 0x1f008 1de5e: d2 01 movw r26, r4 1de60: 11 96 adiw r26, 0x01 ; 1 1de62: 2d 91 ld r18, X+ 1de64: 3d 91 ld r19, X+ 1de66: 4d 91 ld r20, X+ 1de68: 5c 91 ld r21, X 1de6a: 14 97 sbiw r26, 0x04 ; 4 1de6c: cf 57 subi r28, 0x7F ; 127 1de6e: df 4f sbci r29, 0xFF ; 255 1de70: 68 81 ld r22, Y 1de72: 79 81 ldd r23, Y+1 ; 0x01 1de74: 8a 81 ldd r24, Y+2 ; 0x02 1de76: 9b 81 ldd r25, Y+3 ; 0x03 1de78: c1 58 subi r28, 0x81 ; 129 1de7a: d0 40 sbci r29, 0x00 ; 0 1de7c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 1de80: 9b 01 movw r18, r22 1de82: ac 01 movw r20, r24 1de84: c5 01 movw r24, r10 1de86: b4 01 movw r22, r8 1de88: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1de8c: 9b 01 movw r18, r22 1de8e: ac 01 movw r20, r24 1de90: c7 01 movw r24, r14 1de92: b6 01 movw r22, r12 1de94: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1de98: 6b 01 movw r12, r22 1de9a: 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) { 1de9c: 01 11 cpse r16, r1 1de9e: 0c 94 11 f9 jmp 0x1f222 ; 0x1f222 1dea2: 7a 94 dec r7 1dea4: f8 e0 ldi r31, 0x08 ; 8 1dea6: 4f 0e add r4, r31 1dea8: 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) { 1deaa: 71 10 cpse r7, r1 1deac: 16 ce rjmp .-980 ; 0x1dada (-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; 1deae: d1 01 movw r26, r2 1deb0: cd 92 st X+, r12 1deb2: dd 92 st X+, r13 1deb4: ed 92 st X+, r14 1deb6: fd 92 st X+, r15 1deb8: 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) { 1deba: 1f 5f subi r17, 0xFF ; 255 1debc: 14 30 cpi r17, 0x04 ; 4 1debe: 09 f0 breq .+2 ; 0x1dec2 1dec0: 03 ce rjmp .-1018 ; 0x1dac8 1dec2: 30 e5 ldi r19, 0x50 ; 80 1dec4: 23 2e mov r2, r19 1dec6: 32 e9 ldi r19, 0x92 ; 146 1dec8: 33 2e mov r3, r19 1deca: ed e9 ldi r30, 0x9D ; 157 1decc: f3 e1 ldi r31, 0x13 ; 19 1dece: a8 96 adiw r28, 0x28 ; 40 1ded0: ff af std Y+63, r31 ; 0x3f 1ded2: ee af std Y+62, r30 ; 0x3e 1ded4: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 1ded6: c3 57 subi r28, 0x73 ; 115 1ded8: df 4f sbci r29, 0xFF ; 255 1deda: 18 82 st Y, r1 1dedc: cd 58 subi r28, 0x8D ; 141 1dede: d0 40 sbci r29, 0x00 ; 0 1dee0: c3 56 subi r28, 0x63 ; 99 1dee2: df 4f sbci r29, 0xFF ; 255 1dee4: 18 82 st Y, r1 1dee6: cd 59 subi r28, 0x9D ; 157 1dee8: d0 40 sbci r29, 0x00 ; 0 1deea: cf 55 subi r28, 0x5F ; 95 1deec: df 4f sbci r29, 0xFF ; 255 1deee: 18 82 st Y, r1 1def0: c1 5a subi r28, 0xA1 ; 161 1def2: d0 40 sbci r29, 0x00 ; 0 1def4: 10 e0 ldi r17, 0x00 ; 0 1def6: a8 96 adiw r28, 0x28 ; 40 1def8: ae ad ldd r26, Y+62 ; 0x3e 1defa: bf ad ldd r27, Y+63 ; 0x3f 1defc: a8 97 sbiw r28, 0x28 ; 40 1defe: 11 96 adiw r26, 0x01 ; 1 1df00: 2d 91 ld r18, X+ 1df02: 3d 91 ld r19, X+ 1df04: 4d 91 ld r20, X+ 1df06: 5c 91 ld r21, X 1df08: 14 97 sbiw r26, 0x04 ; 4 1df0a: e4 96 adiw r28, 0x34 ; 52 1df0c: 2c af std Y+60, r18 ; 0x3c 1df0e: 3d af std Y+61, r19 ; 0x3d 1df10: 4e af std Y+62, r20 ; 0x3e 1df12: 5f af std Y+63, r21 ; 0x3f 1df14: e4 97 sbiw r28, 0x34 ; 52 1df16: 15 96 adiw r26, 0x05 ; 5 1df18: 4d 90 ld r4, X+ 1df1a: 5d 90 ld r5, X+ 1df1c: 6d 90 ld r6, X+ 1df1e: 7c 90 ld r7, X 1df20: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1df22: 00 23 and r16, r16 1df24: 11 f4 brne .+4 ; 0x1df2a 1df26: 0c 94 37 f8 jmp 0x1f06e ; 0x1f06e ((r == 1) ? 0.f : 1df2a: 81 2c mov r8, r1 1df2c: 91 2c mov r9, r1 1df2e: 54 01 movw r10, r8 1df30: 01 30 cpi r16, 0x01 ; 1 1df32: 81 f0 breq .+32 ; 0x1df54 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1df34: 02 30 cpi r16, 0x02 ; 2 1df36: 11 f0 breq .+4 ; 0x1df3c 1df38: 0c 94 2b f8 jmp 0x1f056 ; 0x1f056 1df3c: cf 57 subi r28, 0x7F ; 127 1df3e: df 4f sbci r29, 0xFF ; 255 1df40: 68 81 ld r22, Y 1df42: 79 81 ldd r23, Y+1 ; 0x01 1df44: 8a 81 ldd r24, Y+2 ; 0x02 1df46: 9b 81 ldd r25, Y+3 ; 0x03 1df48: c1 58 subi r28, 0x81 ; 129 1df4a: d0 40 sbci r29, 0x00 ; 0 1df4c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1df50: 4b 01 movw r8, r22 1df52: 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); 1df54: e4 96 adiw r28, 0x34 ; 52 1df56: 2c ad ldd r18, Y+60 ; 0x3c 1df58: 3d ad ldd r19, Y+61 ; 0x3d 1df5a: 4e ad ldd r20, Y+62 ; 0x3e 1df5c: 5f ad ldd r21, Y+63 ; 0x3f 1df5e: e4 97 sbiw r28, 0x34 ; 52 1df60: 6e 96 adiw r28, 0x1e ; 30 1df62: 6c ad ldd r22, Y+60 ; 0x3c 1df64: 7d ad ldd r23, Y+61 ; 0x3d 1df66: 8e ad ldd r24, Y+62 ; 0x3e 1df68: 9f ad ldd r25, Y+63 ; 0x3f 1df6a: 6e 97 sbiw r28, 0x1e ; 30 1df6c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1df70: 6b 01 movw r12, r22 1df72: 7c 01 movw r14, r24 1df74: f1 01 movw r30, r2 1df76: 25 91 lpm r18, Z+ 1df78: 35 91 lpm r19, Z+ 1df7a: 45 91 lpm r20, Z+ 1df7c: 54 91 lpm r21, Z 1df7e: cb 55 subi r28, 0x5B ; 91 1df80: df 4f sbci r29, 0xFF ; 255 1df82: 28 83 st Y, r18 1df84: 39 83 std Y+1, r19 ; 0x01 1df86: 4a 83 std Y+2, r20 ; 0x02 1df88: 5b 83 std Y+3, r21 ; 0x03 1df8a: c5 5a subi r28, 0xA5 ; 165 1df8c: d0 40 sbci r29, 0x00 ; 0 1df8e: a3 01 movw r20, r6 1df90: 92 01 movw r18, r4 1df92: cb 56 subi r28, 0x6B ; 107 1df94: df 4f sbci r29, 0xFF ; 255 1df96: 68 81 ld r22, Y 1df98: 79 81 ldd r23, Y+1 ; 0x01 1df9a: 8a 81 ldd r24, Y+2 ; 0x02 1df9c: 9b 81 ldd r25, Y+3 ; 0x03 1df9e: c5 59 subi r28, 0x95 ; 149 1dfa0: d0 40 sbci r29, 0x00 ; 0 1dfa2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1dfa6: 9b 01 movw r18, r22 1dfa8: ac 01 movw r20, r24 1dfaa: c7 01 movw r24, r14 1dfac: b6 01 movw r22, r12 1dfae: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1dfb2: c5 55 subi r28, 0x55 ; 85 1dfb4: df 4f sbci r29, 0xFF ; 255 1dfb6: 28 81 ld r18, Y 1dfb8: 39 81 ldd r19, Y+1 ; 0x01 1dfba: 4a 81 ldd r20, Y+2 ; 0x02 1dfbc: 5b 81 ldd r21, Y+3 ; 0x03 1dfbe: cb 5a subi r28, 0xAB ; 171 1dfc0: d0 40 sbci r29, 0x00 ; 0 1dfc2: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1dfc6: cb 55 subi r28, 0x5B ; 91 1dfc8: df 4f sbci r29, 0xFF ; 255 1dfca: 28 81 ld r18, Y 1dfcc: 39 81 ldd r19, Y+1 ; 0x01 1dfce: 4a 81 ldd r20, Y+2 ; 0x02 1dfd0: 5b 81 ldd r21, Y+3 ; 0x03 1dfd2: c5 5a subi r28, 0xA5 ; 165 1dfd4: d0 40 sbci r29, 0x00 ; 0 1dfd6: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 1dfda: a5 01 movw r20, r10 1dfdc: 94 01 movw r18, r8 1dfde: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1dfe2: c3 57 subi r28, 0x73 ; 115 1dfe4: df 4f sbci r29, 0xFF ; 255 1dfe6: 28 81 ld r18, Y 1dfe8: cd 58 subi r28, 0x8D ; 141 1dfea: d0 40 sbci r29, 0x00 ; 0 1dfec: c3 56 subi r28, 0x63 ; 99 1dfee: df 4f sbci r29, 0xFF ; 255 1dff0: 38 81 ld r19, Y 1dff2: cd 59 subi r28, 0x9D ; 157 1dff4: d0 40 sbci r29, 0x00 ; 0 1dff6: cf 55 subi r28, 0x5F ; 95 1dff8: df 4f sbci r29, 0xFF ; 255 1dffa: 48 81 ld r20, Y 1dffc: c1 5a subi r28, 0xA1 ; 161 1dffe: d0 40 sbci r29, 0x00 ; 0 1e000: 51 2f mov r21, r17 1e002: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e006: c3 57 subi r28, 0x73 ; 115 1e008: df 4f sbci r29, 0xFF ; 255 1e00a: 68 83 st Y, r22 1e00c: 79 83 std Y+1, r23 ; 0x01 1e00e: 8a 83 std Y+2, r24 ; 0x02 1e010: 9b 83 std Y+3, r25 ; 0x03 1e012: cd 58 subi r28, 0x8D ; 141 1e014: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 1e016: 00 23 and r16, r16 1e018: 11 f4 brne .+4 ; 0x1e01e 1e01a: 0c 94 3f f8 jmp 0x1f07e ; 0x1f07e ((r == 1) ? 1.f : 1e01e: 01 30 cpi r16, 0x01 ; 1 1e020: 11 f4 brne .+4 ; 0x1e026 1e022: 0c 94 44 f8 jmp 0x1f088 ; 0x1f088 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1e026: 02 30 cpi r16, 0x02 ; 2 1e028: 61 f0 breq .+24 ; 0x1e042 1e02a: a3 01 movw r20, r6 1e02c: 92 01 movw r18, r4 1e02e: ed 96 adiw r28, 0x3d ; 61 1e030: 6c ad ldd r22, Y+60 ; 0x3c 1e032: 7d ad ldd r23, Y+61 ; 0x3d 1e034: 8e ad ldd r24, Y+62 ; 0x3e 1e036: 9f ad ldd r25, Y+63 ; 0x3f 1e038: ed 97 sbiw r28, 0x3d ; 61 1e03a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e03e: 6b 01 movw r12, r22 1e040: 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); 1e042: f1 01 movw r30, r2 1e044: 34 96 adiw r30, 0x04 ; 4 1e046: 85 90 lpm r8, Z+ 1e048: 95 90 lpm r9, Z+ 1e04a: a5 90 lpm r10, Z+ 1e04c: b4 90 lpm r11, Z 1e04e: e4 96 adiw r28, 0x34 ; 52 1e050: 2c ad ldd r18, Y+60 ; 0x3c 1e052: 3d ad ldd r19, Y+61 ; 0x3d 1e054: 4e ad ldd r20, Y+62 ; 0x3e 1e056: 5f ad ldd r21, Y+63 ; 0x3f 1e058: e4 97 sbiw r28, 0x34 ; 52 1e05a: cb 57 subi r28, 0x7B ; 123 1e05c: df 4f sbci r29, 0xFF ; 255 1e05e: 68 81 ld r22, Y 1e060: 79 81 ldd r23, Y+1 ; 0x01 1e062: 8a 81 ldd r24, Y+2 ; 0x02 1e064: 9b 81 ldd r25, Y+3 ; 0x03 1e066: c5 58 subi r28, 0x85 ; 133 1e068: d0 40 sbci r29, 0x00 ; 0 1e06a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e06e: e4 96 adiw r28, 0x34 ; 52 1e070: 6c af std Y+60, r22 ; 0x3c 1e072: 7d af std Y+61, r23 ; 0x3d 1e074: 8e af std Y+62, r24 ; 0x3e 1e076: 9f af std Y+63, r25 ; 0x3f 1e078: e4 97 sbiw r28, 0x34 ; 52 1e07a: a3 01 movw r20, r6 1e07c: 92 01 movw r18, r4 1e07e: c7 57 subi r28, 0x77 ; 119 1e080: df 4f sbci r29, 0xFF ; 255 1e082: 68 81 ld r22, Y 1e084: 79 81 ldd r23, Y+1 ; 0x01 1e086: 8a 81 ldd r24, Y+2 ; 0x02 1e088: 9b 81 ldd r25, Y+3 ; 0x03 1e08a: c9 58 subi r28, 0x89 ; 137 1e08c: d0 40 sbci r29, 0x00 ; 0 1e08e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e092: 9b 01 movw r18, r22 1e094: ac 01 movw r20, r24 1e096: e4 96 adiw r28, 0x34 ; 52 1e098: 6c ad ldd r22, Y+60 ; 0x3c 1e09a: 7d ad ldd r23, Y+61 ; 0x3d 1e09c: 8e ad ldd r24, Y+62 ; 0x3e 1e09e: 9f ad ldd r25, Y+63 ; 0x3f 1e0a0: e4 97 sbiw r28, 0x34 ; 52 1e0a2: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e0a6: c1 55 subi r28, 0x51 ; 81 1e0a8: df 4f sbci r29, 0xFF ; 255 1e0aa: 28 81 ld r18, Y 1e0ac: 39 81 ldd r19, Y+1 ; 0x01 1e0ae: 4a 81 ldd r20, Y+2 ; 0x02 1e0b0: 5b 81 ldd r21, Y+3 ; 0x03 1e0b2: cf 5a subi r28, 0xAF ; 175 1e0b4: d0 40 sbci r29, 0x00 ; 0 1e0b6: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e0ba: a5 01 movw r20, r10 1e0bc: 94 01 movw r18, r8 1e0be: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 1e0c2: a7 01 movw r20, r14 1e0c4: 96 01 movw r18, r12 1e0c6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e0ca: c3 57 subi r28, 0x73 ; 115 1e0cc: df 4f sbci r29, 0xFF ; 255 1e0ce: 28 81 ld r18, Y 1e0d0: 39 81 ldd r19, Y+1 ; 0x01 1e0d2: 4a 81 ldd r20, Y+2 ; 0x02 1e0d4: 5b 81 ldd r21, Y+3 ; 0x03 1e0d6: cd 58 subi r28, 0x8D ; 141 1e0d8: d0 40 sbci r29, 0x00 ; 0 1e0da: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e0de: c3 57 subi r28, 0x73 ; 115 1e0e0: df 4f sbci r29, 0xFF ; 255 1e0e2: 68 83 st Y, r22 1e0e4: cd 58 subi r28, 0x8D ; 141 1e0e6: d0 40 sbci r29, 0x00 ; 0 1e0e8: c3 56 subi r28, 0x63 ; 99 1e0ea: df 4f sbci r29, 0xFF ; 255 1e0ec: 78 83 st Y, r23 1e0ee: cd 59 subi r28, 0x9D ; 157 1e0f0: d0 40 sbci r29, 0x00 ; 0 1e0f2: cf 55 subi r28, 0x5F ; 95 1e0f4: df 4f sbci r29, 0xFF ; 255 1e0f6: 88 83 st Y, r24 1e0f8: c1 5a subi r28, 0xA1 ; 161 1e0fa: d0 40 sbci r29, 0x00 ; 0 1e0fc: 19 2f mov r17, r25 1e0fe: a8 96 adiw r28, 0x28 ; 40 1e100: 4e ad ldd r20, Y+62 ; 0x3e 1e102: 5f ad ldd r21, Y+63 ; 0x3f 1e104: a8 97 sbiw r28, 0x28 ; 40 1e106: 48 5f subi r20, 0xF8 ; 248 1e108: 5f 4f sbci r21, 0xFF ; 255 1e10a: a8 96 adiw r28, 0x28 ; 40 1e10c: 5f af std Y+63, r21 ; 0x3f 1e10e: 4e af std Y+62, r20 ; 0x3e 1e110: a8 97 sbiw r28, 0x28 ; 40 1e112: 58 e0 ldi r21, 0x08 ; 8 1e114: 25 0e add r2, r21 1e116: 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) { 1e118: ad eb ldi r26, 0xBD ; 189 1e11a: b3 e1 ldi r27, 0x13 ; 19 1e11c: a8 96 adiw r28, 0x28 ; 40 1e11e: ee ad ldd r30, Y+62 ; 0x3e 1e120: ff ad ldd r31, Y+63 ; 0x3f 1e122: a8 97 sbiw r28, 0x28 ; 40 1e124: ae 17 cp r26, r30 1e126: bf 07 cpc r27, r31 1e128: 09 f0 breq .+2 ; 0x1e12c 1e12a: e5 ce rjmp .-566 ; 0x1def6 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; 1e12c: 90 58 subi r25, 0x80 ; 128 1e12e: c7 56 subi r28, 0x67 ; 103 1e130: df 4f sbci r29, 0xFF ; 255 1e132: a8 81 ld r26, Y 1e134: b9 81 ldd r27, Y+1 ; 0x01 1e136: c9 59 subi r28, 0x99 ; 153 1e138: d0 40 sbci r29, 0x00 ; 0 1e13a: 6d 93 st X+, r22 1e13c: 7d 93 st X+, r23 1e13e: 8d 93 st X+, r24 1e140: 9d 93 st X+, r25 1e142: c7 56 subi r28, 0x67 ; 103 1e144: df 4f sbci r29, 0xFF ; 255 1e146: b9 83 std Y+1, r27 ; 0x01 1e148: a8 83 st Y, r26 1e14a: c9 59 subi r28, 0x99 ; 153 1e14c: 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) { 1e14e: 0f 5f subi r16, 0xFF ; 255 1e150: ac 96 adiw r28, 0x2c ; 44 1e152: ee ad ldd r30, Y+62 ; 0x3e 1e154: ff ad ldd r31, Y+63 ; 0x3f 1e156: ac 97 sbiw r28, 0x2c ; 44 1e158: 70 96 adiw r30, 0x10 ; 16 1e15a: ac 96 adiw r28, 0x2c ; 44 1e15c: ff af std Y+63, r31 ; 0x3f 1e15e: ee af std Y+62, r30 ; 0x3e 1e160: ac 97 sbiw r28, 0x2c ; 44 1e162: 04 30 cpi r16, 0x04 ; 4 1e164: 09 f0 breq .+2 ; 0x1e168 1e166: ab cc rjmp .-1706 ; 0x1dabe } // 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]; 1e168: 25 96 adiw r28, 0x05 ; 5 1e16a: 2c ad ldd r18, Y+60 ; 0x3c 1e16c: 3d ad ldd r19, Y+61 ; 0x3d 1e16e: 4e ad ldd r20, Y+62 ; 0x3e 1e170: 5f ad ldd r21, Y+63 ; 0x3f 1e172: 25 97 sbiw r28, 0x05 ; 5 1e174: ae 96 adiw r28, 0x2e ; 46 1e176: 2c af std Y+60, r18 ; 0x3c 1e178: 3d af std Y+61, r19 ; 0x3d 1e17a: 4e af std Y+62, r20 ; 0x3e 1e17c: 5f af std Y+63, r21 ; 0x3f 1e17e: ae 97 sbiw r28, 0x2e ; 46 1e180: 8d 81 ldd r24, Y+5 ; 0x05 1e182: 9e 81 ldd r25, Y+6 ; 0x06 1e184: af 81 ldd r26, Y+7 ; 0x07 1e186: b8 85 ldd r27, Y+8 ; 0x08 1e188: e4 96 adiw r28, 0x34 ; 52 1e18a: 8c af std Y+60, r24 ; 0x3c 1e18c: 9d af std Y+61, r25 ; 0x3d 1e18e: ae af std Y+62, r26 ; 0x3e 1e190: bf af std Y+63, r27 ; 0x3f 1e192: e4 97 sbiw r28, 0x34 ; 52 1e194: 29 85 ldd r18, Y+9 ; 0x09 1e196: 3a 85 ldd r19, Y+10 ; 0x0a 1e198: 4b 85 ldd r20, Y+11 ; 0x0b 1e19a: 5c 85 ldd r21, Y+12 ; 0x0c 1e19c: ed 96 adiw r28, 0x3d ; 61 1e19e: 2c af std Y+60, r18 ; 0x3c 1e1a0: 3d af std Y+61, r19 ; 0x3d 1e1a2: 4e af std Y+62, r20 ; 0x3e 1e1a4: 5f af std Y+63, r21 ; 0x3f 1e1a6: ed 97 sbiw r28, 0x3d ; 61 1e1a8: 8d 85 ldd r24, Y+13 ; 0x0d 1e1aa: 9e 85 ldd r25, Y+14 ; 0x0e 1e1ac: af 85 ldd r26, Y+15 ; 0x0f 1e1ae: b8 89 ldd r27, Y+16 ; 0x10 1e1b0: c3 58 subi r28, 0x83 ; 131 1e1b2: df 4f sbci r29, 0xFF ; 255 1e1b4: 88 83 st Y, r24 1e1b6: 99 83 std Y+1, r25 ; 0x01 1e1b8: aa 83 std Y+2, r26 ; 0x02 1e1ba: bb 83 std Y+3, r27 ; 0x03 1e1bc: cd 57 subi r28, 0x7D ; 125 1e1be: d0 40 sbci r29, 0x00 ; 0 1e1c0: 29 81 ldd r18, Y+1 ; 0x01 1e1c2: 3a 81 ldd r19, Y+2 ; 0x02 1e1c4: 4b 81 ldd r20, Y+3 ; 0x03 1e1c6: 5c 81 ldd r21, Y+4 ; 0x04 1e1c8: cf 57 subi r28, 0x7F ; 127 1e1ca: df 4f sbci r29, 0xFF ; 255 1e1cc: 28 83 st Y, r18 1e1ce: 39 83 std Y+1, r19 ; 0x01 1e1d0: 4a 83 std Y+2, r20 ; 0x02 1e1d2: 5b 83 std Y+3, r21 ; 0x03 1e1d4: c1 58 subi r28, 0x81 ; 129 1e1d6: 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]; 1e1d8: 29 96 adiw r28, 0x09 ; 9 1e1da: 8c ad ldd r24, Y+60 ; 0x3c 1e1dc: 9d ad ldd r25, Y+61 ; 0x3d 1e1de: ae ad ldd r26, Y+62 ; 0x3e 1e1e0: bf ad ldd r27, Y+63 ; 0x3f 1e1e2: 29 97 sbiw r28, 0x09 ; 9 1e1e4: cb 57 subi r28, 0x7B ; 123 1e1e6: df 4f sbci r29, 0xFF ; 255 1e1e8: 88 83 st Y, r24 1e1ea: 99 83 std Y+1, r25 ; 0x01 1e1ec: aa 83 std Y+2, r26 ; 0x02 1e1ee: bb 83 std Y+3, r27 ; 0x03 1e1f0: c5 58 subi r28, 0x85 ; 133 1e1f2: d0 40 sbci r29, 0x00 ; 0 1e1f4: 29 89 ldd r18, Y+17 ; 0x11 1e1f6: 3a 89 ldd r19, Y+18 ; 0x12 1e1f8: 4b 89 ldd r20, Y+19 ; 0x13 1e1fa: 5c 89 ldd r21, Y+20 ; 0x14 1e1fc: c7 57 subi r28, 0x77 ; 119 1e1fe: df 4f sbci r29, 0xFF ; 255 1e200: 28 83 st Y, r18 1e202: 39 83 std Y+1, r19 ; 0x01 1e204: 4a 83 std Y+2, r20 ; 0x02 1e206: 5b 83 std Y+3, r21 ; 0x03 1e208: c9 58 subi r28, 0x89 ; 137 1e20a: d0 40 sbci r29, 0x00 ; 0 1e20c: 89 8d ldd r24, Y+25 ; 0x19 1e20e: 9a 8d ldd r25, Y+26 ; 0x1a 1e210: ab 8d ldd r26, Y+27 ; 0x1b 1e212: bc 8d ldd r27, Y+28 ; 0x1c 1e214: cb 56 subi r28, 0x6B ; 107 1e216: df 4f sbci r29, 0xFF ; 255 1e218: 88 83 st Y, r24 1e21a: 99 83 std Y+1, r25 ; 0x01 1e21c: aa 83 std Y+2, r26 ; 0x02 1e21e: bb 83 std Y+3, r27 ; 0x03 1e220: c5 59 subi r28, 0x95 ; 149 1e222: d0 40 sbci r29, 0x00 ; 0 1e224: 2d 8d ldd r18, Y+29 ; 0x1d 1e226: 3e 8d ldd r19, Y+30 ; 0x1e 1e228: 4f 8d ldd r20, Y+31 ; 0x1f 1e22a: 58 a1 ldd r21, Y+32 ; 0x20 1e22c: c7 56 subi r28, 0x67 ; 103 1e22e: df 4f sbci r29, 0xFF ; 255 1e230: 28 83 st Y, r18 1e232: 39 83 std Y+1, r19 ; 0x01 1e234: 4a 83 std Y+2, r20 ; 0x02 1e236: 5b 83 std Y+3, r21 ; 0x03 1e238: c9 59 subi r28, 0x99 ; 153 1e23a: d0 40 sbci r29, 0x00 ; 0 1e23c: 8d 89 ldd r24, Y+21 ; 0x15 1e23e: 9e 89 ldd r25, Y+22 ; 0x16 1e240: af 89 ldd r26, Y+23 ; 0x17 1e242: b8 8d ldd r27, Y+24 ; 0x18 1e244: c3 57 subi r28, 0x73 ; 115 1e246: df 4f sbci r29, 0xFF ; 255 1e248: 88 83 st Y, r24 1e24a: 99 83 std Y+1, r25 ; 0x01 1e24c: aa 83 std Y+2, r26 ; 0x02 1e24e: bb 83 std Y+3, r27 ; 0x03 1e250: cd 58 subi r28, 0x8D ; 141 1e252: 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]; 1e254: 2d 96 adiw r28, 0x0d ; 13 1e256: 2c ad ldd r18, Y+60 ; 0x3c 1e258: 3d ad ldd r19, Y+61 ; 0x3d 1e25a: 4e ad ldd r20, Y+62 ; 0x3e 1e25c: 5f ad ldd r21, Y+63 ; 0x3f 1e25e: 2d 97 sbiw r28, 0x0d ; 13 1e260: c3 56 subi r28, 0x63 ; 99 1e262: df 4f sbci r29, 0xFF ; 255 1e264: 28 83 st Y, r18 1e266: 39 83 std Y+1, r19 ; 0x01 1e268: 4a 83 std Y+2, r20 ; 0x02 1e26a: 5b 83 std Y+3, r21 ; 0x03 1e26c: cd 59 subi r28, 0x9D ; 157 1e26e: d0 40 sbci r29, 0x00 ; 0 1e270: 89 a1 ldd r24, Y+33 ; 0x21 1e272: 9a a1 ldd r25, Y+34 ; 0x22 1e274: ab a1 ldd r26, Y+35 ; 0x23 1e276: bc a1 ldd r27, Y+36 ; 0x24 1e278: cf 55 subi r28, 0x5F ; 95 1e27a: df 4f sbci r29, 0xFF ; 255 1e27c: 88 83 st Y, r24 1e27e: 99 83 std Y+1, r25 ; 0x01 1e280: aa 83 std Y+2, r26 ; 0x02 1e282: bb 83 std Y+3, r27 ; 0x03 1e284: c1 5a subi r28, 0xA1 ; 161 1e286: d0 40 sbci r29, 0x00 ; 0 1e288: 2d a1 ldd r18, Y+37 ; 0x25 1e28a: 3e a1 ldd r19, Y+38 ; 0x26 1e28c: 4f a1 ldd r20, Y+39 ; 0x27 1e28e: 58 a5 ldd r21, Y+40 ; 0x28 1e290: cb 55 subi r28, 0x5B ; 91 1e292: df 4f sbci r29, 0xFF ; 255 1e294: 28 83 st Y, r18 1e296: 39 83 std Y+1, r19 ; 0x01 1e298: 4a 83 std Y+2, r20 ; 0x02 1e29a: 5b 83 std Y+3, r21 ; 0x03 1e29c: c5 5a subi r28, 0xA5 ; 165 1e29e: d0 40 sbci r29, 0x00 ; 0 1e2a0: 8d a5 ldd r24, Y+45 ; 0x2d 1e2a2: 9e a5 ldd r25, Y+46 ; 0x2e 1e2a4: af a5 ldd r26, Y+47 ; 0x2f 1e2a6: b8 a9 ldd r27, Y+48 ; 0x30 1e2a8: cd 54 subi r28, 0x4D ; 77 1e2aa: df 4f sbci r29, 0xFF ; 255 1e2ac: 88 83 st Y, r24 1e2ae: 99 83 std Y+1, r25 ; 0x01 1e2b0: aa 83 std Y+2, r26 ; 0x02 1e2b2: bb 83 std Y+3, r27 ; 0x03 1e2b4: c3 5b subi r28, 0xB3 ; 179 1e2b6: d0 40 sbci r29, 0x00 ; 0 1e2b8: 29 a5 ldd r18, Y+41 ; 0x29 1e2ba: 3a a5 ldd r19, Y+42 ; 0x2a 1e2bc: 4b a5 ldd r20, Y+43 ; 0x2b 1e2be: 5c a5 ldd r21, Y+44 ; 0x2c 1e2c0: c9 54 subi r28, 0x49 ; 73 1e2c2: df 4f sbci r29, 0xFF ; 255 1e2c4: 28 83 st Y, r18 1e2c6: 39 83 std Y+1, r19 ; 0x01 1e2c8: 4a 83 std Y+2, r20 ; 0x02 1e2ca: 5b 83 std Y+3, r21 ; 0x03 1e2cc: c7 5b subi r28, 0xB7 ; 183 1e2ce: 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]; 1e2d0: 61 96 adiw r28, 0x11 ; 17 1e2d2: 8c ad ldd r24, Y+60 ; 0x3c 1e2d4: 9d ad ldd r25, Y+61 ; 0x3d 1e2d6: ae ad ldd r26, Y+62 ; 0x3e 1e2d8: bf ad ldd r27, Y+63 ; 0x3f 1e2da: 61 97 sbiw r28, 0x11 ; 17 1e2dc: c5 54 subi r28, 0x45 ; 69 1e2de: df 4f sbci r29, 0xFF ; 255 1e2e0: 88 83 st Y, r24 1e2e2: 99 83 std Y+1, r25 ; 0x01 1e2e4: aa 83 std Y+2, r26 ; 0x02 1e2e6: bb 83 std Y+3, r27 ; 0x03 1e2e8: cb 5b subi r28, 0xBB ; 187 1e2ea: d0 40 sbci r29, 0x00 ; 0 1e2ec: 29 a9 ldd r18, Y+49 ; 0x31 1e2ee: 3a a9 ldd r19, Y+50 ; 0x32 1e2f0: 4b a9 ldd r20, Y+51 ; 0x33 1e2f2: 5c a9 ldd r21, Y+52 ; 0x34 1e2f4: c1 54 subi r28, 0x41 ; 65 1e2f6: df 4f sbci r29, 0xFF ; 255 1e2f8: 28 83 st Y, r18 1e2fa: 39 83 std Y+1, r19 ; 0x01 1e2fc: 4a 83 std Y+2, r20 ; 0x02 1e2fe: 5b 83 std Y+3, r21 ; 0x03 1e300: cf 5b subi r28, 0xBF ; 191 1e302: d0 40 sbci r29, 0x00 ; 0 1e304: 8d a9 ldd r24, Y+53 ; 0x35 1e306: 9e a9 ldd r25, Y+54 ; 0x36 1e308: af a9 ldd r26, Y+55 ; 0x37 1e30a: b8 ad ldd r27, Y+56 ; 0x38 1e30c: cd 53 subi r28, 0x3D ; 61 1e30e: df 4f sbci r29, 0xFF ; 255 1e310: 88 83 st Y, r24 1e312: 99 83 std Y+1, r25 ; 0x01 1e314: aa 83 std Y+2, r26 ; 0x02 1e316: bb 83 std Y+3, r27 ; 0x03 1e318: c3 5c subi r28, 0xC3 ; 195 1e31a: d0 40 sbci r29, 0x00 ; 0 1e31c: 29 ad ldd r18, Y+57 ; 0x39 1e31e: 3a ad ldd r19, Y+58 ; 0x3a 1e320: 4b ad ldd r20, Y+59 ; 0x3b 1e322: 5c ad ldd r21, Y+60 ; 0x3c 1e324: c9 53 subi r28, 0x39 ; 57 1e326: df 4f sbci r29, 0xFF ; 255 1e328: 28 83 st Y, r18 1e32a: 39 83 std Y+1, r19 ; 0x01 1e32c: 4a 83 std Y+2, r20 ; 0x02 1e32e: 5b 83 std Y+3, r21 ; 0x03 1e330: c7 5c subi r28, 0xC7 ; 199 1e332: d0 40 sbci r29, 0x00 ; 0 1e334: 21 96 adiw r28, 0x01 ; 1 1e336: 8c ad ldd r24, Y+60 ; 0x3c 1e338: 9d ad ldd r25, Y+61 ; 0x3d 1e33a: ae ad ldd r26, Y+62 ; 0x3e 1e33c: bf ad ldd r27, Y+63 ; 0x3f 1e33e: 21 97 sbiw r28, 0x01 ; 1 1e340: c5 53 subi r28, 0x35 ; 53 1e342: df 4f sbci r29, 0xFF ; 255 1e344: 88 83 st Y, r24 1e346: 99 83 std Y+1, r25 ; 0x01 1e348: aa 83 std Y+2, r26 ; 0x02 1e34a: bb 83 std Y+3, r27 ; 0x03 1e34c: cb 5c subi r28, 0xCB ; 203 1e34e: d0 40 sbci r29, 0x00 ; 0 1e350: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1e352: c1 2c mov r12, r1 1e354: d1 2c mov r13, r1 1e356: 76 01 movw r14, r12 1e358: 46 01 movw r8, r12 1e35a: 57 01 movw r10, r14 1e35c: 26 01 movw r4, r12 1e35e: 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]; 1e360: a3 01 movw r20, r6 1e362: 92 01 movw r18, r4 1e364: e4 96 adiw r28, 0x34 ; 52 1e366: 6c ad ldd r22, Y+60 ; 0x3c 1e368: 7d ad ldd r23, Y+61 ; 0x3d 1e36a: 8e ad ldd r24, Y+62 ; 0x3e 1e36c: 9f ad ldd r25, Y+63 ; 0x3f 1e36e: e4 97 sbiw r28, 0x34 ; 52 1e370: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e374: 9b 01 movw r18, r22 1e376: ac 01 movw r20, r24 1e378: ae 96 adiw r28, 0x2e ; 46 1e37a: 6c ad ldd r22, Y+60 ; 0x3c 1e37c: 7d ad ldd r23, Y+61 ; 0x3d 1e37e: 8e ad ldd r24, Y+62 ; 0x3e 1e380: 9f ad ldd r25, Y+63 ; 0x3f 1e382: ae 97 sbiw r28, 0x2e ; 46 1e384: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e388: 2b 01 movw r4, r22 1e38a: 3c 01 movw r6, r24 1e38c: a5 01 movw r20, r10 1e38e: 94 01 movw r18, r8 1e390: ed 96 adiw r28, 0x3d ; 61 1e392: 6c ad ldd r22, Y+60 ; 0x3c 1e394: 7d ad ldd r23, Y+61 ; 0x3d 1e396: 8e ad ldd r24, Y+62 ; 0x3e 1e398: 9f ad ldd r25, Y+63 ; 0x3f 1e39a: ed 97 sbiw r28, 0x3d ; 61 1e39c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e3a0: 9b 01 movw r18, r22 1e3a2: ac 01 movw r20, r24 1e3a4: c3 01 movw r24, r6 1e3a6: b2 01 movw r22, r4 1e3a8: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e3ac: 2b 01 movw r4, r22 1e3ae: 3c 01 movw r6, r24 1e3b0: a7 01 movw r20, r14 1e3b2: 96 01 movw r18, r12 1e3b4: c3 58 subi r28, 0x83 ; 131 1e3b6: df 4f sbci r29, 0xFF ; 255 1e3b8: 68 81 ld r22, Y 1e3ba: 79 81 ldd r23, Y+1 ; 0x01 1e3bc: 8a 81 ldd r24, Y+2 ; 0x02 1e3be: 9b 81 ldd r25, Y+3 ; 0x03 1e3c0: cd 57 subi r28, 0x7D ; 125 1e3c2: d0 40 sbci r29, 0x00 ; 0 1e3c4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e3c8: 9b 01 movw r18, r22 1e3ca: ac 01 movw r20, r24 1e3cc: c3 01 movw r24, r6 1e3ce: b2 01 movw r22, r4 1e3d0: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e3d4: cf 57 subi r28, 0x7F ; 127 1e3d6: df 4f sbci r29, 0xFF ; 255 1e3d8: 28 81 ld r18, Y 1e3da: 39 81 ldd r19, Y+1 ; 0x01 1e3dc: 4a 81 ldd r20, Y+2 ; 0x02 1e3de: 5b 81 ldd r21, Y+3 ; 0x03 1e3e0: c1 58 subi r28, 0x81 ; 129 1e3e2: d0 40 sbci r29, 0x00 ; 0 1e3e4: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1e3e8: 6e 96 adiw r28, 0x1e ; 30 1e3ea: 6c af std Y+60, r22 ; 0x3c 1e3ec: 7d af std Y+61, r23 ; 0x3d 1e3ee: 8e af std Y+62, r24 ; 0x3e 1e3f0: 9f af std Y+63, r25 ; 0x3f 1e3f2: 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]; 1e3f4: c7 57 subi r28, 0x77 ; 119 1e3f6: df 4f sbci r29, 0xFF ; 255 1e3f8: 28 81 ld r18, Y 1e3fa: 39 81 ldd r19, Y+1 ; 0x01 1e3fc: 4a 81 ldd r20, Y+2 ; 0x02 1e3fe: 5b 81 ldd r21, Y+3 ; 0x03 1e400: c9 58 subi r28, 0x89 ; 137 1e402: d0 40 sbci r29, 0x00 ; 0 1e404: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e408: 9b 01 movw r18, r22 1e40a: ac 01 movw r20, r24 1e40c: cb 57 subi r28, 0x7B ; 123 1e40e: df 4f sbci r29, 0xFF ; 255 1e410: 68 81 ld r22, Y 1e412: 79 81 ldd r23, Y+1 ; 0x01 1e414: 8a 81 ldd r24, Y+2 ; 0x02 1e416: 9b 81 ldd r25, Y+3 ; 0x03 1e418: c5 58 subi r28, 0x85 ; 133 1e41a: d0 40 sbci r29, 0x00 ; 0 1e41c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e420: 2b 01 movw r4, r22 1e422: 3c 01 movw r6, r24 1e424: a5 01 movw r20, r10 1e426: 94 01 movw r18, r8 1e428: cb 56 subi r28, 0x6B ; 107 1e42a: df 4f sbci r29, 0xFF ; 255 1e42c: 68 81 ld r22, Y 1e42e: 79 81 ldd r23, Y+1 ; 0x01 1e430: 8a 81 ldd r24, Y+2 ; 0x02 1e432: 9b 81 ldd r25, Y+3 ; 0x03 1e434: c5 59 subi r28, 0x95 ; 149 1e436: d0 40 sbci r29, 0x00 ; 0 1e438: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e43c: 9b 01 movw r18, r22 1e43e: ac 01 movw r20, r24 1e440: c3 01 movw r24, r6 1e442: b2 01 movw r22, r4 1e444: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e448: 4b 01 movw r8, r22 1e44a: 5c 01 movw r10, r24 1e44c: a7 01 movw r20, r14 1e44e: 96 01 movw r18, r12 1e450: c7 56 subi r28, 0x67 ; 103 1e452: df 4f sbci r29, 0xFF ; 255 1e454: 68 81 ld r22, Y 1e456: 79 81 ldd r23, Y+1 ; 0x01 1e458: 8a 81 ldd r24, Y+2 ; 0x02 1e45a: 9b 81 ldd r25, Y+3 ; 0x03 1e45c: c9 59 subi r28, 0x99 ; 153 1e45e: d0 40 sbci r29, 0x00 ; 0 1e460: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e464: 9b 01 movw r18, r22 1e466: ac 01 movw r20, r24 1e468: c5 01 movw r24, r10 1e46a: b4 01 movw r22, r8 1e46c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e470: c3 57 subi r28, 0x73 ; 115 1e472: df 4f sbci r29, 0xFF ; 255 1e474: 28 81 ld r18, Y 1e476: 39 81 ldd r19, Y+1 ; 0x01 1e478: 4a 81 ldd r20, Y+2 ; 0x02 1e47a: 5b 81 ldd r21, Y+3 ; 0x03 1e47c: cd 58 subi r28, 0x8D ; 141 1e47e: d0 40 sbci r29, 0x00 ; 0 1e480: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1e484: 2b 01 movw r4, r22 1e486: 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]; 1e488: cf 55 subi r28, 0x5F ; 95 1e48a: df 4f sbci r29, 0xFF ; 255 1e48c: 28 81 ld r18, Y 1e48e: 39 81 ldd r19, Y+1 ; 0x01 1e490: 4a 81 ldd r20, Y+2 ; 0x02 1e492: 5b 81 ldd r21, Y+3 ; 0x03 1e494: c1 5a subi r28, 0xA1 ; 161 1e496: d0 40 sbci r29, 0x00 ; 0 1e498: 6e 96 adiw r28, 0x1e ; 30 1e49a: 6c ad ldd r22, Y+60 ; 0x3c 1e49c: 7d ad ldd r23, Y+61 ; 0x3d 1e49e: 8e ad ldd r24, Y+62 ; 0x3e 1e4a0: 9f ad ldd r25, Y+63 ; 0x3f 1e4a2: 6e 97 sbiw r28, 0x1e ; 30 1e4a4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e4a8: 9b 01 movw r18, r22 1e4aa: ac 01 movw r20, r24 1e4ac: c3 56 subi r28, 0x63 ; 99 1e4ae: df 4f sbci r29, 0xFF ; 255 1e4b0: 68 81 ld r22, Y 1e4b2: 79 81 ldd r23, Y+1 ; 0x01 1e4b4: 8a 81 ldd r24, Y+2 ; 0x02 1e4b6: 9b 81 ldd r25, Y+3 ; 0x03 1e4b8: cd 59 subi r28, 0x9D ; 157 1e4ba: d0 40 sbci r29, 0x00 ; 0 1e4bc: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e4c0: 4b 01 movw r8, r22 1e4c2: 5c 01 movw r10, r24 1e4c4: cb 55 subi r28, 0x5B ; 91 1e4c6: df 4f sbci r29, 0xFF ; 255 1e4c8: 28 81 ld r18, Y 1e4ca: 39 81 ldd r19, Y+1 ; 0x01 1e4cc: 4a 81 ldd r20, Y+2 ; 0x02 1e4ce: 5b 81 ldd r21, Y+3 ; 0x03 1e4d0: c5 5a subi r28, 0xA5 ; 165 1e4d2: d0 40 sbci r29, 0x00 ; 0 1e4d4: c3 01 movw r24, r6 1e4d6: b2 01 movw r22, r4 1e4d8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e4dc: 9b 01 movw r18, r22 1e4de: ac 01 movw r20, r24 1e4e0: c5 01 movw r24, r10 1e4e2: b4 01 movw r22, r8 1e4e4: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e4e8: 4b 01 movw r8, r22 1e4ea: 5c 01 movw r10, r24 1e4ec: a7 01 movw r20, r14 1e4ee: 96 01 movw r18, r12 1e4f0: cd 54 subi r28, 0x4D ; 77 1e4f2: df 4f sbci r29, 0xFF ; 255 1e4f4: 68 81 ld r22, Y 1e4f6: 79 81 ldd r23, Y+1 ; 0x01 1e4f8: 8a 81 ldd r24, Y+2 ; 0x02 1e4fa: 9b 81 ldd r25, Y+3 ; 0x03 1e4fc: c3 5b subi r28, 0xB3 ; 179 1e4fe: d0 40 sbci r29, 0x00 ; 0 1e500: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e504: 9b 01 movw r18, r22 1e506: ac 01 movw r20, r24 1e508: c5 01 movw r24, r10 1e50a: b4 01 movw r22, r8 1e50c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e510: c9 54 subi r28, 0x49 ; 73 1e512: df 4f sbci r29, 0xFF ; 255 1e514: 28 81 ld r18, Y 1e516: 39 81 ldd r19, Y+1 ; 0x01 1e518: 4a 81 ldd r20, Y+2 ; 0x02 1e51a: 5b 81 ldd r21, Y+3 ; 0x03 1e51c: c7 5b subi r28, 0xB7 ; 183 1e51e: d0 40 sbci r29, 0x00 ; 0 1e520: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1e524: 4b 01 movw r8, r22 1e526: 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]; 1e528: c1 54 subi r28, 0x41 ; 65 1e52a: df 4f sbci r29, 0xFF ; 255 1e52c: 28 81 ld r18, Y 1e52e: 39 81 ldd r19, Y+1 ; 0x01 1e530: 4a 81 ldd r20, Y+2 ; 0x02 1e532: 5b 81 ldd r21, Y+3 ; 0x03 1e534: cf 5b subi r28, 0xBF ; 191 1e536: d0 40 sbci r29, 0x00 ; 0 1e538: 6e 96 adiw r28, 0x1e ; 30 1e53a: 6c ad ldd r22, Y+60 ; 0x3c 1e53c: 7d ad ldd r23, Y+61 ; 0x3d 1e53e: 8e ad ldd r24, Y+62 ; 0x3e 1e540: 9f ad ldd r25, Y+63 ; 0x3f 1e542: 6e 97 sbiw r28, 0x1e ; 30 1e544: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e548: 9b 01 movw r18, r22 1e54a: ac 01 movw r20, r24 1e54c: c5 54 subi r28, 0x45 ; 69 1e54e: df 4f sbci r29, 0xFF ; 255 1e550: 68 81 ld r22, Y 1e552: 79 81 ldd r23, Y+1 ; 0x01 1e554: 8a 81 ldd r24, Y+2 ; 0x02 1e556: 9b 81 ldd r25, Y+3 ; 0x03 1e558: cb 5b subi r28, 0xBB ; 187 1e55a: d0 40 sbci r29, 0x00 ; 0 1e55c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e560: 6b 01 movw r12, r22 1e562: 7c 01 movw r14, r24 1e564: cd 53 subi r28, 0x3D ; 61 1e566: df 4f sbci r29, 0xFF ; 255 1e568: 28 81 ld r18, Y 1e56a: 39 81 ldd r19, Y+1 ; 0x01 1e56c: 4a 81 ldd r20, Y+2 ; 0x02 1e56e: 5b 81 ldd r21, Y+3 ; 0x03 1e570: c3 5c subi r28, 0xC3 ; 195 1e572: d0 40 sbci r29, 0x00 ; 0 1e574: c3 01 movw r24, r6 1e576: b2 01 movw r22, r4 1e578: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e57c: 9b 01 movw r18, r22 1e57e: ac 01 movw r20, r24 1e580: c7 01 movw r24, r14 1e582: b6 01 movw r22, r12 1e584: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e588: 6b 01 movw r12, r22 1e58a: 7c 01 movw r14, r24 1e58c: c9 53 subi r28, 0x39 ; 57 1e58e: df 4f sbci r29, 0xFF ; 255 1e590: 28 81 ld r18, Y 1e592: 39 81 ldd r19, Y+1 ; 0x01 1e594: 4a 81 ldd r20, Y+2 ; 0x02 1e596: 5b 81 ldd r21, Y+3 ; 0x03 1e598: c7 5c subi r28, 0xC7 ; 199 1e59a: d0 40 sbci r29, 0x00 ; 0 1e59c: c5 01 movw r24, r10 1e59e: b4 01 movw r22, r8 1e5a0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e5a4: 9b 01 movw r18, r22 1e5a6: ac 01 movw r20, r24 1e5a8: c7 01 movw r24, r14 1e5aa: b6 01 movw r22, r12 1e5ac: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e5b0: c5 53 subi r28, 0x35 ; 53 1e5b2: df 4f sbci r29, 0xFF ; 255 1e5b4: 28 81 ld r18, Y 1e5b6: 39 81 ldd r19, Y+1 ; 0x01 1e5b8: 4a 81 ldd r20, Y+2 ; 0x02 1e5ba: 5b 81 ldd r21, Y+3 ; 0x03 1e5bc: cb 5c subi r28, 0xCB ; 203 1e5be: d0 40 sbci r29, 0x00 ; 0 1e5c0: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1e5c4: 6b 01 movw r12, r22 1e5c6: 7c 01 movw r14, r24 1e5c8: 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) { 1e5ca: 09 f0 breq .+2 ; 0x1e5ce 1e5cc: c9 ce rjmp .-622 ; 0x1e360 // 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]; 1e5ce: 6e 96 adiw r28, 0x1e ; 30 1e5d0: 2c ad ldd r18, Y+60 ; 0x3c 1e5d2: 3d ad ldd r19, Y+61 ; 0x3d 1e5d4: 4e ad ldd r20, Y+62 ; 0x3e 1e5d6: 5f ad ldd r21, Y+63 ; 0x3f 1e5d8: 6e 97 sbiw r28, 0x1e ; 30 1e5da: c5 55 subi r28, 0x55 ; 85 1e5dc: df 4f sbci r29, 0xFF ; 255 1e5de: 68 81 ld r22, Y 1e5e0: 79 81 ldd r23, Y+1 ; 0x01 1e5e2: 8a 81 ldd r24, Y+2 ; 0x02 1e5e4: 9b 81 ldd r25, Y+3 ; 0x03 1e5e6: cb 5a subi r28, 0xAB ; 171 1e5e8: d0 40 sbci r29, 0x00 ; 0 1e5ea: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e5ee: 60 93 ce 13 sts 0x13CE, r22 ; 0x8013ce 1e5f2: 70 93 cf 13 sts 0x13CF, r23 ; 0x8013cf 1e5f6: 80 93 d0 13 sts 0x13D0, r24 ; 0x8013d0 1e5fa: 90 93 d1 13 sts 0x13D1, r25 ; 0x8013d1 cntr[1] += h[1]; 1e5fe: a3 01 movw r20, r6 1e600: 92 01 movw r18, r4 1e602: c1 55 subi r28, 0x51 ; 81 1e604: df 4f sbci r29, 0xFF ; 255 1e606: 68 81 ld r22, Y 1e608: 79 81 ldd r23, Y+1 ; 0x01 1e60a: 8a 81 ldd r24, Y+2 ; 0x02 1e60c: 9b 81 ldd r25, Y+3 ; 0x03 1e60e: cf 5a subi r28, 0xAF ; 175 1e610: d0 40 sbci r29, 0x00 ; 0 1e612: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e616: 60 93 d2 13 sts 0x13D2, r22 ; 0x8013d2 1e61a: 70 93 d3 13 sts 0x13D3, r23 ; 0x8013d3 1e61e: 80 93 d4 13 sts 0x13D4, r24 ; 0x8013d4 1e622: 90 93 d5 13 sts 0x13D5, r25 ; 0x8013d5 a1 += h[2]; 1e626: a5 01 movw r20, r10 1e628: 94 01 movw r18, r8 1e62a: a6 96 adiw r28, 0x26 ; 38 1e62c: 6c ad ldd r22, Y+60 ; 0x3c 1e62e: 7d ad ldd r23, Y+61 ; 0x3d 1e630: 8e ad ldd r24, Y+62 ; 0x3e 1e632: 9f ad ldd r25, Y+63 ; 0x3f 1e634: a6 97 sbiw r28, 0x26 ; 38 1e636: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e63a: a6 96 adiw r28, 0x26 ; 38 1e63c: 6c af std Y+60, r22 ; 0x3c 1e63e: 7d af std Y+61, r23 ; 0x3d 1e640: 8e af std Y+62, r24 ; 0x3e 1e642: 9f af std Y+63, r25 ; 0x3f 1e644: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1e646: a7 01 movw r20, r14 1e648: 96 01 movw r18, r12 1e64a: a2 96 adiw r28, 0x22 ; 34 1e64c: 6c ad ldd r22, Y+60 ; 0x3c 1e64e: 7d ad ldd r23, Y+61 ; 0x3d 1e650: 8e ad ldd r24, Y+62 ; 0x3e 1e652: 9f ad ldd r25, Y+63 ; 0x3f 1e654: a2 97 sbiw r28, 0x22 ; 34 1e656: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e65a: a2 96 adiw r28, 0x22 ; 34 1e65c: 6c af std Y+60, r22 ; 0x3c 1e65e: 7d af std Y+61, r23 ; 0x3d 1e660: 8e af std Y+62, r24 ; 0x3e 1e662: 9f af std Y+63, r25 ; 0x3f 1e664: a2 97 sbiw r28, 0x22 ; 34 1e666: e6 96 adiw r28, 0x36 ; 54 1e668: 9f ad ldd r25, Y+63 ; 0x3f 1e66a: e6 97 sbiw r28, 0x36 ; 54 1e66c: 91 50 subi r25, 0x01 ; 1 1e66e: e6 96 adiw r28, 0x36 ; 54 1e670: 9f af std Y+63, r25 ; 0x3f 1e672: 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) { 1e674: 91 11 cpse r25, r1 1e676: 70 c9 rjmp .-3360 ; 0x1d958 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1e678: a6 96 adiw r28, 0x26 ; 38 1e67a: 6c ad ldd r22, Y+60 ; 0x3c 1e67c: 7d ad ldd r23, Y+61 ; 0x3d 1e67e: 8e ad ldd r24, Y+62 ; 0x3e 1e680: 9f ad ldd r25, Y+63 ; 0x3f 1e682: a6 97 sbiw r28, 0x26 ; 38 1e684: 0f 94 68 df call 0x3bed0 ; 0x3bed0 1e688: 60 93 be 13 sts 0x13BE, r22 ; 0x8013be 1e68c: 70 93 bf 13 sts 0x13BF, r23 ; 0x8013bf 1e690: 80 93 c0 13 sts 0x13C0, r24 ; 0x8013c0 1e694: 90 93 c1 13 sts 0x13C1, r25 ; 0x8013c1 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1e698: a6 96 adiw r28, 0x26 ; 38 1e69a: 6c ad ldd r22, Y+60 ; 0x3c 1e69c: 7d ad ldd r23, Y+61 ; 0x3d 1e69e: 8e ad ldd r24, Y+62 ; 0x3e 1e6a0: 9f ad ldd r25, Y+63 ; 0x3f 1e6a2: a6 97 sbiw r28, 0x26 ; 38 1e6a4: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 1e6a8: 60 93 c2 13 sts 0x13C2, r22 ; 0x8013c2 1e6ac: 70 93 c3 13 sts 0x13C3, r23 ; 0x8013c3 1e6b0: 80 93 c4 13 sts 0x13C4, r24 ; 0x8013c4 1e6b4: 90 93 c5 13 sts 0x13C5, r25 ; 0x8013c5 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1e6b8: a2 96 adiw r28, 0x22 ; 34 1e6ba: 6c ad ldd r22, Y+60 ; 0x3c 1e6bc: 7d ad ldd r23, Y+61 ; 0x3d 1e6be: 8e ad ldd r24, Y+62 ; 0x3e 1e6c0: 9f ad ldd r25, Y+63 ; 0x3f 1e6c2: a2 97 sbiw r28, 0x22 ; 34 1e6c4: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 1e6c8: 90 58 subi r25, 0x80 ; 128 1e6ca: 60 93 c6 13 sts 0x13C6, r22 ; 0x8013c6 1e6ce: 70 93 c7 13 sts 0x13C7, r23 ; 0x8013c7 1e6d2: 80 93 c8 13 sts 0x13C8, r24 ; 0x8013c8 1e6d6: 90 93 c9 13 sts 0x13C9, r25 ; 0x8013c9 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1e6da: a2 96 adiw r28, 0x22 ; 34 1e6dc: 6c ad ldd r22, Y+60 ; 0x3c 1e6de: 7d ad ldd r23, Y+61 ; 0x3d 1e6e0: 8e ad ldd r24, Y+62 ; 0x3e 1e6e2: 9f ad ldd r25, Y+63 ; 0x3f 1e6e4: a2 97 sbiw r28, 0x22 ; 34 1e6e6: 0f 94 68 df call 0x3bed0 ; 0x3bed0 1e6ea: 60 93 ca 13 sts 0x13CA, r22 ; 0x8013ca 1e6ee: 70 93 cb 13 sts 0x13CB, r23 ; 0x8013cb 1e6f2: 80 93 cc 13 sts 0x13CC, r24 ; 0x8013cc 1e6f6: 90 93 cd 13 sts 0x13CD, r25 ; 0x8013cd BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1e6fa: a6 96 adiw r28, 0x26 ; 38 1e6fc: 2c ad ldd r18, Y+60 ; 0x3c 1e6fe: 3d ad ldd r19, Y+61 ; 0x3d 1e700: 4e ad ldd r20, Y+62 ; 0x3e 1e702: 5f ad ldd r21, Y+63 ; 0x3f 1e704: a6 97 sbiw r28, 0x26 ; 38 1e706: a2 96 adiw r28, 0x22 ; 34 1e708: 6c ad ldd r22, Y+60 ; 0x3c 1e70a: 7d ad ldd r23, Y+61 ; 0x3d 1e70c: 8e ad ldd r24, Y+62 ; 0x3e 1e70e: 9f ad ldd r25, Y+63 ; 0x3f 1e710: a2 97 sbiw r28, 0x22 ; 34 1e712: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e716: 4b 01 movw r8, r22 1e718: 5c 01 movw r10, r24 1e71a: 7c 01 movw r14, r24 1e71c: 6b 01 movw r12, r22 1e71e: e8 94 clt 1e720: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1e722: 21 ee ldi r18, 0xE1 ; 225 1e724: 3e e2 ldi r19, 0x2E ; 46 1e726: 45 e6 ldi r20, 0x65 ; 101 1e728: 52 e4 ldi r21, 0x42 ; 66 1e72a: a2 96 adiw r28, 0x22 ; 34 1e72c: 6c ad ldd r22, Y+60 ; 0x3c 1e72e: 7d ad ldd r23, Y+61 ; 0x3d 1e730: 8e ad ldd r24, Y+62 ; 0x3e 1e732: 9f ad ldd r25, Y+63 ; 0x3f 1e734: a2 97 sbiw r28, 0x22 ; 34 1e736: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e73a: 9f 93 push r25 1e73c: 8f 93 push r24 1e73e: 7f 93 push r23 1e740: 6f 93 push r22 1e742: 21 ee ldi r18, 0xE1 ; 225 1e744: 3e e2 ldi r19, 0x2E ; 46 1e746: 45 e6 ldi r20, 0x65 ; 101 1e748: 52 e4 ldi r21, 0x42 ; 66 1e74a: c5 01 movw r24, r10 1e74c: b4 01 movw r22, r8 1e74e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e752: 9f 93 push r25 1e754: 8f 93 push r24 1e756: 7f 93 push r23 1e758: 6f 93 push r22 1e75a: 80 e5 ldi r24, 0x50 ; 80 1e75c: 9e e6 ldi r25, 0x6E ; 110 1e75e: 9f 93 push r25 1e760: 8f 93 push r24 1e762: 0f 94 08 dc call 0x3b810 ; 0x3b810 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1e766: b7 01 movw r22, r14 1e768: a6 01 movw r20, r12 1e76a: 80 e6 ldi r24, 0x60 ; 96 1e76c: 9f e0 ldi r25, 0x0F ; 15 1e76e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 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) 1e772: 0f b6 in r0, 0x3f ; 63 1e774: f8 94 cli 1e776: de bf out 0x3e, r29 ; 62 1e778: 0f be out 0x3f, r0 ; 63 1e77a: cd bf out 0x3d, r28 ; 61 1e77c: 2f e1 ldi r18, 0x1F ; 31 1e77e: 32 e4 ldi r19, 0x42 ; 66 1e780: 49 e0 ldi r20, 0x09 ; 9 1e782: 5b e3 ldi r21, 0x3B ; 59 1e784: c7 01 movw r24, r14 1e786: b6 01 movw r22, r12 1e788: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__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; 1e78c: 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) 1e78e: 18 16 cp r1, r24 1e790: 64 f4 brge .+24 ; 0x1e7aa result = (angleDiff > bed_skew_angle_extreme) ? 1e792: 25 e3 ldi r18, 0x35 ; 53 1e794: 3a ef ldi r19, 0xFA ; 250 1e796: 4e e8 ldi r20, 0x8E ; 142 1e798: 5b e3 ldi r21, 0x3B ; 59 1e79a: c7 01 movw r24, r14 1e79c: b6 01 movw r22, r12 1e79e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1e7a2: 12 e0 ldi r17, 0x02 ; 2 1e7a4: 18 16 cp r1, r24 1e7a6: 0c f0 brlt .+2 ; 0x1e7aa 1e7a8: 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 || 1e7aa: 25 e3 ldi r18, 0x35 ; 53 1e7ac: 3a ef ldi r19, 0xFA ; 250 1e7ae: 4e e8 ldi r20, 0x8E ; 142 1e7b0: 5b e3 ldi r21, 0x3B ; 59 1e7b2: a6 96 adiw r28, 0x26 ; 38 1e7b4: 6c ad ldd r22, Y+60 ; 0x3c 1e7b6: 7d ad ldd r23, Y+61 ; 0x3d 1e7b8: 8e ad ldd r24, Y+62 ; 0x3e 1e7ba: 9f ad ldd r25, Y+63 ; 0x3f 1e7bc: a6 97 sbiw r28, 0x26 ; 38 1e7be: 9f 77 andi r25, 0x7F ; 127 1e7c0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1e7c4: 18 16 cp r1, r24 1e7c6: 0c f4 brge .+2 ; 0x1e7ca 1e7c8: 67 c4 rjmp .+2254 ; 0x1f098 1e7ca: 25 e3 ldi r18, 0x35 ; 53 1e7cc: 3a ef ldi r19, 0xFA ; 250 1e7ce: 4e e8 ldi r20, 0x8E ; 142 1e7d0: 5b e3 ldi r21, 0x3B ; 59 1e7d2: a2 96 adiw r28, 0x22 ; 34 1e7d4: 6c ad ldd r22, Y+60 ; 0x3c 1e7d6: 7d ad ldd r23, Y+61 ; 0x3d 1e7d8: 8e ad ldd r24, Y+62 ; 0x3e 1e7da: 9f ad ldd r25, Y+63 ; 0x3f 1e7dc: a2 97 sbiw r28, 0x22 ; 34 1e7de: 9f 77 andi r25, 0x7F ; 127 1e7e0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1e7e4: 18 16 cp r1, r24 1e7e6: 0c f4 brge .+2 ; 0x1e7ea 1e7e8: 57 c4 rjmp .+2222 ; 0x1f098 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]; 1e7ea: 20 91 be 13 lds r18, 0x13BE ; 0x8013be 1e7ee: 30 91 bf 13 lds r19, 0x13BF ; 0x8013bf 1e7f2: 40 91 c0 13 lds r20, 0x13C0 ; 0x8013c0 1e7f6: 50 91 c1 13 lds r21, 0x13C1 ; 0x8013c1 1e7fa: ae 96 adiw r28, 0x2e ; 46 1e7fc: 2c af std Y+60, r18 ; 0x3c 1e7fe: 3d af std Y+61, r19 ; 0x3d 1e800: 4e af std Y+62, r20 ; 0x3e 1e802: 5f af std Y+63, r21 ; 0x3f 1e804: ae 97 sbiw r28, 0x2e ; 46 1e806: 80 91 c6 13 lds r24, 0x13C6 ; 0x8013c6 1e80a: 90 91 c7 13 lds r25, 0x13C7 ; 0x8013c7 1e80e: a0 91 c8 13 lds r26, 0x13C8 ; 0x8013c8 1e812: b0 91 c9 13 lds r27, 0x13C9 ; 0x8013c9 1e816: e9 96 adiw r28, 0x39 ; 57 1e818: 8c af std Y+60, r24 ; 0x3c 1e81a: 9d af std Y+61, r25 ; 0x3d 1e81c: ae af std Y+62, r26 ; 0x3e 1e81e: bf af std Y+63, r27 ; 0x3f 1e820: e9 97 sbiw r28, 0x39 ; 57 1e822: 20 91 ce 13 lds r18, 0x13CE ; 0x8013ce 1e826: 30 91 cf 13 lds r19, 0x13CF ; 0x8013cf 1e82a: 40 91 d0 13 lds r20, 0x13D0 ; 0x8013d0 1e82e: 50 91 d1 13 lds r21, 0x13D1 ; 0x8013d1 1e832: e4 96 adiw r28, 0x34 ; 52 1e834: 2c af std Y+60, r18 ; 0x3c 1e836: 3d af std Y+61, r19 ; 0x3d 1e838: 4e af std Y+62, r20 ; 0x3e 1e83a: 5f af std Y+63, r21 ; 0x3f 1e83c: 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]; 1e83e: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 1e842: 90 91 c3 13 lds r25, 0x13C3 ; 0x8013c3 1e846: a0 91 c4 13 lds r26, 0x13C4 ; 0x8013c4 1e84a: b0 91 c5 13 lds r27, 0x13C5 ; 0x8013c5 1e84e: ed 96 adiw r28, 0x3d ; 61 1e850: 8c af std Y+60, r24 ; 0x3c 1e852: 9d af std Y+61, r25 ; 0x3d 1e854: ae af std Y+62, r26 ; 0x3e 1e856: bf af std Y+63, r27 ; 0x3f 1e858: ed 97 sbiw r28, 0x3d ; 61 1e85a: 20 91 ca 13 lds r18, 0x13CA ; 0x8013ca 1e85e: 30 91 cb 13 lds r19, 0x13CB ; 0x8013cb 1e862: 40 91 cc 13 lds r20, 0x13CC ; 0x8013cc 1e866: 50 91 cd 13 lds r21, 0x13CD ; 0x8013cd 1e86a: c3 58 subi r28, 0x83 ; 131 1e86c: df 4f sbci r29, 0xFF ; 255 1e86e: 28 83 st Y, r18 1e870: 39 83 std Y+1, r19 ; 0x01 1e872: 4a 83 std Y+2, r20 ; 0x02 1e874: 5b 83 std Y+3, r21 ; 0x03 1e876: cd 57 subi r28, 0x7D ; 125 1e878: d0 40 sbci r29, 0x00 ; 0 1e87a: 80 91 d2 13 lds r24, 0x13D2 ; 0x8013d2 1e87e: 90 91 d3 13 lds r25, 0x13D3 ; 0x8013d3 1e882: a0 91 d4 13 lds r26, 0x13D4 ; 0x8013d4 1e886: b0 91 d5 13 lds r27, 0x13D5 ; 0x8013d5 1e88a: cf 57 subi r28, 0x7F ; 127 1e88c: df 4f sbci r29, 0xFF ; 255 1e88e: 88 83 st Y, r24 1e890: 99 83 std Y+1, r25 ; 0x01 1e892: aa 83 std Y+2, r26 ; 0x02 1e894: bb 83 std Y+3, r27 ; 0x03 1e896: c1 58 subi r28, 0x81 ; 129 1e898: d0 40 sbci r29, 0x00 ; 0 1e89a: a0 e5 ldi r26, 0x50 ; 80 1e89c: b2 e9 ldi r27, 0x92 ; 146 1e89e: 6c 96 adiw r28, 0x1c ; 28 1e8a0: bf af std Y+63, r27 ; 0x3f 1e8a2: ae af std Y+62, r26 ; 0x3e 1e8a4: 6c 97 sbiw r28, 0x1c ; 28 1e8a6: 8d e9 ldi r24, 0x9D ; 157 1e8a8: 28 2e mov r2, r24 1e8aa: 83 e1 ldi r24, 0x13 ; 19 1e8ac: 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]; 1e8ae: f1 01 movw r30, r2 1e8b0: c1 80 ldd r12, Z+1 ; 0x01 1e8b2: d2 80 ldd r13, Z+2 ; 0x02 1e8b4: e3 80 ldd r14, Z+3 ; 0x03 1e8b6: f4 80 ldd r15, Z+4 ; 0x04 1e8b8: 45 80 ldd r4, Z+5 ; 0x05 1e8ba: 56 80 ldd r5, Z+6 ; 0x06 1e8bc: 67 80 ldd r6, Z+7 ; 0x07 1e8be: 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; 1e8c0: 6c 96 adiw r28, 0x1c ; 28 1e8c2: ee ad ldd r30, Y+62 ; 0x3e 1e8c4: ff ad ldd r31, Y+63 ; 0x3f 1e8c6: 6c 97 sbiw r28, 0x1c ; 28 1e8c8: 25 91 lpm r18, Z+ 1e8ca: 35 91 lpm r19, Z+ 1e8cc: 45 91 lpm r20, Z+ 1e8ce: 54 91 lpm r21, Z 1e8d0: cb 57 subi r28, 0x7B ; 123 1e8d2: df 4f sbci r29, 0xFF ; 255 1e8d4: 28 83 st Y, r18 1e8d6: 39 83 std Y+1, r19 ; 0x01 1e8d8: 4a 83 std Y+2, r20 ; 0x02 1e8da: 5b 83 std Y+3, r21 ; 0x03 1e8dc: c5 58 subi r28, 0x85 ; 133 1e8de: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1e8e0: 6c 96 adiw r28, 0x1c ; 28 1e8e2: ee ad ldd r30, Y+62 ; 0x3e 1e8e4: ff ad ldd r31, Y+63 ; 0x3f 1e8e6: 6c 97 sbiw r28, 0x1c ; 28 1e8e8: 34 96 adiw r30, 0x04 ; 4 1e8ea: 85 90 lpm r8, Z+ 1e8ec: 95 90 lpm r9, Z+ 1e8ee: a5 90 lpm r10, Z+ 1e8f0: 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]; 1e8f2: ed 96 adiw r28, 0x3d ; 61 1e8f4: 2c ad ldd r18, Y+60 ; 0x3c 1e8f6: 3d ad ldd r19, Y+61 ; 0x3d 1e8f8: 4e ad ldd r20, Y+62 ; 0x3e 1e8fa: 5f ad ldd r21, Y+63 ; 0x3f 1e8fc: ed 97 sbiw r28, 0x3d ; 61 1e8fe: c7 01 movw r24, r14 1e900: b6 01 movw r22, r12 1e902: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e906: c7 57 subi r28, 0x77 ; 119 1e908: df 4f sbci r29, 0xFF ; 255 1e90a: 68 83 st Y, r22 1e90c: 79 83 std Y+1, r23 ; 0x01 1e90e: 8a 83 std Y+2, r24 ; 0x02 1e910: 9b 83 std Y+3, r25 ; 0x03 1e912: c9 58 subi r28, 0x89 ; 137 1e914: d0 40 sbci r29, 0x00 ; 0 1e916: c3 58 subi r28, 0x83 ; 131 1e918: df 4f sbci r29, 0xFF ; 255 1e91a: 28 81 ld r18, Y 1e91c: 39 81 ldd r19, Y+1 ; 0x01 1e91e: 4a 81 ldd r20, Y+2 ; 0x02 1e920: 5b 81 ldd r21, Y+3 ; 0x03 1e922: cd 57 subi r28, 0x7D ; 125 1e924: d0 40 sbci r29, 0x00 ; 0 1e926: c3 01 movw r24, r6 1e928: b2 01 movw r22, r4 1e92a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e92e: 9b 01 movw r18, r22 1e930: ac 01 movw r20, r24 1e932: c7 57 subi r28, 0x77 ; 119 1e934: df 4f sbci r29, 0xFF ; 255 1e936: 68 81 ld r22, Y 1e938: 79 81 ldd r23, Y+1 ; 0x01 1e93a: 8a 81 ldd r24, Y+2 ; 0x02 1e93c: 9b 81 ldd r25, Y+3 ; 0x03 1e93e: c9 58 subi r28, 0x89 ; 137 1e940: d0 40 sbci r29, 0x00 ; 0 1e942: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e946: cf 57 subi r28, 0x7F ; 127 1e948: df 4f sbci r29, 0xFF ; 255 1e94a: 28 81 ld r18, Y 1e94c: 39 81 ldd r19, Y+1 ; 0x01 1e94e: 4a 81 ldd r20, Y+2 ; 0x02 1e950: 5b 81 ldd r21, Y+3 ; 0x03 1e952: c1 58 subi r28, 0x81 ; 129 1e954: d0 40 sbci r29, 0x00 ; 0 1e956: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e95a: 9b 01 movw r18, r22 1e95c: 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; 1e95e: c5 01 movw r24, r10 1e960: b4 01 movw r22, r8 1e962: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1e966: 4b 01 movw r8, r22 1e968: 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]; 1e96a: a7 01 movw r20, r14 1e96c: 96 01 movw r18, r12 1e96e: ae 96 adiw r28, 0x2e ; 46 1e970: 6c ad ldd r22, Y+60 ; 0x3c 1e972: 7d ad ldd r23, Y+61 ; 0x3d 1e974: 8e ad ldd r24, Y+62 ; 0x3e 1e976: 9f ad ldd r25, Y+63 ; 0x3f 1e978: ae 97 sbiw r28, 0x2e ; 46 1e97a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e97e: 6b 01 movw r12, r22 1e980: 7c 01 movw r14, r24 1e982: a3 01 movw r20, r6 1e984: 92 01 movw r18, r4 1e986: e9 96 adiw r28, 0x39 ; 57 1e988: 6c ad ldd r22, Y+60 ; 0x3c 1e98a: 7d ad ldd r23, Y+61 ; 0x3d 1e98c: 8e ad ldd r24, Y+62 ; 0x3e 1e98e: 9f ad ldd r25, Y+63 ; 0x3f 1e990: e9 97 sbiw r28, 0x39 ; 57 1e992: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1e996: 9b 01 movw r18, r22 1e998: ac 01 movw r20, r24 1e99a: c7 01 movw r24, r14 1e99c: b6 01 movw r22, r12 1e99e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e9a2: e4 96 adiw r28, 0x34 ; 52 1e9a4: 2c ad ldd r18, Y+60 ; 0x3c 1e9a6: 3d ad ldd r19, Y+61 ; 0x3d 1e9a8: 4e ad ldd r20, Y+62 ; 0x3e 1e9aa: 5f ad ldd r21, Y+63 ; 0x3f 1e9ac: e4 97 sbiw r28, 0x34 ; 52 1e9ae: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1e9b2: 9b 01 movw r18, r22 1e9b4: 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; 1e9b6: cb 57 subi r28, 0x7B ; 123 1e9b8: df 4f sbci r29, 0xFF ; 255 1e9ba: 68 81 ld r22, Y 1e9bc: 79 81 ldd r23, Y+1 ; 0x01 1e9be: 8a 81 ldd r24, Y+2 ; 0x02 1e9c0: 9b 81 ldd r25, Y+3 ; 0x03 1e9c2: c5 58 subi r28, 0x85 ; 133 1e9c4: d0 40 sbci r29, 0x00 ; 0 1e9c6: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1e9ca: a5 01 movw r20, r10 1e9cc: 94 01 movw r18, r8 1e9ce: 0f 94 0a e1 call 0x3c214 ; 0x3c214 } 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) { 1e9d2: 2d ec ldi r18, 0xCD ; 205 1e9d4: 3c ec ldi r19, 0xCC ; 204 1e9d6: 4c e4 ldi r20, 0x4C ; 76 1e9d8: 5f e3 ldi r21, 0x3F ; 63 1e9da: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1e9de: 18 16 cp r1, r24 1e9e0: 0c f4 brge .+2 ; 0x1e9e4 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1e9e2: 1e ef ldi r17, 0xFE ; 254 1e9e4: 38 e0 ldi r19, 0x08 ; 8 1e9e6: 23 0e add r2, r19 1e9e8: 31 1c adc r3, r1 1e9ea: 6c 96 adiw r28, 0x1c ; 28 1e9ec: 4e ad ldd r20, Y+62 ; 0x3e 1e9ee: 5f ad ldd r21, Y+63 ; 0x3f 1e9f0: 6c 97 sbiw r28, 0x1c ; 28 1e9f2: 48 5f subi r20, 0xF8 ; 248 1e9f4: 5f 4f sbci r21, 0xFF ; 255 1e9f6: 6c 96 adiw r28, 0x1c ; 28 1e9f8: 5f af std Y+63, r21 ; 0x3f 1e9fa: 4e af std Y+62, r20 ; 0x3e 1e9fc: 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) { 1e9fe: a8 96 adiw r28, 0x28 ; 40 1ea00: 8e ad ldd r24, Y+62 ; 0x3e 1ea02: 9f ad ldd r25, Y+63 ; 0x3f 1ea04: a8 97 sbiw r28, 0x28 ; 40 1ea06: 82 15 cp r24, r2 1ea08: 93 05 cpc r25, r3 1ea0a: 09 f0 breq .+2 ; 0x1ea0e 1ea0c: 50 cf rjmp .-352 ; 0x1e8ae MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1ea0e: 11 11 cpse r17, r1 1ea10: 62 c1 rjmp .+708 ; 0x1ecd6 #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); 1ea12: a2 96 adiw r28, 0x22 ; 34 1ea14: 2c ad ldd r18, Y+60 ; 0x3c 1ea16: 3d ad ldd r19, Y+61 ; 0x3d 1ea18: 4e ad ldd r20, Y+62 ; 0x3e 1ea1a: 5f ad ldd r21, Y+63 ; 0x3f 1ea1c: a2 97 sbiw r28, 0x22 ; 34 1ea1e: a6 96 adiw r28, 0x26 ; 38 1ea20: 6c ad ldd r22, Y+60 ; 0x3c 1ea22: 7d ad ldd r23, Y+61 ; 0x3d 1ea24: 8e ad ldd r24, Y+62 ; 0x3e 1ea26: 9f ad ldd r25, Y+63 ; 0x3f 1ea28: a6 97 sbiw r28, 0x26 ; 38 1ea2a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1ea2e: 20 e0 ldi r18, 0x00 ; 0 1ea30: 30 e0 ldi r19, 0x00 ; 0 1ea32: 40 e0 ldi r20, 0x00 ; 0 1ea34: 5f e3 ldi r21, 0x3F ; 63 1ea36: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1ea3a: 6b 01 movw r12, r22 1ea3c: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1ea3e: 0f 94 68 df call 0x3bed0 ; 0x3bed0 1ea42: a2 96 adiw r28, 0x22 ; 34 1ea44: 6c af std Y+60, r22 ; 0x3c 1ea46: 7d af std Y+61, r23 ; 0x3d 1ea48: 8e af std Y+62, r24 ; 0x3e 1ea4a: 9f af std Y+63, r25 ; 0x3f 1ea4c: a2 97 sbiw r28, 0x22 ; 34 1ea4e: 60 93 be 13 sts 0x13BE, r22 ; 0x8013be 1ea52: 70 93 bf 13 sts 0x13BF, r23 ; 0x8013bf 1ea56: 80 93 c0 13 sts 0x13C0, r24 ; 0x8013c0 1ea5a: 90 93 c1 13 sts 0x13C1, r25 ; 0x8013c1 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1ea5e: c7 01 movw r24, r14 1ea60: b6 01 movw r22, r12 1ea62: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 1ea66: a6 96 adiw r28, 0x26 ; 38 1ea68: 6c af std Y+60, r22 ; 0x3c 1ea6a: 7d af std Y+61, r23 ; 0x3d 1ea6c: 8e af std Y+62, r24 ; 0x3e 1ea6e: 9f af std Y+63, r25 ; 0x3f 1ea70: a6 97 sbiw r28, 0x26 ; 38 1ea72: 60 93 c2 13 sts 0x13C2, r22 ; 0x8013c2 1ea76: 70 93 c3 13 sts 0x13C3, r23 ; 0x8013c3 1ea7a: 80 93 c4 13 sts 0x13C4, r24 ; 0x8013c4 1ea7e: 90 93 c5 13 sts 0x13C5, r25 ; 0x8013c5 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1ea82: 9b 01 movw r18, r22 1ea84: ac 01 movw r20, r24 1ea86: 50 58 subi r21, 0x80 ; 128 1ea88: aa 96 adiw r28, 0x2a ; 42 1ea8a: 2c af std Y+60, r18 ; 0x3c 1ea8c: 3d af std Y+61, r19 ; 0x3d 1ea8e: 4e af std Y+62, r20 ; 0x3e 1ea90: 5f af std Y+63, r21 ; 0x3f 1ea92: aa 97 sbiw r28, 0x2a ; 42 1ea94: 20 93 c6 13 sts 0x13C6, r18 ; 0x8013c6 1ea98: 30 93 c7 13 sts 0x13C7, r19 ; 0x8013c7 1ea9c: 40 93 c8 13 sts 0x13C8, r20 ; 0x8013c8 1eaa0: 50 93 c9 13 sts 0x13C9, r21 ; 0x8013c9 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1eaa4: a2 96 adiw r28, 0x22 ; 34 1eaa6: 8c ad ldd r24, Y+60 ; 0x3c 1eaa8: 9d ad ldd r25, Y+61 ; 0x3d 1eaaa: ae ad ldd r26, Y+62 ; 0x3e 1eaac: bf ad ldd r27, Y+63 ; 0x3f 1eaae: a2 97 sbiw r28, 0x22 ; 34 1eab0: 80 93 ca 13 sts 0x13CA, r24 ; 0x8013ca 1eab4: 90 93 cb 13 sts 0x13CB, r25 ; 0x8013cb 1eab8: a0 93 cc 13 sts 0x13CC, r26 ; 0x8013cc 1eabc: b0 93 cd 13 sts 0x13CD, r27 ; 0x8013cd // Refresh the offset. cntr[0] = 0.f; 1eac0: 10 92 ce 13 sts 0x13CE, r1 ; 0x8013ce 1eac4: 10 92 cf 13 sts 0x13CF, r1 ; 0x8013cf 1eac8: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 1eacc: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 cntr[1] = 0.f; 1ead0: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 1ead4: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1ead8: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 1eadc: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 float wx = 0.f; 1eae0: 41 2c mov r4, r1 1eae2: 51 2c mov r5, r1 1eae4: 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]; 1eae6: cf 56 subi r28, 0x6F ; 111 1eae8: df 4f sbci r29, 0xFF ; 255 1eaea: a8 81 ld r26, Y 1eaec: b9 81 ldd r27, Y+1 ; 0x01 1eaee: c1 59 subi r28, 0x91 ; 145 1eaf0: d0 40 sbci r29, 0x00 ; 0 1eaf2: 11 96 adiw r26, 0x01 ; 1 1eaf4: 8d 90 ld r8, X+ 1eaf6: 9d 90 ld r9, X+ 1eaf8: ad 90 ld r10, X+ 1eafa: bc 90 ld r11, X 1eafc: 14 97 sbiw r26, 0x04 ; 4 1eafe: 15 96 adiw r26, 0x05 ; 5 1eb00: 2d 91 ld r18, X+ 1eb02: 3d 91 ld r19, X+ 1eb04: 4d 91 ld r20, X+ 1eb06: 5c 91 ld r21, X 1eb08: 18 97 sbiw r26, 0x08 ; 8 1eb0a: 6e 96 adiw r28, 0x1e ; 30 1eb0c: 2c af std Y+60, r18 ; 0x3c 1eb0e: 3d af std Y+61, r19 ; 0x3d 1eb10: 4e af std Y+62, r20 ; 0x3e 1eb12: 5f af std Y+63, r21 ; 0x3f 1eb14: 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); 1eb16: cd 56 subi r28, 0x6D ; 109 1eb18: df 4f sbci r29, 0xFF ; 255 1eb1a: e8 81 ld r30, Y 1eb1c: f9 81 ldd r31, Y+1 ; 0x01 1eb1e: c3 59 subi r28, 0x93 ; 147 1eb20: d0 40 sbci r29, 0x00 ; 0 1eb22: c5 90 lpm r12, Z+ 1eb24: d5 90 lpm r13, Z+ 1eb26: e5 90 lpm r14, Z+ 1eb28: 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]; 1eb2a: a5 01 movw r20, r10 1eb2c: 94 01 movw r18, r8 1eb2e: a2 96 adiw r28, 0x22 ; 34 1eb30: 6c ad ldd r22, Y+60 ; 0x3c 1eb32: 7d ad ldd r23, Y+61 ; 0x3d 1eb34: 8e ad ldd r24, Y+62 ; 0x3e 1eb36: 9f ad ldd r25, Y+63 ; 0x3f 1eb38: a2 97 sbiw r28, 0x22 ; 34 1eb3a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1eb3e: ae 96 adiw r28, 0x2e ; 46 1eb40: 6c af std Y+60, r22 ; 0x3c 1eb42: 7d af std Y+61, r23 ; 0x3d 1eb44: 8e af std Y+62, r24 ; 0x3e 1eb46: 9f af std Y+63, r25 ; 0x3f 1eb48: ae 97 sbiw r28, 0x2e ; 46 1eb4a: 6e 96 adiw r28, 0x1e ; 30 1eb4c: 2c ad ldd r18, Y+60 ; 0x3c 1eb4e: 3d ad ldd r19, Y+61 ; 0x3d 1eb50: 4e ad ldd r20, Y+62 ; 0x3e 1eb52: 5f ad ldd r21, Y+63 ; 0x3f 1eb54: 6e 97 sbiw r28, 0x1e ; 30 1eb56: aa 96 adiw r28, 0x2a ; 42 1eb58: 6c ad ldd r22, Y+60 ; 0x3c 1eb5a: 7d ad ldd r23, Y+61 ; 0x3d 1eb5c: 8e ad ldd r24, Y+62 ; 0x3e 1eb5e: 9f ad ldd r25, Y+63 ; 0x3f 1eb60: aa 97 sbiw r28, 0x2a ; 42 1eb62: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1eb66: 9b 01 movw r18, r22 1eb68: ac 01 movw r20, r24 1eb6a: ae 96 adiw r28, 0x2e ; 46 1eb6c: 6c ad ldd r22, Y+60 ; 0x3c 1eb6e: 7d ad ldd r23, Y+61 ; 0x3d 1eb70: 8e ad ldd r24, Y+62 ; 0x3e 1eb72: 9f ad ldd r25, Y+63 ; 0x3f 1eb74: ae 97 sbiw r28, 0x2e ; 46 1eb76: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1eb7a: 9b 01 movw r18, r22 1eb7c: 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); 1eb7e: c7 01 movw r24, r14 1eb80: b6 01 movw r22, r12 1eb82: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1eb86: 20 91 ce 13 lds r18, 0x13CE ; 0x8013ce 1eb8a: 30 91 cf 13 lds r19, 0x13CF ; 0x8013cf 1eb8e: 40 91 d0 13 lds r20, 0x13D0 ; 0x8013d0 1eb92: 50 91 d1 13 lds r21, 0x13D1 ; 0x8013d1 1eb96: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1eb9a: 6b 01 movw r12, r22 1eb9c: 7c 01 movw r14, r24 1eb9e: c0 92 ce 13 sts 0x13CE, r12 ; 0x8013ce 1eba2: d0 92 cf 13 sts 0x13CF, r13 ; 0x8013cf 1eba6: e0 92 d0 13 sts 0x13D0, r14 ; 0x8013d0 1ebaa: f0 92 d1 13 sts 0x13D1, r15 ; 0x8013d1 wx += w; 1ebae: 20 e0 ldi r18, 0x00 ; 0 1ebb0: 30 e0 ldi r19, 0x00 ; 0 1ebb2: 40 e8 ldi r20, 0x80 ; 128 1ebb4: 5f e3 ldi r21, 0x3F ; 63 1ebb6: c3 01 movw r24, r6 1ebb8: b2 01 movw r22, r4 1ebba: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1ebbe: 2b 01 movw r4, r22 1ebc0: 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); 1ebc2: cd 56 subi r28, 0x6D ; 109 1ebc4: df 4f sbci r29, 0xFF ; 255 1ebc6: e8 81 ld r30, Y 1ebc8: f9 81 ldd r31, Y+1 ; 0x01 1ebca: c3 59 subi r28, 0x93 ; 147 1ebcc: d0 40 sbci r29, 0x00 ; 0 1ebce: 34 96 adiw r30, 0x04 ; 4 1ebd0: 25 91 lpm r18, Z+ 1ebd2: 35 91 lpm r19, Z+ 1ebd4: 45 91 lpm r20, Z+ 1ebd6: 54 91 lpm r21, Z 1ebd8: ae 96 adiw r28, 0x2e ; 46 1ebda: 2c af std Y+60, r18 ; 0x3c 1ebdc: 3d af std Y+61, r19 ; 0x3d 1ebde: 4e af std Y+62, r20 ; 0x3e 1ebe0: 5f af std Y+63, r21 ; 0x3f 1ebe2: 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]; 1ebe4: a5 01 movw r20, r10 1ebe6: 94 01 movw r18, r8 1ebe8: a6 96 adiw r28, 0x26 ; 38 1ebea: 6c ad ldd r22, Y+60 ; 0x3c 1ebec: 7d ad ldd r23, Y+61 ; 0x3d 1ebee: 8e ad ldd r24, Y+62 ; 0x3e 1ebf0: 9f ad ldd r25, Y+63 ; 0x3f 1ebf2: a6 97 sbiw r28, 0x26 ; 38 1ebf4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1ebf8: 4b 01 movw r8, r22 1ebfa: 5c 01 movw r10, r24 1ebfc: 6e 96 adiw r28, 0x1e ; 30 1ebfe: 2c ad ldd r18, Y+60 ; 0x3c 1ec00: 3d ad ldd r19, Y+61 ; 0x3d 1ec02: 4e ad ldd r20, Y+62 ; 0x3e 1ec04: 5f ad ldd r21, Y+63 ; 0x3f 1ec06: 6e 97 sbiw r28, 0x1e ; 30 1ec08: a2 96 adiw r28, 0x22 ; 34 1ec0a: 6c ad ldd r22, Y+60 ; 0x3c 1ec0c: 7d ad ldd r23, Y+61 ; 0x3d 1ec0e: 8e ad ldd r24, Y+62 ; 0x3e 1ec10: 9f ad ldd r25, Y+63 ; 0x3f 1ec12: a2 97 sbiw r28, 0x22 ; 34 1ec14: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1ec18: 9b 01 movw r18, r22 1ec1a: ac 01 movw r20, r24 1ec1c: c5 01 movw r24, r10 1ec1e: b4 01 movw r22, r8 1ec20: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1ec24: 9b 01 movw r18, r22 1ec26: 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); 1ec28: ae 96 adiw r28, 0x2e ; 46 1ec2a: 6c ad ldd r22, Y+60 ; 0x3c 1ec2c: 7d ad ldd r23, Y+61 ; 0x3d 1ec2e: 8e ad ldd r24, Y+62 ; 0x3e 1ec30: 9f ad ldd r25, Y+63 ; 0x3f 1ec32: ae 97 sbiw r28, 0x2e ; 46 1ec34: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1ec38: 20 91 d2 13 lds r18, 0x13D2 ; 0x8013d2 1ec3c: 30 91 d3 13 lds r19, 0x13D3 ; 0x8013d3 1ec40: 40 91 d4 13 lds r20, 0x13D4 ; 0x8013d4 1ec44: 50 91 d5 13 lds r21, 0x13D5 ; 0x8013d5 1ec48: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1ec4c: 4b 01 movw r8, r22 1ec4e: 5c 01 movw r10, r24 1ec50: 80 92 d2 13 sts 0x13D2, r8 ; 0x8013d2 1ec54: 90 92 d3 13 sts 0x13D3, r9 ; 0x8013d3 1ec58: a0 92 d4 13 sts 0x13D4, r10 ; 0x8013d4 1ec5c: b0 92 d5 13 sts 0x13D5, r11 ; 0x8013d5 1ec60: cf 56 subi r28, 0x6F ; 111 1ec62: df 4f sbci r29, 0xFF ; 255 1ec64: 48 81 ld r20, Y 1ec66: 59 81 ldd r21, Y+1 ; 0x01 1ec68: c1 59 subi r28, 0x91 ; 145 1ec6a: d0 40 sbci r29, 0x00 ; 0 1ec6c: 48 5f subi r20, 0xF8 ; 248 1ec6e: 5f 4f sbci r21, 0xFF ; 255 1ec70: cf 56 subi r28, 0x6F ; 111 1ec72: df 4f sbci r29, 0xFF ; 255 1ec74: 59 83 std Y+1, r21 ; 0x01 1ec76: 48 83 st Y, r20 1ec78: c1 59 subi r28, 0x91 ; 145 1ec7a: d0 40 sbci r29, 0x00 ; 0 1ec7c: cd 56 subi r28, 0x6D ; 109 1ec7e: df 4f sbci r29, 0xFF ; 255 1ec80: 88 81 ld r24, Y 1ec82: 99 81 ldd r25, Y+1 ; 0x01 1ec84: c3 59 subi r28, 0x93 ; 147 1ec86: d0 40 sbci r29, 0x00 ; 0 1ec88: 08 96 adiw r24, 0x08 ; 8 1ec8a: cd 56 subi r28, 0x6D ; 109 1ec8c: df 4f sbci r29, 0xFF ; 255 1ec8e: 99 83 std Y+1, r25 ; 0x01 1ec90: 88 83 st Y, r24 1ec92: c3 59 subi r28, 0x93 ; 147 1ec94: 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) { 1ec96: 24 16 cp r2, r20 1ec98: 35 06 cpc r3, r21 1ec9a: 09 f0 breq .+2 ; 0x1ec9e 1ec9c: 24 cf rjmp .-440 ; 0x1eae6 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1ec9e: a3 01 movw r20, r6 1eca0: 92 01 movw r18, r4 1eca2: c7 01 movw r24, r14 1eca4: b6 01 movw r22, r12 1eca6: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1ecaa: 60 93 ce 13 sts 0x13CE, r22 ; 0x8013ce 1ecae: 70 93 cf 13 sts 0x13CF, r23 ; 0x8013cf 1ecb2: 80 93 d0 13 sts 0x13D0, r24 ; 0x8013d0 1ecb6: 90 93 d1 13 sts 0x13D1, r25 ; 0x8013d1 cntr[1] /= wy; 1ecba: a3 01 movw r20, r6 1ecbc: 92 01 movw r18, r4 1ecbe: c5 01 movw r24, r10 1ecc0: b4 01 movw r22, r8 1ecc2: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1ecc6: 60 93 d2 13 sts 0x13D2, r22 ; 0x8013d2 1ecca: 70 93 d3 13 sts 0x13D3, r23 ; 0x8013d3 1ecce: 80 93 d4 13 sts 0x13D4, r24 ; 0x8013d4 1ecd2: 90 93 d5 13 sts 0x13D5, r25 ; 0x8013d5 #endif // SUPPORT_VERBOSITY } // Invert the transformation matrix made of vec_x, vec_y and cntr. { float d = vec_x[0] * vec_y[1] - vec_x[1] * vec_y[0]; 1ecd6: 40 90 be 13 lds r4, 0x13BE ; 0x8013be 1ecda: 50 90 bf 13 lds r5, 0x13BF ; 0x8013bf 1ecde: 60 90 c0 13 lds r6, 0x13C0 ; 0x8013c0 1ece2: 70 90 c1 13 lds r7, 0x13C1 ; 0x8013c1 1ece6: c0 90 ca 13 lds r12, 0x13CA ; 0x8013ca 1ecea: d0 90 cb 13 lds r13, 0x13CB ; 0x8013cb 1ecee: e0 90 cc 13 lds r14, 0x13CC ; 0x8013cc 1ecf2: f0 90 cd 13 lds r15, 0x13CD ; 0x8013cd 1ecf6: 20 91 c2 13 lds r18, 0x13C2 ; 0x8013c2 1ecfa: 30 91 c3 13 lds r19, 0x13C3 ; 0x8013c3 1ecfe: 40 91 c4 13 lds r20, 0x13C4 ; 0x8013c4 1ed02: 50 91 c5 13 lds r21, 0x13C5 ; 0x8013c5 1ed06: a2 96 adiw r28, 0x22 ; 34 1ed08: 2c af std Y+60, r18 ; 0x3c 1ed0a: 3d af std Y+61, r19 ; 0x3d 1ed0c: 4e af std Y+62, r20 ; 0x3e 1ed0e: 5f af std Y+63, r21 ; 0x3f 1ed10: a2 97 sbiw r28, 0x22 ; 34 1ed12: 80 91 c6 13 lds r24, 0x13C6 ; 0x8013c6 1ed16: 90 91 c7 13 lds r25, 0x13C7 ; 0x8013c7 1ed1a: a0 91 c8 13 lds r26, 0x13C8 ; 0x8013c8 1ed1e: b0 91 c9 13 lds r27, 0x13C9 ; 0x8013c9 1ed22: a6 96 adiw r28, 0x26 ; 38 1ed24: 8c af std Y+60, r24 ; 0x3c 1ed26: 9d af std Y+61, r25 ; 0x3d 1ed28: ae af std Y+62, r26 ; 0x3e 1ed2a: bf af std Y+63, r27 ; 0x3f 1ed2c: a6 97 sbiw r28, 0x26 ; 38 1ed2e: a7 01 movw r20, r14 1ed30: 96 01 movw r18, r12 1ed32: c3 01 movw r24, r6 1ed34: b2 01 movw r22, r4 1ed36: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1ed3a: 4b 01 movw r8, r22 1ed3c: 5c 01 movw r10, r24 1ed3e: a6 96 adiw r28, 0x26 ; 38 1ed40: 2c ad ldd r18, Y+60 ; 0x3c 1ed42: 3d ad ldd r19, Y+61 ; 0x3d 1ed44: 4e ad ldd r20, Y+62 ; 0x3e 1ed46: 5f ad ldd r21, Y+63 ; 0x3f 1ed48: a6 97 sbiw r28, 0x26 ; 38 1ed4a: a2 96 adiw r28, 0x22 ; 34 1ed4c: 6c ad ldd r22, Y+60 ; 0x3c 1ed4e: 7d ad ldd r23, Y+61 ; 0x3d 1ed50: 8e ad ldd r24, Y+62 ; 0x3e 1ed52: 9f ad ldd r25, Y+63 ; 0x3f 1ed54: a2 97 sbiw r28, 0x22 ; 34 1ed56: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1ed5a: 9b 01 movw r18, r22 1ed5c: ac 01 movw r20, r24 1ed5e: c5 01 movw r24, r10 1ed60: b4 01 movw r22, r8 1ed62: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 1ed66: 4b 01 movw r8, r22 1ed68: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1ed6a: ac 01 movw r20, r24 1ed6c: 9b 01 movw r18, r22 1ed6e: c7 01 movw r24, r14 1ed70: b6 01 movw r22, r12 1ed72: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1ed76: 6b 01 movw r12, r22 1ed78: 7c 01 movw r14, r24 1ed7a: a6 96 adiw r28, 0x26 ; 38 1ed7c: 6c ad ldd r22, Y+60 ; 0x3c 1ed7e: 7d ad ldd r23, Y+61 ; 0x3d 1ed80: 8e ad ldd r24, Y+62 ; 0x3e 1ed82: 9f ad ldd r25, Y+63 ; 0x3f 1ed84: a6 97 sbiw r28, 0x26 ; 38 1ed86: 90 58 subi r25, 0x80 ; 128 1ed88: a5 01 movw r20, r10 1ed8a: 94 01 movw r18, r8 1ed8c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1ed90: a6 96 adiw r28, 0x26 ; 38 1ed92: 6c af std Y+60, r22 ; 0x3c 1ed94: 7d af std Y+61, r23 ; 0x3d 1ed96: 8e af std Y+62, r24 ; 0x3e 1ed98: 9f af std Y+63, r25 ; 0x3f 1ed9a: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1ed9c: a2 96 adiw r28, 0x22 ; 34 1ed9e: 6c ad ldd r22, Y+60 ; 0x3c 1eda0: 7d ad ldd r23, Y+61 ; 0x3d 1eda2: 8e ad ldd r24, Y+62 ; 0x3e 1eda4: 9f ad ldd r25, Y+63 ; 0x3f 1eda6: a2 97 sbiw r28, 0x22 ; 34 1eda8: 90 58 subi r25, 0x80 ; 128 1edaa: a5 01 movw r20, r10 1edac: 94 01 movw r18, r8 1edae: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1edb2: aa 96 adiw r28, 0x2a ; 42 1edb4: 6c af std Y+60, r22 ; 0x3c 1edb6: 7d af std Y+61, r23 ; 0x3d 1edb8: 8e af std Y+62, r24 ; 0x3e 1edba: 9f af std Y+63, r25 ; 0x3f 1edbc: aa 97 sbiw r28, 0x2a ; 42 1edbe: a5 01 movw r20, r10 1edc0: 94 01 movw r18, r8 1edc2: c3 01 movw r24, r6 1edc4: b2 01 movw r22, r4 1edc6: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 1edca: 4b 01 movw r8, r22 1edcc: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1edce: 40 90 ce 13 lds r4, 0x13CE ; 0x8013ce 1edd2: 50 90 cf 13 lds r5, 0x13CF ; 0x8013cf 1edd6: 60 90 d0 13 lds r6, 0x13D0 ; 0x8013d0 1edda: 70 90 d1 13 lds r7, 0x13D1 ; 0x8013d1 1edde: 20 91 d2 13 lds r18, 0x13D2 ; 0x8013d2 1ede2: 30 91 d3 13 lds r19, 0x13D3 ; 0x8013d3 1ede6: 40 91 d4 13 lds r20, 0x13D4 ; 0x8013d4 1edea: 50 91 d5 13 lds r21, 0x13D5 ; 0x8013d5 1edee: a2 96 adiw r28, 0x22 ; 34 1edf0: 2c af std Y+60, r18 ; 0x3c 1edf2: 3d af std Y+61, r19 ; 0x3d 1edf4: 4e af std Y+62, r20 ; 0x3e 1edf6: 5f af std Y+63, r21 ; 0x3f 1edf8: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1edfa: c0 92 be 13 sts 0x13BE, r12 ; 0x8013be 1edfe: d0 92 bf 13 sts 0x13BF, r13 ; 0x8013bf 1ee02: e0 92 c0 13 sts 0x13C0, r14 ; 0x8013c0 1ee06: f0 92 c1 13 sts 0x13C1, r15 ; 0x8013c1 vec_x[1] = Ainv[1][0]; 1ee0a: aa 96 adiw r28, 0x2a ; 42 1ee0c: 8c ad ldd r24, Y+60 ; 0x3c 1ee0e: 9d ad ldd r25, Y+61 ; 0x3d 1ee10: ae ad ldd r26, Y+62 ; 0x3e 1ee12: bf ad ldd r27, Y+63 ; 0x3f 1ee14: aa 97 sbiw r28, 0x2a ; 42 1ee16: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 1ee1a: 90 93 c3 13 sts 0x13C3, r25 ; 0x8013c3 1ee1e: a0 93 c4 13 sts 0x13C4, r26 ; 0x8013c4 1ee22: b0 93 c5 13 sts 0x13C5, r27 ; 0x8013c5 vec_y[0] = Ainv[0][1]; 1ee26: a6 96 adiw r28, 0x26 ; 38 1ee28: 2c ad ldd r18, Y+60 ; 0x3c 1ee2a: 3d ad ldd r19, Y+61 ; 0x3d 1ee2c: 4e ad ldd r20, Y+62 ; 0x3e 1ee2e: 5f ad ldd r21, Y+63 ; 0x3f 1ee30: a6 97 sbiw r28, 0x26 ; 38 1ee32: 20 93 c6 13 sts 0x13C6, r18 ; 0x8013c6 1ee36: 30 93 c7 13 sts 0x13C7, r19 ; 0x8013c7 1ee3a: 40 93 c8 13 sts 0x13C8, r20 ; 0x8013c8 1ee3e: 50 93 c9 13 sts 0x13C9, r21 ; 0x8013c9 vec_y[1] = Ainv[1][1]; 1ee42: 80 92 ca 13 sts 0x13CA, r8 ; 0x8013ca 1ee46: 90 92 cb 13 sts 0x13CB, r9 ; 0x8013cb 1ee4a: a0 92 cc 13 sts 0x13CC, r10 ; 0x8013cc 1ee4e: b0 92 cd 13 sts 0x13CD, r11 ; 0x8013cd float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, { -vec_x[1] / d, vec_x[0] / d } }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ee52: c7 01 movw r24, r14 1ee54: b6 01 movw r22, r12 1ee56: 90 58 subi r25, 0x80 ; 128 1ee58: a3 01 movw r20, r6 1ee5a: 92 01 movw r18, r4 1ee5c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1ee60: 6b 01 movw r12, r22 1ee62: 7c 01 movw r14, r24 1ee64: a2 96 adiw r28, 0x22 ; 34 1ee66: 2c ad ldd r18, Y+60 ; 0x3c 1ee68: 3d ad ldd r19, Y+61 ; 0x3d 1ee6a: 4e ad ldd r20, Y+62 ; 0x3e 1ee6c: 5f ad ldd r21, Y+63 ; 0x3f 1ee6e: a2 97 sbiw r28, 0x22 ; 34 1ee70: a6 96 adiw r28, 0x26 ; 38 1ee72: 6c ad ldd r22, Y+60 ; 0x3c 1ee74: 7d ad ldd r23, Y+61 ; 0x3d 1ee76: 8e ad ldd r24, Y+62 ; 0x3e 1ee78: 9f ad ldd r25, Y+63 ; 0x3f 1ee7a: a6 97 sbiw r28, 0x26 ; 38 1ee7c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1ee80: 9b 01 movw r18, r22 1ee82: ac 01 movw r20, r24 1ee84: c7 01 movw r24, r14 1ee86: b6 01 movw r22, r12 1ee88: 0f 94 6d de call 0x3bcda ; 0x3bcda <__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]; 1ee8c: 60 93 ce 13 sts 0x13CE, r22 ; 0x8013ce 1ee90: 70 93 cf 13 sts 0x13CF, r23 ; 0x8013cf 1ee94: 80 93 d0 13 sts 0x13D0, r24 ; 0x8013d0 1ee98: 90 93 d1 13 sts 0x13D1, r25 ; 0x8013d1 { vec_y[1] / d, -vec_y[0] / d }, { -vec_x[1] / d, vec_x[0] / d } }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] 1ee9c: aa 96 adiw r28, 0x2a ; 42 1ee9e: 6c ad ldd r22, Y+60 ; 0x3c 1eea0: 7d ad ldd r23, Y+61 ; 0x3d 1eea2: 8e ad ldd r24, Y+62 ; 0x3e 1eea4: 9f ad ldd r25, Y+63 ; 0x3f 1eea6: aa 97 sbiw r28, 0x2a ; 42 1eea8: 90 58 subi r25, 0x80 ; 128 1eeaa: a3 01 movw r20, r6 1eeac: 92 01 movw r18, r4 1eeae: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1eeb2: 6b 01 movw r12, r22 1eeb4: 7c 01 movw r14, r24 1eeb6: a2 96 adiw r28, 0x22 ; 34 1eeb8: 2c ad ldd r18, Y+60 ; 0x3c 1eeba: 3d ad ldd r19, Y+61 ; 0x3d 1eebc: 4e ad ldd r20, Y+62 ; 0x3e 1eebe: 5f ad ldd r21, Y+63 ; 0x3f 1eec0: a2 97 sbiw r28, 0x22 ; 34 1eec2: c5 01 movw r24, r10 1eec4: b4 01 movw r22, r8 1eec6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1eeca: 9b 01 movw r18, r22 1eecc: ac 01 movw r20, r24 1eece: c7 01 movw r24, r14 1eed0: b6 01 movw r22, r12 1eed2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__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]; 1eed6: 60 93 d2 13 sts 0x13D2, r22 ; 0x8013d2 1eeda: 70 93 d3 13 sts 0x13D3, r23 ; 0x8013d3 1eede: 80 93 d4 13 sts 0x13D4, r24 ; 0x8013d4 1eee2: 90 93 d5 13 sts 0x13D5, r25 ; 0x8013d5 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); } result = calculate_machine_skew_and_offset_LS(pts, 4, bed_ref_points_4, vec_x, vec_y, cntr, verbosity_level); delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 1eee6: 90 e0 ldi r25, 0x00 ; 0 1eee8: 80 e0 ldi r24, 0x00 ; 0 1eeea: 0e 94 98 8e call 0x11d30 ; 0x11d30 if (result >= 0) { 1eeee: 17 fd sbrc r17, 7 1eef0: d5 c0 rjmp .+426 ; 0x1f09c DBG(_n("Calibration success.\n")); 1eef2: 8e e8 ldi r24, 0x8E ; 142 1eef4: 9e e6 ldi r25, 0x6E ; 110 1eef6: 9f 93 push r25 1eef8: 8f 93 push r24 1eefa: 0f 94 08 dc call 0x3b810 ; 0x3b810 world2machine_update(vec_x, vec_y, cntr); 1eefe: 4e ec ldi r20, 0xCE ; 206 1ef00: 53 e1 ldi r21, 0x13 ; 19 1ef02: 66 ec ldi r22, 0xC6 ; 198 1ef04: 73 e1 ldi r23, 0x13 ; 19 1ef06: 8e eb ldi r24, 0xBE ; 190 1ef08: 93 e1 ldi r25, 0x13 ; 19 1ef0a: 0f 94 e3 c9 call 0x393c6 ; 0x393c6 #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); 1ef0e: 48 e0 ldi r20, 0x08 ; 8 1ef10: 50 e0 ldi r21, 0x00 ; 0 1ef12: 65 ee ldi r22, 0xE5 ; 229 1ef14: 7f e0 ldi r23, 0x0F ; 15 1ef16: 8e ec ldi r24, 0xCE ; 206 1ef18: 93 e1 ldi r25, 0x13 ; 19 1ef1a: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 1ef1e: 48 e0 ldi r20, 0x08 ; 8 1ef20: 50 e0 ldi r21, 0x00 ; 0 1ef22: 6d ed ldi r22, 0xDD ; 221 1ef24: 7f e0 ldi r23, 0x0F ; 15 1ef26: 8e eb ldi r24, 0xBE ; 190 1ef28: 93 e1 ldi r25, 0x13 ; 19 1ef2a: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 1ef2e: 48 e0 ldi r20, 0x08 ; 8 1ef30: 50 e0 ldi r21, 0x00 ; 0 1ef32: 65 ed ldi r22, 0xD5 ; 213 1ef34: 7f e0 ldi r23, 0x0F ; 15 1ef36: 86 ec ldi r24, 0xC6 ; 198 1ef38: 93 e1 ldi r25, 0x13 ; 19 1ef3a: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 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(); 1ef3e: 0f 94 68 c9 call 0x392d0 ; 0x392d0 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1ef42: 0f 90 pop r0 1ef44: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1ef46: c7 55 subi r28, 0x57 ; 87 1ef48: df 4f sbci r29, 0xFF ; 255 1ef4a: 88 81 ld r24, Y 1ef4c: 99 81 ldd r25, Y+1 ; 0x01 1ef4e: c9 5a subi r28, 0xA9 ; 169 1ef50: d0 40 sbci r29, 0x00 ; 0 1ef52: 0e 94 94 67 call 0xcf28 ; 0xcf28 // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1ef56: 80 e0 ldi r24, 0x00 ; 0 1ef58: 90 e0 ldi r25, 0x00 ; 0 1ef5a: a0 ea ldi r26, 0xA0 ; 160 1ef5c: b0 e4 ldi r27, 0x40 ; 64 1ef5e: 80 93 48 07 sts 0x0748, r24 ; 0x800748 1ef62: 90 93 49 07 sts 0x0749, r25 ; 0x800749 1ef66: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 1ef6a: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1ef6e: 60 e0 ldi r22, 0x00 ; 0 1ef70: 70 e0 ldi r23, 0x00 ; 0 1ef72: 80 ea ldi r24, 0xA0 ; 160 1ef74: 91 e4 ldi r25, 0x41 ; 65 1ef76: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 1ef7a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 //#ifndef NEW_XYZCAL if (result >= 0) 1ef7e: 17 fd sbrc r17, 7 1ef80: 22 c0 rjmp .+68 ; 0x1efc6 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; 1ef82: 10 92 48 07 sts 0x0748, r1 ; 0x800748 1ef86: 10 92 49 07 sts 0x0749, r1 ; 0x800749 1ef8a: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a 1ef8e: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b destination[Z_AXIS] = 150.F; 1ef92: 80 e0 ldi r24, 0x00 ; 0 1ef94: 90 e0 ldi r25, 0x00 ; 0 1ef96: a6 e1 ldi r26, 0x16 ; 22 1ef98: b3 e4 ldi r27, 0x43 ; 67 1ef9a: 80 93 59 05 sts 0x0559, r24 ; 0x800559 1ef9e: 90 93 5a 05 sts 0x055A, r25 ; 0x80055a 1efa2: a0 93 5b 05 sts 0x055B, r26 ; 0x80055b 1efa6: b0 93 5c 05 sts 0x055C, r27 ; 0x80055c plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1efaa: 65 e5 ldi r22, 0x55 ; 85 1efac: 75 e5 ldi r23, 0x55 ; 85 1efae: 85 e5 ldi r24, 0x55 ; 85 1efb0: 91 e4 ldi r25, 0x41 ; 65 1efb2: 0f 94 15 ba call 0x3742a ; 0x3742a lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1efb6: 83 e9 ldi r24, 0x93 ; 147 1efb8: 97 e4 ldi r25, 0x47 ; 71 1efba: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1efbe: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 // 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()) 1efc2: 0f 94 77 c7 call 0x38eee ; 0x38eee st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1efc6: 81 e0 ldi r24, 0x01 ; 1 1efc8: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_update(2); 1efcc: 82 e0 ldi r24, 0x02 ; 2 1efce: 0e 94 6d 6f call 0xdeda ; 0xdeda 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)); 1efd2: 84 e5 ldi r24, 0x54 ; 84 1efd4: 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) { 1efd6: 1f 3f cpi r17, 0xFF ; 255 1efd8: 99 f0 breq .+38 ; 0x1f000 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) { 1efda: 1e 3f cpi r17, 0xFE ; 254 1efdc: 09 f0 breq .+2 ; 0x1efe0 1efde: 73 c0 rjmp .+230 ; 0x1f0c6 if (point_too_far_mask == 0) 1efe0: af 96 adiw r28, 0x2f ; 47 1efe2: 4f ad ldd r20, Y+63 ; 0x3f 1efe4: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1efe6: 8f e1 ldi r24, 0x1F ; 31 1efe8: 97 e4 ldi r25, 0x47 ; 71 { const char *msg = NULL; if (result == BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND) { lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND)); } else if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED) { if (point_too_far_mask == 0) 1efea: 44 23 and r20, r20 1efec: 49 f0 breq .+18 ; 0x1f000 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1efee: af 96 adiw r28, 0x2f ; 47 1eff0: 5f ad ldd r21, Y+63 ; 0x3f 1eff2: 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); 1eff4: 8d ed ldi r24, 0xDD ; 221 1eff6: 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) 1eff8: 52 30 cpi r21, 0x02 ; 2 1effa: 11 f0 breq .+4 ; 0x1f000 // 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); 1effc: 86 e9 ldi r24, 0x96 ; 150 1effe: 96 e4 ldi r25, 0x46 ; 70 1f000: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1f004: 0c 94 dc ea jmp 0x1d5b8 ; 0x1d5b8 (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]) : 1f008: f2 01 movw r30, r4 1f00a: 25 81 ldd r18, Z+5 ; 0x05 1f00c: 36 81 ldd r19, Z+6 ; 0x06 1f00e: 47 81 ldd r20, Z+7 ; 0x07 1f010: 50 85 ldd r21, Z+8 ; 0x08 1f012: c3 58 subi r28, 0x83 ; 131 1f014: df 4f sbci r29, 0xFF ; 255 1f016: 68 81 ld r22, Y 1f018: 79 81 ldd r23, Y+1 ; 0x01 1f01a: 8a 81 ldd r24, Y+2 ; 0x02 1f01c: 9b 81 ldd r25, Y+3 ; 0x03 1f01e: cd 57 subi r28, 0x7D ; 125 1f020: d0 40 sbci r29, 0x00 ; 0 1f022: 0c 94 3e ef jmp 0x1de7c ; 0x1de7c // 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]) : 1f026: f2 01 movw r30, r4 1f028: 25 81 ldd r18, Z+5 ; 0x05 1f02a: 36 81 ldd r19, Z+6 ; 0x06 1f02c: 47 81 ldd r20, Z+7 ; 0x07 1f02e: 50 85 ldd r21, Z+8 ; 0x08 1f030: ed 96 adiw r28, 0x3d ; 61 1f032: 6c ad ldd r22, Y+60 ; 0x3c 1f034: 7d ad ldd r23, Y+61 ; 0x3d 1f036: 8e ad ldd r24, Y+62 ; 0x3e 1f038: 9f ad ldd r25, Y+63 ; 0x3f 1f03a: ed 97 sbiw r28, 0x3d ; 61 1f03c: b8 c0 rjmp .+368 ; 0x1f1ae (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1f03e: f2 01 movw r30, r4 1f040: 25 81 ldd r18, Z+5 ; 0x05 1f042: 36 81 ldd r19, Z+6 ; 0x06 1f044: 47 81 ldd r20, Z+7 ; 0x07 1f046: 50 85 ldd r21, Z+8 ; 0x08 1f048: ed 96 adiw r28, 0x3d ; 61 1f04a: 6c ad ldd r22, Y+60 ; 0x3c 1f04c: 7d ad ldd r23, Y+61 ; 0x3d 1f04e: 8e ad ldd r24, Y+62 ; 0x3e 1f050: 9f ad ldd r25, Y+63 ; 0x3f 1f052: ed 97 sbiw r28, 0x3d ; 61 1f054: c6 c0 rjmp .+396 ; 0x1f1e2 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]) : 1f056: a3 01 movw r20, r6 1f058: 92 01 movw r18, r4 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 a6 ef jmp 0x1df4c ; 0x1df4c // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1f06e: 81 2c mov r8, r1 1f070: 91 2c mov r9, r1 1f072: 20 e8 ldi r18, 0x80 ; 128 1f074: a2 2e mov r10, r18 1f076: 2f e3 ldi r18, 0x3F ; 63 1f078: b2 2e mov r11, r18 1f07a: 0c 94 aa ef jmp 0x1df54 ; 0x1df54 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1f07e: c1 2c mov r12, r1 1f080: d1 2c mov r13, r1 1f082: 76 01 movw r14, r12 1f084: 0c 94 21 f0 jmp 0x1e042 ; 0x1e042 ((r == 1) ? 1.f : 1f088: c1 2c mov r12, r1 1f08a: d1 2c mov r13, r1 1f08c: 90 e8 ldi r25, 0x80 ; 128 1f08e: e9 2e mov r14, r25 1f090: 9f e3 ldi r25, 0x3F ; 63 1f092: f9 2e mov r15, r25 1f094: 0c 94 21 f0 jmp 0x1e042 ; 0x1e042 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; 1f098: 12 e0 ldi r17, 0x02 ; 2 1f09a: a7 cb rjmp .-2226 ; 0x1e7ea } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1f09c: 1e 3f cpi r17, 0xFE ; 254 1f09e: 89 f4 brne .+34 ; 0x1f0c2 1f0a0: af 96 adiw r28, 0x2f ; 47 1f0a2: 3f ad ldd r19, Y+63 ; 0x3f 1f0a4: af 97 sbiw r28, 0x2f ; 47 1f0a6: 32 30 cpi r19, 0x02 ; 2 1f0a8: 09 f0 breq .+2 ; 0x1f0ac 1f0aa: 4d cf rjmp .-358 ; 0x1ef46 DBG(_n("Fitting failed => calibration failed.\n")); 1f0ac: 87 e6 ldi r24, 0x67 ; 103 1f0ae: 9e e6 ldi r25, 0x6E ; 110 1f0b0: 9f 93 push r25 1f0b2: 8f 93 push r24 1f0b4: 0f 94 08 dc call 0x3b810 ; 0x3b810 1f0b8: 44 cf rjmp .-376 ; 0x1ef42 // 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; 1f0ba: af 96 adiw r28, 0x2f ; 47 1f0bc: 1f ae std Y+63, r1 ; 0x3f 1f0be: af 97 sbiw r28, 0x2f ; 47 1f0c0: 42 cf rjmp .-380 ; 0x1ef46 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1f0c2: 1f ef ldi r17, 0xFF ; 255 1f0c4: 40 cf rjmp .-384 ; 0x1ef46 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) { 1f0c6: af 96 adiw r28, 0x2f ; 47 1f0c8: 6f ad ldd r22, Y+63 ; 0x3f 1f0ca: af 97 sbiw r28, 0x2f ; 47 1f0cc: 61 11 cpse r22, r1 1f0ce: 13 c0 rjmp .+38 ; 0x1f0f6 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); 1f0d0: 8b e7 ldi r24, 0x7B ; 123 1f0d2: 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) { 1f0d4: 11 30 cpi r17, 0x01 ; 1 1f0d6: 51 f0 breq .+20 ; 0x1f0ec 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); 1f0d8: 88 e3 ldi r24, 0x38 ; 56 1f0da: 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) { 1f0dc: 12 30 cpi r17, 0x02 ; 2 1f0de: 31 f0 breq .+12 ; 0x1f0ec default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1f0e0: 8f e1 ldi r24, 0x1F ; 31 1f0e2: 97 e4 ldi r25, 0x47 ; 71 // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); } if (point_too_far_mask == 0 || result > 0) { switch (result) { 1f0e4: 11 11 cpse r17, r1 1f0e6: 02 c0 rjmp .+4 ; 0x1f0ec 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); 1f0e8: 80 ec ldi r24, 0xC0 ; 192 1f0ea: 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); 1f0ec: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 break; } lcd_show_fullscreen_message_and_wait_P(msg); 1f0f0: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 1f0f4: 0d c0 rjmp .+26 ; 0x1f110 // 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) 1f0f6: af 96 adiw r28, 0x2f ; 47 1f0f8: 8f ad ldd r24, Y+63 ; 0x3f 1f0fa: af 97 sbiw r28, 0x2f ; 47 1f0fc: 82 30 cpi r24, 0x02 ; 2 1f0fe: f1 f4 brne .+60 ; 0x1f13c // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1f100: 8f e4 ldi r24, 0x4F ; 79 1f102: 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); 1f104: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 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); 1f108: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 } if (point_too_far_mask == 0 || result > 0) { 1f10c: 11 16 cp r1, r17 1f10e: 04 f3 brlt .-64 ; 0x1f0d0 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1f110: 1f 3f cpi r17, 0xFF ; 255 1f112: 11 f4 brne .+4 ; 0x1f118 1f114: 0c 94 e5 e7 jmp 0x1cfca ; 0x1cfca { // 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); 1f118: 86 e0 ldi r24, 0x06 ; 6 1f11a: 0e 94 3a e7 call 0x1ce74 ; 0x1ce74 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1f11e: 8f e5 ldi r24, 0x5F ; 95 1f120: 9f e0 ldi r25, 0x0F ; 15 1f122: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1f126: 81 11 cpse r24, r1 1f128: 0c 94 f6 ea jmp 0x1d5ec ; 0x1d5ec lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1f12c: 8a eb ldi r24, 0xBA ; 186 1f12e: 97 e4 ldi r25, 0x47 ; 71 1f130: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1f134: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 1f138: 0c 94 f6 ea jmp 0x1d5ec ; 0x1d5ec 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); 1f13c: 83 e0 ldi r24, 0x03 ; 3 1f13e: 96 e4 ldi r25, 0x46 ; 70 1f140: e1 cf rjmp .-62 ; 0x1f104 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)) 1f142: 89 81 ldd r24, Y+1 ; 0x01 1f144: 9a 81 ldd r25, Y+2 ; 0x02 1f146: 80 37 cpi r24, 0x70 ; 112 1f148: 98 40 sbci r25, 0x08 ; 8 1f14a: 10 f0 brcs .+4 ; 0x1f150 1f14c: 0c 94 35 eb jmp 0x1d66a ; 0x1d66a if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1f150: ae 01 movw r20, r28 1f152: 4f 5f subi r20, 0xFF ; 255 1f154: 5f 4f sbci r21, 0xFF ; 255 1f156: 7a 01 movw r14, r20 1f158: 04 eb ldi r16, 0xB4 ; 180 1f15a: 10 e0 ldi r17, 0x00 ; 0 1f15c: 24 e8 ldi r18, 0x84 ; 132 1f15e: 33 e0 ldi r19, 0x03 ; 3 1f160: a6 01 movw r20, r12 1f162: 48 5c subi r20, 0xC8 ; 200 1f164: 51 09 sbc r21, r1 1f166: 69 2d mov r22, r9 1f168: 78 2d mov r23, r8 1f16a: 8b 2d mov r24, r11 1f16c: 9a 2d mov r25, r10 1f16e: 0f 94 cc 94 call 0x32998 ; 0x32998 1f172: 88 23 and r24, r24 1f174: 11 f4 brne .+4 ; 0x1f17a 1f176: 0c 94 35 eb jmp 0x1d66a ; 0x1d66a ad += 1440; 1f17a: 89 81 ldd r24, Y+1 ; 0x01 1f17c: 9a 81 ldd r25, Y+2 ; 0x02 1f17e: 80 56 subi r24, 0x60 ; 96 1f180: 9a 4f sbci r25, 0xFA ; 250 1f182: 0c 94 bf e9 jmp 0x1d37e ; 0x1d37e 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) { 1f186: 00 23 and r16, r16 1f188: 11 f4 brne .+4 ; 0x1f18e 1f18a: 0c 94 51 ef jmp 0x1dea2 ; 0x1dea2 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1f18e: 02 30 cpi r16, 0x02 ; 2 1f190: 09 f0 breq .+2 ; 0x1f194 1f192: 49 cf rjmp .-366 ; 0x1f026 1f194: d2 01 movw r26, r4 1f196: 11 96 adiw r26, 0x01 ; 1 1f198: 2d 91 ld r18, X+ 1f19a: 3d 91 ld r19, X+ 1f19c: 4d 91 ld r20, X+ 1f19e: 5c 91 ld r21, X 1f1a0: 14 97 sbiw r26, 0x04 ; 4 1f1a2: 6e 96 adiw r28, 0x1e ; 30 1f1a4: 6c ad ldd r22, Y+60 ; 0x3c 1f1a6: 7d ad ldd r23, Y+61 ; 0x3d 1f1a8: 8e ad ldd r24, Y+62 ; 0x3e 1f1aa: 9f ad ldd r25, Y+63 ; 0x3f 1f1ac: 6e 97 sbiw r28, 0x1e ; 30 1f1ae: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1f1b2: 4b 01 movw r8, r22 1f1b4: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1f1b6: 60 e0 ldi r22, 0x00 ; 0 1f1b8: 70 e0 ldi r23, 0x00 ; 0 1f1ba: 80 e8 ldi r24, 0x80 ; 128 1f1bc: 9f e3 ldi r25, 0x3F ; 63 1f1be: 11 30 cpi r17, 0x01 ; 1 1f1c0: 91 f0 breq .+36 ; 0x1f1e6 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1f1c2: 12 30 cpi r17, 0x02 ; 2 1f1c4: 09 f0 breq .+2 ; 0x1f1c8 1f1c6: 3b cf rjmp .-394 ; 0x1f03e 1f1c8: d2 01 movw r26, r4 1f1ca: 11 96 adiw r26, 0x01 ; 1 1f1cc: 2d 91 ld r18, X+ 1f1ce: 3d 91 ld r19, X+ 1f1d0: 4d 91 ld r20, X+ 1f1d2: 5c 91 ld r21, X 1f1d4: 14 97 sbiw r26, 0x04 ; 4 1f1d6: 6e 96 adiw r28, 0x1e ; 30 1f1d8: 6c ad ldd r22, Y+60 ; 0x3c 1f1da: 7d ad ldd r23, Y+61 ; 0x3d 1f1dc: 8e ad ldd r24, Y+62 ; 0x3e 1f1de: 9f ad ldd r25, Y+63 ; 0x3f 1f1e0: 6e 97 sbiw r28, 0x1e ; 30 1f1e2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1f1e6: 9b 01 movw r18, r22 1f1e8: ac 01 movw r20, r24 1f1ea: c5 01 movw r24, r10 1f1ec: b4 01 movw r22, r8 1f1ee: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 1f1f2: 9b 01 movw r18, r22 1f1f4: ac 01 movw r20, r24 1f1f6: c7 01 movw r24, r14 1f1f8: b6 01 movw r22, r12 1f1fa: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 1f1fe: 6b 01 movw r12, r22 1f200: 7c 01 movw r14, r24 1f202: 0c 94 51 ef jmp 0x1dea2 ; 0x1dea2 // 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 : 1f206: 81 2c mov r8, r1 1f208: 91 2c mov r9, r1 1f20a: 50 e8 ldi r21, 0x80 ; 128 1f20c: a5 2e mov r10, r21 1f20e: 5f e3 ldi r21, 0x3F ; 63 1f210: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1f212: 11 11 cpse r17, r1 1f214: 0c 94 2b ef jmp 0x1de56 ; 0x1de56 ((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; 1f218: 20 e0 ldi r18, 0x00 ; 0 1f21a: 30 e0 ldi r19, 0x00 ; 0 1f21c: 40 e8 ldi r20, 0x80 ; 128 1f21e: 5f e3 ldi r21, 0x3F ; 63 1f220: ea cf rjmp .-44 ; 0x1f1f6 } // 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) { 1f222: 11 11 cpse r17, r1 1f224: b4 cf rjmp .-152 ; 0x1f18e 1f226: 0c 94 51 ef jmp 0x1dea2 ; 0x1dea2 float a = (r == 1) ? 1.f : 1f22a: 81 2c mov r8, r1 1f22c: 91 2c mov r9, r1 1f22e: 40 e8 ldi r20, 0x80 ; 128 1f230: a4 2e mov r10, r20 1f232: 4f e3 ldi r20, 0x3F ; 63 1f234: 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) { 1f236: 11 11 cpse r17, r1 1f238: be cf rjmp .-132 ; 0x1f1b6 1f23a: 0c 94 51 ef jmp 0x1dea2 ; 0x1dea2 0001f23e : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1f23e: cf 93 push r28 1f240: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1f242: 86 ea ldi r24, 0xA6 ; 166 1f244: 9c e0 ldi r25, 0x0C ; 12 1f246: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c return ((status & components) == components); 1f24a: 98 2f mov r25, r24 1f24c: 9c 23 and r25, r28 1f24e: 81 e0 ldi r24, 0x01 ; 1 1f250: 9c 13 cpse r25, r28 1f252: 80 e0 ldi r24, 0x00 ; 0 } 1f254: cf 91 pop r28 1f256: 08 95 ret 0001f258 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1f258: 0f 93 push r16 1f25a: 1f 93 push r17 1f25c: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1f25e: 0e 94 72 d0 call 0x1a0e4 ; 0x1a0e4 if (*str != '.') 1f262: fc 01 movw r30, r24 1f264: 20 81 ld r18, Z 1f266: 2e 32 cpi r18, 0x2E ; 46 1f268: 11 f0 breq .+4 ; 0x1f26e 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 1f26a: 80 e0 ldi r24, 0x00 ; 0 1f26c: 34 c0 rjmp .+104 ; 0x1f2d6 // 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); 1f26e: b8 01 movw r22, r16 1f270: 6e 5f subi r22, 0xFE ; 254 1f272: 7f 4f sbci r23, 0xFF ; 255 1f274: 01 96 adiw r24, 0x01 ; 1 1f276: 0e 94 72 d0 call 0x1a0e4 ; 0x1a0e4 if (*str != '.') 1f27a: fc 01 movw r30, r24 1f27c: 20 81 ld r18, Z 1f27e: 2e 32 cpi r18, 0x2E ; 46 1f280: a1 f7 brne .-24 ; 0x1f26a return false; ++str; } str = Number(str, version + 2); 1f282: b8 01 movw r22, r16 1f284: 6c 5f subi r22, 0xFC ; 252 1f286: 7f 4f sbci r23, 0xFF ; 255 1f288: 01 96 adiw r24, 0x01 ; 1 1f28a: 0e 94 72 d0 call 0x1a0e4 ; 0x1a0e4 version[3] = FIRMWARE_REVISION_RELEASED; 1f28e: 20 e4 ldi r18, 0x40 ; 64 1f290: 30 e0 ldi r19, 0x00 ; 0 1f292: f8 01 movw r30, r16 1f294: 37 83 std Z+7, r19 ; 0x07 1f296: 26 83 std Z+6, r18 ; 0x06 1f298: fc 01 movw r30, r24 1f29a: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1f29c: 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'; 1f29e: 89 2f mov r24, r25 1f2a0: 8f 7d andi r24, 0xDF ; 223 1f2a2: c1 f1 breq .+112 ; 0x1f314 1f2a4: 87 ef ldi r24, 0xF7 ; 247 1f2a6: 89 0f add r24, r25 1f2a8: 82 30 cpi r24, 0x02 ; 2 1f2aa: a0 f1 brcs .+104 ; 0x1f314 1f2ac: 9d 30 cpi r25, 0x0D ; 13 1f2ae: 91 f1 breq .+100 ; 0x1f314 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 == '-'){ 1f2b0: 9d 32 cpi r25, 0x2D ; 45 1f2b2: 99 f7 brne .-26 ; 0x1f29a // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f2b4: 11 96 adiw r26, 0x01 ; 1 1f2b6: 9c 91 ld r25, X 1f2b8: 92 34 cpi r25, 0x42 ; 66 1f2ba: e1 f0 breq .+56 ; 0x1f2f4 1f2bc: 7c f4 brge .+30 ; 0x1f2dc 1f2be: 91 34 cpi r25, 0x41 ; 65 1f2c0: a1 f6 brne .-88 ; 0x1f26a 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); 1f2c2: 0a 5f subi r16, 0xFA ; 250 1f2c4: 1f 4f sbci r17, 0xFF ; 255 1f2c6: 28 e0 ldi r18, 0x08 ; 8 1f2c8: 30 e0 ldi r19, 0x00 ; 0 1f2ca: 45 e0 ldi r20, 0x05 ; 5 1f2cc: 62 e9 ldi r22, 0x92 ; 146 1f2ce: 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); 1f2d0: cf 01 movw r24, r30 1f2d2: 0e 94 47 d2 call 0x1a48e ; 0x1a48e // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1f2d6: 1f 91 pop r17 1f2d8: 0f 91 pop r16 1f2da: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f2dc: 94 34 cpi r25, 0x44 ; 68 1f2de: 91 f0 breq .+36 ; 0x1f304 1f2e0: 92 35 cpi r25, 0x52 ; 82 1f2e2: 19 f6 brne .-122 ; 0x1f26a 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); 1f2e4: 0a 5f subi r16, 0xFA ; 250 1f2e6: 1f 4f sbci r17, 0xFF ; 255 1f2e8: 20 e2 ldi r18, 0x20 ; 32 1f2ea: 30 e0 ldi r19, 0x00 ; 0 1f2ec: 42 e0 ldi r20, 0x02 ; 2 1f2ee: 66 e8 ldi r22, 0x86 ; 134 1f2f0: 7d e8 ldi r23, 0x8D ; 141 1f2f2: ee cf rjmp .-36 ; 0x1f2d0 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); 1f2f4: 0a 5f subi r16, 0xFA ; 250 1f2f6: 1f 4f sbci r17, 0xFF ; 255 1f2f8: 20 e1 ldi r18, 0x10 ; 16 1f2fa: 30 e0 ldi r19, 0x00 ; 0 1f2fc: 44 e0 ldi r20, 0x04 ; 4 1f2fe: 6d e8 ldi r22, 0x8D ; 141 1f300: 7d e8 ldi r23, 0x8D ; 141 1f302: e6 cf rjmp .-52 ; 0x1f2d0 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); 1f304: 0a 5f subi r16, 0xFA ; 250 1f306: 1f 4f sbci r17, 0xFF ; 255 1f308: 30 e0 ldi r19, 0x00 ; 0 1f30a: 20 e0 ldi r18, 0x00 ; 0 1f30c: 43 e0 ldi r20, 0x03 ; 3 1f30e: 69 e8 ldi r22, 0x89 ; 137 1f310: 7d e8 ldi r23, 0x8D ; 141 1f312: de cf rjmp .-68 ; 0x1f2d0 // 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; 1f314: 81 e0 ldi r24, 0x01 ; 1 1f316: df cf rjmp .-66 ; 0x1f2d6 0001f318 : 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)) { 1f318: 0f 93 push r16 1f31a: 1f 93 push r17 1f31c: cf 93 push r28 1f31e: df 93 push r29 1f320: eb 01 movw r28, r22 1f322: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1f324: 81 30 cpi r24, 0x01 ; 1 1f326: 81 f0 breq .+32 ; 0x1f348 1f328: 82 30 cpi r24, 0x02 ; 2 1f32a: 89 f0 breq .+34 ; 0x1f34e case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1f32c: 84 e2 ldi r24, 0x24 ; 36 1f32e: 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); 1f330: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1f334: 22 e0 ldi r18, 0x02 ; 2 1f336: a8 01 movw r20, r16 1f338: bc 01 movw r22, r24 1f33a: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1f33c: df 91 pop r29 1f33e: cf 91 pop r28 1f340: 1f 91 pop r17 1f342: 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); 1f344: 0d 94 54 d0 jmp 0x3a0a8 ; 0x3a0a8 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); 1f348: 8d e1 ldi r24, 0x1D ; 29 1f34a: 90 e4 ldi r25, 0x40 ; 64 1f34c: f1 cf rjmp .-30 ; 0x1f330 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1f34e: 84 e1 ldi r24, 0x14 ; 20 1f350: 90 e4 ldi r25, 0x40 ; 64 1f352: ee cf rjmp .-36 ; 0x1f330 0001f354 : /// (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 ) 1f354: 84 e0 ldi r24, 0x04 ; 4 1f356: 9d e0 ldi r25, 0x0D ; 13 1f358: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1f35c: 8a 32 cpi r24, 0x2A ; 42 1f35e: 39 f4 brne .+14 ; 0x1f36e 1f360: 8a e2 ldi r24, 0x2A ; 42 1f362: 9d e0 ldi r25, 0x0D ; 13 1f364: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1f368: 91 e0 ldi r25, 0x01 ; 1 1f36a: 81 30 cpi r24, 0x01 ; 1 1f36c: 09 f0 breq .+2 ; 0x1f370 1f36e: 90 e0 ldi r25, 0x00 ; 0 } 1f370: 89 2f mov r24, r25 1f372: 08 95 ret 0001f374
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f374: cf 93 push r28 1f376: df 93 push r29 1f378: cd b7 in r28, 0x3d ; 61 1f37a: de b7 in r29, 0x3e ; 62 1f37c: 67 97 sbiw r28, 0x17 ; 23 1f37e: 0f b6 in r0, 0x3f ; 63 1f380: f8 94 cli 1f382: de bf out 0x3e, r29 ; 62 1f384: 0f be out 0x3f, r0 ; 63 1f386: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f388: 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); 1f38a: 84 b5 in r24, 0x24 ; 36 1f38c: 82 60 ori r24, 0x02 ; 2 1f38e: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f390: 84 b5 in r24, 0x24 ; 36 1f392: 81 60 ori r24, 0x01 ; 1 1f394: 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); 1f396: 85 b5 in r24, 0x25 ; 37 1f398: 82 60 ori r24, 0x02 ; 2 1f39a: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f39c: 85 b5 in r24, 0x25 ; 37 1f39e: 81 60 ori r24, 0x01 ; 1 1f3a0: 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); 1f3a2: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f3a6: 81 60 ori r24, 0x01 ; 1 1f3a8: 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; 1f3ac: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f3b0: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f3b4: 82 60 ori r24, 0x02 ; 2 1f3b6: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f3ba: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f3be: 81 60 ori r24, 0x01 ; 1 1f3c0: 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); 1f3c4: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f3c8: 81 60 ori r24, 0x01 ; 1 1f3ca: 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); 1f3ce: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f3d2: 84 60 ori r24, 0x04 ; 4 1f3d4: 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); 1f3d8: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f3dc: 81 60 ori r24, 0x01 ; 1 1f3de: 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 1f3e2: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f3e6: 82 60 ori r24, 0x02 ; 2 1f3e8: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f3ec: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f3f0: 81 60 ori r24, 0x01 ; 1 1f3f2: 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 1f3f6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f3fa: 81 60 ori r24, 0x01 ; 1 1f3fc: 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 1f400: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f404: 82 60 ori r24, 0x02 ; 2 1f406: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f40a: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f40e: 81 60 ori r24, 0x01 ; 1 1f410: 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 1f414: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f418: 81 60 ori r24, 0x01 ; 1 1f41a: 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 1f41e: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f422: 82 60 ori r24, 0x02 ; 2 1f424: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f428: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f42c: 81 60 ori r24, 0x01 ; 1 1f42e: 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 1f432: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f436: 81 60 ori r24, 0x01 ; 1 1f438: 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); 1f43c: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f440: 84 60 ori r24, 0x04 ; 4 1f442: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f446: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f44a: 82 60 ori r24, 0x02 ; 2 1f44c: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f450: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f454: 81 60 ori r24, 0x01 ; 1 1f456: 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); 1f45a: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f45e: 80 68 ori r24, 0x80 ; 128 1f460: 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; 1f464: 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) { 1f468: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f46a: f8 94 cli wdt_reset(); 1f46c: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f46e: 84 b7 in r24, 0x34 ; 52 1f470: 87 7f andi r24, 0xF7 ; 247 1f472: 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" ); 1f474: 0f b6 in r0, 0x3f ; 63 1f476: f8 94 cli 1f478: a8 95 wdr 1f47a: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f47e: 88 61 ori r24, 0x18 ; 24 1f480: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f484: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f488: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f48a: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f48c: 9f b7 in r25, 0x3f ; 63 1f48e: 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 1f490: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f494: 84 e0 ldi r24, 0x04 ; 4 1f496: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f49e: 81 60 ori r24, 0x01 ; 1 1f4a0: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f4a8: 8d 7f andi r24, 0xFD ; 253 1f4aa: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f4b2: 8b 7f andi r24, 0xFB ; 251 1f4b4: 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; 1f4b8: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f4bc: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f4be: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f4c0: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f4c2: 6a e0 ldi r22, 0x0A ; 10 1f4c4: 70 e0 ldi r23, 0x00 ; 0 1f4c6: 80 e0 ldi r24, 0x00 ; 0 1f4c8: 90 e0 ldi r25, 0x00 ; 0 1f4ca: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 backlightSupport = !READ(LCD_BL_PIN); 1f4ce: 9c b1 in r25, 0x0c ; 12 1f4d0: 81 e0 ldi r24, 0x01 ; 1 1f4d2: 29 2f mov r18, r25 1f4d4: 28 70 andi r18, 0x08 ; 8 1f4d6: 93 fd sbrc r25, 3 1f4d8: 80 e0 ldi r24, 0x00 ; 0 1f4da: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb if (!backlightSupport) return; 1f4de: 21 11 cpse r18, r1 1f4e0: 22 c0 rjmp .+68 ; 0x1f526 //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f4e2: 62 e0 ldi r22, 0x02 ; 2 1f4e4: 82 e3 ldi r24, 0x32 ; 50 1f4e6: 9d e0 ldi r25, 0x0D ; 13 1f4e8: 0e 94 a5 77 call 0xef4a ; 0xef4a 1f4ec: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, LCD_BACKLIGHT_LEVEL_HIGH); 1f4f0: 62 e8 ldi r22, 0x82 ; 130 1f4f2: 84 e3 ldi r24, 0x34 ; 52 1f4f4: 9d e0 ldi r25, 0x0D ; 13 1f4f6: 0e 94 a5 77 call 0xef4a ; 0xef4a 1f4fa: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, LCD_BACKLIGHT_LEVEL_LOW); 1f4fe: 62 e3 ldi r22, 0x32 ; 50 1f500: 83 e3 ldi r24, 0x33 ; 51 1f502: 9d e0 ldi r25, 0x0D ; 13 1f504: 0e 94 a5 77 call 0xef4a ; 0xef4a 1f508: 80 93 f9 03 sts 0x03F9, r24 ; 0x8003f9 backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT); // in seconds 1f50c: 6f e0 ldi r22, 0x0F ; 15 1f50e: 70 e0 ldi r23, 0x00 ; 0 1f510: 80 e3 ldi r24, 0x30 ; 48 1f512: 9d e0 ldi r25, 0x0D ; 13 1f514: 0e 94 8d 77 call 0xef1a ; 0xef1a 1f518: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f51c: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f520: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f522: 0e 94 a6 8b call 0x1174c ; 0x1174c return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f526: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f528: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f52a: 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); 1f52c: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f52e: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f530: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f534: 80 68 ori r24, 0x80 ; 128 1f536: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f53a: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f53c: 80 91 0a 04 lds r24, 0x040A ; 0x80040a <_ZL19lcd_displayfunction.lto_priv.569> 1f540: 88 60 ori r24, 0x08 ; 8 1f542: 80 93 0a 04 sts 0x040A, r24 ; 0x80040a <_ZL19lcd_displayfunction.lto_priv.569> 1f546: 2f ef ldi r18, 0xFF ; 255 1f548: 30 e7 ldi r19, 0x70 ; 112 1f54a: 82 e0 ldi r24, 0x02 ; 2 1f54c: 21 50 subi r18, 0x01 ; 1 1f54e: 30 40 sbci r19, 0x00 ; 0 1f550: 80 40 sbci r24, 0x00 ; 0 1f552: e1 f7 brne .-8 ; 0x1f54c 1f554: 00 c0 rjmp .+0 ; 0x1f556 1f556: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f558: 81 e0 ldi r24, 0x01 ; 1 1f55a: 0e 94 11 70 call 0xe022 ; 0xe022 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f55e: 89 eb ldi r24, 0xB9 ; 185 1f560: 91 e7 ldi r25, 0x71 ; 113 1f562: 90 93 05 04 sts 0x0405, r25 ; 0x800405 <_lcdout+0x9> 1f566: 80 93 04 04 sts 0x0404, r24 ; 0x800404 <_lcdout+0x8> 1f56a: 10 92 07 04 sts 0x0407, r1 ; 0x800407 <_lcdout+0xb> 1f56e: 10 92 06 04 sts 0x0406, r1 ; 0x800406 <_lcdout+0xa> 1f572: 12 e0 ldi r17, 0x02 ; 2 1f574: 10 93 ff 03 sts 0x03FF, r17 ; 0x8003ff <_lcdout+0x3> 1f578: 10 92 09 04 sts 0x0409, r1 ; 0x800409 <_lcdout+0xd> 1f57c: 10 92 08 04 sts 0x0408, r1 ; 0x800408 <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f580: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_longpress_func = menu_lcd_longpress_func; 1f584: 8a e4 ldi r24, 0x4A ; 74 1f586: 93 ed ldi r25, 0xD3 ; 211 1f588: 90 93 0f 04 sts 0x040F, r25 ; 0x80040f 1f58c: 80 93 0e 04 sts 0x040E, r24 ; 0x80040e lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f590: 84 ed ldi r24, 0xD4 ; 212 1f592: 9a e3 ldi r25, 0x3A ; 58 1f594: 90 93 0d 04 sts 0x040D, r25 ; 0x80040d 1f598: 80 93 0c 04 sts 0x040C, r24 ; 0x80040c menu_menu = lcd_status_screen; 1f59c: 8c e8 ldi r24, 0x8C ; 140 1f59e: 99 e3 ldi r25, 0x39 ; 57 1f5a0: 90 93 67 0e sts 0x0E67, r25 ; 0x800e67 1f5a4: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 SET_INPUT(BTN_EN1); 1f5a8: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f5ac: 8b 7f andi r24, 0xFB ; 251 1f5ae: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f5b2: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f5b6: 8d 7f andi r24, 0xFD ; 253 1f5b8: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f5bc: 9f b7 in r25, 0x3f ; 63 1f5be: f8 94 cli 1f5c0: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f5c4: 84 60 ori r24, 0x04 ; 4 1f5c6: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f5ca: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f5cc: 9f b7 in r25, 0x3f ; 63 1f5ce: f8 94 cli 1f5d0: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f5d4: 82 60 ori r24, 0x02 ; 2 1f5d6: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f5da: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f5dc: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f5e0: 8f 7b andi r24, 0xBF ; 191 1f5e2: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f5e6: 9f b7 in r25, 0x3f ; 63 1f5e8: f8 94 cli 1f5ea: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f5ee: 80 64 ori r24, 0x40 ; 64 1f5f0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f5f4: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f5f6: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f5fa: 8e 7f andi r24, 0xFE ; 254 1f5fc: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f600: 9f b7 in r25, 0x3f ; 63 1f602: f8 94 cli 1f604: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f608: 81 60 ori r24, 0x01 ; 1 1f60a: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f60e: 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); 1f610: af e9 ldi r26, 0x9F ; 159 1f612: bf e0 ldi r27, 0x0F ; 15 1f614: 11 97 sbiw r26, 0x01 ; 1 1f616: f1 f7 brne .-4 ; 0x1f614 1f618: 00 c0 rjmp .+0 ; 0x1f61a 1f61a: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f61c: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f620: 80 95 com r24 1f622: 81 70 andi r24, 0x01 ; 1 1f624: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f628: 44 e1 ldi r20, 0x14 ; 20 1f62a: 50 e0 ldi r21, 0x00 ; 0 1f62c: 6d ea ldi r22, 0xAD ; 173 1f62e: 70 e7 ldi r23, 0x70 ; 112 1f630: 87 e3 ldi r24, 0x37 ; 55 1f632: 95 e0 ldi r25, 0x05 ; 5 1f634: 0f 94 33 db call 0x3b666 ; 0x3b666 timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f638: 0f 94 05 c0 call 0x3800a ; 0x3800a } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f63c: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f640: 88 ee ldi r24, 0xE8 ; 232 1f642: 9e e8 ldi r25, 0x8E ; 142 1f644: 9f 93 push r25 1f646: 8f 93 push r24 1f648: 8f ee ldi r24, 0xEF ; 239 1f64a: 9e e8 ldi r25, 0x8E ; 142 1f64c: 9f 93 push r25 1f64e: 8f 93 push r24 1f650: 0e 94 7f 6f call 0xdefe ; 0xdefe static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f654: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f658: 84 60 ori r24, 0x04 ; 4 1f65a: 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)); 1f65e: 60 e0 ldi r22, 0x00 ; 0 1f660: 87 ed ldi r24, 0xD7 ; 215 1f662: 9e e0 ldi r25, 0x0E ; 14 1f664: 0e 94 a5 77 call 0xef4a ; 0xef4a 1f668: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1f66c: 60 e0 ldi r22, 0x00 ; 0 1f66e: 88 e0 ldi r24, 0x08 ; 8 1f670: 9f e0 ldi r25, 0x0F ; 15 1f672: 0e 94 a5 77 call 0xef4a ; 0xef4a 1f676: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e MYSERIAL.begin(BAUDRATE); 1f67a: 0e 94 91 db call 0x1b722 ; 0x1b722 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f67e: 87 ee ldi r24, 0xE7 ; 231 1f680: 98 e7 ldi r25, 0x78 ; 120 1f682: 90 93 06 05 sts 0x0506, r25 ; 0x800506 <_uartout+0x9> 1f686: 80 93 05 05 sts 0x0505, r24 ; 0x800505 <_uartout+0x8> 1f68a: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_uartout+0xb> 1f68e: 10 92 07 05 sts 0x0507, r1 ; 0x800507 <_uartout+0xa> 1f692: 10 93 00 05 sts 0x0500, r17 ; 0x800500 <_uartout+0x3> 1f696: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_uartout+0xd> 1f69a: 10 92 09 05 sts 0x0509, r1 ; 0x800509 <_uartout+0xc> stdout = uartout; 1f69e: 8d ef ldi r24, 0xFD ; 253 1f6a0: 94 e0 ldi r25, 0x04 ; 4 1f6a2: 90 93 13 18 sts 0x1813, r25 ; 0x801813 <__iob+0x3> 1f6a6: 80 93 12 18 sts 0x1812, r24 ; 0x801812 <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1f6aa: 0e 94 a6 e4 call 0x1c94c ; 0x1c94c 1f6ae: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1f6b0: 0f 90 pop r0 1f6b2: 0f 90 pop r0 1f6b4: 0f 90 pop r0 1f6b6: 0f 90 pop r0 1f6b8: 8e 01 movw r16, r28 1f6ba: 0f 5f subi r16, 0xFF ; 255 1f6bc: 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; 1f6be: aa 24 eor r10, r10 1f6c0: a3 94 inc r10 if (xflash_success) 1f6c2: 88 23 and r24, r24 1f6c4: 09 f4 brne .+2 ; 0x1f6c8 1f6c6: d8 c0 rjmp .+432 ; 0x1f878 { optiboot_status = optiboot_xflash_enter(); 1f6c8: 0f 94 13 c0 call 0x38026 ; 0x38026 1f6cc: 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)) 1f6ce: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e6> 1f6d2: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e7> 1f6d6: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e8> 1f6da: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e9> 1f6de: 8a 3a cpi r24, 0xAA ; 170 1f6e0: 95 45 sbci r25, 0x55 ; 85 1f6e2: aa 4a sbci r26, 0xAA ; 170 1f6e4: b5 45 sbci r27, 0x55 ; 85 1f6e6: 09 f0 breq .+2 ; 0x1f6ea 1f6e8: bf c0 rjmp .+382 ; 0x1f868 1f6ea: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e5> 1f6ee: 87 ff sbrs r24, 7 1f6f0: bb c0 rjmp .+374 ; 0x1f868 { uint8_t lang = boot_reserved >> 3; 1f6f2: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7e4> 1f6f6: 98 2c mov r9, r8 1f6f8: 96 94 lsr r9 1f6fa: 96 94 lsr r9 1f6fc: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1f6fe: f8 2d mov r31, r8 1f700: f7 70 andi r31, 0x07 ; 7 1f702: 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 1f704: 99 20 and r9, r9 1f706: 09 f4 brne .+2 ; 0x1f70a 1f708: af c0 rjmp .+350 ; 0x1f868 #ifdef XFLASH if (lang == LANG_ID_SEC) 1f70a: 21 e0 ldi r18, 0x01 ; 1 1f70c: 92 12 cpse r9, r18 1f70e: 24 c0 rjmp .+72 ; 0x1f758 { 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 1f710: 40 e1 ldi r20, 0x10 ; 16 1f712: 50 e0 ldi r21, 0x00 ; 0 1f714: 60 e0 ldi r22, 0x00 ; 0 1f716: 71 e0 ldi r23, 0x01 ; 1 1f718: c8 01 movw r24, r16 1f71a: 0f 94 e0 da call 0x3b5c0 ; 0x3b5c0 if (offset) *offset = ui; 1f71e: 60 e0 ldi r22, 0x00 ; 0 1f720: 71 e0 ldi r23, 0x01 ; 1 1f722: 6b 01 movw r12, r22 1f724: f1 2c mov r15, r1 1f726: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 1f728: 89 81 ldd r24, Y+1 ; 0x01 1f72a: 9a 81 ldd r25, Y+2 ; 0x02 1f72c: ab 81 ldd r26, Y+3 ; 0x03 1f72e: bc 81 ldd r27, Y+4 ; 0x04 1f730: 85 3a cpi r24, 0xA5 ; 165 1f732: 9a 45 sbci r25, 0x5A ; 90 1f734: a4 4b sbci r26, 0xB4 ; 180 1f736: bb 44 sbci r27, 0x4B ; 75 1f738: 09 f0 breq .+2 ; 0x1f73c 1f73a: 96 c0 rjmp .+300 ; 0x1f868 { lcd_puts_at_P(1,0,PSTR("Language update")); 1f73c: 4d e1 ldi r20, 0x1D ; 29 1f73e: 5f e8 ldi r21, 0x8F ; 143 1f740: 60 e0 ldi r22, 0x00 ; 0 1f742: 81 e0 ldi r24, 0x01 ; 1 1f744: 0e 94 ba 6f call 0xdf74 ; 0xdf74 for (uint8_t i = 0; i < state; i++) 1f748: 91 2c mov r9, r1 1f74a: 89 14 cp r8, r9 1f74c: 39 f1 breq .+78 ; 0x1f79c } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1f74e: 8e e2 ldi r24, 0x2E ; 46 1f750: 0e 94 55 70 call 0xe0aa ; 0xe0aa 1f754: 93 94 inc r9 1f756: f9 cf rjmp .-14 ; 0x1f74a SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1f758: 8c e5 ldi r24, 0x5C ; 92 1f75a: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1f75c: 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; 1f75e: c1 2c mov r12, r1 1f760: d1 2c mov r13, r1 1f762: 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 1f764: 20 e1 ldi r18, 0x10 ; 16 1f766: 30 e0 ldi r19, 0x00 ; 0 1f768: a8 01 movw r20, r16 1f76a: c7 01 movw r24, r14 1f76c: b6 01 movw r22, r12 1f76e: 0e 94 76 e3 call 0x1c6ec ; 0x1c6ec if (header->magic != LANG_MAGIC) break; //break if not valid 1f772: 89 81 ldd r24, Y+1 ; 0x01 1f774: 9a 81 ldd r25, Y+2 ; 0x02 1f776: ab 81 ldd r26, Y+3 ; 0x03 1f778: bc 81 ldd r27, Y+4 ; 0x04 1f77a: 85 3a cpi r24, 0xA5 ; 165 1f77c: 9a 45 sbci r25, 0x5A ; 90 1f77e: a4 4b sbci r26, 0xB4 ; 180 1f780: bb 44 sbci r27, 0x4B ; 75 1f782: 09 f0 breq .+2 ; 0x1f786 1f784: 71 c0 rjmp .+226 ; 0x1f868 if (offset) *offset = addr; if (--lang == 0) return 1; 1f786: f2 e0 ldi r31, 0x02 ; 2 1f788: 9f 16 cp r9, r31 1f78a: c1 f2 breq .-80 ; 0x1f73c addr += header->size; //calc address of next table 1f78c: 8d 81 ldd r24, Y+5 ; 0x05 1f78e: 9e 81 ldd r25, Y+6 ; 0x06 1f790: c8 0e add r12, r24 1f792: d9 1e adc r13, r25 1f794: e1 1c adc r14, r1 1f796: f1 1c adc r15, r1 1f798: 9a 94 dec r9 1f79a: e4 cf rjmp .-56 ; 0x1f764 lcd_print('.'); _delay(100); 1f79c: 64 e6 ldi r22, 0x64 ; 100 1f79e: 70 e0 ldi r23, 0x00 ; 0 1f7a0: 80 e0 ldi r24, 0x00 ; 0 1f7a2: 90 e0 ldi r25, 0x00 ; 0 1f7a4: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1f7a8: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7e4> 1f7ac: 88 7f andi r24, 0xF8 ; 248 1f7ae: 91 e0 ldi r25, 0x01 ; 1 1f7b0: 98 0d add r25, r8 1f7b2: 97 70 andi r25, 0x07 ; 7 1f7b4: 89 2b or r24, r25 1f7b6: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7e4> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1f7ba: 91 2c mov r9, r1 1f7bc: 98 2c mov r9, r8 1f7be: 88 24 eor r8, r8 1f7c0: 92 94 swap r9 1f7c2: 80 ef ldi r24, 0xF0 ; 240 1f7c4: 98 22 and r9, r24 1f7c6: 8d 81 ldd r24, Y+5 ; 0x05 1f7c8: 9e 81 ldd r25, Y+6 ; 0x06 1f7ca: 88 16 cp r8, r24 1f7cc: 99 06 cpc r9, r25 1f7ce: 08 f0 brcs .+2 ; 0x1f7d2 1f7d0: 46 c0 rjmp .+140 ; 0x1f85e { cli(); 1f7d2: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1f7d4: 0d 81 ldd r16, Y+5 ; 0x05 1f7d6: 1e 81 ldd r17, Y+6 ; 0x06 1f7d8: 08 19 sub r16, r8 1f7da: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1f7dc: 01 30 cpi r16, 0x01 ; 1 1f7de: 20 e1 ldi r18, 0x10 ; 16 1f7e0: 12 07 cpc r17, r18 1f7e2: 10 f0 brcs .+4 ; 0x1f7e8 1f7e4: 00 e0 ldi r16, 0x00 ; 0 1f7e6: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1f7e8: c7 01 movw r24, r14 1f7ea: b6 01 movw r22, r12 1f7ec: 68 0d add r22, r8 1f7ee: 79 1d adc r23, r9 1f7f0: 81 1d adc r24, r1 1f7f2: 91 1d adc r25, r1 1f7f4: 98 01 movw r18, r16 1f7f6: 40 e0 ldi r20, 0x00 ; 0 1f7f8: 58 e0 ldi r21, 0x08 ; 8 1f7fa: 0e 94 76 e3 call 0x1c6ec ; 0x1c6ec } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1f7fe: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1f800: 8a ea ldi r24, 0xAA ; 170 1f802: 95 e5 ldi r25, 0x55 ; 85 1f804: dc 01 movw r26, r24 1f806: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e6> 1f80a: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e7> 1f80e: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e8> 1f812: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e9> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1f816: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e5> 1f81a: 83 60 ori r24, 0x03 ; 3 1f81c: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e5> boot_copy_size = (uint16_t)size; 1f820: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7e3> 1f824: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7e2> boot_src_addr = (uint32_t)rptr; 1f828: 80 e0 ldi r24, 0x00 ; 0 1f82a: 98 e0 ldi r25, 0x08 ; 8 1f82c: a0 e0 ldi r26, 0x00 ; 0 1f82e: b0 e0 ldi r27, 0x00 ; 0 1f830: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7da> 1f834: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7db> 1f838: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7dc> 1f83c: b0 93 f3 1f sts 0x1FF3, r27 ; 0x801ff3 <__bss_end+0x7dd> if (state == 0) { //TODO - check header integrity } bootapp_ram2flash(LANGBOOT_RAMBUFFER, _SEC_LANG_TABLE + state * LANGBOOT_BLOCKSIZE, size); 1f840: c4 01 movw r24, r8 1f842: 80 50 subi r24, 0x00 ; 0 1f844: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1f846: b0 e0 ldi r27, 0x00 ; 0 1f848: a0 e0 ldi r26, 0x00 ; 0 1f84a: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7de> 1f84e: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7df> 1f852: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7e0> 1f856: b0 93 f7 1f sts 0x1FF7, r27 ; 0x801ff7 <__bss_end+0x7e1> for (uint16_t i = 0; i < EEPROM_TOP; i++) { eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); softReset(); 1f85a: 0e 94 12 68 call 0xd024 ; 0xd024 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1f85e: 61 e0 ldi r22, 0x01 ; 1 1f860: 8e ef ldi r24, 0xFE ; 254 1f862: 9f e0 ldi r25, 0x0F ; 15 1f864: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1f868: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e6> 1f86c: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e7> 1f870: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e8> 1f874: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e9> return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 1f878: 0e 94 aa f9 call 0x1f354 ; 0x1f354 setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1f87c: 88 23 and r24, r24 1f87e: 51 f0 breq .+20 ; 0x1f894 //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1f880: 64 e2 ldi r22, 0x24 ; 36 1f882: 86 e6 ldi r24, 0x66 ; 102 1f884: 92 e0 ldi r25, 0x02 ; 2 1f886: 0e 94 cc 68 call 0xd198 ; 0xd198 currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1f88a: 64 e2 ldi r22, 0x24 ; 36 1f88c: 86 e6 ldi r24, 0x66 ; 102 1f88e: 92 e0 ldi r25, 0x02 ; 2 1f890: 0e 94 c4 68 call 0xd188 ; 0xd188 #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); 1f894: 44 e1 ldi r20, 0x14 ; 20 1f896: 50 e0 ldi r21, 0x00 ; 0 1f898: 65 e1 ldi r22, 0x15 ; 21 1f89a: 7d e0 ldi r23, 0x0D ; 13 1f89c: c8 01 movw r24, r16 1f89e: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1f8a2: 8c 89 ldd r24, Y+20 ; 0x14 1f8a4: 81 11 cpse r24, r1 1f8a6: 0a c0 rjmp .+20 ; 0x1f8bc 1f8a8: 44 e0 ldi r20, 0x04 ; 4 1f8aa: 50 e0 ldi r21, 0x00 ; 0 1f8ac: 6d e2 ldi r22, 0x2D ; 45 1f8ae: 70 e9 ldi r23, 0x90 ; 144 1f8b0: c8 01 movw r24, r16 1f8b2: 0f 94 25 db call 0x3b64a ; 0x3b64a 1f8b6: 89 2b or r24, r25 1f8b8: 09 f4 brne .+2 ; 0x1f8bc 1f8ba: 51 c0 rjmp .+162 ; 0x1f95e * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1f8bc: e0 90 1e 05 lds r14, 0x051E ; 0x80051e uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1f8c0: 1d 8a std Y+21, r1 ; 0x15 1f8c2: 1f 8a std Y+23, r1 ; 0x17 1f8c4: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1f8c6: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e timeout.start(); 1f8ca: ce 01 movw r24, r28 1f8cc: 45 96 adiw r24, 0x15 ; 21 1f8ce: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1f8d2: 62 e3 ldi r22, 0x32 ; 50 1f8d4: 70 e0 ldi r23, 0x00 ; 0 1f8d6: 80 e0 ldi r24, 0x00 ; 0 1f8d8: 90 e0 ldi r25, 0x00 ; 0 1f8da: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 // 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; 1f8de: 80 91 92 04 lds r24, 0x0492 ; 0x800492 1f8e2: 90 91 93 04 lds r25, 0x0493 ; 0x800493 1f8e6: 90 93 91 04 sts 0x0491, r25 ; 0x800491 1f8ea: 80 93 90 04 sts 0x0490, r24 ; 0x800490 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1f8ee: 82 e3 ldi r24, 0x32 ; 50 1f8f0: 9f e8 ldi r25, 0x8F ; 143 1f8f2: 0e 94 17 7b call 0xf62e ; 0xf62e 1f8f6: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1f8f8: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1f8fa: 33 e1 ldi r19, 0x13 ; 19 1f8fc: f3 16 cp r15, r19 1f8fe: a1 f0 breq .+40 ; 0x1f928 { if (timeout.expired(250u)) 1f900: 6a ef ldi r22, 0xFA ; 250 1f902: 70 e0 ldi r23, 0x00 ; 0 1f904: ce 01 movw r24, r28 1f906: 45 96 adiw r24, 0x15 ; 21 1f908: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 1f90c: 81 11 cpse r24, r1 1f90e: c1 c0 rjmp .+386 ; 0x1fa92 goto exit; if (MYSERIAL.available() > 0) 1f910: 0e 94 a5 78 call 0xf14a ; 0xf14a 1f914: 18 16 cp r1, r24 1f916: 19 06 cpc r1, r25 1f918: 84 f7 brge .-32 ; 0x1f8fa { SN[rxIndex] = MYSERIAL.read(); 1f91a: 0f 94 4f d6 call 0x3ac9e ; 0x3ac9e 1f91e: d6 01 movw r26, r12 1f920: 8d 93 st X+, r24 1f922: 6d 01 movw r12, r26 rxIndex++; 1f924: f3 94 inc r15 1f926: e9 cf rjmp .-46 ; 0x1f8fa } } SN[rxIndex] = 0; 1f928: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1f92a: 44 e0 ldi r20, 0x04 ; 4 1f92c: 50 e0 ldi r21, 0x00 ; 0 1f92e: 6d e2 ldi r22, 0x2D ; 45 1f930: 7f e8 ldi r23, 0x8F ; 143 1f932: c8 01 movw r24, r16 1f934: 0f 94 25 db call 0x3b64a ; 0x3b64a ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1f938: 89 2b or r24, r25 1f93a: 59 f6 brne .-106 ; 0x1f8d2 1f93c: 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; 1f93e: e0 92 1e 05 sts 0x051E, r14 ; 0x80051e { char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) { if (!get_PRUSA_SN(SN)) 1f942: 88 23 and r24, r24 1f944: 09 f4 brne .+2 ; 0x1f948 1f946: a7 c0 rjmp .+334 ; 0x1fa96 #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); 1f948: 44 e1 ldi r20, 0x14 ; 20 1f94a: 50 e0 ldi r21, 0x00 ; 0 1f94c: 65 e1 ldi r22, 0x15 ; 21 1f94e: 7d e0 ldi r23, 0x0D ; 13 1f950: c8 01 movw r24, r16 1f952: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1f956: 82 e2 ldi r24, 0x22 ; 34 1f958: 90 e9 ldi r25, 0x90 ; 144 } else puts_P(PSTR("SN update failed")); 1f95a: 0f 94 2f dc call 0x3b85e ; 0x3b85e #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1f95e: a1 10 cpse r10, r1 1f960: 04 c0 rjmp .+8 ; 0x1f96a 1f962: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 1f966: 88 23 and r24, r24 1f968: 21 f0 breq .+8 ; 0x1f972 SERIAL_PROTOCOLLNPGM("start"); 1f96a: 8b e0 ldi r24, 0x0B ; 11 1f96c: 90 e9 ldi r25, 0x90 ; 144 1f96e: 0e 94 17 7b call 0xf62e ; 0xf62e #endif SERIAL_ECHO_START; 1f972: 84 e1 ldi r24, 0x14 ; 20 1f974: 9a ea ldi r25, 0xAA ; 170 1f976: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1f97a: 84 ef ldi r24, 0xF4 ; 244 1f97c: 9f e8 ldi r25, 0x8F ; 143 1f97e: 0f 94 2f dc call 0x3b85e ; 0x3b85e // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1f982: 60 e0 ldi r22, 0x00 ; 0 1f984: 8c ea ldi r24, 0xAC ; 172 1f986: 9c e0 ldi r25, 0x0C ; 12 1f988: 0e 94 a5 77 call 0xef4a ; 0xef4a 1f98c: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1f98e: 0e 94 33 db call 0x1b666 ; 0x1b666 } MMU2::mmu2.Status(); 1f992: 0f 94 bc 76 call 0x2ed78 ; 0x2ed78 } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1f996: 85 e3 ldi r24, 0x35 ; 53 1f998: 9f e8 ldi r25, 0x8F ; 143 1f99a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1f99e: 62 e0 ldi r22, 0x02 ; 2 1f9a0: 86 ed ldi r24, 0xD6 ; 214 1f9a2: 9e e0 ldi r25, 0x0E ; 14 1f9a4: 0e 94 a5 77 call 0xef4a ; 0xef4a if (status == (uint8_t)EEPROM::Enabled) 1f9a8: 81 30 cpi r24, 0x01 ; 1 1f9aa: 09 f0 breq .+2 ; 0x1f9ae 1f9ac: 77 c0 rjmp .+238 ; 0x1fa9c { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1f9ae: 84 e8 ldi r24, 0x84 ; 132 1f9b0: 9d e5 ldi r25, 0x5D ; 93 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1f9b2: 0e 94 17 7b call 0xf62e ; 0xf62e #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1f9b6: 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); 1f9b8: f0 fe sbrs r15, 0 1f9ba: 04 c0 rjmp .+8 ; 0x1f9c4 1f9bc: 84 e1 ldi r24, 0x14 ; 20 1f9be: 9e e6 ldi r25, 0x6E ; 110 1f9c0: 0f 94 2f dc call 0x3b85e ; 0x3b85e if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1f9c4: f1 fe sbrs r15, 1 1f9c6: 04 c0 rjmp .+8 ; 0x1f9d0 1f9c8: 84 e0 ldi r24, 0x04 ; 4 1f9ca: 9e e6 ldi r25, 0x6E ; 110 1f9cc: 0f 94 2f dc call 0x3b85e ; 0x3b85e if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1f9d0: f2 fe sbrs r15, 2 1f9d2: 04 c0 rjmp .+8 ; 0x1f9dc 1f9d4: 83 ef ldi r24, 0xF3 ; 243 1f9d6: 9d e6 ldi r25, 0x6D ; 109 1f9d8: 0f 94 2f dc call 0x3b85e ; 0x3b85e if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1f9dc: f3 fe sbrs r15, 3 1f9de: 04 c0 rjmp .+8 ; 0x1f9e8 1f9e0: 83 ee ldi r24, 0xE3 ; 227 1f9e2: 9d e6 ldi r25, 0x6D ; 109 1f9e4: 0f 94 2f dc call 0x3b85e ; 0x3b85e if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1f9e8: f5 fe sbrs r15, 5 1f9ea: 04 c0 rjmp .+8 ; 0x1f9f4 1f9ec: 83 ed ldi r24, 0xD3 ; 211 1f9ee: 9d e6 ldi r25, 0x6D ; 109 1f9f0: 0f 94 2f dc call 0x3b85e ; 0x3b85e MCUSR = 0; 1f9f4: 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; 1f9f6: 84 e1 ldi r24, 0x14 ; 20 1f9f8: 9a ea ldi r25, 0xAA ; 170 1f9fa: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1f9fe: 83 ec ldi r24, 0xC3 ; 195 1fa00: 9d e6 ldi r25, 0x6D ; 109 1fa02: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1fa06: 80 ee ldi r24, 0xE0 ; 224 1fa08: 9f e8 ldi r25, 0x8F ; 143 1fa0a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1fa0e: 87 eb ldi r24, 0xB7 ; 183 1fa10: 9d e6 ldi r25, 0x6D ; 109 1fa12: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1fa16: 88 ed ldi r24, 0xD8 ; 216 1fa18: 9f e8 ldi r25, 0x8F ; 143 1fa1a: 0e 94 17 7b call 0xf62e ; 0xf62e #endif #endif SERIAL_ECHO_START; 1fa1e: 84 e1 ldi r24, 0x14 ; 20 1fa20: 9a ea ldi r25, 0xAA ; 170 1fa22: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1fa26: 88 ea ldi r24, 0xA8 ; 168 1fa28: 9d e6 ldi r25, 0x6D ; 109 1fa2a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1fa2e: 80 91 0c 18 lds r24, 0x180C ; 0x80180c <__brkval> 1fa32: 90 91 0d 18 lds r25, 0x180D ; 0x80180d <__brkval+0x1> 1fa36: 00 97 sbiw r24, 0x00 ; 0 1fa38: a1 f1 breq .+104 ; 0x1faa2 1fa3a: 08 1b sub r16, r24 1fa3c: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1fa3e: b8 01 movw r22, r16 1fa40: 11 0f add r17, r17 1fa42: 88 0b sbc r24, r24 1fa44: 99 0b sbc r25, r25 1fa46: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1fa4a: 81 e9 ldi r24, 0x91 ; 145 1fa4c: 9d e6 ldi r25, 0x6D ; 109 1fa4e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1fa52: 80 ee ldi r24, 0xE0 ; 224 1fa54: 96 e0 ldi r25, 0x06 ; 6 1fa56: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c #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); 1fa5a: 6e e2 ldi r22, 0x2E ; 46 1fa5c: 71 e0 ldi r23, 0x01 ; 1 1fa5e: 8e ee ldi r24, 0xEE ; 238 1fa60: 9e e0 ldi r25, 0x0E ; 14 1fa62: 0e 94 8d 77 call 0xef1a ; 0xef1a 1fa66: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1fa68: 66 e3 ldi r22, 0x36 ; 54 1fa6a: 71 e0 ldi r23, 0x01 ; 1 1fa6c: 8c ee ldi r24, 0xEC ; 236 1fa6e: 9e e0 ldi r25, 0x0E ; 14 1fa70: 0e 94 8d 77 call 0xef1a ; 0xef1a if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1fa74: 0e 32 cpi r16, 0x2E ; 46 1fa76: 11 40 sbci r17, 0x01 ; 1 1fa78: 11 f0 breq .+4 ; 0x1fa7e 1fa7a: 0d 94 8d 05 jmp 0x20b1a ; 0x20b1a if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1fa7e: 01 e0 ldi r16, 0x01 ; 1 1fa80: 86 33 cpi r24, 0x36 ; 54 1fa82: 91 40 sbci r25, 0x01 ; 1 1fa84: 09 f4 brne .+2 ; 0x1fa88 1fa86: 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(); 1fa88: 0e 94 6a 95 call 0x12ad4 ; 0x12ad4 1fa8c: f8 2e mov r15, r24 1fa8e: 0d 94 95 05 jmp 0x20b2a ; 0x20b2a _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1fa92: 80 e0 ldi r24, 0x00 ; 0 1fa94: 54 cf rjmp .-344 ; 0x1f93e { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1fa96: 81 e1 ldi r24, 0x11 ; 17 1fa98: 90 e9 ldi r25, 0x90 ; 144 1fa9a: 5f cf rjmp .-322 ; 0x1f95a 1fa9c: 8e e7 ldi r24, 0x7E ; 126 1fa9e: 9d e5 ldi r25, 0x5D ; 93 1faa0: 88 cf rjmp .-240 ; 0x1f9b2 1faa2: 06 51 subi r16, 0x16 ; 22 1faa4: 18 41 sbci r17, 0x18 ; 24 1faa6: cb cf rjmp .-106 ; 0x1fa3e minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1faa8: 81 e3 ldi r24, 0x31 ; 49 1faaa: 91 e0 ldi r25, 0x01 ; 1 1faac: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.484+0x1> 1fab0: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.484> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1fab4: c0 90 98 04 lds r12, 0x0498 ; 0x800498 <_ZL12maxttemp_raw.lto_priv.477> 1fab8: d0 90 99 04 lds r13, 0x0499 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.477+0x1> 1fabc: c6 01 movw r24, r12 1fabe: 0e 94 9e da call 0x1b53c ; 0x1b53c 1fac2: 20 e0 ldi r18, 0x00 ; 0 1fac4: 30 e8 ldi r19, 0x80 ; 128 1fac6: 48 e9 ldi r20, 0x98 ; 152 1fac8: 53 e4 ldi r21, 0x43 ; 67 1faca: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1face: 18 16 cp r1, r24 1fad0: 44 f4 brge .+16 ; 0x1fae2 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1fad2: f0 e1 ldi r31, 0x10 ; 16 1fad4: cf 0e add r12, r31 1fad6: d1 1c adc r13, r1 1fad8: d0 92 99 04 sts 0x0499, r13 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.477+0x1> 1fadc: c0 92 98 04 sts 0x0498, r12 ; 0x800498 <_ZL12maxttemp_raw.lto_priv.477> 1fae0: e9 cf rjmp .-46 ; 0x1fab4 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1fae2: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.485> 1fae6: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.485+0x1> 1faea: 0f 94 c6 4a call 0x2958c ; 0x2958c 1faee: 20 e0 ldi r18, 0x00 ; 0 1faf0: 30 e0 ldi r19, 0x00 ; 0 1faf2: 40 e2 ldi r20, 0x20 ; 32 1faf4: 51 e4 ldi r21, 0x41 ; 65 1faf6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1fafa: 87 ff sbrs r24, 7 1fafc: 0a c0 rjmp .+20 ; 0x1fb12 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1fafe: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.485> 1fb02: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.485+0x1> 1fb06: 40 97 sbiw r24, 0x10 ; 16 1fb08: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.485+0x1> 1fb0c: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.485> 1fb10: e8 cf rjmp .-48 ; 0x1fae2 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1fb12: 80 91 96 04 lds r24, 0x0496 ; 0x800496 <_ZL16bed_maxttemp_raw.lto_priv.478> 1fb16: 90 91 97 04 lds r25, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.478+0x1> 1fb1a: 0f 94 c6 4a call 0x2958c ; 0x2958c 1fb1e: 20 e0 ldi r18, 0x00 ; 0 1fb20: 30 e0 ldi r19, 0x00 ; 0 1fb22: 4a ef ldi r20, 0xFA ; 250 1fb24: 52 e4 ldi r21, 0x42 ; 66 1fb26: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1fb2a: 18 16 cp r1, r24 1fb2c: 54 f4 brge .+20 ; 0x1fb42 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1fb2e: 80 91 96 04 lds r24, 0x0496 ; 0x800496 <_ZL16bed_maxttemp_raw.lto_priv.478> 1fb32: 90 91 97 04 lds r25, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.478+0x1> 1fb36: 40 96 adiw r24, 0x10 ; 16 1fb38: 90 93 97 04 sts 0x0497, r25 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.478+0x1> 1fb3c: 80 93 96 04 sts 0x0496, r24 ; 0x800496 <_ZL16bed_maxttemp_raw.lto_priv.478> 1fb40: e8 cf rjmp .-48 ; 0x1fb12 #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1fb42: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.476> 1fb46: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.476+0x1> 1fb4a: 0f 94 31 4a call 0x29462 ; 0x29462 1fb4e: 20 e0 ldi r18, 0x00 ; 0 1fb50: 30 e0 ldi r19, 0x00 ; 0 1fb52: 40 ef ldi r20, 0xF0 ; 240 1fb54: 51 ec ldi r21, 0xC1 ; 193 1fb56: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 1fb5a: 87 ff sbrs r24, 7 1fb5c: 0a c0 rjmp .+20 ; 0x1fb72 #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1fb5e: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.476> 1fb62: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.476+0x1> 1fb66: 40 97 sbiw r24, 0x10 ; 16 1fb68: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.476+0x1> 1fb6c: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.476> 1fb70: e8 cf rjmp .-48 ; 0x1fb42 #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1fb72: 80 91 94 04 lds r24, 0x0494 ; 0x800494 <_ZL20ambient_maxttemp_raw.lto_priv.479> 1fb76: 90 91 95 04 lds r25, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.479+0x1> 1fb7a: 0f 94 31 4a call 0x29462 ; 0x29462 1fb7e: 20 e0 ldi r18, 0x00 ; 0 1fb80: 30 e0 ldi r19, 0x00 ; 0 1fb82: 40 ea ldi r20, 0xA0 ; 160 1fb84: 52 e4 ldi r21, 0x42 ; 66 1fb86: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 1fb8a: 18 16 cp r1, r24 1fb8c: 54 f4 brge .+20 ; 0x1fba2 #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1fb8e: 80 91 94 04 lds r24, 0x0494 ; 0x800494 <_ZL20ambient_maxttemp_raw.lto_priv.479> 1fb92: 90 91 95 04 lds r25, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.479+0x1> 1fb96: 40 96 adiw r24, 0x10 ; 16 1fb98: 90 93 95 04 sts 0x0495, r25 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.479+0x1> 1fb9c: 80 93 94 04 sts 0x0494, r24 ; 0x800494 <_ZL20ambient_maxttemp_raw.lto_priv.479> 1fba0: e8 cf rjmp .-48 ; 0x1fb72 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1fba2: 9f b7 in r25, 0x3f ; 63 1fba4: f8 94 cli TCNT0 = 0; 1fba6: 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; 1fba8: 8f ef ldi r24, 0xFF ; 255 1fbaa: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1fbac: 83 e3 ldi r24, 0x33 ; 51 1fbae: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1fbb0: 12 e0 ldi r17, 0x02 ; 2 1fbb2: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1fbb4: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1fbb8: 81 60 ori r24, 0x01 ; 1 1fbba: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1fbbe: 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; 1fbc0: 80 e8 ldi r24, 0x80 ; 128 1fbc2: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1fbc6: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1fbca: 84 60 ori r24, 0x04 ; 4 1fbcc: 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; 1fbd0: 2f b7 in r18, 0x3f ; 63 1fbd2: f8 94 cli SET_OUTPUT(BEEPER); 1fbd4: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fbd8: 84 60 ori r24, 0x04 ; 4 1fbda: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1fbde: 9f b7 in r25, 0x3f ; 63 1fbe0: f8 94 cli 1fbe2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fbe6: 8b 7f andi r24, 0xFB ; 251 1fbe8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fbec: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1fbee: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fbf2: 80 62 ori r24, 0x20 ; 32 1fbf4: 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); 1fbf8: 81 e0 ldi r24, 0x01 ; 1 1fbfa: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1fbfe: 85 e1 ldi r24, 0x15 ; 21 1fc00: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1fc04: 8f ef ldi r24, 0xFF ; 255 1fc06: 90 e0 ldi r25, 0x00 ; 0 1fc08: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1fc0c: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1fc10: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1fc14: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1fc18: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1fc1c: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1fc20: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1fc24: 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")); 1fc26: 83 e4 ldi r24, 0x43 ; 67 1fc28: 9f e8 ldi r25, 0x8F ; 143 1fc2a: 0f 94 2f dc call 0x3b85e ; 0x3b85e DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1fc2e: 8f e5 ldi r24, 0x5F ; 95 1fc30: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1fc34: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1fc38: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1fc3c: 80 64 ori r24, 0x40 ; 64 1fc3e: 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); 1fc42: 8f e9 ldi r24, 0x9F ; 159 1fc44: 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(); 1fc48: 0e 94 95 8f call 0x11f2a ; 0x11f2a // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fc4c: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1fc4e: f8 94 cli // CTC TCCRxB &= ~(1< 1fc54: 8f 7e andi r24, 0xEF ; 239 1fc56: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1fc5e: 88 60 ori r24, 0x08 ; 8 1fc60: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1fc68: 8d 7f andi r24, 0xFD ; 253 1fc6a: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1fc72: 8e 7f andi r24, 0xFE ; 254 1fc74: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1fc7c: 8f 73 andi r24, 0x3F ; 63 1fc7e: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1fc86: 8f 7c andi r24, 0xCF ; 207 1fc88: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fc90: 84 60 ori r24, 0x04 ; 4 1fc92: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fc9a: 8d 7f andi r24, 0xFD ; 253 1fc9c: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fca4: 8e 7f andi r24, 0xFE ; 254 1fca6: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 1fcaa: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 1fcae: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 1fcb2: 2b ee ldi r18, 0xEB ; 235 1fcb4: 31 e4 ldi r19, 0x41 ; 65 1fcb6: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1fcba: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1fcbe: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 1fcc0: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 1fcc4: 82 60 ori r24, 0x02 ; 2 1fcc6: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fcca: 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: ")); 1fccc: 8f e7 ldi r24, 0x7F ; 127 1fcce: 9d e6 ldi r25, 0x6D ; 109 1fcd0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } bool extruder_altfan_detect() { // override isAltFan setting for detection altfanStatus.isAltfan = 0; 1fcd4: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> 1fcd8: 8e 7f andi r24, 0xFE ; 254 1fcda: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> // During initialisation, use the EEPROM value altfanStatus.altfanOverride = eeprom_init_default_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE, 0); 1fcde: 60 e0 ldi r22, 0x00 ; 0 1fce0: 8b e2 ldi r24, 0x2B ; 43 1fce2: 9d e0 ldi r25, 0x0D ; 13 1fce4: 0e 94 a5 77 call 0xef4a ; 0xef4a 1fce8: 90 91 b6 04 lds r25, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> 1fcec: 80 fb bst r24, 0 1fcee: 91 f9 bld r25, 1 1fcf0: 90 93 b6 04 sts 0x04B6, r25 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> setExtruderAutoFanState(3); 1fcf4: 83 e0 ldi r24, 0x03 ; 3 1fcf6: 0e 94 e2 76 call 0xedc4 ; 0xedc4 SET_INPUT(TACH_0); 1fcfa: 6e 98 cbi 0x0d, 6 ; 13 CRITICAL_SECTION_START; 1fcfc: 9f b7 in r25, 0x3f ; 63 1fcfe: f8 94 cli EICRB &= ~(1 << ISC61); 1fd00: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fd04: 8f 7d andi r24, 0xDF ; 223 1fd06: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << ISC60); 1fd0a: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fd0e: 80 61 ori r24, 0x10 ; 16 1fd10: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EIMSK |= (1 << INT6); 1fd14: ee 9a sbi 0x1d, 6 ; 29 fan_edge_counter[0] = 0; 1fd16: 10 92 b3 04 sts 0x04B3, r1 ; 0x8004b3 1fd1a: 10 92 b2 04 sts 0x04B2, r1 ; 0x8004b2 CRITICAL_SECTION_END; 1fd1e: 9f bf out 0x3f, r25 ; 63 extruder_autofan_last_check = _millis(); 1fd20: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 1fd24: 60 93 99 17 sts 0x1799, r22 ; 0x801799 1fd28: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 1fd2c: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 1fd30: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c _delay(1000); 1fd34: 68 ee ldi r22, 0xE8 ; 232 1fd36: 73 e0 ldi r23, 0x03 ; 3 1fd38: 80 e0 ldi r24, 0x00 ; 0 1fd3a: 90 e0 ldi r25, 0x00 ; 0 1fd3c: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 EIMSK &= ~(1 << INT6); 1fd40: ee 98 cbi 0x1d, 6 ; 29 countFanSpeed(); 1fd42: 0e 94 6b 76 call 0xecd6 ; 0xecd6 // restore fan state altfanStatus.isAltfan = fan_speed[0] > 100; 1fd46: 91 e0 ldi r25, 0x01 ; 1 1fd48: 20 91 ae 04 lds r18, 0x04AE ; 0x8004ae 1fd4c: 30 91 af 04 lds r19, 0x04AF ; 0x8004af 1fd50: 25 36 cpi r18, 0x65 ; 101 1fd52: 31 05 cpc r19, r1 1fd54: 0c f4 brge .+2 ; 0x1fd58 1fd56: 90 e0 ldi r25, 0x00 ; 0 1fd58: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> 1fd5c: 90 fb bst r25, 0 1fd5e: 80 f9 bld r24, 0 1fd60: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> setExtruderAutoFanState(1); 1fd64: 81 e0 ldi r24, 0x01 ; 1 1fd66: 0e 94 e2 76 call 0xedc4 ; 0xedc4 return altfanStatus.isAltfan; 1fd6a: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> if (extruder_altfan_detect()) 1fd6e: 80 ff sbrs r24, 0 1fd70: c4 c0 rjmp .+392 ; 0x1fefa SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); 1fd72: 81 ed ldi r24, 0xD1 ; 209 1fd74: 9f e8 ldi r25, 0x8F ; 143 else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1fd76: 0e 94 17 7b call 0xf62e ; 0xf62e // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1fd7a: 10 92 53 0e sts 0x0E53, r1 ; 0x800e53 block_buffer_tail = 0; 1fd7e: 10 92 54 0e sts 0x0E54, r1 ; 0x800e54 memset(position, 0, sizeof(position)); // clear position 1fd82: 80 e1 ldi r24, 0x10 ; 16 1fd84: e1 e5 ldi r30, 0x51 ; 81 1fd86: f7 e0 ldi r31, 0x07 ; 7 1fd88: df 01 movw r26, r30 1fd8a: 28 2f mov r18, r24 1fd8c: 1d 92 st X+, r1 1fd8e: 2a 95 dec r18 1fd90: e9 f7 brne .-6 ; 0x1fd8c #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1fd92: ed ec ldi r30, 0xCD ; 205 1fd94: f4 e0 ldi r31, 0x04 ; 4 1fd96: df 01 movw r26, r30 1fd98: 28 2f mov r18, r24 1fd9a: 1d 92 st X+, r1 1fd9c: 2a 95 dec r18 1fd9e: e9 f7 brne .-6 ; 0x1fd9a #endif memset(previous_speed, 0, sizeof(previous_speed)); 1fda0: ed eb ldi r30, 0xBD ; 189 1fda2: f4 e0 ldi r31, 0x04 ; 4 1fda4: df 01 movw r26, r30 1fda6: 1d 92 st X+, r1 1fda8: 8a 95 dec r24 1fdaa: e9 f7 brne .-6 ; 0x1fda6 previous_nominal_speed = 0.0; 1fdac: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.506> 1fdb0: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.506+0x1> 1fdb4: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.506+0x2> 1fdb8: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.506+0x3> plan_reset_next_e_queue = false; 1fdbc: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.504> plan_reset_next_e_sched = false; 1fdc0: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.505> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1fdc4: 84 e0 ldi r24, 0x04 ; 4 1fdc6: 80 93 96 02 sts 0x0296, r24 ; 0x800296 if (!READ(BTN_ENC)) 1fdca: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fdce: 86 fd sbrc r24, 6 1fdd0: cd c0 rjmp .+410 ; 0x1ff6c 1fdd2: bf ef ldi r27, 0xFF ; 255 1fdd4: e3 ed ldi r30, 0xD3 ; 211 1fdd6: f0 e3 ldi r31, 0x30 ; 48 1fdd8: b1 50 subi r27, 0x01 ; 1 1fdda: e0 40 sbci r30, 0x00 ; 0 1fddc: f0 40 sbci r31, 0x00 ; 0 1fdde: e1 f7 brne .-8 ; 0x1fdd8 1fde0: 00 c0 rjmp .+0 ; 0x1fde2 1fde2: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1fde4: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fde8: 86 fd sbrc r24, 6 1fdea: c0 c0 rjmp .+384 ; 0x1ff6c { lcd_clear(); 1fdec: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_P(PSTR("Factory RESET")); 1fdf0: 8d e9 ldi r24, 0x9D ; 157 1fdf2: 9f e8 ldi r25, 0x8F ; 143 1fdf4: 0e 94 91 6f call 0xdf22 ; 0xdf22 SET_OUTPUT(BEEPER); 1fdf8: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fdfc: 84 60 ori r24, 0x04 ; 4 1fdfe: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1fe02: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1fe06: 82 30 cpi r24, 0x02 ; 2 1fe08: 41 f0 breq .+16 ; 0x1fe1a WRITE(BEEPER, HIGH); 1fe0a: 9f b7 in r25, 0x3f ; 63 1fe0c: f8 94 cli 1fe0e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe12: 84 60 ori r24, 0x04 ; 4 1fe14: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe18: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1fe1a: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe1e: 86 ff sbrs r24, 6 1fe20: fc cf rjmp .-8 ; 0x1fe1a WRITE(BEEPER, LOW); 1fe22: 9f b7 in r25, 0x3f ; 63 1fe24: f8 94 cli 1fe26: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe2a: 8b 7f andi r24, 0xFB ; 251 1fe2c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe30: 9f bf out 0x3f, r25 ; 63 1fe32: 2f ef ldi r18, 0xFF ; 255 1fe34: 37 ea ldi r19, 0xA7 ; 167 1fe36: 81 e6 ldi r24, 0x61 ; 97 1fe38: 21 50 subi r18, 0x01 ; 1 1fe3a: 30 40 sbci r19, 0x00 ; 0 1fe3c: 80 40 sbci r24, 0x00 ; 0 1fe3e: e1 f7 brne .-8 ; 0x1fe38 1fe40: 00 c0 rjmp .+0 ; 0x1fe42 1fe42: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1fe44: 83 e8 ldi r24, 0x83 ; 131 1fe46: 9f e8 ldi r25, 0x8F ; 143 1fe48: 9a 83 std Y+2, r25 ; 0x02 1fe4a: 89 83 std Y+1, r24 ; 0x01 1fe4c: 88 e7 ldi r24, 0x78 ; 120 1fe4e: 9f e8 ldi r25, 0x8F ; 143 1fe50: 9c 83 std Y+4, r25 ; 0x04 1fe52: 8b 83 std Y+3, r24 ; 0x03 1fe54: 8a e6 ldi r24, 0x6A ; 106 1fe56: 9f e8 ldi r25, 0x8F ; 143 1fe58: 9e 83 std Y+6, r25 ; 0x06 1fe5a: 8d 83 std Y+5, r24 ; 0x05 1fe5c: 8d e5 ldi r24, 0x5D ; 93 1fe5e: 9f e8 ldi r25, 0x8F ; 143 1fe60: 98 87 std Y+8, r25 ; 0x08 1fe62: 8f 83 std Y+7, r24 ; 0x07 1fe64: 84 e5 ldi r24, 0x54 ; 84 1fe66: 9f e8 ldi r25, 0x8F ; 143 1fe68: 9a 87 std Y+10, r25 ; 0x0a 1fe6a: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1fe6c: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_putc_at(0, 0, '>'); 1fe70: 4e e3 ldi r20, 0x3E ; 62 1fe72: 60 e0 ldi r22, 0x00 ; 0 1fe74: 80 e0 ldi r24, 0x00 ; 0 1fe76: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_consume_click(); 1fe7a: 0e 94 be 71 call 0xe37c ; 0xe37c } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1fe7e: 10 e0 ldi r17, 0x00 ; 0 1fe80: d1 2c mov r13, r1 1fe82: 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]); 1fe84: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1fe88: f6 01 movw r30, r12 1fe8a: e8 0f add r30, r24 1fe8c: f1 1d adc r31, r1 1fe8e: 87 fd sbrc r24, 7 1fe90: fa 95 dec r31 1fe92: ee 0f add r30, r30 1fe94: ff 1f adc r31, r31 1fe96: a1 e0 ldi r26, 0x01 ; 1 1fe98: b0 e0 ldi r27, 0x00 ; 0 1fe9a: ac 0f add r26, r28 1fe9c: bd 1f adc r27, r29 1fe9e: ea 0f add r30, r26 1fea0: fb 1f adc r31, r27 1fea2: 40 81 ld r20, Z 1fea4: 51 81 ldd r21, Z+1 ; 0x01 1fea6: 6c 2d mov r22, r12 1fea8: 81 e0 ldi r24, 0x01 ; 1 1feaa: 0e 94 ba 6f call 0xdf74 ; 0xdf74 1feae: bf ef ldi r27, 0xFF ; 255 1feb0: cb 1a sub r12, r27 1feb2: 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++) { 1feb4: e4 e0 ldi r30, 0x04 ; 4 1feb6: ce 16 cp r12, r30 1feb8: d1 04 cpc r13, r1 1feba: 21 f7 brne .-56 ; 0x1fe84 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1febc: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 1fec0: 81 e0 ldi r24, 0x01 ; 1 1fec2: 0e 94 f3 8b call 0x117e6 ; 0x117e6 if (lcd_encoder) { 1fec6: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1feca: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1fece: 00 97 sbiw r24, 0x00 ; 0 1fed0: 89 f1 breq .+98 ; 0x1ff34 if (lcd_encoder < 0) { 1fed2: 97 ff sbrs r25, 7 1fed4: 15 c0 rjmp .+42 ; 0x1ff00 cursor_pos--; 1fed6: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1fed8: 14 30 cpi r17, 0x04 ; 4 1feda: 0c f4 brge .+2 ; 0x1fede 1fedc: a9 c0 rjmp .+338 ; 0x20030 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1fede: 87 e0 ldi r24, 0x07 ; 7 1fee0: 0f 94 34 64 call 0x2c868 ; 0x2c868 if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1fee4: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1fee8: 18 16 cp r1, r24 1feea: 2c f0 brlt .+10 ; 0x1fef6 first++; 1feec: 8f 5f subi r24, 0xFF ; 255 1feee: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 1fef2: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1fef6: 13 e0 ldi r17, 0x03 ; 3 1fef8: 06 c0 rjmp .+12 ; 0x1ff06 #ifdef EXTRUDER_ALTFAN_DETECT SERIAL_ECHORPGM(_n("Hotend fan type: ")); if (extruder_altfan_detect()) SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1fefa: 8a ec ldi r24, 0xCA ; 202 1fefc: 9f e8 ldi r25, 0x8F ; 143 1fefe: 3b cf rjmp .-394 ; 0x1fd76 if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1ff00: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1ff02: 14 30 cpi r17, 0x04 ; 4 1ff04: 60 f7 brcc .-40 ; 0x1fede if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1ff06: 4c e4 ldi r20, 0x4C ; 76 1ff08: 5f e8 ldi r21, 0x8F ; 143 1ff0a: 60 e0 ldi r22, 0x00 ; 0 1ff0c: 80 e0 ldi r24, 0x00 ; 0 1ff0e: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(0, cursor_pos); 1ff12: 61 2f mov r22, r17 1ff14: 80 e0 ldi r24, 0x00 ; 0 1ff16: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_putc('>'); 1ff1a: 8e e3 ldi r24, 0x3E ; 62 1ff1c: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_encoder = 0; 1ff20: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1ff24: 10 92 34 05 sts 0x0534, r1 ; 0x800534 _delay(100); 1ff28: 64 e6 ldi r22, 0x64 ; 100 1ff2a: 70 e0 ldi r23, 0x00 ; 0 1ff2c: 80 e0 ldi r24, 0x00 ; 0 1ff2e: 90 e0 ldi r25, 0x00 ; 0 1ff30: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 } if (lcd_clicked()) { 1ff34: 0e 94 c3 71 call 0xe386 ; 0xe386 1ff38: 88 23 and r24, r24 1ff3a: 09 f4 brne .+2 ; 0x1ff3e 1ff3c: a1 cf rjmp .-190 ; 0x1fe80 return(cursor_pos + first); 1ff3e: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1ff42: 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(); 1ff44: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 Sound_MakeCustom(100,0,false); 1ff48: 40 e0 ldi r20, 0x00 ; 0 1ff4a: 70 e0 ldi r23, 0x00 ; 0 1ff4c: 60 e0 ldi r22, 0x00 ; 0 1ff4e: 84 e6 ldi r24, 0x64 ; 100 1ff50: 90 e0 ldi r25, 0x00 ; 0 1ff52: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac switch (level) { 1ff56: 12 30 cpi r17, 0x02 ; 2 1ff58: 09 f4 brne .+2 ; 0x1ff5c 1ff5a: a0 c0 rjmp .+320 ; 0x2009c 1ff5c: 08 f0 brcs .+2 ; 0x1ff60 1ff5e: 79 c0 rjmp .+242 ; 0x20052 1ff60: 11 23 and r17, r17 1ff62: 09 f4 brne .+2 ; 0x1ff66 1ff64: 93 c0 rjmp .+294 ; 0x2008c 1ff66: 11 30 cpi r17, 0x01 ; 1 1ff68: 09 f4 brne .+2 ; 0x1ff6c 1ff6a: 93 c0 rjmp .+294 ; 0x20092 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1ff6c: 82 e0 ldi r24, 0x02 ; 2 1ff6e: 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); 1ff72: 60 e0 ldi r22, 0x00 ; 0 1ff74: 8f ef ldi r24, 0xFF ; 255 1ff76: 9f e0 ldi r25, 0x0F ; 15 1ff78: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1ff7c: 61 e0 ldi r22, 0x01 ; 1 1ff7e: 8f e5 ldi r24, 0x5F ; 95 1ff80: 9f e0 ldi r25, 0x0F ; 15 1ff82: 0e 94 a5 77 call 0xef4a ; 0xef4a #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 1ff86: 8f ef ldi r24, 0xFF ; 255 1ff88: 9f e0 ldi r25, 0x0F ; 15 1ff8a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1ff8e: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 1ff90: 8f 3f cpi r24, 0xFF ; 255 1ff92: 09 f4 brne .+2 ; 0x1ff96 1ff94: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 1ff96: 10 92 69 06 sts 0x0669, r1 ; 0x800669 tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); 1ff9a: 61 e0 ldi r22, 0x01 ; 1 1ff9c: 89 e6 ldi r24, 0x69 ; 105 1ff9e: 9f e0 ldi r25, 0x0F ; 15 1ffa0: 0e 94 a5 77 call 0xef4a ; 0xef4a 1ffa4: 91 e0 ldi r25, 0x01 ; 1 1ffa6: 81 11 cpse r24, r1 1ffa8: 01 c0 rjmp .+2 ; 0x1ffac 1ffaa: 90 e0 ldi r25, 0x00 ; 0 1ffac: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 1ffb0: 88 23 and r24, r24 1ffb2: 09 f4 brne .+2 ; 0x1ffb6 1ffb4: 92 c0 rjmp .+292 ; 0x200da puts_P(_N("CrashDetect ENABLED!")); 1ffb6: 8a e6 ldi r24, 0x6A ; 106 1ffb8: 9d e6 ldi r25, 0x6D ; 109 } else { puts_P(_N("CrashDetect DISABLED")); 1ffba: 0f 94 2f dc call 0x3b85e ; 0x3b85e } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 1ffbe: 87 ef ldi r24, 0xF7 ; 247 1ffc0: 9e e0 ldi r25, 0x0E ; 14 1ffc2: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1ffc6: c8 2e mov r12, r24 1ffc8: 80 93 f9 04 sts 0x04F9, r24 ; 0x8004f9 tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 1ffcc: 86 ef ldi r24, 0xF6 ; 246 1ffce: 9e e0 ldi r25, 0x0E ; 14 1ffd0: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1ffd4: d8 2e mov r13, r24 1ffd6: 80 93 fa 04 sts 0x04FA, r24 ; 0x8004fa tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 1ffda: 85 ef ldi r24, 0xF5 ; 245 1ffdc: 9e e0 ldi r25, 0x0E ; 14 1ffde: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1ffe2: e8 2e mov r14, r24 1ffe4: 80 93 fb 04 sts 0x04FB, r24 ; 0x8004fb #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[E_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_E_FAC); 1ffe8: 84 ef ldi r24, 0xF4 ; 244 1ffea: 9e e0 ldi r25, 0x0E ; 14 1ffec: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 1fff0: 80 93 fc 04 sts 0x04FC, r24 ; 0x8004fc if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 1fff4: 2f ef ldi r18, 0xFF ; 255 1fff6: c2 12 cpse r12, r18 1fff8: 02 c0 rjmp .+4 ; 0x1fffe 1fffa: 10 92 f9 04 sts 0x04F9, r1 ; 0x8004f9 if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 1fffe: 3f ef ldi r19, 0xFF ; 255 20000: d3 12 cpse r13, r19 20002: 02 c0 rjmp .+4 ; 0x20008 20004: 10 92 fa 04 sts 0x04FA, r1 ; 0x8004fa if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 20008: 9f ef ldi r25, 0xFF ; 255 2000a: e9 12 cpse r14, r25 2000c: 02 c0 rjmp .+4 ; 0x20012 2000e: 10 92 fb 04 sts 0x04FB, r1 ; 0x8004fb if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 20012: 8f 3f cpi r24, 0xFF ; 255 20014: 11 f4 brne .+4 ; 0x2001a 20016: 10 92 fc 04 sts 0x04FC, r1 ; 0x8004fc #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 2001a: 80 91 27 07 lds r24, 0x0727 ; 0x800727 2001e: 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--; 20020: 28 e0 ldi r18, 0x08 ; 8 20022: 96 95 lsr r25 20024: 87 95 ror r24 20026: 00 97 sbiw r24, 0x00 ; 0 20028: 09 f4 brne .+2 ; 0x2002c 2002a: 5a c0 rjmp .+180 ; 0x200e0 2002c: 21 50 subi r18, 0x01 ; 1 2002e: f9 cf rjmp .-14 ; 0x20022 first++; lcd_clear(); } } if (cursor_pos < 0) { 20030: 1f 3f cpi r17, 0xFF ; 255 20032: 09 f0 breq .+2 ; 0x20036 20034: 68 cf rjmp .-304 ; 0x1ff06 cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 20036: 87 e0 ldi r24, 0x07 ; 7 20038: 0f 94 34 64 call 0x2c868 ; 0x2c868 if (first > 0) { 2003c: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 20040: 18 16 cp r1, r24 20042: 2c f4 brge .+10 ; 0x2004e first--; 20044: 81 50 subi r24, 0x01 ; 1 20046: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 2004a: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 2004e: 10 e0 ldi r17, 0x00 ; 0 20050: 5a cf rjmp .-332 ; 0x1ff06 // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 20052: 13 30 cpi r17, 0x03 ; 3 20054: 29 f1 breq .+74 ; 0x200a0 20056: 14 30 cpi r17, 0x04 ; 4 20058: 09 f0 breq .+2 ; 0x2005c 2005a: 88 cf rjmp .-240 ; 0x1ff6c #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 2005c: 6c e8 ldi r22, 0x8C ; 140 2005e: 7f e8 ldi r23, 0x8F ; 143 20060: 80 e0 ldi r24, 0x00 ; 0 20062: 90 e1 ldi r25, 0x10 ; 16 20064: 0f 94 27 cd call 0x39a4e ; 0x39a4e // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 20068: 10 e0 ldi r17, 0x00 ; 0 2006a: 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); 2006c: 6f ef ldi r22, 0xFF ; 255 2006e: c8 01 movw r24, r16 20070: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 20074: c8 01 movw r24, r16 20076: 0f 94 f8 cc call 0x399f0 ; 0x399f0 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 2007a: 0f 5f subi r16, 0xFF ; 255 2007c: 1f 4f sbci r17, 0xFF ; 255 2007e: 01 15 cp r16, r1 20080: f0 e1 ldi r31, 0x10 ; 16 20082: 1f 07 cpc r17, r31 20084: 99 f7 brne .-26 ; 0x2006c eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 20086: 0f 94 19 cd call 0x39a32 ; 0x39a32 2008a: e7 cb rjmp .-2098 ; 0x1f85a lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 2008c: 0e 94 f2 71 call 0xe3e4 ; 0xe3e4 20090: 6d cf rjmp .-294 ; 0x1ff6c break; case 1: //Level 1: Reset statistics factory_reset_stats(); 20092: 0e 94 d7 67 call 0xcfae ; 0xcfae lcd_menu_statistics(); 20096: 0f 94 e5 54 call 0x2a9ca ; 0x2a9ca 2009a: 68 cf rjmp .-304 ; 0x1ff6c break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 2009c: 0e 94 d7 67 call 0xcfae ; 0xcfae // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 200a0: 0e 94 f2 71 call 0xe3e4 ; 0xe3e4 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 200a4: 84 e0 ldi r24, 0x04 ; 4 200a6: 0e 94 e5 e6 call 0x1cdca ; 0x1cdca 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); 200aa: 62 e0 ldi r22, 0x02 ; 2 200ac: 8f e5 ldi r24, 0x5F ; 95 200ae: 9f e0 ldi r25, 0x0F ; 15 200b0: 0f 94 8e dd call 0x3bb1c ; 0x3bb1c eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 200b4: 81 e0 ldi r24, 0x01 ; 1 200b6: 0e 94 c5 75 call 0xeb8a ; 0xeb8a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 200ba: 11 e0 ldi r17, 0x01 ; 1 200bc: 10 93 86 17 sts 0x1786, r17 ; 0x801786 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 200c0: 61 e0 ldi r22, 0x01 ; 1 200c2: 87 e0 ldi r24, 0x07 ; 7 200c4: 9f e0 ldi r25, 0x0F ; 15 200c6: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 200ca: 10 93 87 17 sts 0x1787, r17 ; 0x801787 200ce: 61 e0 ldi r22, 0x01 ; 1 200d0: 85 ed ldi r24, 0xD5 ; 213 200d2: 9e e0 ldi r25, 0x0E ; 14 200d4: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 200d8: 49 cf rjmp .-366 ; 0x1ff6c 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")); 200da: 85 e5 ldi r24, 0x55 ; 85 200dc: 9d e6 ldi r25, 0x6D ; 109 200de: 6d cf rjmp .-294 ; 0x1ffba 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]); 200e0: 20 93 f5 04 sts 0x04F5, r18 ; 0x8004f5 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 200e4: 80 91 28 07 lds r24, 0x0728 ; 0x800728 200e8: 90 e0 ldi r25, 0x00 ; 0 200ea: 28 e0 ldi r18, 0x08 ; 8 200ec: 96 95 lsr r25 200ee: 87 95 ror r24 200f0: 00 97 sbiw r24, 0x00 ; 0 200f2: 11 f0 breq .+4 ; 0x200f8 200f4: 21 50 subi r18, 0x01 ; 1 200f6: fa cf rjmp .-12 ; 0x200ec 200f8: 20 93 f6 04 sts 0x04F6, r18 ; 0x8004f6 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 200fc: 80 91 29 07 lds r24, 0x0729 ; 0x800729 20100: 90 e0 ldi r25, 0x00 ; 0 20102: 28 e0 ldi r18, 0x08 ; 8 20104: 96 95 lsr r25 20106: 87 95 ror r24 20108: 00 97 sbiw r24, 0x00 ; 0 2010a: 11 f0 breq .+4 ; 0x20110 2010c: 21 50 subi r18, 0x01 ; 1 2010e: fa cf rjmp .-12 ; 0x20104 20110: 20 93 f7 04 sts 0x04F7, r18 ; 0x8004f7 tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 20114: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 20118: 90 e0 ldi r25, 0x00 ; 0 2011a: 28 e0 ldi r18, 0x08 ; 8 2011c: 96 95 lsr r25 2011e: 87 95 ror r24 20120: 00 97 sbiw r24, 0x00 ; 0 20122: 11 f0 breq .+4 ; 0x20128 20124: 21 50 subi r18, 0x01 ; 1 20126: fa cf rjmp .-12 ; 0x2011c 20128: 20 93 f8 04 sts 0x04F8, r18 ; 0x8004f8 return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 2012c: 0e 94 aa f9 call 0x1f354 ; 0x1f354 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) { } 20130: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 20132: 82 70 andi r24, 0x02 ; 2 20134: 0f 94 f1 3b call 0x277e2 ; 0x277e2 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 20138: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2013c: 81 60 ori r24, 0x01 ; 1 2013e: 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); 20142: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20146: 82 60 ori r24, 0x02 ; 2 20148: 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); 2014c: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20150: 84 60 ori r24, 0x04 ; 4 20152: 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); 20156: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2015a: 80 64 ori r24, 0x40 ; 64 2015c: 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); 20160: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 20162: 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); 20164: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 20166: 16 9a sbi 0x02, 6 ; 2 #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 20168: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 2016a: 15 9a sbi 0x02, 5 ; 2 #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 2016c: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 2016e: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 20170: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 20172: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 20174: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 20176: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 20178: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 2017a: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 2017c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 20180: 8b 7f andi r24, 0xFB ; 251 20182: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 20186: 9f b7 in r25, 0x3f ; 63 20188: f8 94 cli 2018a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2018e: 84 60 ori r24, 0x04 ; 4 20190: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20194: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 20196: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2019a: 8f 77 andi r24, 0x7F ; 127 2019c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 201a0: 9f b7 in r25, 0x3f ; 63 201a2: f8 94 cli 201a4: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 201a8: 80 68 ori r24, 0x80 ; 128 201aa: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 201ae: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 201b0: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 201b2: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 201b4: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 201b6: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 201b8: 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(); 201ba: 17 9a sbi 0x02, 7 ; 2 201bc: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d SET_OUTPUT(X2_STEP_PIN); WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN); disable_x(); #endif #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) SET_OUTPUT(Y_STEP_PIN); 201c0: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 201c2: 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(); 201c4: 16 9a sbi 0x02, 6 ; 2 201c6: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 201ca: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 201cc: 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); 201ce: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 201d0: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 201d2: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 201d8: 8f 7e andi r24, 0xEF ; 239 201da: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 201e2: 88 60 ori r24, 0x08 ; 8 201e4: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 201ec: 8d 7f andi r24, 0xFD ; 253 201ee: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 201f6: 8e 7f andi r24, 0xFE ; 254 201f8: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 20200: 8f 73 andi r24, 0x3F ; 63 20202: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 2020a: 8f 7c andi r24, 0xCF ; 207 2020c: 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< 20214: 88 7f andi r24, 0xF8 ; 248 20216: 82 60 ori r24, 0x02 ; 2 20218: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 2021c: 80 e0 ldi r24, 0x00 ; 0 2021e: 90 e4 ldi r25, 0x40 ; 64 20220: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 20224: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 20228: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2022c: 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; 20230: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 20234: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> nextAdvanceISR = ADV_NEVER; 20238: 8f ef ldi r24, 0xFF ; 255 2023a: 9f ef ldi r25, 0xFF ; 255 2023c: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 20240: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> main_Rate = ADV_NEVER; 20244: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.493+0x1> 20248: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.493> current_adv_steps = 0; 2024c: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 20250: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 20254: 81 e0 ldi r24, 0x01 ; 1 20256: 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(); 2025a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2025e: 82 60 ori r24, 0x02 ; 2 20260: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 20264: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 20266: 81 e0 ldi r24, 0x01 ; 1 20268: 11 11 cpse r17, r1 2026a: 01 c0 rjmp .+2 ; 0x2026e 2026c: 80 e0 ldi r24, 0x00 ; 0 2026e: 80 93 69 06 sts 0x0669, r24 ; 0x800669 update_mode_profile(); 20272: 0f 94 7c aa call 0x354f8 ; 0x354f8 20276: 0e 94 aa f9 call 0x1f354 ; 0x1f354 2027a: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 2027c: 82 70 andi r24, 0x02 ; 2 2027e: 0f 94 f1 3b call 0x277e2 ; 0x277e2 setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 20282: 0f 94 2c cb call 0x39658 ; 0x39658 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 20286: 80 e4 ldi r24, 0x40 ; 64 20288: 97 e0 ldi r25, 0x07 ; 7 2028a: 0e 94 8f 6c call 0xd91e ; 0xd91e plan_set_position_curposXYZE(); 2028e: 0f 94 08 b9 call 0x37210 ; 0x37210 // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 20292: b1 10 cpse r11, r1 20294: 08 c0 rjmp .+16 ; 0x202a6 } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 20296: 82 eb ldi r24, 0xB2 ; 178 20298: 9c e6 ldi r25, 0x6C ; 108 2029a: 0f 94 2f dc call 0x3b85e ; 0x3b85e lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 2029e: 86 e6 ldi r24, 0x66 ; 102 202a0: 9c e6 ldi r25, 0x6C ; 108 202a2: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 202a6: 84 e9 ldi r24, 0x94 ; 148 202a8: 9c e0 ldi r25, 0x0C ; 12 202aa: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 202ae: 82 34 cpi r24, 0x42 ; 66 202b0: 59 f4 brne .+22 ; 0x202c8 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); 202b2: 6f ef ldi r22, 0xFF ; 255 202b4: 84 e9 ldi r24, 0x94 ; 148 202b6: 9c e0 ldi r25, 0x0C ; 12 202b8: 0f 94 8e dd call 0x3bb1c ; 0x3bb1c // 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); 202bc: 85 e9 ldi r24, 0x95 ; 149 202be: 9c e0 ldi r25, 0x0C ; 12 202c0: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 lcd_show_fullscreen_message_and_wait_P(kill_msg); 202c4: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 202c8: 0f 94 29 87 call 0x30e52 ; 0x30e52 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 202cc: 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); 202ce: 8b eb ldi r24, 0xBB ; 187 202d0: 9f e0 ldi r25, 0x0F ; 15 202d2: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 202d6: 91 e0 ldi r25, 0x01 ; 1 202d8: 81 30 cpi r24, 0x01 ; 1 202da: 09 f0 breq .+2 ; 0x202de 202dc: 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; } 202de: 90 93 dc 16 sts 0x16DC, r25 ; 0x8016dc // Force SD card update. Otherwise the SD card update is done from loop() on card.checkautostart(false), // but this times out if a blocking dialog is shown in setup(). card.mount(); 202e2: 81 e0 ldi r24, 0x01 ; 1 202e4: 0f 94 2d 81 call 0x3025a ; 0x3025a #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 202e8: 60 e0 ldi r22, 0x00 ; 0 202ea: 84 e6 ldi r24, 0x64 ; 100 202ec: 9f e0 ldi r25, 0x0F ; 15 202ee: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 202f2: 60 e0 ldi r22, 0x00 ; 0 202f4: 86 e6 ldi r24, 0x66 ; 102 202f6: 9f e0 ldi r25, 0x0F ; 15 202f8: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 202fc: 60 e0 ldi r22, 0x00 ; 0 202fe: 88 e6 ldi r24, 0x68 ; 104 20300: 9f e0 ldi r25, 0x0F ; 15 20302: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 20306: 60 e0 ldi r22, 0x00 ; 0 20308: 85 e6 ldi r24, 0x65 ; 101 2030a: 9f e0 ldi r25, 0x0F ; 15 2030c: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 20310: 70 e0 ldi r23, 0x00 ; 0 20312: 60 e0 ldi r22, 0x00 ; 0 20314: 8f ef ldi r24, 0xFF ; 255 20316: 9e e0 ldi r25, 0x0E ; 14 20318: 0e 94 8d 77 call 0xef1a ; 0xef1a eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 2031c: 70 e0 ldi r23, 0x00 ; 0 2031e: 60 e0 ldi r22, 0x00 ; 0 20320: 85 e0 ldi r24, 0x05 ; 5 20322: 9f e0 ldi r25, 0x0F ; 15 20324: 0e 94 8d 77 call 0xef1a ; 0xef1a eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 20328: 70 e0 ldi r23, 0x00 ; 0 2032a: 60 e0 ldi r22, 0x00 ; 0 2032c: 83 e0 ldi r24, 0x03 ; 3 2032e: 9f e0 ldi r25, 0x0F ; 15 20330: 0e 94 8d 77 call 0xef1a ; 0xef1a eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 20334: 70 e0 ldi r23, 0x00 ; 0 20336: 60 e0 ldi r22, 0x00 ; 0 20338: 81 e0 ldi r24, 0x01 ; 1 2033a: 9f e0 ldi r25, 0x0F ; 15 2033c: 0e 94 8d 77 call 0xef1a ; 0xef1a eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 20340: 70 e0 ldi r23, 0x00 ; 0 20342: 60 e0 ldi r22, 0x00 ; 0 20344: 83 ed ldi r24, 0xD3 ; 211 20346: 9e e0 ldi r25, 0x0E ; 14 20348: 0e 94 8d 77 call 0xef1a ; 0xef1a eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 2034c: 70 e0 ldi r23, 0x00 ; 0 2034e: 60 e0 ldi r22, 0x00 ; 0 20350: 80 ed ldi r24, 0xD0 ; 208 20352: 9e e0 ldi r25, 0x0E ; 14 20354: 0e 94 8d 77 call 0xef1a ; 0xef1a eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 20358: 60 e0 ldi r22, 0x00 ; 0 2035a: 82 ed ldi r24, 0xD2 ; 210 2035c: 9e e0 ldi r25, 0x0E ; 14 2035e: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 20362: 60 e0 ldi r22, 0x00 ; 0 20364: 8f ec ldi r24, 0xCF ; 207 20366: 9e e0 ldi r25, 0x0E ; 14 20368: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 2036c: 88 ea ldi r24, 0xA8 ; 168 2036e: 9c e0 ldi r25, 0x0C ; 12 20370: 0f 94 36 7c call 0x2f86c ; 0x2f86c if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 20374: 81 ea ldi r24, 0xA1 ; 161 20376: 9d e0 ldi r25, 0x0D ; 13 20378: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2037c: 8f 3f cpi r24, 0xFF ; 255 2037e: 71 f4 brne .+28 ; 0x2039c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20380: 60 e0 ldi r22, 0x00 ; 0 20382: 81 ea ldi r24, 0xA1 ; 161 20384: 9d e0 ldi r25, 0x0D ; 13 20386: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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); 2038a: 88 ef ldi r24, 0xF8 ; 248 2038c: 9f e0 ldi r25, 0x0F ; 15 2038e: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 20392: bc 01 movw r22, r24 20394: 80 e5 ldi r24, 0x50 ; 80 20396: 9d e0 ldi r25, 0x0D ; 13 20398: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 2039c: 39 e4 ldi r19, 0x49 ; 73 2039e: c3 2e mov r12, r19 203a0: 3d e0 ldi r19, 0x0D ; 13 203a2: d3 2e mov r13, r19 203a4: 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); 203a6: be 01 movw r22, r28 203a8: 6f 5f subi r22, 0xFF ; 255 203aa: 7f 4f sbci r23, 0xFF ; 255 203ac: 81 2f mov r24, r17 203ae: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 203b2: ae 01 movw r20, r28 203b4: 4f 5f subi r20, 0xFF ; 255 203b6: 5f 4f sbci r21, 0xFF ; 255 203b8: 67 e0 ldi r22, 0x07 ; 7 203ba: 70 e0 ldi r23, 0x00 ; 0 203bc: c6 01 movw r24, r12 203be: 0e 94 6e 77 call 0xeedc ; 0xeedc 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++) { 203c2: 1f 5f subi r17, 0xFF ; 255 203c4: ab e0 ldi r26, 0x0B ; 11 203c6: ca 0e add r12, r26 203c8: d1 1c adc r13, r1 203ca: 18 30 cpi r17, 0x08 ; 8 203cc: 61 f7 brne .-40 ; 0x203a6 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)))) 203ce: 81 ea ldi r24, 0xA1 ; 161 203d0: 9d e0 ldi r25, 0x0D ; 13 203d2: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 203d6: 0e 94 dd 77 call 0xefba ; 0xefba 203da: 81 11 cpse r24, r1 203dc: 02 c0 rjmp .+4 ; 0x203e2 { eeprom_switch_to_next_sheet(); 203de: 0e 94 ff 77 call 0xeffe ; 0xeffe } check_babystep(); 203e2: 0e 94 1b 7b call 0xf636 ; 0xf636 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 203e6: 80 e8 ldi r24, 0x80 ; 128 203e8: 9c e0 ldi r25, 0x0C ; 12 203ea: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 203ee: 8f 3f cpi r24, 0xFF ; 255 203f0: 41 f4 brne .+16 ; 0x20402 #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); 203f2: 4e e0 ldi r20, 0x0E ; 14 203f4: 50 e0 ldi r21, 0x00 ; 0 203f6: 60 e8 ldi r22, 0x80 ; 128 203f8: 7c e0 ldi r23, 0x0C ; 12 203fa: 81 ee ldi r24, 0xE1 ; 225 203fc: 92 e0 ldi r25, 0x02 ; 2 203fe: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 #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); 20402: 85 e0 ldi r24, 0x05 ; 5 20404: 9d e0 ldi r25, 0x0D ; 13 20406: 0f 94 36 7c call 0x2f86c ; 0x2f86c eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 2040a: 8d ee ldi r24, 0xED ; 237 2040c: 9f e0 ldi r25, 0x0F ; 15 2040e: 0f 94 36 7c call 0x2f86c ; 0x2f86c eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 20412: 81 ef ldi r24, 0xF1 ; 241 20414: 9f e0 ldi r25, 0x0F ; 15 20416: 0f 94 36 7c call 0x2f86c ; 0x2f86c eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 2041a: 60 e0 ldi r22, 0x00 ; 0 2041c: 8e ec ldi r24, 0xCE ; 206 2041e: 9e e0 ldi r25, 0x0E ; 14 20420: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 20424: 61 e0 ldi r22, 0x01 ; 1 20426: 87 ea ldi r24, 0xA7 ; 167 20428: 9c e0 ldi r25, 0x0C ; 12 2042a: 0e 94 a5 77 call 0xef4a ; 0xef4a putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 2042e: 8e ef ldi r24, 0xFE ; 254 20430: 9f e0 ldi r25, 0x0F ; 15 20432: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 20436: 0e 94 fa 72 call 0xe5f4 ; 0xe5f4 2043a: 81 11 cpse r24, r1 2043c: 02 c0 rjmp .+4 ; 0x20442 lcd_language(); 2043e: 0f 94 34 27 call 0x24e68 ; 0x24e68 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 20442: 60 e0 ldi r22, 0x00 ; 0 20444: 8f ea ldi r24, 0xAF ; 175 20446: 9f e0 ldi r25, 0x0F ; 15 20448: 0e 94 a5 77 call 0xef4a ; 0xef4a if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 2044c: 86 ea ldi r24, 0xA6 ; 166 2044e: 9f e0 ldi r25, 0x0F ; 15 20450: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 20454: 8f 3f cpi r24, 0xFF ; 255 20456: d9 f4 brne .+54 ; 0x2048e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20458: 61 e0 ldi r22, 0x01 ; 1 2045a: 86 ea ldi r24, 0xA6 ; 166 2045c: 9f e0 ldi r25, 0x0F ; 15 2045e: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 20462: 20 eb ldi r18, 0xB0 ; 176 20464: c2 2e mov r12, r18 20466: 2f e0 ldi r18, 0x0F ; 15 20468: 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); 2046a: 70 e0 ldi r23, 0x00 ; 0 2046c: 60 e0 ldi r22, 0x00 ; 0 2046e: c6 01 movw r24, r12 20470: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 20474: b2 e0 ldi r27, 0x02 ; 2 20476: cb 0e add r12, r27 20478: 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++) { 2047a: ea eb ldi r30, 0xBA ; 186 2047c: ce 16 cp r12, r30 2047e: ef e0 ldi r30, 0x0F ; 15 20480: de 06 cpc r13, r30 20482: 99 f7 brne .-26 ; 0x2046a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20484: 60 e0 ldi r22, 0x00 ; 0 20486: 8f ea ldi r24, 0xAF ; 175 20488: 9f e0 ldi r25, 0x0F ; 15 2048a: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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); 2048e: 60 e0 ldi r22, 0x00 ; 0 20490: 85 ea ldi r24, 0xA5 ; 165 20492: 9f e0 ldi r25, 0x0F ; 15 20494: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 20498: 60 e0 ldi r22, 0x00 ; 0 2049a: 8f e7 ldi r24, 0x7F ; 127 2049c: 9c e0 ldi r25, 0x0C ; 12 2049e: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 204a2: 60 e0 ldi r22, 0x00 ; 0 204a4: 89 e0 ldi r24, 0x09 ; 9 204a6: 9f e0 ldi r25, 0x0F ; 15 204a8: 0e 94 a5 77 call 0xef4a ; 0xef4a } 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); 204ac: 61 e0 ldi r22, 0x01 ; 1 204ae: 8c ea ldi r24, 0xAC ; 172 204b0: 9d e0 ldi r25, 0x0D ; 13 204b2: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 204b6: 63 e0 ldi r22, 0x03 ; 3 204b8: 8b ea ldi r24, 0xAB ; 171 204ba: 9d e0 ldi r25, 0x0D ; 13 204bc: 0e 94 a5 77 call 0xef4a ; 0xef4a eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 204c0: 63 e0 ldi r22, 0x03 ; 3 204c2: 8a ea ldi r24, 0xAA ; 170 204c4: 9d e0 ldi r25, 0x0D ; 13 204c6: 0e 94 a5 77 call 0xef4a ; 0xef4a //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 204ca: 61 e0 ldi r22, 0x01 ; 1 204cc: 89 ea ldi r24, 0xA9 ; 169 204ce: 9d e0 ldi r25, 0x0D ; 13 204d0: 0e 94 a5 77 call 0xef4a ; 0xef4a #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 204d4: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 204d6: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 204d8: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 204dc: 8f 7b andi r24, 0xBF ; 191 204de: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 204e2: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 204e6: 80 68 ori r24, 0x80 ; 128 204e8: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 204ec: 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); 204ee: 84 e0 ldi r24, 0x04 ; 4 204f0: 80 93 96 02 sts 0x0296, r24 ; 0x800296 void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 204f4: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 204f6: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 204f8: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 204fa: 50 9a sbi 0x0a, 0 ; 10 204fc: 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); 204fe: 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); 20500: f5 e0 ldi r31, 0x05 ; 5 20502: fa 95 dec r31 20504: f1 f7 brne .-4 ; 0x20502 20506: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 20508: 58 98 cbi 0x0b, 0 ; 11 2050a: 25 e0 ldi r18, 0x05 ; 5 2050c: 2a 95 dec r18 2050e: f1 f7 brne .-4 ; 0x2050c 20510: 00 00 nop 20512: 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++) { 20514: a1 f7 brne .-24 ; 0x204fe WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 20516: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 20518: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 2051a: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2051e: 8c 7f andi r24, 0xFC ; 252 20520: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 20524: 8c e0 ldi r24, 0x0C ; 12 20526: 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); 2052a: 84 ea ldi r24, 0xA4 ; 164 2052c: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 20530: 88 e0 ldi r24, 0x08 ; 8 20532: 0f 94 c8 3f call 0x27f90 ; 0x27f90 20536: 81 11 cpse r24, r1 20538: 14 c0 rjmp .+40 ; 0x20562 return 1; // send address TWDR = TW_WRITE | (address << 1); 2053a: 8a ee ldi r24, 0xEA ; 234 2053c: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 20540: 84 e8 ldi r24, 0x84 ; 132 20542: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 20546: 88 e1 ldi r24, 0x18 ; 24 20548: 0f 94 c8 3f call 0x27f90 ; 0x27f90 2054c: 81 11 cpse r24, r1 2054e: 09 c0 rjmp .+18 ; 0x20562 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 20550: 84 e9 ldi r24, 0x94 ; 148 20552: 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)); 20556: 82 e7 ldi r24, 0x72 ; 114 20558: 91 e4 ldi r25, 0x41 ; 65 2055a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2055e: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 20562: 02 30 cpi r16, 0x02 ; 2 20564: 81 f0 breq .+32 ; 0x20586 20566: 03 30 cpi r16, 0x03 ; 3 20568: 09 f4 brne .+2 ; 0x2056c 2056a: 37 c1 rjmp .+622 ; 0x207da 2056c: 01 30 cpi r16, 0x01 ; 1 2056e: b9 f4 brne .+46 ; 0x2059e //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)); 20570: 84 ea ldi r24, 0xA4 ; 164 20572: 93 e4 ldi r25, 0x43 ; 67 20574: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20578: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 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); 2057c: 66 e3 ldi r22, 0x36 ; 54 2057e: 71 e0 ldi r23, 0x01 ; 1 20580: 8c ee ldi r24, 0xEC ; 236 20582: 9e e0 ldi r25, 0x0E ; 14 20584: 0a c0 rjmp .+20 ; 0x2059a eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 20586: 83 e8 ldi r24, 0x83 ; 131 20588: 93 e4 ldi r25, 0x43 ; 67 2058a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2058e: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 20592: 6e e2 ldi r22, 0x2E ; 46 20594: 71 e0 ldi r23, 0x01 ; 1 20596: 8e ee ldi r24, 0xEE ; 238 20598: 9e e0 ldi r25, 0x0E ; 14 2059a: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 2059e: f1 10 cpse r15, r1 205a0: 08 c0 rjmp .+16 ; 0x205b2 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 205a2: 8c e0 ldi r24, 0x0C ; 12 205a4: 93 e4 ldi r25, 0x43 ; 67 205a6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 205aa: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 Config_StoreSettings(); 205ae: 0e 94 e0 83 call 0x107c0 ; 0x107c0 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 205b2: 80 e8 ldi r24, 0x80 ; 128 205b4: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 205b8: 88 23 and r24, r24 205ba: c9 f0 breq .+50 ; 0x205ee CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 205bc: 87 ef ldi r24, 0xF7 ; 247 205be: 9f e0 ldi r25, 0x0F ; 15 205c0: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 205c4: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 205c6: 81 30 cpi r24, 0x01 ; 1 205c8: 71 f4 brne .+28 ; 0x205e6 // 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)) { 205ca: 82 ec ldi r24, 0xC2 ; 194 205cc: 9f e8 ldi r25, 0x8F ; 143 205ce: 0e 94 be d2 call 0x1a57c ; 0x1a57c 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); 205d2: 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)) { 205d4: 88 23 and r24, r24 205d6: 39 f0 breq .+14 ; 0x205e6 // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 205d8: 8a ec ldi r24, 0xCA ; 202 205da: 92 e4 ldi r25, 0x42 ; 66 205dc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 205e0: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 205e4: 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); 205e6: 86 ea ldi r24, 0xA6 ; 166 205e8: 9c e0 ldi r25, 0x0C ; 12 205ea: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 205ee: 8a eb ldi r24, 0xBA ; 186 205f0: 9f e8 ldi r25, 0x8F ; 143 205f2: 0e 94 be d2 call 0x1a57c ; 0x1a57c 205f6: f8 2e mov r15, r24 205f8: 88 23 and r24, r24 205fa: 31 f0 breq .+12 ; 0x20608 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 205fc: 8f e1 ldi r24, 0x1F ; 31 205fe: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 20602: 91 e0 ldi r25, 0x01 ; 1 20604: f8 2e mov r15, r24 20606: 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; 20608: 10 e0 ldi r17, 0x00 ; 0 2060a: 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)); 2060c: f8 01 movw r30, r16 2060e: e5 55 subi r30, 0x55 ; 85 20610: f0 47 sbci r31, 0x70 ; 112 20612: 64 91 lpm r22, Z 20614: c8 01 movw r24, r16 20616: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 2061a: 0f 5f subi r16, 0xFF ; 255 2061c: 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){ 2061e: 0a 30 cpi r16, 0x0A ; 10 20620: 11 05 cpc r17, r1 20622: a1 f7 brne .-24 ; 0x2060c 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])); 20624: ea eb ldi r30, 0xBA ; 186 20626: ff e8 ldi r31, 0x8F ; 143 20628: 65 91 lpm r22, Z+ 2062a: 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); 2062c: 8a e0 ldi r24, 0x0A ; 10 2062e: 90 e0 ldi r25, 0x00 ; 0 20630: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 20634: ec eb ldi r30, 0xBC ; 188 20636: ff e8 ldi r31, 0x8F ; 143 20638: 65 91 lpm r22, Z+ 2063a: 74 91 lpm r23, Z 2063c: 8c e0 ldi r24, 0x0C ; 12 2063e: 90 e0 ldi r25, 0x00 ; 0 20640: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 20644: ee eb ldi r30, 0xBE ; 190 20646: ff e8 ldi r31, 0x8F ; 143 20648: 65 91 lpm r22, Z+ 2064a: 74 91 lpm r23, Z 2064c: 8e e0 ldi r24, 0x0E ; 14 2064e: 90 e0 ldi r25, 0x00 ; 0 20650: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 // 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])); 20654: e0 ec ldi r30, 0xC0 ; 192 20656: ff e8 ldi r31, 0x8F ; 143 20658: 65 91 lpm r22, Z+ 2065a: 74 91 lpm r23, Z 2065c: 80 e1 ldi r24, 0x10 ; 16 2065e: 90 e0 ldi r25, 0x00 ; 0 20660: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 20664: 8f e5 ldi r24, 0x5F ; 95 20666: 9f e0 ldi r25, 0x0F ; 15 20668: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2066c: 88 23 and r24, r24 2066e: 09 f4 brne .+2 ; 0x20672 20670: c1 c0 rjmp .+386 ; 0x207f4 // first time run of wizard or service prep lcd_wizard(WizState::Run); 20672: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 20674: 0f 94 bf 65 call 0x2cb7e ; 0x2cb7e lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 20678: 83 e0 ldi r24, 0x03 ; 3 2067a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 2067e: 81 e0 ldi r24, 0x01 ; 1 20680: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_clear(); 20684: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_update(2); 20688: 82 e0 ldi r24, 0x02 ; 2 2068a: 0e 94 6d 6f call 0xdeda ; 0xdeda #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 2068e: 60 e0 ldi r22, 0x00 ; 0 20690: 8e ef ldi r24, 0xFE ; 254 20692: 9e e0 ldi r25, 0x0E ; 14 20694: 0e 94 a5 77 call 0xef4a ; 0xef4a 20698: 80 93 f3 04 sts 0x04F3, r24 ; 0x8004f3 tmc2130_home_bsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_BSTEPS, 48); 2069c: 60 e3 ldi r22, 0x30 ; 48 2069e: 8d ef ldi r24, 0xFD ; 253 206a0: 9e e0 ldi r25, 0x0E ; 14 206a2: 0e 94 a5 77 call 0xef4a ; 0xef4a 206a6: 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); 206aa: 60 e3 ldi r22, 0x30 ; 48 206ac: 8c ef ldi r24, 0xFC ; 252 206ae: 9e e0 ldi r25, 0x0E ; 14 206b0: 0e 94 a5 77 call 0xef4a ; 0xef4a 206b4: 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); 206b8: 60 e0 ldi r22, 0x00 ; 0 206ba: 8b ef ldi r24, 0xFB ; 251 206bc: 9e e0 ldi r25, 0x0E ; 14 206be: 0e 94 a5 77 call 0xef4a ; 0xef4a 206c2: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 tmc2130_home_bsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_BSTEPS, 48); 206c6: 60 e3 ldi r22, 0x30 ; 48 206c8: 8a ef ldi r24, 0xFA ; 250 206ca: 9e e0 ldi r25, 0x0E ; 14 206cc: 0e 94 a5 77 call 0xef4a ; 0xef4a 206d0: 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); 206d4: 60 e3 ldi r22, 0x30 ; 48 206d6: 89 ef ldi r24, 0xF9 ; 249 206d8: 9e e0 ldi r25, 0x0E ; 14 206da: 0e 94 a5 77 call 0xef4a ; 0xef4a 206de: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 206e2: 60 e0 ldi r22, 0x00 ; 0 206e4: 88 ef ldi r24, 0xF8 ; 248 206e6: 9e e0 ldi r25, 0x0E ; 14 206e8: 0e 94 a5 77 call 0xef4a ; 0xef4a 206ec: 80 93 f2 04 sts 0x04F2, r24 ; 0x8004f2 static void fw_crash_init() { #ifdef XFLASH_DUMP dump_crash_reason crash_reason; if(xfdump_check_state(&crash_reason)) 206f0: ce 01 movw r24, r28 206f2: 01 96 adiw r24, 0x01 ; 1 206f4: 0e 94 97 e3 call 0x1c72e ; 0x1c72e 206f8: 88 23 and r24, r24 206fa: 89 f0 breq .+34 ; 0x2071e { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 206fc: 8d e3 ldi r24, 0x3D ; 61 206fe: 9d e6 ldi r25, 0x6D ; 109 20700: 0f 94 2f dc call 0x3b85e ; 0x3b85e #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 20704: 89 81 ldd r24, Y+1 ; 0x01 20706: 88 23 and r24, r24 20708: 51 f0 breq .+20 ; 0x2071e eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 2070a: 83 e0 ldi r24, 0x03 ; 3 2070c: 9d e0 ldi r25, 0x0D ; 13 2070e: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c { // 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 && 20712: 8f 3f cpi r24, 0xFF ; 255 20714: 21 f0 breq .+8 ; 0x2071e eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 20716: 89 ec ldi r24, 0xC9 ; 201 20718: 9c e6 ldi r25, 0x6C ; 108 2071a: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2071e: 6f ef ldi r22, 0xFF ; 255 20720: 83 e0 ldi r24, 0x03 ; 3 20722: 9d e0 ldi r25, 0x0D ; 13 20724: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 20728: 0e 94 41 68 call 0xd082 ; 0xd082 2072c: 88 23 and r24, r24 2072e: d9 f1 breq .+118 ; 0x207a6 manage_heater(); // Update temperatures 20730: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 20734: 8c e8 ldi r24, 0x8C ; 140 20736: 9f e0 ldi r25, 0x0F ; 15 20738: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2073c: 08 2f mov r16, r24 2073e: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 20742: 80 90 ee 04 lds r8, 0x04EE ; 0x8004ee 20746: 90 90 ef 04 lds r9, 0x04EF ; 0x8004ef 2074a: a0 90 f0 04 lds r10, 0x04F0 ; 0x8004f0 2074e: b0 90 f1 04 lds r11, 0x04F1 ; 0x8004f1 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER printf_P(_N("Power panic detected!\nCurrent bed temp:%d\nSaved bed temp:%d\n"), (int)degBed(), eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED)); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER uvlo_auto_recovery_ready = (degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET)); 20752: 8b e8 ldi r24, 0x8B ; 139 20754: 9f e0 ldi r25, 0x0F ; 15 20756: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2075a: 68 2f mov r22, r24 2075c: 70 e0 ldi r23, 0x00 ; 0 2075e: 90 e0 ldi r25, 0x00 ; 0 20760: 80 e0 ldi r24, 0x00 ; 0 20762: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 20766: 20 e0 ldi r18, 0x00 ; 0 20768: 30 e0 ldi r19, 0x00 ; 0 2076a: 40 ea ldi r20, 0xA0 ; 160 2076c: 50 e4 ldi r21, 0x40 ; 64 2076e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 20772: 6b 01 movw r12, r22 20774: 7c 01 movw r14, r24 20776: 11 e0 ldi r17, 0x01 ; 1 20778: ac 01 movw r20, r24 2077a: 9b 01 movw r18, r22 2077c: c5 01 movw r24, r10 2077e: b4 01 movw r22, r8 20780: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 20784: 18 16 cp r1, r24 20786: 0c f0 brlt .+2 ; 0x2078a 20788: 10 e0 ldi r17, 0x00 ; 0 2078a: 10 93 ed 04 sts 0x04ED, r17 ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.551> if (uvlo_auto_recovery_ready){ 2078e: a7 01 movw r20, r14 20790: 96 01 movw r18, r12 20792: c5 01 movw r24, r10 20794: b4 01 movw r22, r8 20796: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 2079a: 18 16 cp r1, r24 2079c: 0c f0 brlt .+2 ; 0x207a0 2079e: 58 c0 rjmp .+176 ; 0x20850 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 207a0: 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); 207a2: 0f 94 b6 d2 call 0x3a56c ; 0x3a56c printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 207a6: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 207a8: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 207aa: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 207ae: 81 60 ori r24, 0x01 ; 1 207b0: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 207b4: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 207b8: 8d 7f andi r24, 0xFD ; 253 207ba: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 207be: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 207c0: 64 99 sbic 0x0c, 4 ; 12 207c2: 57 c0 rjmp .+174 ; 0x20872 207c4: 0e 94 41 68 call 0xd082 ; 0xd082 207c8: 88 23 and r24, r24 207ca: 09 f4 brne .+2 ; 0x207ce 207cc: 52 c0 rjmp .+164 ; 0x20872 { SERIAL_ECHOLNRPGM(MSG_INT4); 207ce: 85 eb ldi r24, 0xB5 ; 181 207d0: 9f e8 ldi r25, 0x8F ; 143 207d2: 0e 94 17 7b call 0xf62e ; 0xf62e uvlo_drain_reset(); 207d6: 0f 94 ef a9 call 0x353de ; 0x353de 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)); 207da: 88 e4 ldi r24, 0x48 ; 72 207dc: 93 e4 ldi r25, 0x43 ; 67 207de: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 207e2: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 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); 207e6: 6e e2 ldi r22, 0x2E ; 46 207e8: 71 e0 ldi r23, 0x01 ; 1 207ea: 8e ee ldi r24, 0xEE ; 238 207ec: 9e e0 ldi r25, 0x0E ; 14 207ee: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 207f2: c4 ce rjmp .-632 ; 0x2057c // 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); 207f4: 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) { 207f6: f1 10 cpse r15, r1 207f8: 3d cf rjmp .-390 ; 0x20674 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 207fa: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 207fe: 81 11 cpse r24, r1 20800: 07 c0 rjmp .+14 ; 0x20810 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 20802: 8a e5 ldi r24, 0x5A ; 90 20804: 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)); 20806: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2080a: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 2080e: 34 cf rjmp .-408 ; 0x20678 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)) { 20810: 84 e0 ldi r24, 0x04 ; 4 20812: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 20816: 81 11 cpse r24, r1 20818: 03 c0 rjmp .+6 ; 0x20820 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 2081a: 82 ee ldi r24, 0xE2 ; 226 2081c: 91 e4 ldi r25, 0x41 ; 65 2081e: f3 cf rjmp .-26 ; 0x20806 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 20820: 80 e1 ldi r24, 0x10 ; 16 20822: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 20826: 81 11 cpse r24, r1 20828: 06 c0 rjmp .+12 ; 0x20836 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 2082a: 8a eb ldi r24, 0xBA ; 186 2082c: 97 e4 ldi r25, 0x47 ; 71 2082e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20832: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 20836: 88 e0 ldi r24, 0x08 ; 8 20838: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 2083c: 81 11 cpse r24, r1 2083e: 1c cf rjmp .-456 ; 0x20678 20840: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> 20844: 88 23 and r24, r24 20846: 09 f4 brne .+2 ; 0x2084a 20848: 17 cf rjmp .-466 ; 0x20678 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 2084a: 8e eb ldi r24, 0xBE ; 190 2084c: 91 e4 ldi r25, 0x41 ; 65 2084e: db cf rjmp .-74 ; 0x20806 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) { 20850: 01 30 cpi r16, 0x01 ; 1 20852: 11 f4 brne .+4 ; 0x20858 recover_print(0); 20854: 80 e0 ldi r24, 0x00 ; 0 20856: a5 cf rjmp .-182 ; 0x207a2 } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 20858: 8a e9 ldi r24, 0x9A ; 154 2085a: 91 e4 ldi r25, 0x41 ; 65 2085c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20860: 41 e0 ldi r20, 0x01 ; 1 20862: 60 e0 ldi r22, 0x00 ; 0 20864: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c if ( btn == LCD_LEFT_BUTTON_CHOICE) { 20868: 88 23 and r24, r24 2086a: a1 f3 breq .-24 ; 0x20854 recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 2086c: 0e 94 73 65 call 0xcae6 ; 0xcae6 20870: 9a cf rjmp .-204 ; 0x207a6 ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 20872: 61 e0 ldi r22, 0x01 ; 1 20874: 88 ea ldi r24, 0xA8 ; 168 20876: 9d e0 ldi r25, 0x0D ; 13 20878: 0e 94 a5 77 call 0xef4a ; 0xef4a 2087c: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec if (farm_mode) { oCheckMode = ClCheckMode::_Strict; eeprom_update_byte_notify((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Strict); } oNozzleDiameter = (ClNozzleDiameter)eeprom_init_default_byte((uint8_t *)EEPROM_NOZZLE_DIAMETER, (uint8_t)ClNozzleDiameter::_Diameter_400); 20880: 68 e2 ldi r22, 0x28 ; 40 20882: 87 ea ldi r24, 0xA7 ; 167 20884: 9d e0 ldi r25, 0x0D ; 13 20886: 0e 94 a5 77 call 0xef4a ; 0xef4a 2088a: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 2088e: 60 e9 ldi r22, 0x90 ; 144 20890: 71 e0 ldi r23, 0x01 ; 1 20892: 85 ea ldi r24, 0xA5 ; 165 20894: 9d e0 ldi r25, 0x0D ; 13 20896: 0e 94 8d 77 call 0xef1a ; 0xef1a oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 2089a: 61 e0 ldi r22, 0x01 ; 1 2089c: 84 ea ldi r24, 0xA4 ; 164 2089e: 9d e0 ldi r25, 0x0D ; 13 208a0: 0e 94 a5 77 call 0xef4a ; 0xef4a 208a4: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 208a8: 61 e0 ldi r22, 0x01 ; 1 208aa: 83 ea ldi r24, 0xA3 ; 163 208ac: 9d e0 ldi r25, 0x0D ; 13 208ae: 0e 94 a5 77 call 0xef4a ; 0xef4a 208b2: 80 93 e9 04 sts 0x04E9, r24 ; 0x8004e9 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 208b6: 61 e0 ldi r22, 0x01 ; 1 208b8: 82 ea ldi r24, 0xA2 ; 162 208ba: 9d e0 ldi r25, 0x0D ; 13 208bc: 0e 94 a5 77 call 0xef4a ; 0xef4a 208c0: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 208c4: 61 e0 ldi r22, 0x01 ; 1 208c6: 80 e2 ldi r24, 0x20 ; 32 208c8: 9c e0 ldi r25, 0x0C ; 12 208ca: 0e 94 a5 77 call 0xef4a ; 0xef4a 208ce: 80 93 e7 04 sts 0x04E7, r24 ; 0x8004e7 // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 208d2: 81 e0 ldi r24, 0x01 ; 1 208d4: 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" ); 208d8: 88 e1 ldi r24, 0x18 ; 24 208da: 98 e2 ldi r25, 0x28 ; 40 208dc: 0f b6 in r0, 0x3f ; 63 208de: f8 94 cli 208e0: a8 95 wdr 208e2: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 208e6: 0f be out 0x3f, r0 ; 63 208e8: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 208ec: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 208f0: 80 64 ori r24, 0x40 ; 64 208f2: 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; 208f6: 85 e0 ldi r24, 0x05 ; 5 208f8: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 208fa: 00 e0 ldi r16, 0x00 ; 0 208fc: 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); 208fe: cc 24 eor r12, r12 20900: 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); 20902: 94 e0 ldi r25, 0x04 ; 4 20904: 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; 20906: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a if(Stopped) { 2090a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2090e: 88 23 and r24, r24 20910: 09 f4 brne .+2 ; 0x20914 20912: c4 c0 rjmp .+392 ; 0x20a9c // 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); 20914: 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. 20918: 0e 94 4b 68 call 0xd096 ; 0xd096 2091c: 88 23 and r24, r24 2091e: 09 f4 brne .+2 ; 0x20922 20920: c0 c0 rjmp .+384 ; 0x20aa2 20922: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 20926: 81 30 cpi r24, 0x01 ; 1 20928: 09 f0 breq .+2 ; 0x2092c 2092a: bb c0 rjmp .+374 ; 0x20aa2 usb_timer.start(); 2092c: 8e e0 ldi r24, 0x0E ; 14 2092e: 95 e0 ldi r25, 0x05 ; 5 20930: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> } else #endif { get_command(); 20934: 0e 94 5c 84 call 0x108b8 ; 0x108b8 // 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) 20938: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.571> 2093c: 88 23 and r24, r24 2093e: 89 f0 breq .+34 ; 0x20962 return; if(autostart_atmillis.expired(5000)) 20940: 68 e8 ldi r22, 0x88 ; 136 20942: 73 e1 ldi r23, 0x13 ; 19 20944: 8c e7 ldi r24, 0x7C ; 124 20946: 97 e1 ldi r25, 0x17 ; 23 20948: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 2094c: 81 11 cpse r24, r1 2094e: 09 c0 rjmp .+18 ; 0x20962 return; } autostart_stilltocheck = false; 20950: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.571> if(!mounted) 20954: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 20958: 88 23 and r24, r24 2095a: 09 f4 brne .+2 ; 0x2095e 2095c: ae c0 rjmp .+348 ; 0x20aba 2095e: 0f 94 90 77 call 0x2ef20 ; 0x2ef20 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 20962: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 20966: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 2096a: 89 2b or r24, r25 2096c: 09 f4 brne .+2 ; 0x20970 2096e: 61 c0 rjmp .+194 ; 0x20a32 { cmdbuffer_front_already_processed = false; 20970: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d #ifdef SDSUPPORT if(card.saving) 20974: 80 91 69 14 lds r24, 0x1469 ; 0x801469 20978: 88 23 and r24, r24 2097a: d1 f1 breq .+116 ; 0x209f0 { // 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) { 2097c: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 20980: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 20984: dc 01 movw r26, r24 20986: ad 57 subi r26, 0x7D ; 125 20988: bf 4e sbci r27, 0xEF ; 239 2098a: 7d 01 movw r14, r26 2098c: 63 e6 ldi r22, 0x63 ; 99 2098e: 70 e9 ldi r23, 0x90 ; 144 20990: cd 01 movw r24, r26 20992: 0f 94 4d db call 0x3b69a ; 0x3b69a 20996: 89 2b or r24, r25 20998: 09 f0 breq .+2 ; 0x2099c 2099a: 9c c0 rjmp .+312 ; 0x20ad4 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 2099c: 10 92 fb 16 sts 0x16FB, r1 ; 0x8016fb /** Write a string to a file. Used by the Arduino Print class. * \param[in] str Pointer to the string. * Use writeError to check for errors. */ void SdFile::write(const char* str) { SdBaseFile::write(str, strlen(str)); 209a0: f7 01 movw r30, r14 209a2: 01 90 ld r0, Z+ 209a4: 00 20 and r0, r0 209a6: e9 f7 brne .-6 ; 0x209a2 209a8: 31 97 sbiw r30, 0x01 ; 1 209aa: bf 01 movw r22, r30 209ac: 6e 19 sub r22, r14 209ae: 7f 09 sbc r23, r15 209b0: c7 01 movw r24, r14 209b2: 0f 94 cb 83 call 0x30796 ; 0x30796 209b6: 62 e0 ldi r22, 0x02 ; 2 209b8: 70 e0 ldi r23, 0x00 ; 0 209ba: 8f ee ldi r24, 0xEF ; 239 209bc: 92 e0 ldi r25, 0x02 ; 2 209be: 0f 94 cb 83 call 0x30796 ; 0x30796 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 209c2: 80 91 fb 16 lds r24, 0x16FB ; 0x8016fb 209c6: 88 23 and r24, r24 209c8: 41 f0 breq .+16 ; 0x209da { SERIAL_ERROR_START; 209ca: 8c ee ldi r24, 0xEC ; 236 209cc: 99 ea ldi r25, 0xA9 ; 169 209ce: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 209d2: 8c e1 ldi r24, 0x1C ; 28 209d4: 9e e6 ldi r25, 0x6E ; 110 209d6: 0e 94 17 7b call 0xf62e ; 0xf62e card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 209da: 80 91 6a 14 lds r24, 0x146A ; 0x80146a 209de: 88 23 and r24, r24 209e0: 09 f4 brne .+2 ; 0x209e4 209e2: 73 c0 rjmp .+230 ; 0x20aca */ void process_commands() { if (!buflen) return; //empty command 209e4: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 209e8: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 209ec: 89 2b or r24, r25 209ee: 11 f0 breq .+4 ; 0x209f4 209f0: 0e 94 38 97 call 0x12e70 ; 0x12e70 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 209f4: 80 91 7d 10 lds r24, 0x107D ; 0x80107d 209f8: 81 11 cpse r24, r1 209fa: 19 c0 rjmp .+50 ; 0x20a2e 209fc: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 20a00: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 20a04: 89 2b or r24, r25 20a06: 99 f0 breq .+38 ; 0x20a2e { // 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; 20a08: e0 91 6d 12 lds r30, 0x126D ; 0x80126d 20a0c: f0 91 6e 12 lds r31, 0x126E ; 0x80126e 20a10: e0 58 subi r30, 0x80 ; 128 20a12: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 20a14: 80 81 ld r24, Z 20a16: 82 30 cpi r24, 0x02 ; 2 20a18: 09 f0 breq .+2 ; 0x20a1c 20a1a: 6b c0 rjmp .+214 ; 0x20af2 { // 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(); 20a1c: 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; 20a1e: 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); 20a20: 81 81 ldd r24, Z+1 ; 0x01 20a22: 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); 20a24: 0f 94 21 aa call 0x35442 ; 0x35442 sei(); 20a28: 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(); 20a2a: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 } host_keepalive(); 20a2e: 0e 94 43 81 call 0x10286 ; 0x10286 } } //check heater every n milliseconds manage_heater(); 20a32: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(printingIsPaused()); 20a36: 0e 94 4b 68 call 0xd096 ; 0xd096 20a3a: 0e 94 f3 8b call 0x117e6 ; 0x117e6 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 20a3e: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.495> 20a42: 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; 20a44: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.495> checkHitEndstops(); lcd_update(0); 20a48: 80 e0 ldi r24, 0x00 ; 0 20a4a: 0e 94 6d 6f call 0xdeda ; 0xdeda #ifdef TMC2130 tmc2130_check_overtemp(); 20a4e: 0f 94 f6 3f call 0x27fec ; 0x27fec if (tmc2130_sg_crash) 20a52: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 20a56: 88 23 and r24, r24 20a58: 79 f0 breq .+30 ; 0x20a78 { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 20a5a: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d // crashdet_stop_and_save_print(); switch (crash) 20a5e: 82 30 cpi r24, 0x02 ; 2 20a60: 09 f4 brne .+2 ; 0x20a64 20a62: 53 c0 rjmp .+166 ; 0x20b0a 20a64: 83 30 cpi r24, 0x03 ; 3 20a66: 09 f4 brne .+2 ; 0x20a6a 20a68: 54 c0 rjmp .+168 ; 0x20b12 20a6a: 81 30 cpi r24, 0x01 ; 1 20a6c: 29 f4 brne .+10 ; 0x20a78 { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 20a6e: 61 e0 ldi r22, 0x01 ; 1 20a70: 83 e5 ldi r24, 0x53 ; 83 20a72: 90 e9 ldi r25, 0x90 ; 144 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20a74: 0e 94 5c 89 call 0x112b8 ; 0x112b8 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) { 20a78: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.560> 20a7c: 81 11 cpse r24, r1 20a7e: 07 c0 rjmp .+14 ; 0x20a8e return; } avoidRecursion = true; 20a80: c0 92 0c 05 sts 0x050C, r12 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.560> mmu_loop_inner(true); 20a84: 81 e0 ldi r24, 0x01 ; 1 20a86: 0f 94 e3 99 call 0x333c6 ; 0x333c6 avoidRecursion = false; 20a8a: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.560> 20a8e: 01 15 cp r16, r1 20a90: 11 05 cpc r17, r1 20a92: 09 f4 brne .+2 ; 0x20a96 20a94: 38 cf rjmp .-400 ; 0x20906 20a96: 0e 94 00 00 call 0 ; 0x0 <__vectors> 20a9a: 35 cf rjmp .-406 ; 0x20906 // 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); 20a9c: c0 92 96 02 sts 0x0296, r12 ; 0x800296 20aa0: 3b cf rjmp .-394 ; 0x20918 } 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. 20aa2: 60 e1 ldi r22, 0x10 ; 16 20aa4: 77 e2 ldi r23, 0x27 ; 39 20aa6: 8e e0 ldi r24, 0x0E ; 14 20aa8: 95 e0 ldi r25, 0x05 ; 5 20aaa: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 20aae: 88 23 and r24, r24 20ab0: 09 f4 brne .+2 ; 0x20ab4 20ab2: 40 cf rjmp .-384 ; 0x20934 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 20ab4: b0 92 64 0e sts 0x0E64, r11 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 20ab8: 3d cf rjmp .-390 ; 0x20934 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 20aba: 81 e0 ldi r24, 0x01 ; 1 20abc: 0f 94 2d 81 call 0x3025a ; 0x3025a if(!mounted) //fail 20ac0: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 20ac4: 81 11 cpse r24, r1 20ac6: 4b cf rjmp .-362 ; 0x2095e 20ac8: 4c cf rjmp .-360 ; 0x20962 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); 20aca: 84 e4 ldi r24, 0x44 ; 68 20acc: 9e e6 ldi r25, 0x6E ; 110 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 20ace: 0e 94 17 7b call 0xf62e ; 0xf62e 20ad2: 90 cf rjmp .-224 ; 0x209f4 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20ad4: 8b ef ldi r24, 0xFB ; 251 20ad6: 96 e1 ldi r25, 0x16 ; 22 20ad8: 0f 94 31 6e call 0x2dc62 ; 0x2dc62 file.close(); 20adc: 8b ef ldi r24, 0xFB ; 251 20ade: 96 e1 ldi r25, 0x16 ; 22 20ae0: 0f 94 29 a4 call 0x34852 ; 0x34852 saving = false; 20ae4: 10 92 69 14 sts 0x1469, r1 ; 0x801469 logging = false; 20ae8: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a 20aec: 82 e3 ldi r24, 0x32 ; 50 20aee: 9e e6 ldi r25, 0x6E ; 110 20af0: ee cf rjmp .-36 ; 0x20ace // 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){ 20af2: 86 30 cpi r24, 0x06 ; 6 20af4: 09 f0 breq .+2 ; 0x20af8 20af6: 99 cf rjmp .-206 ; 0x20a2a 20af8: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 20afc: 81 11 cpse r24, r1 20afe: 95 cf rjmp .-214 ; 0x20a2a cli(); 20b00: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 20b02: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 20b04: 81 e0 ldi r24, 0x01 ; 1 20b06: 90 e0 ldi r25, 0x00 ; 0 20b08: 8d cf rjmp .-230 ; 0x20a24 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; 20b0a: 61 e0 ldi r22, 0x01 ; 1 20b0c: 83 e4 ldi r24, 0x43 ; 67 20b0e: 90 e9 ldi r25, 0x90 ; 144 20b10: b1 cf rjmp .-158 ; 0x20a74 case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20b12: 61 e0 ldi r22, 0x01 ; 1 20b14: 82 e3 ldi r24, 0x32 ; 50 20b16: 90 e9 ldi r25, 0x90 ; 144 20b18: ad cf rjmp .-166 ; 0x20a74 { 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; 20b1a: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 20b1c: 86 33 cpi r24, 0x36 ; 54 20b1e: 91 40 sbci r25, 0x01 ; 1 20b20: 09 f0 breq .+2 ; 0x20b24 20b22: 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(); 20b24: 0e 94 c8 83 call 0x10790 ; 0x10790 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; 20b28: 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; 20b2a: 82 ea ldi r24, 0xA2 ; 162 20b2c: 92 ea ldi r25, 0xA2 ; 162 20b2e: a0 e0 ldi r26, 0x00 ; 0 20b30: b0 e0 ldi r27, 0x00 ; 0 20b32: 80 93 36 18 sts 0x1836, r24 ; 0x801836 <__bss_end+0x20> 20b36: 90 93 37 18 sts 0x1837, r25 ; 0x801837 <__bss_end+0x21> 20b3a: a0 93 38 18 sts 0x1838, r26 ; 0x801838 <__bss_end+0x22> 20b3e: b0 93 39 18 sts 0x1839, r27 ; 0x801839 <__bss_end+0x23> // Finish init of mult extruder arrays for(int e = 0; e < EXTRUDERS; e++) { // populate with the first value maxttemp[e] = maxttemp[0]; #ifdef PIDTEMP iState_sum_min[e] = 0.0; 20b42: 10 92 aa 04 sts 0x04AA, r1 ; 0x8004aa <_ZL14iState_sum_min.lto_priv.482> 20b46: 10 92 ab 04 sts 0x04AB, r1 ; 0x8004ab <_ZL14iState_sum_min.lto_priv.482+0x1> 20b4a: 10 92 ac 04 sts 0x04AC, r1 ; 0x8004ac <_ZL14iState_sum_min.lto_priv.482+0x2> 20b4e: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL14iState_sum_min.lto_priv.482+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 20b52: 20 91 d7 06 lds r18, 0x06D7 ; 0x8006d7 20b56: 30 91 d8 06 lds r19, 0x06D8 ; 0x8006d8 20b5a: 40 91 d9 06 lds r20, 0x06D9 ; 0x8006d9 20b5e: 50 91 da 06 lds r21, 0x06DA ; 0x8006da 20b62: 60 e0 ldi r22, 0x00 ; 0 20b64: 70 e0 ldi r23, 0x00 ; 0 20b66: 8f e7 ldi r24, 0x7F ; 127 20b68: 93 e4 ldi r25, 0x43 ; 67 20b6a: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 20b6e: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 <_ZL14iState_sum_max.lto_priv.483> 20b72: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.483+0x1> 20b76: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.483+0x2> 20b7a: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.483+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 20b7e: 10 92 a2 04 sts 0x04A2, r1 ; 0x8004a2 <_ZL19temp_iState_min_bed.lto_priv.480> 20b82: 10 92 a3 04 sts 0x04A3, r1 ; 0x8004a3 <_ZL19temp_iState_min_bed.lto_priv.480+0x1> 20b86: 10 92 a4 04 sts 0x04A4, r1 ; 0x8004a4 <_ZL19temp_iState_min_bed.lto_priv.480+0x2> 20b8a: 10 92 a5 04 sts 0x04A5, r1 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.480+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 20b8e: 20 91 e3 06 lds r18, 0x06E3 ; 0x8006e3 20b92: 30 91 e4 06 lds r19, 0x06E4 ; 0x8006e4 20b96: 40 91 e5 06 lds r20, 0x06E5 ; 0x8006e5 20b9a: 50 91 e6 06 lds r21, 0x06E6 ; 0x8006e6 20b9e: 60 e0 ldi r22, 0x00 ; 0 20ba0: 70 e0 ldi r23, 0x00 ; 0 20ba2: 8f e7 ldi r24, 0x7F ; 127 20ba4: 93 e4 ldi r25, 0x43 ; 67 20ba6: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 20baa: 60 93 9e 04 sts 0x049E, r22 ; 0x80049e <_ZL19temp_iState_max_bed.lto_priv.481> 20bae: 70 93 9f 04 sts 0x049F, r23 ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.481+0x1> 20bb2: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.481+0x2> 20bb6: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.481+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 20bba: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20bbc: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20bbe: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20bc2: 88 60 ori r24, 0x08 ; 8 20bc4: 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)); 20bc8: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 20bcc: 90 e0 ldi r25, 0x00 ; 0 20bce: b4 e0 ldi r27, 0x04 ; 4 20bd0: 95 95 asr r25 20bd2: 87 95 ror r24 20bd4: ba 95 dec r27 20bd6: e1 f7 brne .-8 ; 0x20bd0 20bd8: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c <_ZL12soft_pwm_fan.lto_priv.474> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 20bdc: 8a e0 ldi r24, 0x0A ; 10 20bde: 90 e0 ldi r25, 0x00 ; 0 20be0: 90 93 9b 04 sts 0x049B, r25 ; 0x80049b <_ZL8minttemp.lto_priv.475+0x1> 20be4: 80 93 9a 04 sts 0x049A, r24 ; 0x80049a <_ZL8minttemp.lto_priv.475> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20be8: c0 90 54 02 lds r12, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.486> 20bec: d0 90 55 02 lds r13, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.486+0x1> 20bf0: c6 01 movw r24, r12 20bf2: 0e 94 9e da call 0x1b53c ; 0x1b53c 20bf6: 20 e0 ldi r18, 0x00 ; 0 20bf8: 30 e0 ldi r19, 0x00 ; 0 20bfa: 40 e2 ldi r20, 0x20 ; 32 20bfc: 51 e4 ldi r21, 0x41 ; 65 20bfe: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 20c02: 87 fd sbrc r24, 7 20c04: 02 c0 rjmp .+4 ; 0x20c0a 20c06: 0c 94 54 fd jmp 0x1faa8 ; 0x1faa8 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20c0a: e0 e1 ldi r30, 0x10 ; 16 20c0c: ce 1a sub r12, r30 20c0e: d1 08 sbc r13, r1 20c10: d0 92 55 02 sts 0x0255, r13 ; 0x800255 <_ZL12minttemp_raw.lto_priv.486+0x1> 20c14: c0 92 54 02 sts 0x0254, r12 ; 0x800254 <_ZL12minttemp_raw.lto_priv.486> 20c18: e7 cf rjmp .-50 ; 0x20be8 00020c1a : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20c1a: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 20c1e: 10 92 12 05 sts 0x0512, r1 ; 0x800512 20c22: 80 91 12 05 lds r24, 0x0512 ; 0x800512 20c26: 84 30 cpi r24, 0x04 ; 4 20c28: 08 f0 brcs .+2 ; 0x20c2c 20c2a: 41 c0 rjmp .+130 ; 0x20cae 20c2c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 20c30: 8d e0 ldi r24, 0x0D ; 13 20c32: 90 e4 ldi r25, 0x40 ; 64 20c34: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20c38: 0f 94 90 d1 call 0x3a320 ; 0x3a320 eeprom_update_byte_notify((uint8_t *)EEPROM_ALTFAN_OVERRIDE, altfanStatus.altfanOverride); } bool altfanOverride_get() { return altfanStatus.altfanOverride; 20c3c: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> #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 20c40: 81 ff sbrs r24, 1 20c42: 2f c0 rjmp .+94 ; 0x20ca2 20c44: 8c e7 ldi r24, 0x7C ; 124 20c46: 9d e5 ldi r25, 0x5D ; 93 20c48: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20c4c: 22 e0 ldi r18, 0x02 ; 2 20c4e: 49 ef ldi r20, 0xF9 ; 249 20c50: 5c e5 ldi r21, 0x5C ; 92 20c52: bc 01 movw r22, r24 20c54: 83 e3 ldi r24, 0x33 ; 51 20c56: 9c e6 ldi r25, 0x6C ; 108 20c58: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #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 20c5c: 0e 94 aa f9 call 0x1f354 ; 0x1f354 20c60: 88 23 and r24, r24 20c62: 11 f1 breq .+68 ; 0x20ca8 20c64: 82 e8 ldi r24, 0x82 ; 130 20c66: 9d e5 ldi r25, 0x5D ; 93 20c68: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20c6c: 22 e0 ldi r18, 0x02 ; 2 20c6e: 48 eb ldi r20, 0xB8 ; 184 20c70: 5a e3 ldi r21, 0x3A ; 58 20c72: bc 01 movw r22, r24 20c74: 87 e2 ldi r24, 0x27 ; 39 20c76: 9c e6 ldi r25, 0x6C ; 108 20c78: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #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 20c7c: 6d e7 ldi r22, 0x7D ; 125 20c7e: 72 ed ldi r23, 0xD2 ; 210 20c80: 84 e1 ldi r24, 0x14 ; 20 20c82: 9c e6 ldi r25, 0x6C ; 108 20c84: 0f 94 42 ce call 0x39c84 ; 0x39c84 #endif //PRUSA_SN_SUPPORT MENU_END(); 20c88: 0f 94 99 ce call 0x39d32 ; 0x39d32 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20c8c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 20c90: 8f 5f subi r24, 0xFF ; 255 20c92: 80 93 12 05 sts 0x0512, r24 ; 0x800512 20c96: 80 91 14 05 lds r24, 0x0514 ; 0x800514 20c9a: 8f 5f subi r24, 0xFF ; 255 20c9c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 20ca0: c0 cf rjmp .-128 ; 0x20c22 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 20ca2: 82 e8 ldi r24, 0x82 ; 130 20ca4: 9d e5 ldi r25, 0x5D ; 93 20ca6: d0 cf rjmp .-96 ; 0x20c48 #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 20ca8: 8c e7 ldi r24, 0x7C ; 124 20caa: 9d e5 ldi r25, 0x5D ; 93 20cac: dd cf rjmp .-70 ; 0x20c68 #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(); } 20cae: 08 95 ret 00020cb0 : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 20cb0: 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(); 20cb2: 0e 94 aa f9 call 0x1f354 ; 0x1f354 20cb6: c1 e0 ldi r28, 0x01 ; 1 20cb8: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 20cba: 6f ef ldi r22, 0xFF ; 255 20cbc: 09 f0 breq .+2 ; 0x20cc0 20cbe: 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); 20cc0: 84 e0 ldi r24, 0x04 ; 4 20cc2: 9d e0 ldi r25, 0x0D ; 13 20cc4: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 1 #else 0 #endif ) , enableECool(enableECool) { } 20cc8: 8c 2f mov r24, r28 20cca: 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)); 20ccc: 82 70 andi r24, 0x02 ; 2 } 20cce: 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)); 20cd0: 0d 94 f1 3b jmp 0x277e2 ; 0x277e2 00020cd4 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 20cd4: 44 e1 ldi r20, 0x14 ; 20 20cd6: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 20cd8: 66 23 and r22, r22 20cda: 89 f0 breq .+34 ; 0x20cfe strncpy_P(lcd_status_message, message, LCD_WIDTH); 20cdc: bc 01 movw r22, r24 20cde: 87 e3 ldi r24, 0x37 ; 55 20ce0: 95 e0 ldi r25, 0x05 ; 5 20ce2: 0f 94 33 db call 0x3b666 ; 0x3b666 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 20ce6: 10 92 4b 05 sts 0x054B, r1 ; 0x80054b <_ZL18lcd_status_message.lto_priv.467+0x14> lcd_status_message_idx = 0; // Print message from beginning 20cea: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.463> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 20cee: 80 ef ldi r24, 0xF0 ; 240 20cf0: 9b e6 ldi r25, 0x6B ; 107 20cf2: 0e 94 17 7b call 0xf62e ; 0xf62e // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 20cf6: 81 e0 ldi r24, 0x01 ; 1 20cf8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 20cfc: 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); 20cfe: bc 01 movw r22, r24 20d00: 87 e3 ldi r24, 0x37 ; 55 20d02: 95 e0 ldi r25, 0x05 ; 5 20d04: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c 20d08: ee cf rjmp .-36 ; 0x20ce6 00020d0a : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 20d0a: 90 91 cd 03 lds r25, 0x03CD ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> 20d0e: 89 17 cp r24, r25 20d10: 80 f4 brcc .+32 ; 0x20d32 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 20d12: 91 30 cpi r25, 0x01 ; 1 20d14: 61 f4 brne .+24 ; 0x20d2e } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 20d16: 80 91 4c 05 lds r24, 0x054C ; 0x80054c <_ZL26lcd_status_message_timeout.lto_priv.466> 20d1a: 88 23 and r24, r24 20d1c: 51 f0 breq .+20 ; 0x20d32 20d1e: 40 e2 ldi r20, 0x20 ; 32 20d20: 5e e4 ldi r21, 0x4E ; 78 20d22: 60 e0 ldi r22, 0x00 ; 0 20d24: 70 e0 ldi r23, 0x00 ; 0 20d26: 8c e4 ldi r24, 0x4C ; 76 20d28: 95 e0 ldi r25, 0x05 ; 5 20d2a: 0d 94 3f 40 jmp 0x2807e ; 0x2807e ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 20d2e: 80 e0 ldi r24, 0x00 ; 0 20d30: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 20d32: 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; } 20d34: 08 95 ret 00020d36 : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 20d36: ef 92 push r14 20d38: ff 92 push r15 20d3a: 1f 93 push r17 20d3c: cf 93 push r28 20d3e: df 93 push r29 20d40: ec 01 movw r28, r24 20d42: 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)) { 20d44: 86 2f mov r24, r22 20d46: 0f 94 85 06 call 0x20d0a ; 0x20d0a 20d4a: 88 23 and r24, r24 20d4c: e9 f0 breq .+58 ; 0x20d88 bool same = !(progmem? strcmp_P(lcd_status_message, message): 20d4e: be 01 movw r22, r28 20d50: 87 e3 ldi r24, 0x37 ; 55 20d52: 95 e0 ldi r25, 0x05 ; 5 20d54: 0f 94 f4 da call 0x3b5e8 ; 0x3b5e8 20d58: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 20d5a: 8c e4 ldi r24, 0x4C ; 76 20d5c: 95 e0 ldi r25, 0x05 ; 5 20d5e: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> lcd_status_message_level = severity; 20d62: 10 93 cd 03 sts 0x03CD, r17 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> custom_message_type = CustomMsg::Status; 20d66: 10 92 72 07 sts 0x0772, r1 ; 0x800772 custom_message_state = 0; 20d6a: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 if (!same) { 20d6e: ef 28 or r14, r15 20d70: 59 f0 breq .+22 ; 0x20d88 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 20d72: 61 e0 ldi r22, 0x01 ; 1 20d74: ce 01 movw r24, r28 20d76: 0f 94 6a 06 call 0x20cd4 ; 0x20cd4 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20d7a: df 91 pop r29 20d7c: cf 91 pop r28 20d7e: 1f 91 pop r17 20d80: ff 90 pop r15 20d82: 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(); 20d84: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20d88: df 91 pop r29 20d8a: cf 91 pop r28 20d8c: 1f 91 pop r17 20d8e: ff 90 pop r15 20d90: ef 90 pop r14 20d92: 08 95 ret 00020d94 : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 20d94: 1f 93 push r17 20d96: cf 93 push r28 20d98: df 93 push r29 20d9a: 18 2f mov r17, r24 20d9c: eb 01 movw r28, r22 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 20d9e: 80 e0 ldi r24, 0x00 ; 0 20da0: 0f 94 34 64 call 0x2c868 ; 0x2c868 { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 20da4: 80 e0 ldi r24, 0x00 ; 0 20da6: 0e 94 8d 8b call 0x1171a ; 0x1171a target_temperature[0] = 0; 20daa: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 20dae: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a target_temperature_bed = 0; 20db2: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 20db6: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 manage_heater(); 20dba: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(); 20dbe: 80 e0 ldi r24, 0x00 ; 0 20dc0: 0e 94 f3 8b call 0x117e6 ; 0x117e6 lcd_clear(); 20dc4: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 20dc8: 86 e2 ldi r24, 0x26 ; 38 20dca: 95 e4 ldi r25, 0x45 ; 69 20dcc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20dd0: ac 01 movw r20, r24 20dd2: 60 e0 ldi r22, 0x00 ; 0 20dd4: 80 e0 ldi r24, 0x00 ; 0 20dd6: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 20dda: 86 e1 ldi r24, 0x16 ; 22 20ddc: 95 e4 ldi r25, 0x45 ; 69 20dde: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20de2: ac 01 movw r20, r24 20de4: 61 e0 ldi r22, 0x01 ; 1 20de6: 80 e0 ldi r24, 0x00 ; 0 20de8: 0e 94 ba 6f call 0xdf74 ; 0xdf74 switch (testError) 20dec: 11 50 subi r17, 0x01 ; 1 20dee: 1c 30 cpi r17, 0x0C ; 12 20df0: a0 f4 brcc .+40 ; 0x20e1a 20df2: e1 2f mov r30, r17 20df4: f0 e0 ldi r31, 0x00 ; 0 20df6: 88 27 eor r24, r24 20df8: ef 5f subi r30, 0xFF ; 255 20dfa: f8 4f sbci r31, 0xF8 ; 248 20dfc: 8e 4f sbci r24, 0xFE ; 254 20dfe: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 20e02: 94 39 cpi r25, 0x94 ; 148 20e04: 22 3a cpi r18, 0xA2 ; 162 20e06: 02 3a cpi r16, 0xA2 ; 162 20e08: cc 3a cpi r28, 0xAC ; 172 20e0a: a4 39 cpi r26, 0x94 ; 148 20e0c: b2 39 cpi r27, 0x92 ; 146 20e0e: e6 39 cpi r30, 0x96 ; 150 20e10: d8 3a cpi r29, 0xA8 ; 168 20e12: 58 3a cpi r21, 0xA8 ; 168 20e14: da 39 cpi r29, 0x9A ; 154 20e16: 0c 3b cpi r16, 0xBC ; 188 20e18: 90 39 cpi r25, 0x90 ; 144 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 20e1a: 82 e0 ldi r24, 0x02 ; 2 20e1c: 95 e4 ldi r25, 0x45 ; 69 20e1e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20e22: ac 01 movw r20, r24 20e24: 62 e0 ldi r22, 0x02 ; 2 20e26: 80 e0 ldi r24, 0x00 ; 0 20e28: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 20e2c: 82 ef ldi r24, 0xF2 ; 242 20e2e: 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)); 20e30: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20e34: ac 01 movw r20, r24 20e36: 63 e0 ldi r22, 0x03 ; 3 20e38: 80 e0 ldi r24, 0x00 ; 0 20e3a: 0e 94 ba 6f call 0xdf74 ; 0xdf74 20e3e: 45 c0 rjmp .+138 ; 0x20eca 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)); 20e40: 85 ee ldi r24, 0xE5 ; 229 20e42: 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)); 20e44: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20e48: ac 01 movw r20, r24 20e4a: 62 e0 ldi r22, 0x02 ; 2 20e4c: 80 e0 ldi r24, 0x00 ; 0 20e4e: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20e52: 86 ed ldi r24, 0xD6 ; 214 20e54: 94 e4 ldi r25, 0x44 ; 68 20e56: ec cf rjmp .-40 ; 0x20e30 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)); 20e58: 8b ec ldi r24, 0xCB ; 203 20e5a: 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)); 20e5c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20e60: ac 01 movw r20, r24 20e62: 62 e0 ldi r22, 0x02 ; 2 20e64: 80 e0 ldi r24, 0x00 ; 0 20e66: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20e6a: 86 ed ldi r24, 0xD6 ; 214 20e6c: 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)); 20e6e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20e72: ac 01 movw r20, r24 20e74: 63 e0 ldi r22, 0x03 ; 3 20e76: 80 e0 ldi r24, 0x00 ; 0 20e78: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(18, 3); 20e7c: 63 e0 ldi r22, 0x03 ; 3 20e7e: 82 e1 ldi r24, 0x12 ; 18 20e80: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print(_error_1); 20e84: ce 01 movw r24, r28 20e86: 1f c0 rjmp .+62 ; 0x20ec6 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)); 20e88: 83 ec ldi r24, 0xC3 ; 195 20e8a: 94 e4 ldi r25, 0x44 ; 68 20e8c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20e90: ac 01 movw r20, r24 20e92: 62 e0 ldi r22, 0x02 ; 2 20e94: 80 e0 ldi r24, 0x00 ; 0 20e96: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(18, 2); 20e9a: 62 e0 ldi r22, 0x02 ; 2 20e9c: 82 e1 ldi r24, 0x12 ; 18 20e9e: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print(_error_1); 20ea2: ce 01 movw r24, r28 20ea4: 0e 94 ad 71 call 0xe35a ; 0xe35a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 20ea8: 89 eb ldi r24, 0xB9 ; 185 20eaa: 94 e4 ldi r25, 0x44 ; 68 20eac: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20eb0: ac 01 movw r20, r24 20eb2: 63 e0 ldi r22, 0x03 ; 3 20eb4: 80 e0 ldi r24, 0x00 ; 0 20eb6: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(18, 3); 20eba: 63 e0 ldi r22, 0x03 ; 3 20ebc: 82 e1 ldi r24, 0x12 ; 18 20ebe: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print(_error_2); 20ec2: 81 ef ldi r24, 0xF1 ; 241 20ec4: 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); 20ec6: 0e 94 ad 71 call 0xe35a ; 0xe35a lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 20eca: 68 ee ldi r22, 0xE8 ; 232 20ecc: 73 e0 ldi r23, 0x03 ; 3 20ece: 80 e0 ldi r24, 0x00 ; 0 20ed0: 90 e0 ldi r25, 0x00 ; 0 20ed2: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 20ed6: 80 e0 ldi r24, 0x00 ; 0 20ed8: 0f 94 34 64 call 0x2c868 ; 0x2c868 lcd_beeper_quick_feedback(); do { _delay(100); 20edc: 64 e6 ldi r22, 0x64 ; 100 20ede: 70 e0 ldi r23, 0x00 ; 0 20ee0: 80 e0 ldi r24, 0x00 ; 0 20ee2: 90 e0 ldi r25, 0x00 ; 0 20ee4: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 manage_heater(); 20ee8: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(); 20eec: 80 e0 ldi r24, 0x00 ; 0 20eee: 0e 94 f3 8b call 0x117e6 ; 0x117e6 } while (!lcd_clicked()); 20ef2: 0e 94 c3 71 call 0xe386 ; 0xe386 20ef6: 88 23 and r24, r24 20ef8: 89 f3 breq .-30 ; 0x20edc LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 20efa: 86 ef ldi r24, 0xF6 ; 246 20efc: 93 e4 ldi r25, 0x43 ; 67 20efe: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20f02: 62 e0 ldi r22, 0x02 ; 2 20f04: 0f 94 9b 06 call 0x20d36 ; 0x20d36 lcd_return_to_status(); } 20f08: df 91 pop r29 20f0a: cf 91 pop r28 20f0c: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 20f0e: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 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)); 20f12: 87 ea ldi r24, 0xA7 ; 167 20f14: 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)); 20f16: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20f1a: ac 01 movw r20, r24 20f1c: 62 e0 ldi r22, 0x02 ; 2 20f1e: 80 e0 ldi r24, 0x00 ; 0 20f20: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 20f24: 83 ec ldi r24, 0xC3 ; 195 20f26: 94 e4 ldi r25, 0x44 ; 68 20f28: a2 cf rjmp .-188 ; 0x20e6e 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)); 20f2a: 84 e9 ldi r24, 0x94 ; 148 20f2c: 94 e4 ldi r25, 0x44 ; 68 20f2e: 96 cf rjmp .-212 ; 0x20e5c 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)); 20f30: 81 e8 ldi r24, 0x81 ; 129 20f32: 94 e4 ldi r25, 0x44 ; 68 20f34: 93 cf rjmp .-218 ; 0x20e5c 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)); 20f36: 82 e7 ldi r24, 0x72 ; 114 20f38: 94 e4 ldi r25, 0x44 ; 68 20f3a: ed cf rjmp .-38 ; 0x20f16 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)); 20f3c: 84 e6 ldi r24, 0x64 ; 100 20f3e: 94 e4 ldi r25, 0x44 ; 68 20f40: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20f44: ac 01 movw r20, r24 20f46: 62 e0 ldi r22, 0x02 ; 2 20f48: 80 e0 ldi r24, 0x00 ; 0 20f4a: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 20f4e: 8d e5 ldi r24, 0x5D ; 93 20f50: 94 e4 ldi r25, 0x44 ; 68 20f52: 8d cf rjmp .-230 ; 0x20e6e lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 20f54: 8b e4 ldi r24, 0x4B ; 75 20f56: 94 e4 ldi r25, 0x44 ; 68 20f58: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20f5c: ac 01 movw r20, r24 20f5e: 62 e0 ldi r22, 0x02 ; 2 20f60: 80 e0 ldi r24, 0x00 ; 0 20f62: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 20f66: 81 e4 ldi r24, 0x41 ; 65 20f68: 94 e4 ldi r25, 0x44 ; 68 20f6a: 81 cf rjmp .-254 ; 0x20e6e lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20f6c: 8f e2 ldi r24, 0x2F ; 47 20f6e: 94 e4 ldi r25, 0x44 ; 68 20f70: 69 cf rjmp .-302 ; 0x20e44 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)); 20f72: 8f e2 ldi r24, 0x2F ; 47 20f74: 94 e4 ldi r25, 0x44 ; 68 20f76: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20f7a: ac 01 movw r20, r24 20f7c: 62 e0 ldi r22, 0x02 ; 2 20f7e: 80 e0 ldi r24, 0x00 ; 0 20f80: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 3, _T(MSG_FALSE_TRIGGERING)); 20f84: 8c e1 ldi r24, 0x1C ; 28 20f86: 94 e4 ldi r25, 0x44 ; 68 20f88: 53 cf rjmp .-346 ; 0x20e30 break; case TestError::FsensorLevel: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20f8a: 8f e2 ldi r24, 0x2F ; 47 20f8c: 94 e4 ldi r25, 0x44 ; 68 20f8e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20f92: ac 01 movw r20, r24 20f94: 62 e0 ldi r22, 0x02 ; 2 20f96: 80 e0 ldi r24, 0x00 ; 0 20f98: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(0, 3); 20f9c: 63 e0 ldi r22, 0x03 ; 3 20f9e: 80 e0 ldi r24, 0x00 ; 0 20fa0: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); 20fa4: 88 e0 ldi r24, 0x08 ; 8 20fa6: 94 e4 ldi r25, 0x44 ; 68 20fa8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 20fac: df 93 push r29 20fae: cf 93 push r28 20fb0: 9f 93 push r25 20fb2: 8f 93 push r24 20fb4: 0e 94 7f 6f call 0xdefe ; 0xdefe 20fb8: 0f 90 pop r0 20fba: 0f 90 pop r0 20fbc: 0f 90 pop r0 20fbe: 0f 90 pop r0 20fc0: 84 cf rjmp .-248 ; 0x20eca 00020fc2 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 20fc2: 8f 92 push r8 20fc4: 9f 92 push r9 20fc6: af 92 push r10 20fc8: bf 92 push r11 20fca: cf 92 push r12 20fcc: df 92 push r13 20fce: ef 92 push r14 20fd0: ff 92 push r15 20fd2: 0f 93 push r16 20fd4: 1f 93 push r17 20fd6: cf 93 push r28 20fd8: df 93 push r29 20fda: f8 2e mov r15, r24 20fdc: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 20fe0: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 20fe4: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 20fe8: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 20fec: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 20ff0: 4b 01 movw r8, r22 20ff2: 6b 01 movw r12, r22 20ff4: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 20ff8: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 20ffc: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 21000: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 21004: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 21008: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 2100a: ff 20 and r15, r15 2100c: 09 f4 brne .+2 ; 0x21010 2100e: a6 c0 rjmp .+332 ; 0x2115c 21010: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 21012: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 21014: 24 eb ldi r18, 0xB4 ; 180 21016: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 21018: 90 e0 ldi r25, 0x00 ; 0 2101a: 80 e0 ldi r24, 0x00 ; 0 2101c: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 21020: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a target_temperature_bed = (_isbed) ? 100 : 0; 21024: 84 e6 ldi r24, 0x64 ; 100 21026: 90 e0 ldi r25, 0x00 ; 0 21028: f1 10 cpse r15, r1 2102a: 02 c0 rjmp .+4 ; 0x21030 2102c: 90 e0 ldi r25, 0x00 ; 0 2102e: 80 e0 ldi r24, 0x00 ; 0 21030: 90 93 69 0e sts 0x0E69, r25 ; 0x800e69 21034: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 21038: e0 90 1d 05 lds r14, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); 2103c: 80 e0 ldi r24, 0x00 ; 0 2103e: 0f 94 4d 48 call 0x2909a ; 0x2909a #endif //THERMAL_MODEL manage_heater(); 21042: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 21046: 81 e0 ldi r24, 0x01 ; 1 21048: 0e 94 f3 8b call 0x117e6 ; 0x117e6 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 2104c: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 2104e: 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 21050: 85 e0 ldi r24, 0x05 ; 5 21052: 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) 21054: 80 91 11 05 lds r24, 0x0511 ; 0x800511 21058: 81 11 cpse r24, r1 2105a: 1c c0 rjmp .+56 ; 0x21094 { manage_heater(); 2105c: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 21060: 81 e0 ldi r24, 0x01 ; 1 21062: 0e 94 f3 8b call 0x117e6 ; 0x117e6 _progress = (_isbed? 21066: 00 e9 ldi r16, 0x90 ; 144 21068: 11 e0 ldi r17, 0x01 ; 1 2106a: 20 e0 ldi r18, 0x00 ; 0 2106c: 42 e0 ldi r20, 0x02 ; 2 2106e: 6a 2d mov r22, r10 21070: 87 e0 ldi r24, 0x07 ; 7 21072: f1 10 cpse r15, r1 21074: 01 c0 rjmp .+2 ; 0x21078 21076: 88 e0 ldi r24, 0x08 ; 8 21078: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 2107c: 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 2107e: 8b 2d mov r24, r11 21080: 68 2d mov r22, r8 21082: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__udivmodqi4> 21086: 91 11 cpse r25, r1 21088: 02 c0 rjmp .+4 ; 0x2108e 2108a: 0e 94 fa 78 call 0xf1f4 ; 0xf1f4 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 2108e: b3 94 inc r11 21090: b9 10 cpse r11, r9 21092: e0 cf rjmp .-64 ; 0x21054 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 21094: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 21098: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a target_temperature_bed = 0; 2109c: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 210a0: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 manage_heater(); 210a4: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 210a8: b6 01 movw r22, r12 210aa: dd 0c add r13, r13 210ac: 88 0b sbc r24, r24 210ae: 99 0b sbc r25, r25 210b0: 4e 01 movw r8, r28 210b2: dd 0f add r29, r29 210b4: aa 08 sbc r10, r10 210b6: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 210b8: ff 20 and r15, r15 210ba: 09 f4 brne .+2 ; 0x210be 210bc: 54 c0 rjmp .+168 ; 0x21166 210be: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 210c2: 9b 01 movw r18, r22 210c4: ac 01 movw r20, r24 210c6: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 210ca: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 210ce: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 210d2: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 210d6: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 210da: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 210de: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 210e0: c5 01 movw r24, r10 210e2: b4 01 movw r22, r8 210e4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 210e8: 9b 01 movw r18, r22 210ea: ac 01 movw r20, r24 210ec: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 210f0: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 210f4: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 210f8: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 210fc: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 21100: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 21104: 10 91 11 05 lds r17, 0x0511 ; 0x800511 21108: 11 11 cpse r17, r1 2110a: 0c c0 rjmp .+24 ; 0x21124 2110c: f1 10 cpse r15, r1 2110e: 4b c0 rjmp .+150 ; 0x211a6 21110: 69 30 cpi r22, 0x09 ; 9 21112: 71 05 cpc r23, r1 21114: 0c f0 brlt .+2 ; 0x21118 21116: 4d c0 rjmp .+154 ; 0x211b2 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 21118: 8e e1 ldi r24, 0x1E ; 30 2111a: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 2111c: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 2111e: c8 17 cp r28, r24 21120: d9 07 cpc r29, r25 21122: 34 f4 brge .+12 ; 0x21130 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 21124: 61 ef ldi r22, 0xF1 ; 241 21126: 72 e0 ldi r23, 0x02 ; 2 21128: 80 e0 ldi r24, 0x00 ; 0 2112a: 0f 94 ca 06 call 0x20d94 ; 0x20d94 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 2112e: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 21130: 8e 2d mov r24, r14 21132: 0f 94 4d 48 call 0x2909a ; 0x2909a #endif //THERMAL_MODEL manage_heater(); 21136: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 2113a: 81 e0 ldi r24, 0x01 ; 1 2113c: 0e 94 f3 8b call 0x117e6 ; 0x117e6 return _stepresult; } 21140: 81 2f mov r24, r17 21142: df 91 pop r29 21144: cf 91 pop r28 21146: 1f 91 pop r17 21148: 0f 91 pop r16 2114a: ff 90 pop r15 2114c: ef 90 pop r14 2114e: df 90 pop r13 21150: cf 90 pop r12 21152: bf 90 pop r11 21154: af 90 pop r10 21156: 9f 90 pop r9 21158: 8f 90 pop r8 2115a: 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 2115c: 9c e3 ldi r25, 0x3C ; 60 2115e: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 21160: 88 ec ldi r24, 0xC8 ; 200 21162: 90 e0 ldi r25, 0x00 ; 0 21164: 5b cf rjmp .-330 ; 0x2101c target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 21166: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 2116a: 9b 01 movw r18, r22 2116c: ac 01 movw r20, r24 2116e: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 21172: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 21176: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 2117a: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 2117e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 21182: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 21186: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 21188: c5 01 movw r24, r10 2118a: b4 01 movw r22, r8 2118c: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 21190: 9b 01 movw r18, r22 21192: ac 01 movw r20, r24 21194: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 21198: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 2119c: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 211a0: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 211a4: ab cf rjmp .-170 ; 0x210fc */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 211a6: 89 e0 ldi r24, 0x09 ; 9 211a8: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 211aa: 6e 31 cpi r22, 0x1E ; 30 211ac: 71 05 cpc r23, r1 211ae: 0c f4 brge .+2 ; 0x211b2 211b0: b5 cf rjmp .-150 ; 0x2111c else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 211b2: 61 ef ldi r22, 0xF1 ; 241 211b4: 72 e0 ldi r23, 0x02 ; 2 211b6: 81 e0 ldi r24, 0x01 ; 1 211b8: 0f 94 ca 06 call 0x20d94 ; 0x20d94 211bc: b9 cf rjmp .-142 ; 0x21130 000211be : plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); crashdet_use_eeprom_setting(); } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 211be: 2f 92 push r2 211c0: 3f 92 push r3 211c2: 4f 92 push r4 211c4: 5f 92 push r5 211c6: 6f 92 push r6 211c8: 7f 92 push r7 211ca: 8f 92 push r8 211cc: 9f 92 push r9 211ce: af 92 push r10 211d0: bf 92 push r11 211d2: cf 92 push r12 211d4: df 92 push r13 211d6: ef 92 push r14 211d8: ff 92 push r15 211da: 1f 93 push r17 211dc: cf 93 push r28 211de: df 93 push r29 211e0: 00 d0 rcall .+0 ; 0x211e2 211e2: 00 d0 rcall .+0 ; 0x211e4 211e4: 1f 92 push r1 211e6: cd b7 in r28, 0x3d ; 61 211e8: de b7 in r29, 0x3e ; 62 211ea: 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) { 211ec: 68 2e mov r6, r24 211ee: 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; 211f0: 81 2c mov r8, r1 211f2: 20 e8 ldi r18, 0x80 ; 128 211f4: 92 2e mov r9, r18 211f6: 2c e5 ldi r18, 0x5C ; 92 211f8: a2 2e mov r10, r18 211fa: 23 e4 ldi r18, 0x43 ; 67 211fc: 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) { 211fe: 81 30 cpi r24, 0x01 ; 1 21200: 31 f0 breq .+12 ; 0x2120e case 0: axis_length = X_MAX_POS; break; 21202: 81 2c mov r8, r1 21204: 91 2c mov r9, r1 21206: 9f e7 ldi r25, 0x7F ; 127 21208: a9 2e mov r10, r25 2120a: 93 e4 ldi r25, 0x43 ; 67 2120c: 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; 2120e: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 21212: 0f 94 34 3b call 0x27668 ; 0x27668 } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 21216: 81 e0 ldi r24, 0x01 ; 1 21218: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 2121c: 60 e0 ldi r22, 0x00 ; 0 2121e: 70 e0 ldi r23, 0x00 ; 0 21220: 80 ea ldi r24, 0xA0 ; 160 21222: 90 e4 ldi r25, 0x40 ; 64 21224: 0e 94 26 6f call 0xde4c ; 0xde4c tmc2130_home_enter(1 << axis); 21228: 81 e0 ldi r24, 0x01 ; 1 2122a: 01 2e mov r0, r17 2122c: 01 c0 rjmp .+2 ; 0x21230 2122e: 88 0f add r24, r24 21230: 0a 94 dec r0 21232: ea f7 brpl .-6 ; 0x2122e 21234: 0f 94 63 3b call 0x276c6 ; 0x276c6 // first axis length measurement begin current_position[axis] -= (axis_length + margin); 21238: 20 e0 ldi r18, 0x00 ; 0 2123a: 30 e0 ldi r19, 0x00 ; 0 2123c: 40 e7 ldi r20, 0x70 ; 112 2123e: 52 e4 ldi r21, 0x42 ; 66 21240: c5 01 movw r24, r10 21242: b4 01 movw r22, r8 21244: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 21248: 69 83 std Y+1, r22 ; 0x01 2124a: 7a 83 std Y+2, r23 ; 0x02 2124c: 8b 83 std Y+3, r24 ; 0x03 2124e: 9c 83 std Y+4, r25 ; 0x04 21250: 13 01 movw r2, r6 21252: 22 0c add r2, r2 21254: 33 1c adc r3, r3 21256: 22 0c add r2, r2 21258: 33 1c adc r3, r3 2125a: c1 01 movw r24, r2 2125c: 80 5c subi r24, 0xC0 ; 192 2125e: 98 4f sbci r25, 0xF8 ; 248 21260: 9e 83 std Y+6, r25 ; 0x06 21262: 8d 83 std Y+5, r24 ; 0x05 21264: 29 81 ldd r18, Y+1 ; 0x01 21266: 3a 81 ldd r19, Y+2 ; 0x02 21268: 4b 81 ldd r20, Y+3 ; 0x03 2126a: 5c 81 ldd r21, Y+4 ; 0x04 2126c: fc 01 movw r30, r24 2126e: 60 81 ld r22, Z 21270: 71 81 ldd r23, Z+1 ; 0x01 21272: 82 81 ldd r24, Z+2 ; 0x02 21274: 93 81 ldd r25, Z+3 ; 0x03 21276: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 2127a: ed 81 ldd r30, Y+5 ; 0x05 2127c: fe 81 ldd r31, Y+6 ; 0x06 2127e: 60 83 st Z, r22 21280: 71 83 std Z+1, r23 ; 0x01 21282: 82 83 std Z+2, r24 ; 0x02 21284: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21286: 60 e0 ldi r22, 0x00 ; 0 21288: 70 e0 ldi r23, 0x00 ; 0 2128a: 84 e3 ldi r24, 0x34 ; 52 2128c: 92 e4 ldi r25, 0x42 ; 66 2128e: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 21292: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 21296: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.488> tmc2130_sg_measure_cnt = 0; 2129a: 10 92 c5 03 sts 0x03C5, r1 ; 0x8003c5 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490> 2129e: 10 92 c6 03 sts 0x03C6, r1 ; 0x8003c6 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x1> 212a2: 10 92 c7 03 sts 0x03C7, r1 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x2> 212a6: 10 92 c8 03 sts 0x03C8, r1 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x3> tmc2130_sg_measure_val = 0; 212aa: 10 92 c9 03 sts 0x03C9, r1 ; 0x8003c9 <_ZL22tmc2130_sg_measure_val.lto_priv.489> 212ae: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x1> 212b2: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x2> 212b6: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x3> tmc2130_sg_measure_start(axis); current_position_init = st_get_position_mm(axis); 212ba: 81 2f mov r24, r17 212bc: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 212c0: 6b 01 movw r12, r22 212c2: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 212c4: 20 e0 ldi r18, 0x00 ; 0 212c6: 30 e0 ldi r19, 0x00 ; 0 212c8: 40 ef ldi r20, 0xF0 ; 240 212ca: 52 e4 ldi r21, 0x42 ; 66 212cc: ed 81 ldd r30, Y+5 ; 0x05 212ce: fe 81 ldd r31, Y+6 ; 0x06 212d0: 60 81 ld r22, Z 212d2: 71 81 ldd r23, Z+1 ; 0x01 212d4: 82 81 ldd r24, Z+2 ; 0x02 212d6: 93 81 ldd r25, Z+3 ; 0x03 212d8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 212dc: ed 81 ldd r30, Y+5 ; 0x05 212de: fe 81 ldd r31, Y+6 ; 0x06 212e0: 60 83 st Z, r22 212e2: 71 83 std Z+1, r23 ; 0x01 212e4: 82 83 std Z+2, r24 ; 0x02 212e6: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 212e8: 60 e0 ldi r22, 0x00 ; 0 212ea: 70 e0 ldi r23, 0x00 ; 0 212ec: 84 e3 ldi r24, 0x34 ; 52 212ee: 92 e4 ldi r25, 0x42 ; 66 212f0: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 212f4: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position[axis] += axis_length; 212f8: a5 01 movw r20, r10 212fa: 94 01 movw r18, r8 212fc: ed 81 ldd r30, Y+5 ; 0x05 212fe: fe 81 ldd r31, Y+6 ; 0x06 21300: 60 81 ld r22, Z 21302: 71 81 ldd r23, Z+1 ; 0x01 21304: 82 81 ldd r24, Z+2 ; 0x02 21306: 93 81 ldd r25, Z+3 ; 0x03 21308: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2130c: ed 81 ldd r30, Y+5 ; 0x05 2130e: fe 81 ldd r31, Y+6 ; 0x06 21310: 60 83 st Z, r22 21312: 71 83 std Z+1, r23 ; 0x01 21314: 82 83 std Z+2, r24 ; 0x02 21316: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21318: 60 e0 ldi r22, 0x00 ; 0 2131a: 70 e0 ldi r23, 0x00 ; 0 2131c: 84 e3 ldi r24, 0x34 ; 52 2131e: 92 e4 ldi r25, 0x42 ; 66 21320: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 21324: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 21328: 8f ef ldi r24, 0xFF ; 255 2132a: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.488> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 2132e: 60 91 c9 03 lds r22, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_val.lto_priv.489> 21332: 70 91 ca 03 lds r23, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x1> 21336: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x2> 2133a: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x3> 2133e: 20 91 c5 03 lds r18, 0x03C5 ; 0x8003c5 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490> 21342: 30 91 c6 03 lds r19, 0x03C6 ; 0x8003c6 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x1> 21346: 40 91 c7 03 lds r20, 0x03C7 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x2> 2134a: 50 91 c8 03 lds r21, 0x03C8 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x3> 2134e: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 21352: 2d 83 std Y+5, r18 ; 0x05 21354: 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); 21356: 3f 93 push r19 21358: 2f 93 push r18 2135a: f8 e5 ldi r31, 0x58 ; 88 2135c: 6f 0e add r6, r31 2135e: 71 1c adc r7, r1 21360: 7f 92 push r7 21362: 6f 92 push r6 21364: 80 e2 ldi r24, 0x20 ; 32 21366: 9c e8 ldi r25, 0x8C ; 140 21368: 9f 93 push r25 2136a: 8f 93 push r24 2136c: 0f 94 08 dc call 0x3b810 ; 0x3b810 eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 21370: 0f 90 pop r0 21372: 0f 90 pop r0 21374: 0f 90 pop r0 21376: 0f 90 pop r0 21378: 0f 90 pop r0 2137a: 0f 90 pop r0 2137c: 8b e5 ldi r24, 0x5B ; 91 2137e: 9f e0 ldi r25, 0x0F ; 15 21380: 11 11 cpse r17, r1 21382: 02 c0 rjmp .+4 ; 0x21388 21384: 8d e5 ldi r24, 0x5D ; 93 21386: 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); 21388: 6d 81 ldd r22, Y+5 ; 0x05 2138a: 7f 81 ldd r23, Y+7 ; 0x07 2138c: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 current_position_final = st_get_position_mm(axis); 21390: 81 2f mov r24, r17 21392: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 21396: 2b 01 movw r4, r22 21398: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 2139a: a7 01 movw r20, r14 2139c: 96 01 movw r18, r12 2139e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 213a2: 6b 01 movw r12, r22 213a4: 7c 01 movw r14, r24 213a6: e8 94 clt 213a8: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 213aa: c1 01 movw r24, r2 213ac: 80 5c subi r24, 0xC0 ; 192 213ae: 98 4f sbci r25, 0xF8 ; 248 213b0: 9e 83 std Y+6, r25 ; 0x06 213b2: 8d 83 std Y+5, r24 ; 0x05 213b4: 20 e0 ldi r18, 0x00 ; 0 213b6: 30 e0 ldi r19, 0x00 ; 0 213b8: 40 e7 ldi r20, 0x70 ; 112 213ba: 52 e4 ldi r21, 0x42 ; 66 213bc: fc 01 movw r30, r24 213be: 60 81 ld r22, Z 213c0: 71 81 ldd r23, Z+1 ; 0x01 213c2: 82 81 ldd r24, Z+2 ; 0x02 213c4: 93 81 ldd r25, Z+3 ; 0x03 213c6: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 213ca: ed 81 ldd r30, Y+5 ; 0x05 213cc: fe 81 ldd r31, Y+6 ; 0x06 213ce: 60 83 st Z, r22 213d0: 71 83 std Z+1, r23 ; 0x01 213d2: 82 83 std Z+2, r24 ; 0x02 213d4: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 213d6: 60 e0 ldi r22, 0x00 ; 0 213d8: 70 e0 ldi r23, 0x00 ; 0 213da: 84 e3 ldi r24, 0x34 ; 52 213dc: 92 e4 ldi r25, 0x42 ; 66 213de: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 213e2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position[axis] -= (axis_length + margin); 213e6: 29 81 ldd r18, Y+1 ; 0x01 213e8: 3a 81 ldd r19, Y+2 ; 0x02 213ea: 4b 81 ldd r20, Y+3 ; 0x03 213ec: 5c 81 ldd r21, Y+4 ; 0x04 213ee: ed 81 ldd r30, Y+5 ; 0x05 213f0: fe 81 ldd r31, Y+6 ; 0x06 213f2: 60 81 ld r22, Z 213f4: 71 81 ldd r23, Z+1 ; 0x01 213f6: 82 81 ldd r24, Z+2 ; 0x02 213f8: 93 81 ldd r25, Z+3 ; 0x03 213fa: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 213fe: ed 81 ldd r30, Y+5 ; 0x05 21400: fe 81 ldd r31, Y+6 ; 0x06 21402: 60 83 st Z, r22 21404: 71 83 std Z+1, r23 ; 0x01 21406: 82 83 std Z+2, r24 ; 0x02 21408: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2140a: 60 e0 ldi r22, 0x00 ; 0 2140c: 70 e0 ldi r23, 0x00 ; 0 2140e: 84 e3 ldi r24, 0x34 ; 52 21410: 92 e4 ldi r25, 0x42 ; 66 21412: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 21416: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position_init = st_get_position_mm(axis); 2141a: 81 2f mov r24, r17 2141c: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 21420: 9b 01 movw r18, r22 21422: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 21424: c3 01 movw r24, r6 21426: b2 01 movw r22, r4 21428: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 2142c: 2b 01 movw r4, r22 2142e: 3c 01 movw r6, r24 21430: e8 94 clt 21432: 77 f8 bld r7, 7 tmc2130_home_exit(); 21434: 0f 94 34 3b call 0x27668 ; 0x27668 //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]); 21438: ff 92 push r15 2143a: ef 92 push r14 2143c: df 92 push r13 2143e: cf 92 push r12 21440: 82 ed ldi r24, 0xD2 ; 210 21442: 9b e6 ldi r25, 0x6B ; 107 21444: 9f 93 push r25 21446: 8f 93 push r24 21448: 0f 94 08 dc call 0x3b810 ; 0x3b810 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 2144c: a5 01 movw r20, r10 2144e: 94 01 movw r18, r8 21450: c7 01 movw r24, r14 21452: b6 01 movw r22, r12 21454: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 21458: 9f 77 andi r25, 0x7F ; 127 2145a: 0f 90 pop r0 2145c: 0f 90 pop r0 2145e: 0f 90 pop r0 21460: 0f 90 pop r0 21462: 0f 90 pop r0 21464: 0f 90 pop r0 21466: 20 e0 ldi r18, 0x00 ; 0 21468: 30 e0 ldi r19, 0x00 ; 0 2146a: 40 ea ldi r20, 0xA0 ; 160 2146c: 50 e4 ldi r21, 0x40 ; 64 2146e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 21472: 18 16 cp r1, r24 21474: 0c f4 brge .+2 ; 0x21478 21476: 53 c0 rjmp .+166 ; 0x2151e 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]); 21478: 7f 92 push r7 2147a: 6f 92 push r6 2147c: 5f 92 push r5 2147e: 4f 92 push r4 21480: 82 ed ldi r24, 0xD2 ; 210 21482: 9b e6 ldi r25, 0x6B ; 107 21484: 9f 93 push r25 21486: 8f 93 push r24 21488: 0f 94 08 dc call 0x3b810 ; 0x3b810 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 2148c: a5 01 movw r20, r10 2148e: 94 01 movw r18, r8 21490: c3 01 movw r24, r6 21492: b2 01 movw r22, r4 21494: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 21498: 9f 77 andi r25, 0x7F ; 127 2149a: 0f 90 pop r0 2149c: 0f 90 pop r0 2149e: 0f 90 pop r0 214a0: 0f 90 pop r0 214a2: 0f 90 pop r0 214a4: 0f 90 pop r0 214a6: 20 e0 ldi r18, 0x00 ; 0 214a8: 30 e0 ldi r19, 0x00 ; 0 214aa: 40 ea ldi r20, 0xA0 ; 160 214ac: 50 e4 ldi r21, 0x40 ; 64 214ae: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 214b2: 18 16 cp r1, r24 214b4: a4 f1 brlt .+104 ; 0x2151e endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 214b6: a3 01 movw r20, r6 214b8: 92 01 movw r18, r4 214ba: c7 01 movw r24, r14 214bc: b6 01 movw r22, r12 214be: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 214c2: 6b 01 movw r12, r22 214c4: 7c 01 movw r14, r24 214c6: e8 94 clt 214c8: f7 f8 bld r15, 7 214ca: ff 92 push r15 214cc: ef 92 push r14 214ce: df 92 push r13 214d0: cf 92 push r12 214d2: 85 eb ldi r24, 0xB5 ; 181 214d4: 9b e6 ldi r25, 0x6B ; 107 214d6: 9f 93 push r25 214d8: 8f 93 push r24 214da: 0f 94 08 dc call 0x3b810 ; 0x3b810 if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 214de: 0f 90 pop r0 214e0: 0f 90 pop r0 214e2: 0f 90 pop r0 214e4: 0f 90 pop r0 214e6: 0f 90 pop r0 214e8: 0f 90 pop r0 214ea: 20 e0 ldi r18, 0x00 ; 0 214ec: 30 e0 ldi r19, 0x00 ; 0 214ee: 40 e8 ldi r20, 0x80 ; 128 214f0: 5f e3 ldi r21, 0x3F ; 63 214f2: c7 01 movw r24, r14 214f4: b6 01 movw r22, r12 214f6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 214fa: 18 16 cp r1, r24 214fc: 0c f4 brge .+2 ; 0x21500 214fe: 44 c0 rjmp .+136 ; 0x21588 plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 21500: ed 81 ldd r30, Y+5 ; 0x05 21502: fe 81 ldd r31, Y+6 ; 0x06 21504: 10 82 st Z, r1 21506: 11 82 std Z+1, r1 ; 0x01 21508: 12 82 std Z+2, r1 ; 0x02 2150a: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2150c: 0f 94 08 b9 call 0x37210 ; 0x37210 reset_crash_det(axis); 21510: 81 2f mov r24, r17 21512: 0e 94 54 d7 call 0x1aea8 ; 0x1aea8 endstops_hit_on_purpose(); 21516: 0f 94 2b 64 call 0x2c856 ; 0x2c856 return true; 2151a: 81 e0 ldi r24, 0x01 ; 1 2151c: 1d c0 rjmp .+58 ; 0x21558 2151e: 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"; 21522: 64 ef ldi r22, 0xF4 ; 244 21524: 72 e0 ldi r23, 0x02 ; 2 21526: 11 30 cpi r17, 0x01 ; 1 21528: 11 f0 breq .+4 ; 0x2152e 2152a: 62 ef ldi r22, 0xF2 ; 242 2152c: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 2152e: 88 e0 ldi r24, 0x08 ; 8 21530: 0f 94 ca 06 call 0x20d94 ; 0x20d94 current_position[axis] = 0; 21534: f1 01 movw r30, r2 21536: e0 5c subi r30, 0xC0 ; 192 21538: f8 4f sbci r31, 0xF8 ; 248 2153a: 10 82 st Z, r1 2153c: 11 82 std Z+1, r1 ; 0x01 2153e: 12 82 std Z+2, r1 ; 0x02 21540: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 21542: 0f 94 08 b9 call 0x37210 ; 0x37210 reset_crash_det(axis); 21546: 81 2f mov r24, r17 21548: 0e 94 54 d7 call 0x1aea8 ; 0x1aea8 2154c: 81 e0 ldi r24, 0x01 ; 1 2154e: 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(); 21552: 0f 94 2b 64 call 0x2c856 ; 0x2c856 return false; 21556: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 21558: 27 96 adiw r28, 0x07 ; 7 2155a: 0f b6 in r0, 0x3f ; 63 2155c: f8 94 cli 2155e: de bf out 0x3e, r29 ; 62 21560: 0f be out 0x3f, r0 ; 63 21562: cd bf out 0x3d, r28 ; 61 21564: df 91 pop r29 21566: cf 91 pop r28 21568: 1f 91 pop r17 2156a: ff 90 pop r15 2156c: ef 90 pop r14 2156e: df 90 pop r13 21570: cf 90 pop r12 21572: bf 90 pop r11 21574: af 90 pop r10 21576: 9f 90 pop r9 21578: 8f 90 pop r8 2157a: 7f 90 pop r7 2157c: 6f 90 pop r6 2157e: 5f 90 pop r5 21580: 4f 90 pop r4 21582: 3f 90 pop r3 21584: 2f 90 pop r2 21586: 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"; 21588: 64 ef ldi r22, 0xF4 ; 244 2158a: 72 e0 ldi r23, 0x02 ; 2 2158c: 11 30 cpi r17, 0x01 ; 1 2158e: 11 f0 breq .+4 ; 0x21594 21590: 62 ef ldi r22, 0xF2 ; 242 21592: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 21594: 87 e0 ldi r24, 0x07 ; 7 21596: 0f 94 ca 06 call 0x20d94 ; 0x20d94 current_position[axis] = 0; 2159a: f1 01 movw r30, r2 2159c: e0 5c subi r30, 0xC0 ; 192 2159e: f8 4f sbci r31, 0xF8 ; 248 215a0: 10 82 st Z, r1 215a2: 11 82 std Z+1, r1 ; 0x01 215a4: 12 82 std Z+2, r1 ; 0x02 215a6: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 215a8: 0f 94 08 b9 call 0x37210 ; 0x37210 reset_crash_det(axis); 215ac: 81 2f mov r24, r17 215ae: 0e 94 54 d7 call 0x1aea8 ; 0x1aea8 215b2: cf cf rjmp .-98 ; 0x21552 000215b4 : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 215b4: 0f 93 push r16 215b6: 1f 93 push r17 215b8: cf 93 push r28 215ba: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 215bc: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 215c0: 81 e0 ldi r24, 0x01 ; 1 215c2: 0e 94 76 67 call 0xceec ; 0xceec uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 215c6: 8d e5 ldi r24, 0x5D ; 93 215c8: 9f e0 ldi r25, 0x0F ; 15 215ca: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 215ce: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 215d0: 8b e5 ldi r24, 0x5B ; 91 215d2: 9f e0 ldi r25, 0x0F ; 15 215d4: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 215d8: 18 2f mov r17, r24 215da: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 215dc: 88 ed ldi r24, 0xD8 ; 216 215de: 9f e3 ldi r25, 0x3F ; 63 215e0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 215e4: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 215e8: 61 e0 ldi r22, 0x01 ; 1 215ea: 80 e0 ldi r24, 0x00 ; 0 215ec: 0e 94 a6 6f call 0xdf4c ; 0xdf4c 215f0: df 93 push r29 215f2: cf 93 push r28 215f4: 8b e7 ldi r24, 0x7B ; 123 215f6: 9b e8 ldi r25, 0x8B ; 139 215f8: 9f 93 push r25 215fa: 8f 93 push r24 215fc: 0e 94 7f 6f call 0xdefe ; 0xdefe KEEPALIVE_STATE(IN_HANDLER); 21600: 82 e0 ldi r24, 0x02 ; 2 21602: 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)){ 21606: 80 e0 ldi r24, 0x00 ; 0 21608: 0f 94 df 08 call 0x211be ; 0x211be 2160c: 0f 90 pop r0 2160e: 0f 90 pop r0 21610: 0f 90 pop r0 21612: 0f 90 pop r0 21614: 88 23 and r24, r24 21616: 09 f4 brne .+2 ; 0x2161a 21618: 45 c0 rjmp .+138 ; 0x216a4 X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 2161a: 8d e5 ldi r24, 0x5D ; 93 2161c: 9f e0 ldi r25, 0x0F ; 15 2161e: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 21622: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 21624: 61 e0 ldi r22, 0x01 ; 1 21626: 8a e0 ldi r24, 0x0A ; 10 21628: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 2162c: be 01 movw r22, r28 2162e: 90 e0 ldi r25, 0x00 ; 0 21630: 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); 21632: 4a e0 ldi r20, 0x0A ; 10 21634: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 21638: 86 ec ldi r24, 0xC6 ; 198 2163a: 9f e3 ldi r25, 0x3F ; 63 2163c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 21640: ac 01 movw r20, r24 21642: 62 e0 ldi r22, 0x02 ; 2 21644: 80 e0 ldi r24, 0x00 ; 0 21646: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 2164a: 63 e0 ldi r22, 0x03 ; 3 2164c: 80 e0 ldi r24, 0x00 ; 0 2164e: 0e 94 a6 6f call 0xdf4c ; 0xdf4c 21652: 0f 93 push r16 21654: 1f 93 push r17 21656: 8e e6 ldi r24, 0x6E ; 110 21658: 9b e8 ldi r25, 0x8B ; 139 2165a: 9f 93 push r25 2165c: 8f 93 push r24 2165e: 0e 94 7f 6f call 0xdefe ; 0xdefe if (lcd_selfcheck_axis_sg(Y_AXIS)) 21662: 81 e0 ldi r24, 0x01 ; 1 21664: 0f 94 df 08 call 0x211be ; 0x211be 21668: 0f 90 pop r0 2166a: 0f 90 pop r0 2166c: 0f 90 pop r0 2166e: 0f 90 pop r0 21670: 88 23 and r24, r24 21672: c1 f0 breq .+48 ; 0x216a4 { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 21674: 8b e5 ldi r24, 0x5B ; 91 21676: 9f e0 ldi r25, 0x0F ; 15 21678: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 2167c: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 2167e: 63 e0 ldi r22, 0x03 ; 3 21680: 8a e0 ldi r24, 0x0A ; 10 21682: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 21686: be 01 movw r22, r28 21688: 90 e0 ldi r25, 0x00 ; 0 2168a: 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); 2168c: 4a e0 ldi r20, 0x0A ; 10 2168e: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 21692: 43 e8 ldi r20, 0x83 ; 131 21694: 63 e0 ldi r22, 0x03 ; 3 21696: 83 e1 ldi r24, 0x13 ; 19 21698: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_wait_for_click_delay(10); 2169c: 8a e0 ldi r24, 0x0A ; 10 2169e: 90 e0 ldi r25, 0x00 ; 0 216a0: 0f 94 3f 50 call 0x2a07e ; 0x2a07e } } FORCE_HIGH_POWER_END; 216a4: 80 e0 ldi r24, 0x00 ; 0 216a6: 0e 94 76 67 call 0xceec ; 0xceec KEEPALIVE_STATE(NOT_BUSY); 216aa: 81 e0 ldi r24, 0x01 ; 1 216ac: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 216b0: df 91 pop r29 216b2: cf 91 pop r28 216b4: 1f 91 pop r17 216b6: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 216b8: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 000216bc : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 216bc: 0f 94 23 27 call 0x24e46 ; 0x24e46 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 216c0: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 216c4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 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() 216c8: 81 11 cpse r24, r1 216ca: 32 c0 rjmp .+100 ; 0x21730 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 216cc: 80 91 38 02 lds r24, 0x0238 ; 0x800238 216d0: 81 11 cpse r24, r1 216d2: 02 c0 rjmp .+4 ; 0x216d8 #endif ) { return false; // abort if error persists } return true; 216d4: 81 e0 ldi r24, 0x01 ; 1 216d6: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 216d8: 8f ef ldi r24, 0xFF ; 255 216da: 0e 94 a6 d0 call 0x1a14c ; 0x1a14c setExtruderAutoFanState(3); //force enables the hotend fan 216de: 83 e0 ldi r24, 0x03 ; 3 216e0: 0e 94 e2 76 call 0xedc4 ; 0xedc4 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 216e4: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 216e8: 60 93 99 17 sts 0x1799, r22 ; 0x801799 216ec: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 216f0: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 216f4: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c fan_measuring = true; 216f8: 81 e0 ldi r24, 0x01 ; 1 216fa: 80 93 33 05 sts 0x0533, r24 ; 0x800533 #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 216fe: 68 ee ldi r22, 0xE8 ; 232 21700: 73 e0 ldi r23, 0x03 ; 3 21702: 80 e0 ldi r24, 0x00 ; 0 21704: 90 e0 ldi r25, 0x00 ; 0 21706: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 manage_heater(); 2170a: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 setExtruderAutoFanState(1); //releases lock on the hotend fan 2170e: 81 e0 ldi r24, 0x01 ; 1 21710: 0e 94 e2 76 call 0xedc4 ; 0xedc4 lcd_selftest_setfan(0); 21714: 80 e0 ldi r24, 0x00 ; 0 21716: 0e 94 a6 d0 call 0x1a14c ; 0x1a14c #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 2171a: 80 91 ae 04 lds r24, 0x04AE ; 0x8004ae 2171e: 90 91 af 04 lds r25, 0x04AF ; 0x8004af 21722: 45 97 sbiw r24, 0x15 ; 21 21724: 3c f4 brge .+14 ; 0x21734 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 21726: 62 e0 ldi r22, 0x02 ; 2 21728: 89 e4 ldi r24, 0x49 ; 73 2172a: 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); 2172c: 0f 94 9b 06 call 0x20d36 ; 0x20d36 if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 21730: 80 e0 ldi r24, 0x00 ; 0 } return true; } 21732: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 21734: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 21738: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 2173c: 45 97 sbiw r24, 0x15 ; 21 2173e: 54 f6 brge .-108 ; 0x216d4 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 21740: 62 e0 ldi r22, 0x02 ; 2 21742: 85 e3 ldi r24, 0x35 ; 53 21744: 9b e6 ldi r25, 0x6B ; 107 21746: f2 cf rjmp .-28 ; 0x2172c 00021748 : //! @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; 21748: 0f 94 5e 0b call 0x216bc ; 0x216bc 2174c: 88 23 and r24, r24 2174e: 21 f0 breq .+8 ; 0x21758 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 21750: 8f e6 ldi r24, 0x6F ; 111 21752: 9b e6 ldi r25, 0x6B ; 107 21754: 0c 94 17 7b jmp 0xf62e ; 0xf62e } 21758: 08 95 ret 0002175a : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 2175a: cf 93 push r28 2175c: df 93 push r29 2175e: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 21760: 80 e0 ldi r24, 0x00 ; 0 21762: 0f 94 85 06 call 0x20d0a ; 0x20d0a 21766: 88 23 and r24, r24 21768: 21 f0 breq .+8 ; 0x21772 lcd_updatestatus(message); 2176a: 60 e0 ldi r22, 0x00 ; 0 2176c: ce 01 movw r24, r28 2176e: 0f 94 6a 06 call 0x20cd4 ; 0x20cd4 SERIAL_ECHOLN(message); 21772: ce 01 movw r24, r28 } 21774: df 91 pop r29 21776: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 21778: 0d 94 4b d6 jmp 0x3ac96 ; 0x3ac96 0002177c : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 2177c: cf 93 push r28 2177e: df 93 push r29 21780: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 21782: 80 e0 ldi r24, 0x00 ; 0 21784: 0f 94 85 06 call 0x20d0a ; 0x20d0a 21788: 88 23 and r24, r24 2178a: 31 f0 breq .+12 ; 0x21798 lcd_updatestatus(message, true); 2178c: 61 e0 ldi r22, 0x01 ; 1 2178e: ce 01 movw r24, r28 } 21790: df 91 pop r29 21792: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 21794: 0d 94 6a 06 jmp 0x20cd4 ; 0x20cd4 } 21798: df 91 pop r29 2179a: cf 91 pop r28 2179c: 08 95 ret 0002179e : } } void lcd_print_stop_finish(); void lcd_commands() 2179e: 2f 92 push r2 217a0: 3f 92 push r3 217a2: 4f 92 push r4 217a4: 5f 92 push r5 217a6: 6f 92 push r6 217a8: 7f 92 push r7 217aa: 8f 92 push r8 217ac: 9f 92 push r9 217ae: af 92 push r10 217b0: bf 92 push r11 217b2: cf 92 push r12 217b4: df 92 push r13 217b6: ef 92 push r14 217b8: ff 92 push r15 217ba: 0f 93 push r16 217bc: 1f 93 push r17 217be: cf 93 push r28 217c0: 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) 217c2: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 217c6: 81 30 cpi r24, 0x01 ; 1 217c8: 09 f0 breq .+2 ; 0x217cc 217ca: 61 c0 rjmp .+194 ; 0x2188e 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); 217cc: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 217d0: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 { if (!blocks_queued() && !homing_flag) 217d4: 98 13 cpse r25, r24 217d6: 5b c0 rjmp .+182 ; 0x2188e 217d8: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 217dc: 81 11 cpse r24, r1 217de: 57 c0 rjmp .+174 ; 0x2188e { custom_message_type = CustomMsg::Status; 217e0: 10 92 72 07 sts 0x0772, r1 ; 0x800772 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 217e4: 89 ec ldi r24, 0xC9 ; 201 217e6: 90 e4 ldi r25, 0x40 ; 64 217e8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 217ec: 0f 94 be 0b call 0x2177c ; 0x2177c lcd_commands_type = LcdCommands::Idle; 217f0: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 217f4: 82 e0 ldi r24, 0x02 ; 2 217f6: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 217fa: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 #endif //COMMUNITY_PREVENT_OOZE // continue stopping the print from the main loop after lcd_print_stop() is called void lcd_print_stop_finish() { print_job_timer.stop(); 217fe: 0f 94 aa 58 call 0x2b154 ; 0x2b154 save_statistics(); 21802: 0e 94 e5 66 call 0xcdca ; 0xcdca // lift Z raise_z(10); 21806: 60 e0 ldi r22, 0x00 ; 0 21808: 70 e0 ldi r23, 0x00 ; 0 2180a: 80 e2 ldi r24, 0x20 ; 32 2180c: 91 e4 ldi r25, 0x41 ; 65 2180e: 0e 94 a7 6e call 0xdd4e ; 0xdd4e // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 21812: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 21816: 88 23 and r24, r24 21818: 21 f1 breq .+72 ; 0x21862 2181a: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 2181e: 88 23 and r24, r24 21820: 01 f1 breq .+64 ; 0x21862 current_position[X_AXIS] = X_CANCEL_POS; 21822: 80 e0 ldi r24, 0x00 ; 0 21824: 90 e0 ldi r25, 0x00 ; 0 21826: a8 e4 ldi r26, 0x48 ; 72 21828: b2 e4 ldi r27, 0x42 ; 66 2182a: 80 93 40 07 sts 0x0740, r24 ; 0x800740 2182e: 90 93 41 07 sts 0x0741, r25 ; 0x800741 21832: a0 93 42 07 sts 0x0742, r26 ; 0x800742 21836: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = Y_CANCEL_POS; 2183a: 80 e0 ldi r24, 0x00 ; 0 2183c: 90 e0 ldi r25, 0x00 ; 0 2183e: ae e3 ldi r26, 0x3E ; 62 21840: b3 e4 ldi r27, 0x43 ; 67 21842: 80 93 44 07 sts 0x0744, r24 ; 0x800744 21846: 90 93 45 07 sts 0x0745, r25 ; 0x800745 2184a: a0 93 46 07 sts 0x0746, r26 ; 0x800746 2184e: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21852: 60 e0 ldi r22, 0x00 ; 0 21854: 70 e0 ldi r23, 0x00 ; 0 21856: 84 e3 ldi r24, 0x34 ; 52 21858: 92 e4 ldi r25, 0x42 ; 66 2185a: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 2185e: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 21862: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> // 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()) { 21866: 88 23 and r24, r24 21868: 09 f4 brne .+2 ; 0x2186c 2186a: c8 c0 rjmp .+400 ; 0x219fc // time to stop the error beep WRITE(BEEPER, LOW); 2186c: 9f b7 in r25, 0x3f ; 63 2186e: f8 94 cli 21870: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 21874: 8b 7f andi r24, 0xFB ; 251 21876: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2187a: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 2187c: 0f 94 3c 45 call 0x28a78 ; 0x28a78 finishAndDisableSteppers(); //M84 21880: 0e 94 a4 83 call 0x10748 ; 0x10748 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 21884: 88 e0 ldi r24, 0x08 ; 8 21886: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd did_pause_print = false; // Clear pause state in case the print was aborted while paused 2188a: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 2188e: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 21892: 82 30 cpi r24, 0x02 ; 2 21894: 09 f0 breq .+2 ; 0x21898 21896: 6a c0 rjmp .+212 ; 0x2196c 21898: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2189c: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 { if (!blocks_queued() && !homing_flag) 218a0: 98 13 cpse r25, r24 218a2: 64 c0 rjmp .+200 ; 0x2196c 218a4: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 218a8: 81 11 cpse r24, r1 218aa: 60 c0 rjmp .+192 ; 0x2196c { if (custom_message_type != CustomMsg::M117) 218ac: 80 91 72 07 lds r24, 0x0772 ; 0x800772 218b0: 87 30 cpi r24, 0x07 ; 7 218b2: 41 f0 breq .+16 ; 0x218c4 { custom_message_type = CustomMsg::Status; 218b4: 10 92 72 07 sts 0x0772, r1 ; 0x800772 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 218b8: 8a eb ldi r24, 0xBA ; 186 218ba: 90 e4 ldi r25, 0x40 ; 64 218bc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 218c0: 0f 94 be 0b call 0x2177c ; 0x2177c } lcd_commands_type = LcdCommands::Idle; 218c4: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 218c8: 82 e0 ldi r24, 0x02 ; 2 218ca: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 218ce: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 218d2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 218d6: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 218da: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 218de: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 218e2: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.496+0x8> 218e6: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.496+0x9> 218ea: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.496+0xa> 218ee: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.496+0xb> 218f2: 0e 94 a7 6e call 0xdd4e ; 0xdd4e // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 218f6: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 218fa: 88 23 and r24, r24 218fc: 51 f1 breq .+84 ; 0x21952 218fe: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 21902: 88 23 and r24, r24 21904: 31 f1 breq .+76 ; 0x21952 current_position[X_AXIS] = pause_position[X_AXIS]; 21906: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.496> 2190a: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.496+0x1> 2190e: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.496+0x2> 21912: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.496+0x3> 21916: 80 93 40 07 sts 0x0740, r24 ; 0x800740 2191a: 90 93 41 07 sts 0x0741, r25 ; 0x800741 2191e: a0 93 42 07 sts 0x0742, r26 ; 0x800742 21922: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pause_position[Y_AXIS]; 21926: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.496+0x4> 2192a: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.496+0x5> 2192e: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.496+0x6> 21932: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.496+0x7> 21936: 80 93 44 07 sts 0x0744, r24 ; 0x800744 2193a: 90 93 45 07 sts 0x0745, r25 ; 0x800745 2193e: a0 93 46 07 sts 0x0746, r26 ; 0x800746 21942: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(50); 21946: 60 e0 ldi r22, 0x00 ; 0 21948: 70 e0 ldi r23, 0x00 ; 0 2194a: 88 e4 ldi r24, 0x48 ; 72 2194c: 92 e4 ldi r25, 0x42 ; 66 2194e: 0f 94 48 ba call 0x37490 ; 0x37490 21952: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> } // did we come here from a thermal error? if(get_temp_error()) { 21956: 88 23 and r24, r24 21958: 09 f4 brne .+2 ; 0x2195c 2195a: 77 c0 rjmp .+238 ; 0x21a4a // time to stop the error beep WRITE(BEEPER, LOW); 2195c: 9f b7 in r25, 0x3f ; 63 2195e: f8 94 cli 21960: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 21964: 8b 7f andi r24, 0xFB ; 251 21966: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2196a: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 2196c: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 21970: 84 30 cpi r24, 0x04 ; 4 21972: 09 f0 breq .+2 ; 0x21976 21974: a4 c0 rjmp .+328 ; 0x21abe { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 21976: 85 ea ldi r24, 0xA5 ; 165 21978: 9d e0 ldi r25, 0x0D ; 13 2197a: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 2197e: 30 91 53 0e lds r19, 0x0E53 ; 0x800e53 21982: 20 91 54 0e lds r18, 0x0E54 ; 0x800e54 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 21986: 32 13 cpse r19, r18 21988: 71 c1 rjmp .+738 ; 0x21c6c 2198a: 20 91 7e 10 lds r18, 0x107E ; 0x80107e 2198e: 30 91 7f 10 lds r19, 0x107F ; 0x80107f 21992: 23 2b or r18, r19 21994: 09 f0 breq .+2 ; 0x21998 21996: 6a c1 rjmp .+724 ; 0x21c6c 21998: c0 91 57 0e lds r28, 0x0E57 ; 0x800e57 2199c: c1 11 cpse r28, r1 2199e: 66 c1 rjmp .+716 ; 0x21c6c { if (lcd_commands_step == 0) 219a0: 20 91 f4 03 lds r18, 0x03F4 ; 0x8003f4 219a4: 21 11 cpse r18, r1 219a6: 54 c0 rjmp .+168 ; 0x21a50 lcd_commands_step = 12; 219a8: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 219aa: 20 93 f4 03 sts 0x03F4, r18 ; 0x8003f4 } if (lcd_commands_type == LcdCommands::Layer1Cal) { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); const float extrusion_width = (nozzle_dia + 20)/1000.0f; 219ae: 44 96 adiw r24, 0x14 ; 20 219b0: bc 01 movw r22, r24 219b2: 90 e0 ldi r25, 0x00 ; 0 219b4: 80 e0 ldi r24, 0x00 ; 0 219b6: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 219ba: 20 e0 ldi r18, 0x00 ; 0 219bc: 30 e0 ldi r19, 0x00 ; 0 219be: 4a e7 ldi r20, 0x7A ; 122 219c0: 54 e4 ldi r21, 0x44 ; 68 219c2: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 219c6: 4b 01 movw r8, r22 219c8: 5c 01 movw r10, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 219ca: e0 91 f4 03 lds r30, 0x03F4 ; 0x8003f4 219ce: e1 50 subi r30, 0x01 ; 1 219d0: ec 30 cpi r30, 0x0C ; 12 219d2: 08 f0 brcs .+2 ; 0x219d6 219d4: 74 c0 rjmp .+232 ; 0x21abe 219d6: f0 e0 ldi r31, 0x00 ; 0 219d8: 88 27 eor r24, r24 219da: ee 50 subi r30, 0x0E ; 14 219dc: f3 4f sbci r31, 0xF3 ; 243 219de: 8e 4f sbci r24, 0xFE ; 254 219e0: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 219e4: a0 3a cpi r26, 0xA0 ; 160 219e6: ae 3a cpi r26, 0xAE ; 174 219e8: 66 3a cpi r22, 0xA6 ; 166 219ea: 66 3a cpi r22, 0xA6 ; 166 219ec: 66 3a cpi r22, 0xA6 ; 166 219ee: 66 3a cpi r22, 0xA6 ; 166 219f0: 48 3b cpi r20, 0xB8 ; 184 219f2: e2 39 cpi r30, 0x92 ; 146 219f4: a6 3a cpi r26, 0xA6 ; 166 219f6: 78 3b cpi r23, 0xB8 ; 184 219f8: 7c 3b cpi r23, 0xBC ; 188 219fa: 3e 3b cpi r19, 0xBE ; 190 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 219fc: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // restore the auto hotend state hotendDefaultAutoFanState(); 21a00: 0e 94 34 77 call 0xee68 ; 0xee68 if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21a04: 80 91 95 13 lds r24, 0x1395 ; 0x801395 21a08: 81 30 cpi r24, 0x01 ; 1 21a0a: 09 f0 breq .+2 ; 0x21a0e 21a0c: 37 cf rjmp .-402 ; 0x2187c fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 21a0e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 21a12: 88 23 and r24, r24 21a14: 09 f4 brne .+2 ; 0x21a18 21a16: 32 cf rjmp .-412 ; 0x2187c #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21a18: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21a1c: 82 30 cpi r24, 0x02 ; 2 21a1e: 09 f4 brne .+2 ; 0x21a22 21a20: 2d cf rjmp .-422 ; 0x2187c #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()) 21a22: 0e 94 4b 68 call 0xd096 ; 0xd096 21a26: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 21a28: 0e 94 8f 65 call 0xcb1e ; 0xcb1e } // 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) { 21a2c: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 21a30: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 21a34: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 21a38: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 21a3c: 28 17 cp r18, r24 21a3e: 39 07 cpc r19, r25 21a40: 0c f4 brge .+2 ; 0x21a44 21a42: 1c cf rjmp .-456 ; 0x2187c MMU2::mmu2.unload(); // M702 21a44: 0f 94 22 a0 call 0x34044 ; 0x34044 21a48: 19 cf rjmp .-462 ; 0x2187c } else { // Turn off the print fan fanSpeed = 0; 21a4a: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df 21a4e: 8e cf rjmp .-228 ; 0x2196c if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 21a50: 21 50 subi r18, 0x01 ; 1 21a52: ab cf rjmp .-170 ; 0x219aa preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 21a54: 65 e0 ldi r22, 0x05 ; 5 21a56: 84 ee ldi r24, 0xE4 ; 228 21a58: 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]))); 21a5a: 0e 94 db 89 call 0x113b6 ; 0x113b6 21a5e: 2f c0 rjmp .+94 ; 0x21abe //! @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()) 21a60: 80 91 95 13 lds r24, 0x1395 ; 0x801395 21a64: 81 30 cpi r24, 0x01 ; 1 21a66: 49 f5 brne .+82 ; 0x21aba { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 21a68: d0 91 f3 03 lds r29, 0x03F3 ; 0x8003f3 <_ZL16lay1cal_filament.lto_priv.455> { enquecommand_P(MSG_M83); 21a6c: 61 e0 ldi r22, 0x01 ; 1 21a6e: 87 e5 ldi r24, 0x57 ; 87 21a70: 9c e6 ldi r25, 0x6C ; 108 21a72: 0e 94 5c 89 call 0x112b8 ; 0x112b8 enquecommand_P(PSTR("G1Y-3F1000")); 21a76: 61 e0 ldi r22, 0x01 ; 1 21a78: 89 ed ldi r24, 0xD9 ; 217 21a7a: 9c e8 ldi r25, 0x8C ; 140 21a7c: 0e 94 5c 89 call 0x112b8 ; 0x112b8 enquecommand_P(PSTR("G1Z0.4")); 21a80: 61 e0 ldi r22, 0x01 ; 1 21a82: 82 ed ldi r24, 0xD2 ; 210 21a84: 9c e8 ldi r25, 0x8C ; 140 21a86: 0e 94 5c 89 call 0x112b8 ; 0x112b8 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 21a8a: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 if(currentTool == filament ){ 21a8e: d8 17 cp r29, r24 21a90: a1 f0 breq .+40 ; 0x21aba // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 21a92: 8f 3f cpi r24, 0xFF ; 255 21a94: 29 f0 breq .+10 ; 0x21aa0 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 21a96: 61 e0 ldi r22, 0x01 ; 1 21a98: 82 e5 ldi r24, 0x52 ; 82 21a9a: 9c e6 ldi r25, 0x6C ; 108 21a9c: 0e 94 5c 89 call 0x112b8 ; 0x112b8 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 21aa0: 1f 92 push r1 21aa2: df 93 push r29 21aa4: 8e ec ldi r24, 0xCE ; 206 21aa6: 9c e8 ldi r25, 0x8C ; 140 21aa8: 9f 93 push r25 21aaa: 8f 93 push r24 21aac: 0e 94 fa 89 call 0x113f4 ; 0x113f4 21ab0: 0f 90 pop r0 21ab2: 0f 90 pop r0 21ab4: 0f 90 pop r0 21ab6: 0f 90 pop r0 return true; 21ab8: c1 e0 ldi r28, 0x01 ; 1 21aba: c0 93 f2 03 sts 0x03F2, r28 ; 0x8003f2 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 21abe: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 21ac2: 83 30 cpi r24, 0x03 ; 3 21ac4: 09 f0 breq .+2 ; 0x21ac8 21ac6: d2 c0 rjmp .+420 ; 0x21c6c if (lcd_commands_step == 0) { 21ac8: 90 91 f4 03 lds r25, 0x03F4 ; 0x8003f4 21acc: 91 11 cpse r25, r1 21ace: 09 c0 rjmp .+18 ; 0x21ae2 custom_message_type = CustomMsg::PidCal; 21ad0: 80 93 72 07 sts 0x0772, r24 ; 0x800772 custom_message_state = 1; 21ad4: 91 e0 ldi r25, 0x01 ; 1 21ad6: 90 93 f0 03 sts 0x03F0, r25 ; 0x8003f0 lcd_draw_update = 3; 21ada: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 21ade: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 21ae2: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21ae6: 83 30 cpi r24, 0x03 ; 3 21ae8: 19 f5 brne .+70 ; 0x21b30 21aea: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 21aee: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 21af2: 98 13 cpse r25, r24 21af4: 1d c0 rjmp .+58 ; 0x21b30 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 21af6: 0f 94 27 45 call 0x28a4e ; 0x28a4e pid_tuning_finished = false; 21afa: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.472> 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); 21afe: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.456+0x1> 21b02: 8f 93 push r24 21b04: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.456> 21b08: 8f 93 push r24 21b0a: 89 e7 ldi r24, 0x79 ; 121 21b0c: 9d e8 ldi r25, 0x8D ; 141 21b0e: 9f 93 push r25 21b10: 8f 93 push r24 21b12: 0e 94 fa 89 call 0x113f4 ; 0x113f4 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 21b16: 8f ea ldi r24, 0xAF ; 175 21b18: 90 e4 ldi r25, 0x40 ; 64 21b1a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 21b1e: 0f 94 be 0b call 0x2177c ; 0x2177c lcd_commands_step = 2; 21b22: 82 e0 ldi r24, 0x02 ; 2 21b24: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 21b28: 0f 90 pop r0 21b2a: 0f 90 pop r0 21b2c: 0f 90 pop r0 21b2e: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 21b30: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21b34: 82 30 cpi r24, 0x02 ; 2 21b36: 09 f0 breq .+2 ; 0x21b3a 21b38: 7a c0 rjmp .+244 ; 0x21c2e 21b3a: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.472> 21b3e: 88 23 and r24, r24 21b40: 09 f4 brne .+2 ; 0x21b44 21b42: 75 c0 rjmp .+234 ; 0x21c2e custom_message_state = 0; 21b44: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 21b48: 8b e9 ldi r24, 0x9B ; 155 21b4a: 90 e4 ldi r25, 0x40 ; 64 21b4c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 21b50: 0f 94 be 0b call 0x2177c ; 0x2177c 21b54: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 21b58: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 21b5c: c0 91 ec 03 lds r28, 0x03EC ; 0x8003ec <_Kp> 21b60: d0 91 ed 03 lds r29, 0x03ED ; 0x8003ed <_Kp+0x1> 21b64: 10 91 ee 03 lds r17, 0x03EE ; 0x8003ee <_Kp+0x2> 21b68: 00 91 ef 03 lds r16, 0x03EF ; 0x8003ef <_Kp+0x3> 21b6c: 20 e0 ldi r18, 0x00 ; 0 21b6e: 30 e0 ldi r19, 0x00 ; 0 21b70: a9 01 movw r20, r18 21b72: f8 01 movw r30, r16 21b74: 6c 2f mov r22, r28 21b76: 7d 2f mov r23, r29 21b78: 8f 2f mov r24, r31 21b7a: 9e 2f mov r25, r30 21b7c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 21b80: 81 11 cpse r24, r1 21b82: 1f c0 rjmp .+62 ; 0x21bc2 21b84: 20 e0 ldi r18, 0x00 ; 0 21b86: 30 e0 ldi r19, 0x00 ; 0 21b88: a9 01 movw r20, r18 21b8a: 60 91 e8 03 lds r22, 0x03E8 ; 0x8003e8 <_Ki> 21b8e: 70 91 e9 03 lds r23, 0x03E9 ; 0x8003e9 <_Ki+0x1> 21b92: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Ki+0x2> 21b96: 90 91 eb 03 lds r25, 0x03EB ; 0x8003eb <_Ki+0x3> 21b9a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 21b9e: 81 11 cpse r24, r1 21ba0: 10 c0 rjmp .+32 ; 0x21bc2 21ba2: 20 e0 ldi r18, 0x00 ; 0 21ba4: 30 e0 ldi r19, 0x00 ; 0 21ba6: a9 01 movw r20, r18 21ba8: 60 91 e4 03 lds r22, 0x03E4 ; 0x8003e4 <_Kd> 21bac: 70 91 e5 03 lds r23, 0x03E5 ; 0x8003e5 <_Kd+0x1> 21bb0: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_Kd+0x2> 21bb4: 90 91 e7 03 lds r25, 0x03E7 ; 0x8003e7 <_Kd+0x3> 21bb8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 21bbc: 88 23 and r24, r24 21bbe: 09 f4 brne .+2 ; 0x21bc2 21bc0: 7d c2 rjmp .+1274 ; 0x220bc enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 21bc2: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 <_Kd+0x3> 21bc6: 8f 93 push r24 21bc8: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_Kd+0x2> 21bcc: 8f 93 push r24 21bce: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 <_Kd+0x1> 21bd2: 8f 93 push r24 21bd4: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 <_Kd> 21bd8: 8f 93 push r24 21bda: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Ki+0x3> 21bde: 8f 93 push r24 21be0: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Ki+0x2> 21be4: 8f 93 push r24 21be6: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Ki+0x1> 21bea: 8f 93 push r24 21bec: 80 91 e8 03 lds r24, 0x03E8 ; 0x8003e8 <_Ki> 21bf0: 8f 93 push r24 21bf2: 0f 93 push r16 21bf4: 1f 93 push r17 21bf6: df 93 push r29 21bf8: cf 93 push r28 21bfa: 82 e6 ldi r24, 0x62 ; 98 21bfc: 9d e8 ldi r25, 0x8D ; 141 21bfe: 9f 93 push r25 21c00: 8f 93 push r24 21c02: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommand_P(MSG_M500); 21c06: 61 e0 ldi r22, 0x01 ; 1 21c08: 81 e6 ldi r24, 0x61 ; 97 21c0a: 9c e6 ldi r25, 0x6C ; 108 21c0c: 0e 94 5c 89 call 0x112b8 ; 0x112b8 21c10: 8d b7 in r24, 0x3d ; 61 21c12: 9e b7 in r25, 0x3e ; 62 21c14: 0e 96 adiw r24, 0x0e ; 14 21c16: 0f b6 in r0, 0x3f ; 63 21c18: f8 94 cli 21c1a: 9e bf out 0x3e, r25 ; 62 21c1c: 0f be out 0x3f, r0 ; 63 21c1e: 8d bf out 0x3d, r24 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 21c20: 81 ee ldi r24, 0xE1 ; 225 21c22: 93 e0 ldi r25, 0x03 ; 3 21c24: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> lcd_commands_step = 1; 21c28: 81 e0 ldi r24, 0x01 ; 1 21c2a: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 21c2e: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21c32: 81 30 cpi r24, 0x01 ; 1 21c34: d9 f4 brne .+54 ; 0x21c6c 21c36: 60 ed ldi r22, 0xD0 ; 208 21c38: 77 e0 ldi r23, 0x07 ; 7 21c3a: 81 ee ldi r24, 0xE1 ; 225 21c3c: 93 e0 ldi r25, 0x03 ; 3 21c3e: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 21c42: 88 23 and r24, r24 21c44: 99 f0 breq .+38 ; 0x21c6c lcd_setstatuspgm(MSG_WELCOME); 21c46: 8d ea ldi r24, 0xAD ; 173 21c48: 90 e7 ldi r25, 0x70 ; 112 21c4a: 0f 94 be 0b call 0x2177c ; 0x2177c custom_message_type = CustomMsg::Status; 21c4e: 10 92 72 07 sts 0x0772, r1 ; 0x800772 pid_temp = DEFAULT_PID_TEMP; 21c52: 82 ed ldi r24, 0xD2 ; 210 21c54: 90 e0 ldi r25, 0x00 ; 0 21c56: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.456+0x1> 21c5a: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.456> lcd_commands_step = 0; 21c5e: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 lcd_commands_type = LcdCommands::Idle; 21c62: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 21c66: 82 e0 ldi r24, 0x02 ; 2 21c68: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); } } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) 21c6c: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 21c70: 95 30 cpi r25, 0x05 ; 5 21c72: 99 f4 brne .+38 ; 0x21c9a 21c74: 20 91 7e 10 lds r18, 0x107E ; 0x80107e 21c78: 30 91 7f 10 lds r19, 0x107F ; 0x80107f 21c7c: 23 2b or r18, r19 21c7e: 71 f5 brne .+92 ; 0x21cdc { switch (lcd_commands_step) 21c80: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21c84: 82 30 cpi r24, 0x02 ; 2 21c86: 09 f4 brne .+2 ; 0x21c8a 21c88: 42 c2 rjmp .+1156 ; 0x2210e 21c8a: 08 f0 brcs .+2 ; 0x21c8e 21c8c: 1c c2 rjmp .+1080 ; 0x220c6 21c8e: 88 23 and r24, r24 21c90: 09 f4 brne .+2 ; 0x21c94 21c92: 2d c2 rjmp .+1114 ; 0x220ee 21c94: 81 30 cpi r24, 0x01 ; 1 21c96: 09 f4 brne .+2 ; 0x21c9a 21c98: 45 c2 rjmp .+1162 ; 0x22124 break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 21c9a: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 21c9e: 86 30 cpi r24, 0x06 ; 6 21ca0: e9 f4 brne .+58 ; 0x21cdc 21ca2: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 21ca6: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 21caa: 98 13 cpse r25, r24 21cac: 17 c0 rjmp .+46 ; 0x21cdc 21cae: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 21cb2: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 21cb6: 89 2b or r24, r25 21cb8: 89 f4 brne .+34 ; 0x21cdc 21cba: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 21cbe: 81 11 cpse r24, r1 21cc0: 0d c0 rjmp .+26 ; 0x21cdc #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) 21cc2: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21cc6: 81 30 cpi r24, 0x01 ; 1 21cc8: 09 f4 brne .+2 ; 0x21ccc 21cca: 81 c2 rjmp .+1282 ; 0x221ce 21ccc: 08 f4 brcc .+2 ; 0x21cd0 21cce: 44 c2 rjmp .+1160 ; 0x22158 21cd0: 82 30 cpi r24, 0x02 ; 2 21cd2: 09 f4 brne .+2 ; 0x21cd6 21cd4: 63 c2 rjmp .+1222 ; 0x2219c 21cd6: 83 30 cpi r24, 0x03 ; 3 21cd8: 09 f4 brne .+2 ; 0x21cdc 21cda: 42 c2 rjmp .+1156 ; 0x22160 menu_depth = 3; break; } } } } 21cdc: df 91 pop r29 21cde: cf 91 pop r28 21ce0: 1f 91 pop r17 21ce2: 0f 91 pop r16 21ce4: ff 90 pop r15 21ce6: ef 90 pop r14 21ce8: df 90 pop r13 21cea: cf 90 pop r12 21cec: bf 90 pop r11 21cee: af 90 pop r10 21cf0: 9f 90 pop r9 21cf2: 8f 90 pop r8 21cf4: 7f 90 pop r7 21cf6: 6f 90 pop r6 21cf8: 5f 90 pop r5 21cfa: 4f 90 pop r4 21cfc: 3f 90 pop r3 21cfe: 2f 90 pop r2 21d00: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 21d02: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 menu_depth = 0; 21d06: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 menu_submenu(lcd_babystep_z, true); 21d0a: 61 e0 ldi r22, 0x01 ; 1 21d0c: 8a ed ldi r24, 0xDA ; 218 21d0e: 9a e3 ldi r25, 0x3A ; 58 21d10: 0f 94 32 d0 call 0x3a064 ; 0x3a064 cmd_intro_mmu_9, cmd_intro_mmu_10, cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) 21d14: 80 91 95 13 lds r24, 0x1395 ; 0x801395 21d18: 81 30 cpi r24, 0x01 ; 1 21d1a: b9 f4 brne .+46 ; 0x21d4a { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 21d1c: 80 91 f2 03 lds r24, 0x03F2 ; 0x8003f2 21d20: 10 e0 ldi r17, 0x00 ; 0 21d22: 81 11 cpse r24, r1 21d24: 01 c0 rjmp .+2 ; 0x21d28 21d26: 12 e0 ldi r17, 0x02 ; 2 21d28: c1 2f mov r28, r17 21d2a: d0 e0 ldi r29, 0x00 ; 0 21d2c: cc 0f add r28, r28 21d2e: dd 1f adc r29, r29 21d30: c4 54 subi r28, 0x44 ; 68 21d32: d3 47 sbci r29, 0x73 ; 115 { enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); 21d34: fe 01 movw r30, r28 21d36: 85 91 lpm r24, Z+ 21d38: 94 91 lpm r25, Z 21d3a: 61 e0 ldi r22, 0x01 ; 1 21d3c: 0e 94 5c 89 call 0x112b8 ; 0x112b8 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) 21d40: 1f 5f subi r17, 0xFF ; 255 21d42: 22 96 adiw r28, 0x02 ; 2 21d44: 19 30 cpi r17, 0x09 ; 9 21d46: b1 f7 brne .-20 ; 0x21d34 21d48: ba ce rjmp .-652 ; 0x21abe enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); } } else { enquecommand_P(feedrate_F1080); //fixed velocity for the intro line 21d4a: 61 e0 ldi r22, 0x01 ; 1 21d4c: 84 eb ldi r24, 0xB4 ; 180 21d4e: 9c e8 ldi r25, 0x8C ; 140 21d50: 0e 94 5c 89 call 0x112b8 ; 0x112b8 enquecommandf_P(extrude_fmt_X, 60.f, count_e(layer_height, extrusion_width * 4.f, 60)); 21d54: 20 e0 ldi r18, 0x00 ; 0 21d56: 30 e0 ldi r19, 0x00 ; 0 21d58: 40 e8 ldi r20, 0x80 ; 128 21d5a: 50 e4 ldi r21, 0x40 ; 64 21d5c: c5 01 movw r24, r10 21d5e: b4 01 movw r22, r8 21d60: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 21d64: 20 e0 ldi r18, 0x00 ; 0 21d66: 30 e0 ldi r19, 0x00 ; 0 21d68: 40 e7 ldi r20, 0x70 ; 112 21d6a: 52 e4 ldi r21, 0x42 ; 66 21d6c: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21d70: 9f 93 push r25 21d72: 8f 93 push r24 21d74: 7f 93 push r23 21d76: 6f 93 push r22 21d78: 82 e4 ldi r24, 0x42 ; 66 21d7a: 8f 93 push r24 21d7c: 80 e7 ldi r24, 0x70 ; 112 21d7e: 8f 93 push r24 21d80: 1f 92 push r1 21d82: 1f 92 push r1 21d84: c7 ea ldi r28, 0xA7 ; 167 21d86: dc e8 ldi r29, 0x8C ; 140 21d88: df 93 push r29 21d8a: cf 93 push r28 21d8c: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(extrude_fmt_X, 202.5f, count_e(layer_height, extrusion_width * 8.f, 142.5)); 21d90: 20 e0 ldi r18, 0x00 ; 0 21d92: 30 e0 ldi r19, 0x00 ; 0 21d94: 40 e0 ldi r20, 0x00 ; 0 21d96: 51 e4 ldi r21, 0x41 ; 65 21d98: c5 01 movw r24, r10 21d9a: b4 01 movw r22, r8 21d9c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 21da0: 20 e0 ldi r18, 0x00 ; 0 21da2: 30 e8 ldi r19, 0x80 ; 128 21da4: 4e e0 ldi r20, 0x0E ; 14 21da6: 53 e4 ldi r21, 0x43 ; 67 21da8: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21dac: 9f 93 push r25 21dae: 8f 93 push r24 21db0: 7f 93 push r23 21db2: 6f 93 push r22 21db4: 83 e4 ldi r24, 0x43 ; 67 21db6: 8f 93 push r24 21db8: 8a e4 ldi r24, 0x4A ; 74 21dba: 8f 93 push r24 21dbc: 80 e8 ldi r24, 0x80 ; 128 21dbe: 8f 93 push r24 21dc0: 1f 92 push r1 21dc2: df 93 push r29 21dc4: cf 93 push r28 21dc6: 0e 94 fa 89 call 0x113f4 ; 0x113f4 21dca: 8d b7 in r24, 0x3d ; 61 21dcc: 9e b7 in r25, 0x3e ; 62 21dce: 44 96 adiw r24, 0x14 ; 20 21dd0: 0f b6 in r0, 0x3f ; 63 21dd2: f8 94 cli 21dd4: 9e bf out 0x3e, r25 ; 62 21dd6: 0f be out 0x3f, r0 ; 63 21dd8: 8d bf out 0x3d, r24 ; 61 21dda: 71 ce rjmp .-798 ; 0x21abe 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]))); 21ddc: 66 e0 ldi r22, 0x06 ; 6 21dde: 8b e9 ldi r24, 0x9B ; 155 21de0: 9c e8 ldi r25, 0x8C ; 140 21de2: 3b ce rjmp .-906 ; 0x21a5a //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { #ifndef NEW_FIRST_LAYER_CAL enquecommand_P(PSTR("G1X50Y155")); 21de4: 61 e0 ldi r22, 0x01 ; 1 21de6: 81 e9 ldi r24, 0x91 ; 145 21de8: 9c e8 ldi r25, 0x8C ; 140 21dea: 0e 94 5c 89 call 0x112b8 ; 0x112b8 #endif //_NEW_FIRST_LAYER_CAL static const char fmt1[] PROGMEM = "G1Z%.2f"; enquecommandf_P(fmt1, layer_height); 21dee: 8e e3 ldi r24, 0x3E ; 62 21df0: 8f 93 push r24 21df2: 8c e4 ldi r24, 0x4C ; 76 21df4: 8f 93 push r24 21df6: 8c ec ldi r24, 0xCC ; 204 21df8: 8f 93 push r24 21dfa: 8d ec ldi r24, 0xCD ; 205 21dfc: 8f 93 push r24 21dfe: 89 e8 ldi r24, 0x89 ; 137 21e00: 9c e8 ldi r25, 0x8C ; 140 21e02: 9f 93 push r25 21e04: 8f 93 push r24 21e06: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommand_P(feedrate_F1080); 21e0a: 61 e0 ldi r22, 0x01 ; 1 21e0c: 84 eb ldi r24, 0xB4 ; 180 21e0e: 9c e8 ldi r25, 0x8C ; 140 21e10: 0e 94 5c 89 call 0x112b8 ; 0x112b8 enquecommand_P(MSG_G91); //enable relative XYZ 21e14: 61 e0 ldi r22, 0x01 ; 1 21e16: 8e e4 ldi r24, 0x4E ; 78 21e18: 9c e6 ldi r25, 0x6C ; 108 21e1a: 0e 94 5c 89 call 0x112b8 ; 0x112b8 #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)); 21e1e: 20 e0 ldi r18, 0x00 ; 0 21e20: 30 e0 ldi r19, 0x00 ; 0 21e22: 40 e8 ldi r20, 0x80 ; 128 21e24: 50 e4 ldi r21, 0x40 ; 64 21e26: c5 01 movw r24, r10 21e28: b4 01 movw r22, r8 21e2a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 21e2e: 20 e0 ldi r18, 0x00 ; 0 21e30: 30 e0 ldi r19, 0x00 ; 0 21e32: 48 ec ldi r20, 0xC8 ; 200 21e34: 51 e4 ldi r21, 0x41 ; 65 21e36: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21e3a: 9f 93 push r25 21e3c: 8f 93 push r24 21e3e: 7f 93 push r23 21e40: 6f 93 push r22 21e42: 01 e4 ldi r16, 0x41 ; 65 21e44: 0f 93 push r16 21e46: 18 ec ldi r17, 0xC8 ; 200 21e48: 1f 93 push r17 21e4a: 1f 92 push r1 21e4c: 1f 92 push r1 21e4e: c7 ea ldi r28, 0xA7 ; 167 21e50: dc e8 ldi r29, 0x8C ; 140 21e52: df 93 push r29 21e54: cf 93 push r28 21e56: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 2.f, 25)); 21e5a: a5 01 movw r20, r10 21e5c: 94 01 movw r18, r8 21e5e: c5 01 movw r24, r10 21e60: b4 01 movw r22, r8 21e62: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 21e66: 20 e0 ldi r18, 0x00 ; 0 21e68: 30 e0 ldi r19, 0x00 ; 0 21e6a: 48 ec ldi r20, 0xC8 ; 200 21e6c: 51 e4 ldi r21, 0x41 ; 65 21e6e: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21e72: 9f 93 push r25 21e74: 8f 93 push r24 21e76: 7f 93 push r23 21e78: 6f 93 push r22 21e7a: 0f 93 push r16 21e7c: 1f 93 push r17 21e7e: 1f 92 push r1 21e80: 1f 92 push r1 21e82: df 93 push r29 21e84: cf 93 push r28 21e86: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(extrude_fmt_X, 100.f*invert, count_e(layer_height, extrusion_width, 100)); 21e8a: 20 e0 ldi r18, 0x00 ; 0 21e8c: 30 e0 ldi r19, 0x00 ; 0 21e8e: 48 ec ldi r20, 0xC8 ; 200 21e90: 52 e4 ldi r21, 0x42 ; 66 21e92: c5 01 movw r24, r10 21e94: b4 01 movw r22, r8 21e96: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21e9a: 9f 93 push r25 21e9c: 8f 93 push r24 21e9e: 7f 93 push r23 21ea0: 6f 93 push r22 21ea2: 82 e4 ldi r24, 0x42 ; 66 21ea4: 8f 93 push r24 21ea6: 1f 93 push r17 21ea8: 1f 92 push r1 21eaa: 1f 92 push r1 21eac: df 93 push r29 21eae: cf 93 push r28 21eb0: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(extrude_fmt_Y, -20.f*invert, count_e(layer_height, extrusion_width, 20)); 21eb4: 8d b7 in r24, 0x3d ; 61 21eb6: 9e b7 in r25, 0x3e ; 62 21eb8: 84 96 adiw r24, 0x24 ; 36 21eba: 0f b6 in r0, 0x3f ; 63 21ebc: f8 94 cli 21ebe: 9e bf out 0x3e, r25 ; 62 21ec0: 0f be out 0x3f, r0 ; 63 21ec2: 8d bf out 0x3d, r24 ; 61 21ec4: 20 e0 ldi r18, 0x00 ; 0 21ec6: 30 e0 ldi r19, 0x00 ; 0 21ec8: 40 ea ldi r20, 0xA0 ; 160 21eca: 51 e4 ldi r21, 0x41 ; 65 21ecc: c5 01 movw r24, r10 21ece: b4 01 movw r22, r8 21ed0: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21ed4: 9f 93 push r25 21ed6: 8f 93 push r24 21ed8: 7f 93 push r23 21eda: 6f 93 push r22 21edc: 81 ec ldi r24, 0xC1 ; 193 21ede: 8f 93 push r24 21ee0: 80 ea ldi r24, 0xA0 ; 160 21ee2: 8f 93 push r24 21ee4: 1f 92 push r1 21ee6: 1f 92 push r1 21ee8: 8c e7 ldi r24, 0x7C ; 124 21eea: 9c e8 ldi r25, 0x8C ; 140 21eec: 9f 93 push r25 21eee: 8f 93 push r24 21ef0: 0e 94 fa 89 call 0x113f4 ; 0x113f4 21ef4: 8d b7 in r24, 0x3d ; 61 21ef6: 9e b7 in r25, 0x3e ; 62 21ef8: 0a 96 adiw r24, 0x0a ; 10 21efa: 0f b6 in r0, 0x3f ; 63 21efc: f8 94 cli 21efe: 9e bf out 0x3e, r25 ; 62 21f00: 0f be out 0x3f, r0 ; 63 21f02: 8d bf out 0x3d, r24 ; 61 21f04: dc cd rjmp .-1096 ; 0x21abe //! @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); 21f06: 20 e0 ldi r18, 0x00 ; 0 21f08: 30 e0 ldi r19, 0x00 ; 0 21f0a: 46 e1 ldi r20, 0x16 ; 22 21f0c: 53 e4 ldi r21, 0x43 ; 67 21f0e: c5 01 movw r24, r10 21f10: b4 01 movw r22, r8 21f12: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21f16: 76 2e mov r7, r22 21f18: 67 2e mov r6, r23 21f1a: 58 2e mov r5, r24 21f1c: 49 2e mov r4, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 21f1e: 20 e0 ldi r18, 0x00 ; 0 21f20: 30 e0 ldi r19, 0x00 ; 0 21f22: 40 ea ldi r20, 0xA0 ; 160 21f24: 51 e4 ldi r21, 0x41 ; 65 21f26: c5 01 movw r24, r10 21f28: b4 01 movw r22, r8 21f2a: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21f2e: b6 2e mov r11, r22 21f30: a7 2e mov r10, r23 21f32: 98 2e mov r9, r24 21f34: 89 2e mov r8, r25 21f36: c5 e0 ldi r28, 0x05 ; 5 for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 21f38: df ef ldi r29, 0xFF ; 255 { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 21f3a: 27 ea ldi r18, 0xA7 ; 167 21f3c: e2 2e mov r14, r18 21f3e: 2c e8 ldi r18, 0x8C ; 140 21f40: f2 2e mov r15, r18 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 21f42: 31 ec ldi r19, 0xC1 ; 193 21f44: c3 2e mov r12, r19 21f46: 40 ea ldi r20, 0xA0 ; 160 21f48: d4 2e mov r13, r20 21f4a: 0c e7 ldi r16, 0x7C ; 124 21f4c: 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); 21f4e: 4f 92 push r4 21f50: 5f 92 push r5 21f52: 6f 92 push r6 21f54: 7f 92 push r7 21f56: 6d 2f mov r22, r29 21f58: 0d 2e mov r0, r29 21f5a: 00 0c add r0, r0 21f5c: 77 0b sbc r23, r23 21f5e: 88 0b sbc r24, r24 21f60: 99 0b sbc r25, r25 21f62: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 21f66: 20 e0 ldi r18, 0x00 ; 0 21f68: 30 e0 ldi r19, 0x00 ; 0 21f6a: 46 e1 ldi r20, 0x16 ; 22 21f6c: 53 e4 ldi r21, 0x43 ; 67 21f6e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 21f72: 9f 93 push r25 21f74: 8f 93 push r24 21f76: 7f 93 push r23 21f78: 6f 93 push r22 21f7a: ff 92 push r15 21f7c: ef 92 push r14 21f7e: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 21f82: 8f 92 push r8 21f84: 9f 92 push r9 21f86: af 92 push r10 21f88: bf 92 push r11 21f8a: cf 92 push r12 21f8c: df 92 push r13 21f8e: 1f 92 push r1 21f90: 1f 92 push r1 21f92: 1f 93 push r17 21f94: 0f 93 push r16 21f96: 0e 94 fa 89 call 0x113f4 ; 0x113f4 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) 21f9a: d1 95 neg r29 21f9c: c1 50 subi r28, 0x01 ; 1 21f9e: 8d b7 in r24, 0x3d ; 61 21fa0: 9e b7 in r25, 0x3e ; 62 21fa2: 44 96 adiw r24, 0x14 ; 20 21fa4: 0f b6 in r0, 0x3f ; 63 21fa6: f8 94 cli 21fa8: 9e bf out 0x3e, r25 ; 62 21faa: 0f be out 0x3f, r0 ; 63 21fac: 8d bf out 0x3d, r24 ; 61 21fae: c1 11 cpse r28, r1 21fb0: ce cf rjmp .-100 ; 0x21f4e 21fb2: 85 cd rjmp .-1270 ; 0x21abe //! @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); 21fb4: 23 e4 ldi r18, 0x43 ; 67 21fb6: 3d ec ldi r19, 0xCD ; 205 21fb8: 4f e2 ldi r20, 0x2F ; 47 21fba: 5d e3 ldi r21, 0x3D ; 61 21fbc: c5 01 movw r24, r10 21fbe: b4 01 movw r22, r8 21fc0: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 21fc4: 6b 01 movw r12, r22 21fc6: 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); 21fc8: 20 e0 ldi r18, 0x00 ; 0 21fca: 30 e0 ldi r19, 0x00 ; 0 21fcc: 40 ea ldi r20, 0xA0 ; 160 21fce: 51 e4 ldi r21, 0x41 ; 65 21fd0: c5 01 movw r24, r10 21fd2: b4 01 movw r22, r8 21fd4: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21fd8: 66 2e mov r6, r22 21fda: 57 2e mov r5, r23 21fdc: 48 2e mov r4, r24 21fde: 39 2e mov r3, r25 const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); 21fe0: a7 01 movw r20, r14 21fe2: 96 01 movw r18, r12 21fe4: c5 01 movw r24, r10 21fe6: b4 01 movw r22, r8 21fe8: 0f 94 4b 87 call 0x30e96 ; 0x30e96 21fec: 26 2e mov r2, r22 21fee: a7 2e mov r10, r23 21ff0: 98 2e mov r9, r24 21ff2: 89 2e mov r8, r25 21ff4: 84 e0 ldi r24, 0x04 ; 4 21ff6: b8 2e mov r11, r24 for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 21ff8: 90 ea ldi r25, 0xA0 ; 160 21ffa: 79 2e mov r7, r25 21ffc: 07 ea ldi r16, 0xA7 ; 167 21ffe: 1c e8 ldi r17, 0x8C ; 140 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 22000: f7 fa bst r15, 7 22002: f0 94 com r15 22004: f7 f8 bld r15, 7 22006: f0 94 com r15 22008: cc e7 ldi r28, 0x7C ; 124 2200a: 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); 2200c: 3f 92 push r3 2200e: 4f 92 push r4 22010: 5f 92 push r5 22012: 6f 92 push r6 22014: 91 e4 ldi r25, 0x41 ; 65 22016: 9f 93 push r25 22018: 7f 92 push r7 2201a: 1f 92 push r1 2201c: 1f 92 push r1 2201e: 1f 93 push r17 22020: 0f 93 push r16 22022: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 22026: 8f 92 push r8 22028: 9f 92 push r9 2202a: af 92 push r10 2202c: 2f 92 push r2 2202e: ff 92 push r15 22030: ef 92 push r14 22032: df 92 push r13 22034: cf 92 push r12 22036: df 93 push r29 22038: cf 93 push r28 2203a: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(extrude_fmt_X, -square_width*invert, long_extrusion); 2203e: 3f 92 push r3 22040: 4f 92 push r4 22042: 5f 92 push r5 22044: 6f 92 push r6 22046: 81 ec ldi r24, 0xC1 ; 193 22048: 8f 93 push r24 2204a: 7f 92 push r7 2204c: 1f 92 push r1 2204e: 1f 92 push r1 22050: 1f 93 push r17 22052: 0f 93 push r16 22054: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 22058: 8f 92 push r8 2205a: 9f 92 push r9 2205c: af 92 push r10 2205e: 2f 92 push r2 22060: ff 92 push r15 22062: ef 92 push r14 22064: df 92 push r13 22066: cf 92 push r12 22068: df 93 push r29 2206a: cf 93 push r28 2206c: 0e 94 fa 89 call 0x113f4 ; 0x113f4 22070: 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++) 22072: 8d b7 in r24, 0x3d ; 61 22074: 9e b7 in r25, 0x3e ; 62 22076: 88 96 adiw r24, 0x28 ; 40 22078: 0f b6 in r0, 0x3f ; 63 2207a: f8 94 cli 2207c: 9e bf out 0x3e, r25 ; 62 2207e: 0f be out 0x3f, r0 ; 63 22080: 8d bf out 0x3d, r24 ; 61 22082: b1 10 cpse r11, r1 22084: c3 cf rjmp .-122 ; 0x2200c 22086: 1b cd rjmp .-1482 ; 0x21abe 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]))); 22088: 69 e0 ldi r22, 0x09 ; 9 2208a: 8a e6 ldi r24, 0x6A ; 106 2208c: 9c e8 ldi r25, 0x8C ; 140 2208e: e5 cc rjmp .-1590 ; 0x21a5a break; case 2: lay1cal_finish(); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 22090: 8d ea ldi r24, 0xAD ; 173 22092: 90 e7 ldi r25, 0x70 ; 112 22094: 0f 94 be 0b call 0x2177c ; 0x2177c lcd_commands_step = 0; 22098: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 lcd_commands_type = LcdCommands::Idle; 2209c: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 220a0: 82 e0 ldi r24, 0x02 ; 2 220a2: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 220a6: 8f e5 ldi r24, 0x5F ; 95 220a8: 9f e0 ldi r25, 0x0F ; 15 220aa: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 220ae: 88 23 and r24, r24 220b0: 09 f4 brne .+2 ; 0x220b4 220b2: dc cd rjmp .-1096 ; 0x21c6c lcd_wizard(WizState::RepeatLay1Cal); 220b4: 8c e0 ldi r24, 0x0C ; 12 220b6: 0f 94 bf 65 call 0x2cb7e ; 0x2cb7e 220ba: 01 cd rjmp .-1534 ; 0x21abe 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."); 220bc: 82 e3 ldi r24, 0x32 ; 50 220be: 9d e8 ldi r25, 0x8D ; 141 220c0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 220c4: ad cd rjmp .-1190 ; 0x21c20 } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 220c6: 84 30 cpi r24, 0x04 ; 4 220c8: a9 f0 breq .+42 ; 0x220f4 220ca: c0 f0 brcs .+48 ; 0x220fc 220cc: 85 30 cpi r24, 0x05 ; 5 220ce: 09 f0 breq .+2 ; 0x220d2 220d0: e4 cd rjmp .-1080 ; 0x21c9a case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 220d2: 61 e0 ldi r22, 0x01 ; 1 220d4: 8b e5 ldi r24, 0x5B ; 91 220d6: 9c e6 ldi r25, 0x6C ; 108 220d8: 0e 94 5c 89 call 0x112b8 ; 0x112b8 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 220dc: 61 e0 ldi r22, 0x01 ; 1 220de: 8c e1 ldi r24, 0x1C ; 28 220e0: 9d e8 ldi r25, 0x8D ; 141 220e2: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_commands_step = 4; 220e6: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 220e8: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 220ec: d6 cd rjmp .-1108 ; 0x21c9a if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 220ee: 90 93 f4 03 sts 0x03F4, r25 ; 0x8003f4 220f2: ef cf rjmp .-34 ; 0x220d2 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 220f4: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 lcd_commands_step = 3; 220f8: 83 e0 ldi r24, 0x03 ; 3 220fa: f6 cf rjmp .-20 ; 0x220e8 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 220fc: 10 92 3d 02 sts 0x023D, r1 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.469> break; case 3: thermal_model_set_warn_beep(false); enquecommand_P(PSTR("M310 A F1")); 22100: 61 e0 ldi r22, 0x01 ; 1 22102: 82 e1 ldi r24, 0x12 ; 18 22104: 9d e8 ldi r25, 0x8D ; 141 22106: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_commands_step = 2; 2210a: 82 e0 ldi r24, 0x02 ; 2 2210c: ed cf rjmp .-38 ; 0x220e8 break; case 2: if (thermal_model_autotune_result()) 2210e: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.556> 22112: 81 11 cpse r24, r1 22114: 05 c0 rjmp .+10 ; 0x22120 enquecommand_P(MSG_M500); 22116: 61 e0 ldi r22, 0x01 ; 1 22118: 81 e6 ldi r24, 0x61 ; 97 2211a: 9c e6 ldi r25, 0x6C ; 108 2211c: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_commands_step = 1; 22120: 81 e0 ldi r24, 0x01 ; 1 22122: e2 cf rjmp .-60 ; 0x220e8 break; case 1: lcd_commands_step = 0; 22124: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 lcd_commands_type = LcdCommands::Idle; 22128: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 2212c: 92 e0 ldi r25, 0x02 ; 2 2212e: 90 93 64 0e sts 0x0E64, r25 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 22132: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.469> SetPrinterState(PrinterState::Idle); thermal_model_set_warn_beep(true); bool res = thermal_model_autotune_result(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 22136: 8f e5 ldi r24, 0x5F ; 95 22138: 9f e0 ldi r25, 0x0F ; 15 2213a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2213e: 88 23 and r24, r24 22140: 09 f4 brne .+2 ; 0x22144 22142: cc cd rjmp .-1128 ; 0x21cdc // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 22144: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.556> 22148: 81 11 cpse r24, r1 2214a: 04 c0 rjmp .+8 ; 0x22154 2214c: 81 e0 ldi r24, 0x01 ; 1 2214e: 0f 94 bf 65 call 0x2cb7e ; 0x2cb7e 22152: a3 cd rjmp .-1210 ; 0x21c9a 22154: 8e e0 ldi r24, 0x0E ; 14 22156: fb cf rjmp .-10 ; 0x2214e #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 22158: 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; 2215a: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 2215e: be cd rjmp .-1156 ; 0x21cdc case 0: lcd_commands_step = 3; break; case 3: #ifndef QUICK_NOZZLE_CHANGE lcd_show_fullscreen_message_and_wait_P(_T(MSG_NOZZLE_CNG_READ_HELP)); 22160: 84 e6 ldi r24, 0x64 ; 100 22162: 90 e4 ldi r25, 0x40 ; 64 22164: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22168: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 enquecommand_P(G28W); 2216c: 61 e0 ldi r22, 0x01 ; 1 2216e: 8b e5 ldi r24, 0x5B ; 91 22170: 9c e6 ldi r25, 0x6C ; 108 22172: 0e 94 5c 89 call 0x112b8 ; 0x112b8 enquecommand_P(PSTR("G1 X125 Z200 F1000")); 22176: 61 e0 ldi r22, 0x01 ; 1 22178: 8f ef ldi r24, 0xFF ; 255 2217a: 9c e8 ldi r25, 0x8C ; 140 2217c: 0e 94 5c 89 call 0x112b8 ; 0x112b8 enquecommand_P(PSTR("M109 S280")); 22180: 61 e0 ldi r22, 0x01 ; 1 22182: 85 ef ldi r24, 0xF5 ; 245 22184: 9c e8 ldi r25, 0x8C ; 140 22186: 0e 94 5c 89 call 0x112b8 ; 0x112b8 #ifdef THERMAL_MODEL was_enabled = thermal_model_enabled(); 2218a: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> 2218e: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 thermal_model_set_enabled(false); 22192: 80 e0 ldi r24, 0x00 ; 0 22194: 0f 94 4d 48 call 0x2909a ; 0x2909a } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 22198: 82 e0 ldi r24, 0x02 ; 2 2219a: df cf rjmp .-66 ; 0x2215a break; case 2: enquecommand_P(PSTR("M84 XY")); 2219c: 61 e0 ldi r22, 0x01 ; 1 2219e: 8e ee ldi r24, 0xEE ; 238 221a0: 9c e8 ldi r25, 0x8C ; 140 221a2: 0e 94 5c 89 call 0x112b8 ; 0x112b8 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 221a6: 8b e2 ldi r24, 0x2B ; 43 221a8: 90 e4 ldi r25, 0x40 ; 64 221aa: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 221ae: 41 e0 ldi r20, 0x01 ; 1 221b0: 60 e0 ldi r22, 0x00 ; 0 221b2: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c 221b6: 81 11 cpse r24, r1 221b8: 91 cd rjmp .-1246 ; 0x21cdc 221ba: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 221be: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a #ifndef QUICK_NOZZLE_CHANGE setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); 221c2: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 221c6: 0f 94 4d 48 call 0x2909a ; 0x2909a #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 221ca: 81 e0 ldi r24, 0x01 ; 1 221cc: c6 cf rjmp .-116 ; 0x2215a } break; case 1: lcd_commands_step = 0; 221ce: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 lcd_commands_type = LcdCommands::Idle; 221d2: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 221d6: 82 e0 ldi r24, 0x02 ; 2 221d8: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 221dc: 20 e0 ldi r18, 0x00 ; 0 221de: 41 e0 ldi r20, 0x01 ; 1 221e0: 62 e0 ldi r22, 0x02 ; 2 221e2: 70 e0 ldi r23, 0x00 ; 0 221e4: 8a e2 ldi r24, 0x2A ; 42 221e6: 9a e3 ldi r25, 0x3A ; 58 221e8: 0f 94 ef ce call 0x39dde ; 0x39dde menu_depth = 3; 221ec: 83 e0 ldi r24, 0x03 ; 3 221ee: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 221f2: 74 cd rjmp .-1304 ; 0x21cdc 000221f4 : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 221f4: 0f 93 push r16 221f6: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 221f8: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 221fc: 80 95 com r24 221fe: 81 70 andi r24, 0x01 ; 1 22200: 90 91 0b 04 lds r25, 0x040B ; 0x80040b 22204: 89 17 cp r24, r25 22206: a1 f1 breq .+104 ; 0x22270 { if(menu_menu == lcd_sdcard_menu) { 22208: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 2220c: 90 91 67 0e lds r25, 0x0E67 ; 0x800e67 22210: 88 58 subi r24, 0x88 ; 136 22212: 99 43 sbci r25, 0x39 ; 57 22214: 11 f4 brne .+4 ; 0x2221a // 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(); 22216: 0f 94 8d d1 call 0x3a31a ; 0x3a31a } lcd_draw_update = 2; 2221a: 82 e0 ldi r24, 0x02 ; 2 2221c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 22220: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22224: 80 95 com r24 22226: 81 70 andi r24, 0x01 ; 1 22228: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2222c: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 backlight_wake(); 22230: 80 e0 ldi r24, 0x00 ; 0 22232: 0e 94 b1 8b call 0x11762 ; 0x11762 if (lcd_oldcardstatus) 22236: 80 91 0b 04 lds r24, 0x040B ; 0x80040b 2223a: 88 23 and r24, r24 2223c: 09 f4 brne .+2 ; 0x22240 2223e: 71 c0 rjmp .+226 ; 0x22322 { if (!card.mounted) 22240: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 22244: 81 11 cpse r24, r1 22246: 05 c0 rjmp .+10 ; 0x22252 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 22248: 0f 94 2d 81 call 0x3025a ; 0x3025a card.presort_flag = true; //force sorting of the SD menu 2224c: 81 e0 ldi r24, 0x01 ; 1 2224e: 80 93 ba 14 sts 0x14BA, r24 ; 0x8014ba } LCD_MESSAGERPGM(MSG_WELCOME); 22252: 8d ea ldi r24, 0xAD ; 173 22254: 90 e7 ldi r25, 0x70 ; 112 22256: 0f 94 be 0b call 0x2177c ; 0x2177c bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 2225a: 10 92 d9 03 sts 0x03D9, r1 ; 0x8003d9 menu_submenu(lcd_sdcard_menu, true); 2225e: 61 e0 ldi r22, 0x01 ; 1 22260: 88 e8 ldi r24, 0x88 ; 136 22262: 99 e3 ldi r25, 0x39 ; 57 22264: 0f 94 32 d0 call 0x3a064 ; 0x3a064 lcd_timeoutToStatus.start(); 22268: 84 ed ldi r24, 0xD4 ; 212 2226a: 93 e0 ldi r25, 0x03 ; 3 2226c: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 22270: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 22274: 00 91 d0 03 lds r16, 0x03D0 ; 0x8003d0 22278: 10 91 d1 03 lds r17, 0x03D1 ; 0x8003d1 2227c: 20 91 d2 03 lds r18, 0x03D2 ; 0x8003d2 22280: 30 91 d3 03 lds r19, 0x03D3 ; 0x8003d3 22284: 06 17 cp r16, r22 22286: 17 07 cpc r17, r23 22288: 28 07 cpc r18, r24 2228a: 39 07 cpc r19, r25 2228c: e8 f5 brcc .+122 ; 0x22308 { if (lcd_draw_update) { 2228e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22292: 88 23 and r24, r24 22294: 31 f0 breq .+12 ; 0x222a2 lcd_timeoutToStatus.start(); 22296: 84 ed ldi r24, 0xD4 ; 212 22298: 93 e0 ldi r25, 0x03 ; 3 2229a: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> lcd_frame_start(); 2229e: 0e 94 5a 6f call 0xdeb4 ; 0xdeb4 } (*menu_menu)(); 222a2: e0 91 66 0e lds r30, 0x0E66 ; 0x800e66 222a6: f0 91 67 0e lds r31, 0x0E67 ; 0x800e67 222aa: 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)))); 222ac: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 222b0: 90 91 67 0e lds r25, 0x0E67 ; 0x800e67 222b4: 8a 5d subi r24, 0xDA ; 218 222b6: 9a 43 sbci r25, 0x3A ; 58 222b8: 09 f4 brne .+2 ; 0x222bc 222ba: 46 c0 rjmp .+140 ; 0x22348 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 222bc: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 222c0: 90 91 67 0e lds r25, 0x0E67 ; 0x800e67 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 222c4: 29 e3 ldi r18, 0x39 ; 57 222c6: 8c 38 cpi r24, 0x8C ; 140 222c8: 92 07 cpc r25, r18 222ca: 09 f0 breq .+2 ; 0x222ce 222cc: 5e c0 rjmp .+188 ; 0x2238a } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 222ce: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 222d2: 82 30 cpi r24, 0x02 ; 2 222d4: 21 f4 brne .+8 ; 0x222de #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 222d6: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_status_message_idx = 0; // Re-draw message from beginning 222da: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.463> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 222de: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 222e2: 88 23 and r24, r24 222e4: 19 f0 breq .+6 ; 0x222ec 222e6: 81 50 subi r24, 0x01 ; 1 222e8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 222ec: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 222f0: 6c 59 subi r22, 0x9C ; 156 222f2: 7f 4f sbci r23, 0xFF ; 255 222f4: 8f 4f sbci r24, 0xFF ; 255 222f6: 9f 4f sbci r25, 0xFF ; 255 222f8: 60 93 d0 03 sts 0x03D0, r22 ; 0x8003d0 222fc: 70 93 d1 03 sts 0x03D1, r23 ; 0x8003d1 22300: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 22304: 90 93 d3 03 sts 0x03D3, r25 ; 0x8003d3 } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 22308: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 2230c: 84 30 cpi r24, 0x04 ; 4 2230e: 09 f0 breq .+2 ; 0x22312 22310: 53 c0 rjmp .+166 ; 0x223b8 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) { 22312: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 22316: 81 11 cpse r24, r1 22318: 4f c0 rjmp .+158 ; 0x223b8 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(); } 2231a: 1f 91 pop r17 2231c: 0f 91 pop r16 2231e: 0d 94 cf 0b jmp 0x2179e ; 0x2179e presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 22322: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b mounted = false; 22326: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c SERIAL_ECHO_START; 2232a: 84 e1 ldi r24, 0x14 ; 20 2232c: 9a ea ldi r25, 0xAA ; 170 2232e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 22332: 83 e0 ldi r24, 0x03 ; 3 22334: 9c e6 ldi r25, 0x6C ; 108 22336: 0e 94 17 7b call 0xf62e ; 0xf62e lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 2233a: 8e ef ldi r24, 0xFE ; 254 2233c: 9f e3 ldi r25, 0x3F ; 63 2233e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22342: 0f 94 be 0b call 0x2177c ; 0x2177c 22346: 94 cf rjmp .-216 ; 0x22270 // 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)))); 22348: 0e 94 65 68 call 0xd0ca ; 0xd0ca 2234c: 81 11 cpse r24, r1 2234e: 0e c0 rjmp .+28 ; 0x2236c 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) 22350: e0 91 66 0e lds r30, 0x0E66 ; 0x800e66 22354: f0 91 67 0e lds r31, 0x0E67 ; 0x800e67 22358: 30 97 sbiw r30, 0x00 ; 0 2235a: 39 f5 brne .+78 ; 0x223aa { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 2235c: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_return_to_status(); 22360: 0f 94 23 27 call 0x24e46 ; 0x24e46 lcd_draw_update = 2; 22364: 82 e0 ldi r24, 0x02 ; 2 22366: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 2236a: b1 cf rjmp .-158 ; 0x222ce // 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)))); 2236c: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 22370: 81 11 cpse r24, r1 22372: a4 cf rjmp .-184 ; 0x222bc 22374: 40 e9 ldi r20, 0x90 ; 144 22376: 5f e5 ldi r21, 0x5F ; 95 22378: 61 e0 ldi r22, 0x01 ; 1 2237a: 70 e0 ldi r23, 0x00 ; 0 2237c: 84 ed ldi r24, 0xD4 ; 212 2237e: 93 e0 ldi r25, 0x03 ; 3 22380: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 22384: 81 11 cpse r24, r1 22386: e4 cf rjmp .-56 ; 0x22350 22388: 99 cf rjmp .-206 ; 0x222bc } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 2238a: 8a 5d subi r24, 0xDA ; 218 2238c: 9a 43 sbci r25, 0x3A ; 58 2238e: 09 f4 brne .+2 ; 0x22392 22390: 9e cf rjmp .-196 ; 0x222ce && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 22392: 40 e3 ldi r20, 0x30 ; 48 22394: 55 e7 ldi r21, 0x75 ; 117 22396: 60 e0 ldi r22, 0x00 ; 0 22398: 70 e0 ldi r23, 0x00 ; 0 2239a: 84 ed ldi r24, 0xD4 ; 212 2239c: 93 e0 ldi r25, 0x03 ; 3 2239e: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 223a2: 88 23 and r24, r24 223a4: 09 f4 brne .+2 ; 0x223a8 223a6: 93 cf rjmp .-218 ; 0x222ce 223a8: d3 cf rjmp .-90 ; 0x22350 // 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; 223aa: 81 e0 ldi r24, 0x01 ; 1 223ac: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf (*menu_menu)(); 223b0: 19 95 eicall menu_leaving = 0; 223b2: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf 223b6: d2 cf rjmp .-92 ; 0x2235c 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(); } 223b8: 1f 91 pop r17 223ba: 0f 91 pop r16 223bc: 08 95 ret 000223be : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 223be: 2f 92 push r2 223c0: 3f 92 push r3 223c2: 4f 92 push r4 223c4: 5f 92 push r5 223c6: 6f 92 push r6 223c8: 7f 92 push r7 223ca: 8f 92 push r8 223cc: 9f 92 push r9 223ce: af 92 push r10 223d0: bf 92 push r11 223d2: cf 92 push r12 223d4: df 92 push r13 223d6: ef 92 push r14 223d8: ff 92 push r15 223da: 0f 93 push r16 223dc: 1f 93 push r17 223de: cf 93 push r28 223e0: df 93 push r29 223e2: cd b7 in r28, 0x3d ; 61 223e4: de b7 in r29, 0x3e ; 62 223e6: 2d 97 sbiw r28, 0x0d ; 13 223e8: 0f b6 in r0, 0x3f ; 63 223ea: f8 94 cli 223ec: de bf out 0x3e, r29 ; 62 223ee: 0f be out 0x3f, r0 ; 63 223f0: 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) 223f2: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 223f6: 81 30 cpi r24, 0x01 ; 1 223f8: 31 f1 breq .+76 ; 0x22446 223fa: 30 f0 brcs .+12 ; 0x22408 223fc: 82 30 cpi r24, 0x02 ; 2 223fe: 09 f4 brne .+2 ; 0x22402 22400: 7d c2 rjmp .+1274 ; 0x228fc { _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. 22402: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 22406: fe c0 rjmp .+508 ; 0x22604 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 22408: 80 91 ba 14 lds r24, 0x14BA ; 0x8014ba 2240c: 88 23 and r24, r24 2240e: 49 f0 breq .+18 ; 0x22422 { card.presort_flag = false; 22410: 10 92 ba 14 sts 0x14BA, r1 ; 0x8014ba lcd_update_enabled = false; 22414: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 22418: 0f 94 fd 7c call 0x2f9fa ; 0x2f9fa lcd_update_enabled = true; 2241c: 81 e0 ldi r24, 0x01 ; 1 2241e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 22422: 0f 94 ad 7b call 0x2f75a ; 0x2f75a 22426: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 2242a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2242e: 89 e0 ldi r24, 0x09 ; 9 22430: 9f e0 ldi r25, 0x0F ; 15 22432: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 22436: 80 93 af 03 sts 0x03AF, r24 ; 0x8003af _md->menuState = _standard; 2243a: 81 e0 ldi r24, 0x01 ; 1 2243c: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 _md->row = -1; // assume that no SD file/dir is currently selected. Once they are rendered, it will be changed to the correct row for the _scrolling state. 22440: 8f ef ldi r24, 0xFF ; 255 22442: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae } // FALLTHRU case _standard: //normal menu structure. { if (!_md->lcd_scrollTimer.running()) //if the timer is not running, then the menu state was just switched, so redraw the screen. 22446: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 2244a: 81 11 cpse r24, r1 2244c: 07 c0 rjmp .+14 ; 0x2245c { _md->lcd_scrollTimer.start(); 2244e: 80 eb ldi r24, 0xB0 ; 176 22450: 93 e0 ldi r25, 0x03 ; 3 22452: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> lcd_draw_update = 1; 22456: 81 e0 ldi r24, 0x01 ; 1 22458: 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. 2245c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22460: 81 11 cpse r24, r1 22462: 21 c0 rjmp .+66 ; 0x224a6 22464: 64 ef ldi r22, 0xF4 ; 244 22466: 71 e0 ldi r23, 0x01 ; 1 22468: 80 eb ldi r24, 0xB0 ; 176 2246a: 93 e0 ldi r25, 0x03 ; 3 2246c: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 22470: 88 23 and r24, r24 22472: a1 f0 breq .+40 ; 0x2249c 22474: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 22478: 8f 3f cpi r24, 0xFF ; 255 2247a: 81 f0 breq .+32 ; 0x2249c { _md->menuState = _scrolling; 2247c: 82 e0 ldi r24, 0x02 ; 2 2247e: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 _md->offset = 0; 22482: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 _md->scrollPointer = NULL; 22486: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 2248a: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 _md->lcd_scrollTimer.start(); 2248e: 80 eb ldi r24, 0xB0 ; 176 22490: 93 e0 ldi r25, 0x03 ; 3 22492: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 22496: 81 e0 ldi r24, 0x01 ; 1 22498: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 2249c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 224a0: 88 23 and r24, r24 224a2: 09 f4 brne .+2 ; 0x224a6 224a4: ab c0 rjmp .+342 ; 0x225fc 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. 224a6: 8f ef ldi r24, 0xFF ; 255 224a8: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae //if we reached this point it means that the encoder moved or clicked or the state is being switched. Reset the scrollTimer. _md->lcd_scrollTimer.start(); 224ac: 80 eb ldi r24, 0xB0 ; 176 224ae: 93 e0 ldi r25, 0x03 ; 3 224b0: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> MENU_BEGIN(); 224b4: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 224b8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if(eFilamentAction != FilamentAction::None) return; // Create a copy of card.filename on the stack since card.filename pointer // will be modified by the SD card library when searching for the file char selected_filename[FILENAME_LENGTH]; strcpy(selected_filename, filename); 224bc: ce 01 movw r24, r28 224be: 01 96 adiw r24, 0x01 ; 1 224c0: 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); 224c2: fd e2 ldi r31, 0x2D ; 45 224c4: 2f 2e mov r2, r31 224c6: f1 e7 ldi r31, 0x71 ; 113 224c8: 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(); 224ca: 80 91 12 05 lds r24, 0x0512 ; 0x800512 224ce: 84 30 cpi r24, 0x04 ; 4 224d0: 08 f0 brcs .+2 ; 0x224d4 224d2: 98 c0 rjmp .+304 ; 0x22604 224d4: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 224d8: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 224dc: 88 23 and r24, r24 224de: 09 f4 brne .+2 ; 0x224e2 224e0: aa c0 rjmp .+340 ; 0x22636 224e2: 8c ea ldi r24, 0xAC ; 172 224e4: 9d e3 ldi r25, 0x3D ; 61 224e6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 224ea: 0f 94 90 d1 call 0x3a320 ; 0x3a320 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;}; 224ee: 6d e6 ldi r22, 0x6D ; 109 224f0: 74 e1 ldi r23, 0x14 ; 20 224f2: 86 e1 ldi r24, 0x16 ; 22 224f4: 95 e1 ldi r25, 0x15 ; 21 224f6: 0f 94 4c a4 call 0x34898 ; 0x34898 card.getWorkDirName(); if (card.filename[0] == '/') 224fa: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 224fe: 8f 32 cpi r24, 0x2F ; 47 22500: 09 f0 breq .+2 ; 0x22504 22502: 9c c0 rjmp .+312 ; 0x2263c { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 22504: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 22508: 88 23 and r24, r24 2250a: 41 f0 breq .+16 ; 0x2251c MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 2250c: 81 ea ldi r24, 0xA1 ; 161 2250e: 9d e3 ldi r25, 0x3D ; 61 22510: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22514: 66 e7 ldi r22, 0x76 ; 118 22516: 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. 22518: 0f 94 42 ce call 0x39c84 ; 0x39c84 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 2251c: c0 90 ac 03 lds r12, 0x03AC ; 0x8003ac 22520: d0 90 ad 03 lds r13, 0x03AD ; 0x8003ad } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 22524: 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. 22526: 91 e0 ldi r25, 0x01 ; 1 22528: c9 1a sub r12, r25 2252a: d1 08 sbc r13, r1 2252c: 08 f4 brcc .+2 ; 0x22530 2252e: d9 c1 rjmp .+946 ; 0x228e2 { if (menu_item == menu_line) //If the file is on the screen. 22530: 80 91 15 05 lds r24, 0x0515 ; 0x800515 22534: 90 91 14 05 lds r25, 0x0514 ; 0x800514 22538: 89 13 cpse r24, r25 2253a: cf c1 rjmp .+926 ; 0x228da { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 2253c: 60 91 af 03 lds r22, 0x03AF ; 0x8003af 22540: c6 01 movw r24, r12 22542: 0f 94 6b 85 call 0x30ad6 ; 0x30ad6 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 22546: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2254a: 90 e0 ldi r25, 0x00 ; 0 2254c: 20 91 34 05 lds r18, 0x0534 ; 0x800534 22550: 30 91 35 05 lds r19, 0x0535 ; 0x800535 22554: 10 91 b7 14 lds r17, 0x14B7 ; 0x8014b7 22558: 82 17 cp r24, r18 2255a: 93 07 cpc r25, r19 2255c: 51 f4 brne .+20 ; 0x22572 { _md->selectedFileID = i; 2255e: d0 92 ab 03 sts 0x03AB, r13 ; 0x8003ab 22562: c0 92 aa 03 sts 0x03AA, r12 ; 0x8003aa _md->isDir = card.filenameIsDir; 22566: 10 93 a7 03 sts 0x03A7, r17 ; 0x8003a7 _md->row = menu_row; 2256a: 40 91 12 05 lds r20, 0x0512 ; 0x800512 2256e: 40 93 ae 03 sts 0x03AE, r20 ; 0x8003ae 22572: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 22576: 11 23 and r17, r17 22578: 09 f4 brne .+2 ; 0x2257c 2257a: 65 c0 rjmp .+202 ; 0x22646 #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) 2257c: 44 23 and r20, r20 2257e: e9 f0 breq .+58 ; 0x225ba { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 22580: 40 91 82 14 lds r20, 0x1482 ; 0x801482 22584: ed e6 ldi r30, 0x6D ; 109 22586: ae 2e mov r10, r30 22588: e4 e1 ldi r30, 0x14 ; 20 2258a: be 2e mov r11, r30 2258c: 44 23 and r20, r20 2258e: 21 f0 breq .+8 ; 0x22598 22590: 72 e8 ldi r23, 0x82 ; 130 22592: a7 2e mov r10, r23 22594: 74 e1 ldi r23, 0x14 ; 20 22596: b7 2e mov r11, r23 22598: 60 91 12 05 lds r22, 0x0512 ; 0x800512 } static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 2; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 2259c: 4e e3 ldi r20, 0x3E ; 62 2259e: 82 17 cp r24, r18 225a0: 93 07 cpc r25, r19 225a2: 09 f0 breq .+2 ; 0x225a6 225a4: 40 e2 ldi r20, 0x20 ; 32 225a6: 80 e0 ldi r24, 0x00 ; 0 225a8: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_putc(LCD_STR_FOLDER[0]); 225ac: 85 e8 ldi r24, 0x85 ; 133 225ae: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print_pad(longFilename, len); 225b2: 62 e1 ldi r22, 0x12 ; 18 225b4: c5 01 movw r24, r10 225b6: 0e 94 95 71 call 0xe32a ; 0xe32a 225ba: 80 91 15 05 lds r24, 0x0515 ; 0x800515 { if (lcd_draw_update) { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 225be: 90 91 13 05 lds r25, 0x0513 ; 0x800513 225c2: 99 23 and r25, r25 225c4: 09 f4 brne .+2 ; 0x225c8 225c6: 89 c1 rjmp .+786 ; 0x228da 225c8: 20 91 34 05 lds r18, 0x0534 ; 0x800534 225cc: 30 91 35 05 lds r19, 0x0535 ; 0x800535 225d0: 82 17 cp r24, r18 225d2: 13 06 cpc r1, r19 225d4: 09 f0 breq .+2 ; 0x225d8 225d6: 81 c1 rjmp .+770 ; 0x228da { lcd_update_enabled = false; 225d8: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 225dc: 61 e0 ldi r22, 0x01 ; 1 225de: 8d e6 ldi r24, 0x6D ; 109 225e0: 94 e1 ldi r25, 0x14 ; 20 225e2: 0f 94 7f 7e call 0x2fcfe ; 0x2fcfe lcd_encoder = 0; 225e6: 10 92 35 05 sts 0x0535, r1 ; 0x800535 225ea: 10 92 34 05 sts 0x0534, r1 ; 0x800534 menu_data_reset(); //Forces reloading of cached variables. 225ee: 0f 94 e7 ce call 0x39dce ; 0x39dce } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 225f2: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 225f6: 0f 94 ab cd call 0x39b56 ; 0x39b56 225fa: 95 cf rjmp .-214 ; 0x22526 _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()) 225fc: 0e 94 c3 71 call 0xe386 ; 0xe386 22600: 81 11 cpse r24, r1 22602: 51 cf rjmp .-350 ; 0x224a6 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 22604: 2d 96 adiw r28, 0x0d ; 13 22606: 0f b6 in r0, 0x3f ; 63 22608: f8 94 cli 2260a: de bf out 0x3e, r29 ; 62 2260c: 0f be out 0x3f, r0 ; 63 2260e: cd bf out 0x3d, r28 ; 61 22610: df 91 pop r29 22612: cf 91 pop r28 22614: 1f 91 pop r17 22616: 0f 91 pop r16 22618: ff 90 pop r15 2261a: ef 90 pop r14 2261c: df 90 pop r13 2261e: cf 90 pop r12 22620: bf 90 pop r11 22622: af 90 pop r10 22624: 9f 90 pop r9 22626: 8f 90 pop r8 22628: 7f 90 pop r7 2262a: 6f 90 pop r6 2262c: 5f 90 pop r5 2262e: 4f 90 pop r4 22630: 3f 90 pop r3 22632: 2f 90 pop r2 22634: 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 22636: 8d e0 ldi r24, 0x0D ; 13 22638: 90 e4 ldi r25, 0x40 ; 64 2263a: 55 cf rjmp .-342 ; 0x224e6 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. 2263c: 60 e8 ldi r22, 0x80 ; 128 2263e: 77 ed ldi r23, 0xD7 ; 215 22640: 8a e6 ldi r24, 0x6A ; 106 22642: 9b e8 ldi r25, 0x8B ; 139 22644: 69 cf rjmp .-302 ; 0x22518 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 22646: 44 23 and r20, r20 22648: d1 f0 breq .+52 ; 0x2267e { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 2264a: 40 91 82 14 lds r20, 0x1482 ; 0x801482 2264e: 6d e6 ldi r22, 0x6D ; 109 22650: a6 2e mov r10, r22 22652: 64 e1 ldi r22, 0x14 ; 20 22654: b6 2e mov r11, r22 22656: 44 23 and r20, r20 22658: 21 f0 breq .+8 ; 0x22662 2265a: 52 e8 ldi r21, 0x82 ; 130 2265c: a5 2e mov r10, r21 2265e: 54 e1 ldi r21, 0x14 ; 20 22660: b5 2e mov r11, r21 22662: 60 91 12 05 lds r22, 0x0512 ; 0x800512 bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 1; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 22666: 4e e3 ldi r20, 0x3E ; 62 22668: 82 17 cp r24, r18 2266a: 93 07 cpc r25, r19 2266c: 09 f0 breq .+2 ; 0x22670 2266e: 40 e2 ldi r20, 0x20 ; 32 22670: 80 e0 ldi r24, 0x00 ; 0 22672: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_print_pad(longFilename, len); 22676: 63 e1 ldi r22, 0x13 ; 19 22678: c5 01 movw r24, r10 2267a: 0e 94 95 71 call 0xe32a ; 0xe32a 2267e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 { if (lcd_draw_update) { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 22682: 90 91 13 05 lds r25, 0x0513 ; 0x800513 22686: 99 23 and r25, r25 22688: 09 f4 brne .+2 ; 0x2268c 2268a: 27 c1 rjmp .+590 ; 0x228da 2268c: 20 91 34 05 lds r18, 0x0534 ; 0x800534 22690: 30 91 35 05 lds r19, 0x0535 ; 0x800535 22694: 82 17 cp r24, r18 22696: 13 06 cpc r1, r19 22698: 09 f0 breq .+2 ; 0x2269c 2269a: 1f c1 rjmp .+574 ; 0x228da { lcd_update_enabled = false; 2269c: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 226a0: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 226a4: 81 11 cpse r24, r1 226a6: a5 cf rjmp .-182 ; 0x225f2 // 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); 226a8: 6d e6 ldi r22, 0x6D ; 109 226aa: 74 e1 ldi r23, 0x14 ; 20 226ac: c7 01 movw r24, r14 226ae: 0f 94 b1 e3 call 0x3c762 ; 0x3c762 226b2: 47 01 movw r8, r14 226b4: 45 e9 ldi r20, 0x95 ; 149 226b6: a4 2e mov r10, r20 226b8: 4f e0 ldi r20, 0x0F ; 15 226ba: 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] == '.') { 226bc: f4 01 movw r30, r8 226be: 61 91 ld r22, Z+ 226c0: 4f 01 movw r8, r30 226c2: 66 23 and r22, r22 226c4: 19 f0 breq .+6 ; 0x226cc 226c6: 6e 32 cpi r22, 0x2E ; 46 226c8: 09 f0 breq .+2 ; 0x226cc 226ca: 4b c0 rjmp .+150 ; 0x22762 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 226cc: 60 e0 ldi r22, 0x00 ; 0 226ce: c5 01 movw r24, r10 226d0: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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, '.'); 226d4: 6e e2 ldi r22, 0x2E ; 46 226d6: 70 e0 ldi r23, 0x00 ; 0 226d8: c7 01 movw r24, r14 226da: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 226de: 3c 01 movw r6, r24 if (extension_ptr) { 226e0: 89 2b or r24, r25 226e2: 19 f0 breq .+6 ; 0x226ea extension_ptr++; // skip the '.' 226e4: 8f ef ldi r24, 0xFF ; 255 226e6: 68 1a sub r6, r24 226e8: 78 0a sbc r7, r24 226ea: 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); 226ec: 31 e9 ldi r19, 0x91 ; 145 226ee: a3 2e mov r10, r19 226f0: 3c e0 ldi r19, 0x0C ; 12 226f2: 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') { 226f4: 61 14 cp r6, r1 226f6: 71 04 cpc r7, r1 226f8: 21 f0 breq .+8 ; 0x22702 226fa: f4 01 movw r30, r8 226fc: 60 81 ld r22, Z 226fe: 61 11 cpse r22, r1 22700: 01 c0 rjmp .+2 ; 0x22704 22702: 60 e0 ldi r22, 0x00 ; 0 22704: c5 01 movw r24, r10 22706: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 2270a: ff ef ldi r31, 0xFF ; 255 2270c: af 1a sub r10, r31 2270e: bf 0a sbc r11, r31 22710: 2f ef ldi r18, 0xFF ; 255 22712: 82 1a sub r8, r18 22714: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 22716: 84 e9 ldi r24, 0x94 ; 148 22718: a8 16 cp r10, r24 2271a: 8c e0 ldi r24, 0x0C ; 12 2271c: b8 06 cpc r11, r24 2271e: 51 f7 brne .-44 ; 0x226f4 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 22720: 60 90 0b 16 lds r6, 0x160B ; 0x80160b 22724: 66 2d mov r22, r6 22726: 8a e5 ldi r24, 0x5A ; 90 22728: 9f e0 ldi r25, 0x0F ; 15 2272a: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 2272e: 89 e6 ldi r24, 0x69 ; 105 22730: 94 e1 ldi r25, 0x14 ; 20 22732: 2a e0 ldi r18, 0x0A ; 10 22734: a2 2e mov r10, r18 22736: 2f e0 ldi r18, 0x0F ; 15 22738: 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++) { 2273a: 71 2c mov r7, r1 2273c: 4c 01 movw r8, r24 2273e: e9 e0 ldi r30, 0x09 ; 9 22740: 8e 0e add r8, r30 22742: 91 1c adc r9, r1 22744: 76 14 cp r7, r6 22746: d1 f0 breq .+52 ; 0x2277c #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); 22748: 48 e0 ldi r20, 0x08 ; 8 2274a: 50 e0 ldi r21, 0x00 ; 0 2274c: b5 01 movw r22, r10 2274e: 8e 5a subi r24, 0xAE ; 174 22750: 9f 4f sbci r25, 0xFF ; 255 22752: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 22756: 73 94 inc r7 22758: f8 e0 ldi r31, 0x08 ; 8 2275a: af 0e add r10, r31 2275c: b1 1c adc r11, r1 2275e: c4 01 movw r24, r8 22760: ed cf rjmp .-38 ; 0x2273c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 22762: c5 01 movw r24, r10 22764: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 22768: ff ef ldi r31, 0xFF ; 255 2276a: af 1a sub r10, r31 2276c: 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++) { 2276e: 2d e9 ldi r18, 0x9D ; 157 22770: a2 16 cp r10, r18 22772: 2f e0 ldi r18, 0x0F ; 15 22774: b2 06 cpc r11, r18 22776: 09 f0 breq .+2 ; 0x2277a 22778: a1 cf rjmp .-190 ; 0x226bc 2277a: ac cf rjmp .-168 ; 0x226d4 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 2277c: 61 e0 ldi r22, 0x01 ; 1 2277e: c7 01 movw r24, r14 22780: 0f 94 b6 7f call 0x2ff6c ; 0x2ff6c } uint32_t CardReader::getFileSize() { return filesize; 22784: 40 90 78 17 lds r4, 0x1778 ; 0x801778 22788: 50 90 79 17 lds r5, 0x1779 ; 0x801779 2278c: 60 90 7a 17 lds r6, 0x177A ; 0x80177a 22790: 70 90 7b 17 lds r7, 0x177B ; 0x80177b bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 22794: 94 2d mov r25, r4 22796: 85 2d mov r24, r5 22798: 21 e0 ldi r18, 0x01 ; 1 2279a: 42 16 cp r4, r18 2279c: 28 e7 ldi r18, 0x78 ; 120 2279e: 52 06 cpc r5, r18 227a0: 61 04 cpc r6, r1 227a2: 71 04 cpc r7, r1 227a4: 10 f0 brcs .+4 ; 0x227aa 227a6: 90 e0 ldi r25, 0x00 ; 0 227a8: 88 e7 ldi r24, 0x78 ; 120 227aa: a9 2e mov r10, r25 227ac: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 227ae: 81 e0 ldi r24, 0x01 ; 1 227b0: 48 16 cp r4, r24 227b2: 88 e7 ldi r24, 0x78 ; 120 227b4: 58 06 cpc r5, r24 227b6: 61 04 cpc r6, r1 227b8: 71 04 cpc r7, r1 227ba: 08 f4 brcc .+2 ; 0x227be 227bc: 5d c0 rjmp .+186 ; 0x22878 startPos = filesize - END_FILE_SECTION; 227be: 98 e7 ldi r25, 0x78 ; 120 227c0: 59 1a sub r5, r25 227c2: 61 08 sbc r6, r1 227c4: 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);}; 227c6: 40 92 7f 17 sts 0x177F, r4 ; 0x80177f 227ca: 50 92 80 17 sts 0x1780, r5 ; 0x801780 227ce: 60 92 81 17 sts 0x1781, r6 ; 0x801781 227d2: 70 92 82 17 sts 0x1782, r7 ; 0x801782 227d6: c3 01 movw r24, r6 227d8: b2 01 movw r22, r4 227da: 0f 94 75 77 call 0x2eeea ; 0x2eeea card.setIndex(startPos); } cmdqueue_reset(); 227de: 0e 94 e0 80 call 0x101c0 ; 0x101c0 cmdqueue_serial_disabled = true; 227e2: 00 93 a2 03 sts 0x03A2, r16 ; 0x8003a2 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 227e6: 8e e7 ldi r24, 0x7E ; 126 227e8: 9d e3 ldi r25, 0x3D ; 61 227ea: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 227ee: bc 01 movw r22, r24 227f0: c5 01 movw r24, r10 227f2: 0f 94 27 cd call 0x39a4e ; 0x39a4e 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; } 227f6: 80 91 7f 17 lds r24, 0x177F ; 0x80177f 227fa: 90 91 80 17 lds r25, 0x1780 ; 0x801780 227fe: a0 91 81 17 lds r26, 0x1781 ; 0x801781 22802: b0 91 82 17 lds r27, 0x1782 ; 0x801782 while (!card.eof() && !result) { 22806: 40 91 78 17 lds r20, 0x1778 ; 0x801778 2280a: 50 91 79 17 lds r21, 0x1779 ; 0x801779 2280e: 60 91 7a 17 lds r22, 0x177A ; 0x80177a 22812: 70 91 7b 17 lds r23, 0x177B ; 0x80177b 22816: 84 17 cp r24, r20 22818: 95 07 cpc r25, r21 2281a: a6 07 cpc r26, r22 2281c: b7 07 cpc r27, r23 2281e: 80 f5 brcc .+96 ; 0x22880 22820: 11 11 cpse r17, r1 22822: 2e c0 rjmp .+92 ; 0x22880 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); }; 22824: 20 91 fe 16 lds r18, 0x16FE ; 0x8016fe 22828: 21 11 cpse r18, r1 2282a: 03 c0 rjmp .+6 ; 0x22832 2282c: 80 e0 ldi r24, 0x00 ; 0 2282e: 90 e0 ldi r25, 0x00 ; 0 22830: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 22832: 84 19 sub r24, r4 22834: 95 09 sbc r25, r5 22836: 0f 94 f8 cc call 0x399f0 ; 0x399f0 card.sdprinting = true; 2283a: 00 93 6b 14 sts 0x146B, r16 ; 0x80146b get_command(); 2283e: 0e 94 5c 84 call 0x108b8 ; 0x108b8 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 22842: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 22846: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 2284a: 89 2b or r24, r25 2284c: a1 f2 breq .-88 ; 0x227f6 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 2284e: 81 eb ldi r24, 0xB1 ; 177 22850: 9b e6 ldi r25, 0x6B ; 107 22852: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 22856: 81 11 cpse r24, r1 22858: 05 c0 rjmp .+10 ; 0x22864 2285a: 85 e6 ldi r24, 0x65 ; 101 2285c: 9b e8 ldi r25, 0x8B ; 139 2285e: 0e 94 ec 68 call 0xd1d8 ; 0xd1d8 22862: 81 11 cpse r24, r1 22864: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 22866: 80 91 7d 10 lds r24, 0x107D ; 0x80107d 2286a: 81 11 cpse r24, r1 2286c: 02 c0 rjmp .+4 ; 0x22872 cmdqueue_pop_front(); 2286e: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 cmdbuffer_front_already_processed = false; 22872: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 22876: e5 cf rjmp .-54 ; 0x22842 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; 22878: 41 2c mov r4, r1 2287a: 51 2c mov r5, r1 2287c: 32 01 movw r6, r4 2287e: af cf rjmp .-162 ; 0x227de // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 22880: 0f 94 19 cd call 0x39a32 ; 0x39a32 cmdqueue_serial_disabled = false; 22884: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 card.printingHasFinished(); 22888: 0f 94 ee 80 call 0x301dc ; 0x301dc lcd_setstatuspgm(MSG_WELCOME); 2288c: 8d ea ldi r24, 0xAD ; 173 2288e: 90 e7 ldi r25, 0x70 ; 112 22890: 0f 94 be 0b call 0x2177c ; 0x2177c 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)) { 22894: 11 23 and r17, r17 22896: 91 f0 breq .+36 ; 0x228bc 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); 22898: ff 92 push r15 2289a: ef 92 push r14 2289c: 3f 92 push r3 2289e: 2f 92 push r2 228a0: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommand_P(MSG_M24); 228a4: 61 e0 ldi r22, 0x01 ; 1 228a6: 89 e2 ldi r24, 0x29 ; 41 228a8: 91 e7 ldi r25, 0x71 ; 113 228aa: 0e 94 5c 89 call 0x112b8 ; 0x112b8 228ae: 0f 90 pop r0 228b0: 0f 90 pop r0 228b2: 0f 90 pop r0 228b4: 0f 90 pop r0 } lcd_return_to_status(); 228b6: 0f 94 23 27 call 0x24e46 ; 0x24e46 228ba: 9b ce rjmp .-714 ; 0x225f2 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); 228bc: 8e e8 ldi r24, 0x8E ; 142 228be: 9d e3 ldi r25, 0x3D ; 61 228c0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 228c4: 41 e0 ldi r20, 0x01 ; 1 228c6: 60 e0 ldi r22, 0x00 ; 0 228c8: 0f 94 6d 65 call 0x2cada ; 0x2cada 228cc: 18 2f mov r17, r24 lcd_update_enable(true); 228ce: 81 e0 ldi r24, 0x01 ; 1 228d0: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 } if (result) { 228d4: 11 23 and r17, r17 228d6: 01 f3 breq .-64 ; 0x22898 228d8: ee cf rjmp .-36 ; 0x228b6 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 228da: 8f 5f subi r24, 0xFF ; 255 228dc: 80 93 15 05 sts 0x0515, r24 ; 0x800515 228e0: 22 ce rjmp .-956 ; 0x22526 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 228e2: 0f 94 99 ce call 0x39d32 ; 0x39d32 _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(); 228e6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 228ea: 8f 5f subi r24, 0xFF ; 255 228ec: 80 93 12 05 sts 0x0512, r24 ; 0x800512 228f0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 228f4: 8f 5f subi r24, 0xFF ; 255 228f6: 80 93 14 05 sts 0x0514, r24 ; 0x800514 228fa: e7 cd rjmp .-1074 ; 0x224ca 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. 228fc: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 22900: 11 e0 ldi r17, 0x01 ; 1 22902: 81 11 cpse r24, r1 22904: 05 c0 rjmp .+10 ; 0x22910 22906: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2290a: 81 11 cpse r24, r1 2290c: 01 c0 rjmp .+2 ; 0x22910 2290e: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 22910: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 22914: 90 91 a9 03 lds r25, 0x03A9 ; 0x8003a9 22918: 89 2b or r24, r25 2291a: 91 f4 brne .+36 ; 0x22940 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 2291c: 60 91 af 03 lds r22, 0x03AF ; 0x8003af 22920: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 22924: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab 22928: 0f 94 6b 85 call 0x30ad6 ; 0x30ad6 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 2292c: 80 91 82 14 lds r24, 0x1482 ; 0x801482 22930: 81 11 cpse r24, r1 22932: 46 c0 rjmp .+140 ; 0x229c0 22934: 8d e6 ldi r24, 0x6D ; 109 22936: 94 e1 ldi r25, 0x14 ; 20 22938: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 2293c: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } if (rewindFlag) 22940: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 22942: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 22946: 6c e2 ldi r22, 0x2C ; 44 22948: 71 e0 ldi r23, 0x01 ; 1 2294a: 80 eb ldi r24, 0xB0 ; 176 2294c: 93 e0 ldi r25, 0x03 ; 3 2294e: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 22952: 81 11 cpse r24, r1 22954: 03 c0 rjmp .+6 ; 0x2295c 22956: 11 23 and r17, r17 22958: 09 f4 brne .+2 ; 0x2295c 2295a: 54 ce rjmp .-856 ; 0x22604 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 2295c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 22960: 02 e1 ldi r16, 0x12 ; 18 22962: 81 11 cpse r24, r1 22964: 01 c0 rjmp .+2 ; 0x22968 22966: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 22968: 4e e3 ldi r20, 0x3E ; 62 2296a: 60 91 ae 03 lds r22, 0x03AE ; 0x8003ae 2296e: 80 e0 ldi r24, 0x00 ; 0 22970: 0e 94 c6 6f call 0xdf8c ; 0xdf8c if (_md->isDir) 22974: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 22978: 88 23 and r24, r24 2297a: 19 f0 breq .+6 ; 0x22982 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 2297c: 85 e8 ldi r24, 0x85 ; 133 2297e: 0e 94 55 70 call 0xe0aa ; 0xe0aa lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 22982: 20 91 a6 03 lds r18, 0x03A6 ; 0x8003a6 22986: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 2298a: 90 91 a9 03 lds r25, 0x03A9 ; 0x8003a9 2298e: 60 2f mov r22, r16 22990: 82 0f add r24, r18 22992: 91 1d adc r25, r1 22994: 0e 94 95 71 call 0xe32a ; 0xe32a 22998: 81 11 cpse r24, r1 2299a: 15 c0 rjmp .+42 ; 0x229c6 { _md->lcd_scrollTimer.start(); 2299c: 80 eb ldi r24, 0xB0 ; 176 2299e: 93 e0 ldi r25, 0x03 ; 3 229a0: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> _md->offset++; 229a4: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 229a8: 8f 5f subi r24, 0xFF ; 255 229aa: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 } else { // stop at the end of the string _md->lcd_scrollTimer.stop(); } } if (rewindFlag) //go back to sd_menu. 229ae: 11 23 and r17, r17 229b0: 09 f4 brne .+2 ; 0x229b4 229b2: 28 ce rjmp .-944 ; 0x22604 229b4: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 229b8: 81 e0 ldi r24, 0x01 ; 1 229ba: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 229be: 22 ce rjmp .-956 ; 0x22604 #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; 229c0: 82 e8 ldi r24, 0x82 ; 130 229c2: 94 e1 ldi r25, 0x14 ; 20 229c4: b9 cf rjmp .-142 ; 0x22938 229c6: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 229ca: f1 cf rjmp .-30 ; 0x229ae 000229cc : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 229cc: 61 e0 ldi r22, 0x01 ; 1 229ce: 8f eb ldi r24, 0xBF ; 191 229d0: 90 e7 ldi r25, 0x70 ; 112 229d2: 0e 94 5c 89 call 0x112b8 ; 0x112b8 custom_message_type = CustomMsg::FilamentLoading; //just print status message 229d6: 82 e0 ldi r24, 0x02 ; 2 229d8: 80 93 72 07 sts 0x0772, r24 ; 0x800772 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 229dc: 89 e6 ldi r24, 0x69 ; 105 229de: 99 e5 ldi r25, 0x59 ; 89 229e0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 229e4: 0f 94 be 0b call 0x2177c ; 0x2177c lcd_return_to_status(); 229e8: 0f 94 23 27 call 0x24e46 ; 0x24e46 lcd_draw_update = 3; 229ec: 83 e0 ldi r24, 0x03 ; 3 229ee: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 229f2: 08 95 ret 000229f4 : //! @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; 229f4: 0f 94 5e 0b call 0x216bc ; 0x216bc 229f8: 88 23 and r24, r24 229fa: 39 f1 breq .+78 ; 0x22a4a cmdqueue_serial_disabled = false; 229fc: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 22a00: 89 e6 ldi r24, 0x69 ; 105 22a02: 99 e5 ldi r25, 0x59 ; 89 22a04: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22a08: 0f 94 be 0b call 0x2177c ; 0x2177c st_synchronize(); 22a0c: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 custom_message_type = CustomMsg::Resuming; 22a10: 88 e0 ldi r24, 0x08 ; 8 22a12: 80 93 72 07 sts 0x0772, r24 ; 0x800772 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); 22a16: 0e 94 34 77 call 0xee68 ; 0xee68 Stopped = false; 22a1a: 10 92 11 05 sts 0x0511, r1 ; 0x800511 restore_print_from_ram_and_continue(default_retraction); 22a1e: 60 e0 ldi r22, 0x00 ; 0 22a20: 70 e0 ldi r23, 0x00 ; 0 22a22: 80 e8 ldi r24, 0x80 ; 128 22a24: 9f e3 ldi r25, 0x3F ; 63 22a26: 0e 94 0a 69 call 0xd214 ; 0xd214 did_pause_print = false; 22a2a: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 22a2e: 80 91 99 03 lds r24, 0x0399 ; 0x800399 22a32: 82 30 cpi r24, 0x02 ; 2 22a34: 11 f4 brne .+4 ; 0x22a3a 22a36: 0f 94 86 58 call 0x2b10c ; 0x2b10c refresh_cmd_timeout(); 22a3a: 0e 94 89 67 call 0xcf12 ; 0xcf12 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 22a3e: 8e e5 ldi r24, 0x5E ; 94 22a40: 9b e6 ldi r25, 0x6B ; 107 22a42: 0e 94 17 7b call 0xf62e ; 0xf62e custom_message_type = CustomMsg::Status; 22a46: 10 92 72 07 sts 0x0772, r1 ; 0x800772 } 22a4a: 08 95 ret 00022a4c : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 22a4c: cf 93 push r28 22a4e: df 93 push r29 22a50: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 22a52: 80 e0 ldi r24, 0x00 ; 0 22a54: 0f 94 85 06 call 0x20d0a ; 0x20d0a 22a58: 88 23 and r24, r24 22a5a: 31 f0 breq .+12 ; 0x22a68 lcd_updatestatus(message); 22a5c: 60 e0 ldi r22, 0x00 ; 0 22a5e: ce 01 movw r24, r28 } 22a60: df 91 pop r29 22a62: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 22a64: 0d 94 6a 06 jmp 0x20cd4 ; 0x20cd4 } 22a68: df 91 pop r29 22a6a: cf 91 pop r28 22a6c: 08 95 ret 00022a6e : #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()); 22a6e: 0f 94 a4 7c call 0x2f948 ; 0x2f948 22a72: 9f 93 push r25 22a74: 8f 93 push r24 22a76: 88 e8 ldi r24, 0x88 ; 136 22a78: 9b e8 ldi r25, 0x8B ; 139 22a7a: 9f 93 push r25 22a7c: 8f 93 push r24 22a7e: 0f 94 08 dc call 0x3b810 ; 0x3b810 22a82: 0f 90 pop r0 22a84: 0f 90 pop r0 22a86: 0f 90 pop r0 22a88: 0f 90 pop r0 } 22a8a: 08 95 ret 00022a8c : printf_IRSensorAnalogBoardChange(); } return true; } static void lcd_detect_IRsensor(){ 22a8c: ef 92 push r14 22a8e: ff 92 push r15 22a90: 0f 93 push r16 22a92: 1f 93 push r17 22a94: cf 93 push r28 22a96: 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(); 22a98: 0e 94 cc e4 call 0x1c998 ; 0x1c998 22a9c: c8 2f mov r28, r24 if(loaded){ lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 22a9e: 80 eb ldi r24, 0xB0 ; 176 22aa0: 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){ 22aa2: c1 11 cpse r28, r1 22aa4: 8a c0 rjmp .+276 ; 0x22bba 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)); 22aa6: 8b e6 ldi r24, 0x6B ; 107 22aa8: 9e e3 ldi r25, 0x3E ; 62 22aaa: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22aae: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 22ab2: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 22ab6: 10 92 86 17 sts 0x1786, r1 ; 0x801786 22aba: d0 91 8e 17 lds r29, 0x178E ; 0x80178e static bool lcd_selftest_IRsensor(bool bStandalone) { FSensorBlockRunout fsBlockRunout; IR_sensor_analog::SensorRevision oldSensorRevision = fsensor.getSensorRevision(); IR_sensor_analog::SensorRevision newSensorRevision; uint16_t volt_IR_int = fsensor.getVoltRaw(); 22abe: 0f 94 9c 7c call 0x2f938 ; 0x2f938 22ac2: 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)); 22ac4: bc 01 movw r22, r24 22ac6: 90 e0 ldi r25, 0x00 ; 0 22ac8: 80 e0 ldi r24, 0x00 ; 0 22aca: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 22ace: 20 e0 ldi r18, 0x00 ; 0 22ad0: 30 ec ldi r19, 0xC0 ; 192 22ad2: 4f e7 ldi r20, 0x7F ; 127 22ad4: 56 e4 ldi r21, 0x46 ; 70 22ad6: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 22ada: 20 e0 ldi r18, 0x00 ; 0 22adc: 30 e0 ldi r19, 0x00 ; 0 22ade: 40 ea ldi r20, 0xA0 ; 160 22ae0: 50 e4 ldi r21, 0x40 ; 64 22ae2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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) ); 22ae6: 9f 93 push r25 22ae8: 8f 93 push r24 22aea: 7f 93 push r23 22aec: 6f 93 push r22 22aee: 87 ee ldi r24, 0xE7 ; 231 22af0: 9b e8 ldi r25, 0x8B ; 139 22af2: 9f 93 push r25 22af4: 8f 93 push r24 22af6: 0f 94 08 dc call 0x3b810 ; 0x3b810 if(volt_IR_int < fsensor.IRsensor_Hmin_TRESHOLD){ 22afa: 0f 90 pop r0 22afc: 0f 90 pop r0 22afe: 0f 90 pop r0 22b00: 0f 90 pop r0 22b02: 0f 90 pop r0 22b04: 0f 90 pop r0 22b06: 0d 35 cpi r16, 0x5D ; 93 22b08: 86 e2 ldi r24, 0x26 ; 38 22b0a: 18 07 cpc r17, r24 22b0c: 08 f4 brcc .+2 ; 0x22b10 22b0e: 3f c0 rjmp .+126 ; 0x22b8e if(!bStandalone) lcd_selftest_error(TestError::FsensorLevel,"HIGH",""); return false; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_INSERT_FIL)); 22b10: 83 eb ldi r24, 0xB3 ; 179 22b12: 9d e3 ldi r25, 0x3D ; 61 22b14: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22b18: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 volt_IR_int = fsensor.getVoltRaw(); 22b1c: 0f 94 9c 7c call 0x2f938 ; 0x2f938 22b20: 7c 01 movw r14, r24 22b22: bc 01 movw r22, r24 22b24: 90 e0 ldi r25, 0x00 ; 0 22b26: 80 e0 ldi r24, 0x00 ; 0 22b28: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 22b2c: 20 e0 ldi r18, 0x00 ; 0 22b2e: 30 ec ldi r19, 0xC0 ; 192 22b30: 4f e7 ldi r20, 0x7F ; 127 22b32: 56 e4 ldi r21, 0x46 ; 70 22b34: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 22b38: 20 e0 ldi r18, 0x00 ; 0 22b3a: 30 e0 ldi r19, 0x00 ; 0 22b3c: 40 ea ldi r20, 0xA0 ; 160 22b3e: 50 e4 ldi r21, 0x40 ; 64 22b40: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> printf_P(PSTR("Measured filament sensor low level: %4.2fV\n"), Raw2Voltage(volt_IR_int)); 22b44: 9f 93 push r25 22b46: 8f 93 push r24 22b48: 7f 93 push r23 22b4a: 6f 93 push r22 22b4c: 8b eb ldi r24, 0xBB ; 187 22b4e: 9b e8 ldi r25, 0x8B ; 139 22b50: 9f 93 push r25 22b52: 8f 93 push r24 22b54: 0f 94 08 dc call 0x3b810 ; 0x3b810 if(volt_IR_int > (fsensor.IRsensor_Lmax_TRESHOLD)){ 22b58: 0f 90 pop r0 22b5a: 0f 90 pop r0 22b5c: 0f 90 pop r0 22b5e: 0f 90 pop r0 22b60: 0f 90 pop r0 22b62: 0f 90 pop r0 22b64: 8f e2 ldi r24, 0x2F ; 47 22b66: e8 16 cp r14, r24 22b68: 83 e1 ldi r24, 0x13 ; 19 22b6a: f8 06 cpc r15, r24 22b6c: 80 f4 brcc .+32 ; 0x22b8e 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; 22b6e: 61 e0 ldi r22, 0x01 ; 1 22b70: 03 3d cpi r16, 0xD3 ; 211 22b72: 1a 43 sbci r17, 0x3A ; 58 22b74: 08 f0 brcs .+2 ; 0x22b78 22b76: 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) { 22b78: d6 17 cp r29, r22 22b7a: 41 f0 breq .+16 ; 0x22b8c return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 22b7c: 60 93 8e 17 sts 0x178E, r22 ; 0x80178e 22b80: 88 e4 ldi r24, 0x48 ; 72 22b82: 9d e0 ldi r25, 0x0D ; 13 22b84: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 fsensor.setSensorRevision(newSensorRevision, true); printf_IRSensorAnalogBoardChange(); 22b88: 0f 94 37 15 call 0x22a6e ; 0x22a6e } return true; 22b8c: 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(); } 22b8e: 85 e8 ldi r24, 0x85 ; 133 22b90: 97 e1 ldi r25, 0x17 ; 23 22b92: 0e 94 95 75 call 0xeb2a ; 0xeb2a } 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)); 22b96: 81 e3 ldi r24, 0x31 ; 49 22b98: 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){ 22b9a: cc 23 and r28, r28 22b9c: 71 f0 breq .+28 ; 0x22bba lcd_show_fullscreen_message_and_wait_P(_T(MSG_FS_VERIFIED)); 22b9e: 85 e0 ldi r24, 0x05 ; 5 22ba0: 9e e3 ldi r25, 0x3E ; 62 22ba2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22ba6: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 fsensor.init(); } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); } } 22baa: df 91 pop r29 22bac: cf 91 pop r28 22bae: 1f 91 pop r17 22bb0: 0f 91 pop r16 22bb2: ff 90 pop r15 22bb4: 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(); 22bb6: 0d 94 29 87 jmp 0x30e52 ; 0x30e52 } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); 22bba: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 } } 22bbe: df 91 pop r29 22bc0: cf 91 pop r28 22bc2: 1f 91 pop r17 22bc4: 0f 91 pop r16 22bc6: ff 90 pop r15 22bc8: 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)); 22bca: 0d 94 dc 35 jmp 0x26bb8 ; 0x26bb8 00022bce : 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) { 22bce: cf 93 push r28 22bd0: df 93 push r29 22bd2: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 22bd4: 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) { 22bd6: 66 23 and r22, r22 22bd8: d9 f1 breq .+118 ; 0x22c50 22bda: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 22bdc: 0f 94 27 45 call 0x28a4e ; 0x28a4e cancel_heatup = true; 22be0: 81 e0 ldi r24, 0x01 ; 1 22be2: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.404> heating_status = HeatingStatus::NO_HEATING; 22be6: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db // Clear any saved printing state cancel_saved_printing(); 22bea: 0e 94 73 65 call 0xcae6 ; 0xcae6 // Abort the planner planner_abort_hard(); 22bee: 0f 94 c2 bb call 0x37784 ; 0x37784 // Reset the queue cmdqueue_reset(); 22bf2: 0e 94 e0 80 call 0x101c0 ; 0x101c0 cmdqueue_serial_disabled = false; 22bf6: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 st_reset_timer(); 22bfa: 0f 94 3b 59 call 0x2b276 ; 0x2b276 CRITICAL_SECTION_END; 22bfe: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 22c00: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc print_job_timer.stop(); 22c04: 0f 94 aa 58 call 0x2b154 ; 0x2b154 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 22c08: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 22c0c: 88 23 and r24, r24 22c0e: 71 f0 breq .+28 ; 0x22c2c // Reset the sd status card.sdprinting = false; 22c10: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 22c14: 8b ef ldi r24, 0xFB ; 251 22c16: 96 e1 ldi r25, 0x16 ; 22 22c18: 0f 94 31 6e call 0x2dc62 ; 0x2dc62 file.close(); 22c1c: 8b ef ldi r24, 0xFB ; 251 22c1e: 96 e1 ldi r25, 0x16 ; 22 22c20: 0f 94 29 a4 call 0x34852 ; 0x34852 saving = false; 22c24: 10 92 69 14 sts 0x1469, r1 ; 0x801469 logging = false; 22c28: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 22c2c: 81 ea ldi r24, 0xA1 ; 161 22c2e: 9b e6 ldi r25, 0x6B ; 107 22c30: 0e 94 17 7b call 0xf62e ; 0xf62e #ifdef MESH_BED_LEVELING mbl.active = false; 22c34: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d #endif if (interactive) { 22c38: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 22c3a: 10 92 11 05 sts 0x0511, r1 ; 0x800511 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 22c3e: 81 e0 ldi r24, 0x01 ; 1 22c40: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 22c44: 10 92 64 0e sts 0x0E64, r1 ; 0x800e64 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 22c48: df 91 pop r29 22c4a: 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(); 22c4c: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 } void ConditionalStop() { CRITICAL_SECTION_START; 22c50: 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; 22c52: 81 e0 ldi r24, 0x01 ; 1 22c54: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.404> heating_status = HeatingStatus::NO_HEATING; 22c58: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db // Clear any saved printing state cancel_saved_printing(); 22c5c: 0e 94 73 65 call 0xcae6 ; 0xcae6 // Abort the planner planner_abort_hard(); 22c60: 0f 94 c2 bb call 0x37784 ; 0x37784 // Reset the queue cmdqueue_reset(); 22c64: 0e 94 e0 80 call 0x101c0 ; 0x101c0 cmdqueue_serial_disabled = false; 22c68: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 st_reset_timer(); 22c6c: 0f 94 3b 59 call 0x2b276 ; 0x2b276 CRITICAL_SECTION_END; 22c70: df bf out 0x3f, r29 ; 63 22c72: ca cf rjmp .-108 ; 0x22c08 00022c74 : } void lcd_print_stop() { print_stop(true); 22c74: 60 e0 ldi r22, 0x00 ; 0 22c76: 81 e0 ldi r24, 0x01 ; 1 22c78: 0d 94 e7 15 jmp 0x22bce ; 0x22bce 00022c7c : } static void render_M862_warnings(const char* warning, const char* strict, uint8_t check) { if (check == 1) { // Warning, stop print if user selects 'No' 22c7c: 41 30 cpi r20, 0x01 ; 1 22c7e: 41 f4 brne .+16 ; 0x22c90 if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 22c80: 40 e0 ldi r20, 0x00 ; 0 22c82: 61 e0 ldi r22, 0x01 ; 1 22c84: 0f 94 6d 65 call 0x2cada ; 0x2cada 22c88: 81 30 cpi r24, 0x01 ; 1 22c8a: 41 f4 brne .+16 ; 0x22c9c lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 22c8c: 0d 94 3a 16 jmp 0x22c74 ; 0x22c74 { 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 22c90: 42 30 cpi r20, 0x02 ; 2 22c92: 21 f4 brne .+8 ; 0x22c9c lcd_show_fullscreen_message_and_wait_P(strict); 22c94: cb 01 movw r24, r22 22c96: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 22c9a: f8 cf rjmp .-16 ; 0x22c8c lcd_print_stop(); } } 22c9c: 08 95 ret 00022c9e : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 22c9e: 0f 93 push r16 22ca0: 1f 93 push r17 22ca2: 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)) { 22ca4: 8c ea ldi r24, 0xAC ; 172 22ca6: 9c e0 ldi r25, 0x0C ; 12 22ca8: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 22cac: 88 23 and r24, r24 22cae: 29 f0 breq .+10 ; 0x22cba return false; } } done: return true; 22cb0: 81 e0 ldi r24, 0x01 ; 1 } 22cb2: cf 91 pop r28 22cb4: 1f 91 pop r17 22cb6: 0f 91 pop r16 22cb8: 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()) { 22cba: 80 91 85 17 lds r24, 0x1785 ; 0x801785 22cbe: 88 23 and r24, r24 22cc0: b9 f3 breq .-18 ; 0x22cb0 22cc2: 0e 94 cc e4 call 0x1c998 ; 0x1c998 22cc6: 81 11 cpse r24, r1 22cc8: f3 cf rjmp .-26 ; 0x22cb0 if (oCheckFilament == ClCheckMode::_None) { 22cca: c0 91 e7 04 lds r28, 0x04E7 ; 0x8004e7 22cce: cc 23 and r28, r28 22cd0: 79 f3 breq .-34 ; 0x22cb0 goto done; } render_M862_warnings( 22cd2: 83 e5 ldi r24, 0x53 ; 83 22cd4: 91 e4 ldi r25, 0x41 ; 65 22cd6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22cda: 8c 01 movw r16, r24 22cdc: 83 e5 ldi r24, 0x53 ; 83 22cde: 91 e4 ldi r25, 0x41 ; 65 22ce0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22ce4: 4c 2f mov r20, r28 22ce6: b8 01 movw r22, r16 22ce8: 0f 94 3e 16 call 0x22c7c ; 0x22c7c _T(MSG_MISSING_FILAMENT) ,_T(MSG_MISSING_FILAMENT) //Identical messages ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 22cec: 81 e0 ldi r24, 0x01 ; 1 22cee: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 22cf2: 91 30 cpi r25, 0x01 ; 1 22cf4: f1 f6 brne .-68 ; 0x22cb2 22cf6: 80 e0 ldi r24, 0x00 ; 0 22cf8: dc cf rjmp .-72 ; 0x22cb2 00022cfa : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 22cfa: 1f 93 push r17 22cfc: cf 93 push r28 22cfe: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 22d00: 10 91 ec 04 lds r17, 0x04EC ; 0x8004ec 22d04: 11 23 and r17, r17 22d06: f9 f0 breq .+62 ; 0x22d46 22d08: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 22d0a: 85 ea ldi r24, 0xA5 ; 165 22d0c: 9d e0 ldi r25, 0x0D ; 13 22d0e: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 if (nDiameter == nDiameter_um) 22d12: 8c 17 cp r24, r28 22d14: 9d 07 cpc r25, r29 22d16: b9 f0 breq .+46 ; 0x22d46 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 22d18: 84 e0 ldi r24, 0x04 ; 4 22d1a: 91 e4 ldi r25, 0x41 ; 65 22d1c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22d20: ec 01 movw r28, r24 22d22: 89 ed ldi r24, 0xD9 ; 217 22d24: 90 e4 ldi r25, 0x40 ; 64 22d26: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22d2a: 41 2f mov r20, r17 22d2c: be 01 movw r22, r28 22d2e: 0f 94 3e 16 call 0x22c7c ; 0x22c7c ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 22d32: 10 92 f5 03 sts 0x03F5, r1 ; 0x8003f5 menu_submenu(lcd_hw_setup_menu); 22d36: 60 e0 ldi r22, 0x00 ; 0 22d38: 8a e2 ldi r24, 0x2A ; 42 22d3a: 9a e3 ldi r25, 0x3A ; 58 } } 22d3c: df 91 pop r29 22d3e: cf 91 pop r28 22d40: 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); 22d42: 0d 94 32 d0 jmp 0x3a064 ; 0x3a064 } } 22d46: df 91 pop r29 22d48: cf 91 pop r28 22d4a: 1f 91 pop r17 22d4c: 08 95 ret 00022d4e : } /// @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) { 22d4e: cf 92 push r12 22d50: df 92 push r13 22d52: ef 92 push r14 22d54: ff 92 push r15 22d56: cf 93 push r28 22d58: 6b 01 movw r12, r22 22d5a: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 22d5c: 82 e0 ldi r24, 0x02 ; 2 22d5e: 80 93 72 07 sts 0x0772, r24 ; 0x800772 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 22d62: 8c e0 ldi r24, 0x0C ; 12 22d64: 99 e5 ldi r25, 0x59 ; 89 22d66: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22d6a: 0f 94 be 0b call 0x2177c ; 0x2177c eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 22d6e: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 22d72: 10 92 86 17 sts 0x1786, r1 ; 0x801786 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 22d76: 20 e0 ldi r18, 0x00 ; 0 22d78: 30 e0 ldi r19, 0x00 ; 0 22d7a: 44 e3 ldi r20, 0x34 ; 52 22d7c: 52 e4 ldi r21, 0x42 ; 66 22d7e: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 22d82: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 22d86: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 22d8a: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 22d8e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 22d92: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 22d96: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 22d9a: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 22d9e: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 22da2: 6a e0 ldi r22, 0x0A ; 10 22da4: 77 e5 ldi r23, 0x57 ; 87 22da6: 8d ea ldi r24, 0xAD ; 173 22da8: 92 e4 ldi r25, 0x42 ; 66 22daa: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 22dae: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 22db2: 20 e0 ldi r18, 0x00 ; 0 22db4: 30 e0 ldi r19, 0x00 ; 0 22db6: 4c e0 ldi r20, 0x0C ; 12 22db8: 52 e4 ldi r21, 0x42 ; 66 22dba: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 22dbe: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 22dc2: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 22dc6: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 22dca: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 22dce: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 22dd2: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 22dd6: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 22dda: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 22dde: 69 e2 ldi r22, 0x29 ; 41 22de0: 7c e5 ldi r23, 0x5C ; 92 22de2: 85 e8 ldi r24, 0x85 ; 133 22de4: 91 e4 ldi r25, 0x41 ; 65 22de6: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 22dea: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 22dee: 20 e0 ldi r18, 0x00 ; 0 22df0: 30 e0 ldi r19, 0x00 ; 0 22df2: a9 01 movw r20, r18 22df4: c7 01 movw r24, r14 22df6: b6 01 movw r22, r12 22df8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 22dfc: 88 23 and r24, r24 22dfe: e1 f0 breq .+56 ; 0x22e38 { current_position[E_AXIS] += unloadLength; 22e00: a7 01 movw r20, r14 22e02: 96 01 movw r18, r12 22e04: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 22e08: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 22e0c: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 22e10: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 22e14: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 22e18: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 22e1c: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 22e20: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 22e24: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 22e28: 60 e0 ldi r22, 0x00 ; 0 22e2a: 70 e0 ldi r23, 0x00 ; 0 22e2c: 80 e2 ldi r24, 0x20 ; 32 22e2e: 91 e4 ldi r25, 0x41 ; 65 22e30: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 22e34: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 22e38: 89 ee ldi r24, 0xE9 ; 233 22e3a: 9a e3 ldi r25, 0x3A ; 58 22e3c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 22e40: 0f 94 55 35 call 0x26aaa ; 0x26aaa //disable extruder steppers so filament can be removed disable_e0(); 22e44: 14 9a sbi 0x02, 4 ; 2 _delay(100); 22e46: 64 e6 ldi r22, 0x64 ; 100 22e48: 70 e0 ldi r23, 0x00 ; 0 22e4a: 80 e0 ldi r24, 0x00 ; 0 22e4c: 90 e0 ldi r25, 0x00 ; 0 22e4e: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 22e52: 82 e0 ldi r24, 0x02 ; 2 22e54: 0f 94 34 64 call 0x2c868 ; 0x2c868 22e58: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 22e5a: 0e 94 c3 71 call 0xe386 ; 0xe386 22e5e: 81 11 cpse r24, r1 22e60: 07 c0 rjmp .+14 ; 0x22e70 22e62: c1 50 subi r28, 0x01 ; 1 22e64: 29 f0 breq .+10 ; 0x22e70 delay_keep_alive(100); 22e66: 84 e6 ldi r24, 0x64 ; 100 22e68: 90 e0 ldi r25, 0x00 ; 0 22e6a: 0e 94 98 8e call 0x11d30 ; 0x11d30 22e6e: f5 cf rjmp .-22 ; 0x22e5a counterBeep++; } st_synchronize(); 22e70: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 while (lcd_clicked()) delay_keep_alive(100); 22e74: 0e 94 c3 71 call 0xe386 ; 0xe386 22e78: 88 23 and r24, r24 22e7a: 29 f0 breq .+10 ; 0x22e86 22e7c: 84 e6 ldi r24, 0x64 ; 100 22e7e: 90 e0 ldi r25, 0x00 ; 0 22e80: 0e 94 98 8e call 0x11d30 ; 0x11d30 22e84: f7 cf rjmp .-18 ; 0x22e74 lcd_update_enable(true); 22e86: 81 e0 ldi r24, 0x01 ; 1 22e88: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_setstatuspgm(MSG_WELCOME); 22e8c: 8d ea ldi r24, 0xAD ; 173 22e8e: 90 e7 ldi r25, 0x70 ; 112 22e90: 0f 94 be 0b call 0x2177c ; 0x2177c custom_message_type = CustomMsg::Status; 22e94: 10 92 72 07 sts 0x0772, r1 ; 0x800772 clearFilamentAction(); 22e98: 0f 94 c4 36 call 0x26d88 ; 0x26d88 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 22e9c: 85 e8 ldi r24, 0x85 ; 133 22e9e: 97 e1 ldi r25, 0x17 ; 23 } 22ea0: cf 91 pop r28 22ea2: ff 90 pop r15 22ea4: ef 90 pop r14 22ea6: df 90 pop r13 22ea8: cf 90 pop r12 22eaa: 0c 94 95 75 jmp 0xeb2a ; 0xeb2a 00022eae : 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() 22eae: 2f 92 push r2 22eb0: 3f 92 push r3 22eb2: 4f 92 push r4 22eb4: 5f 92 push r5 22eb6: 6f 92 push r6 22eb8: 7f 92 push r7 22eba: 8f 92 push r8 22ebc: 9f 92 push r9 22ebe: af 92 push r10 22ec0: bf 92 push r11 22ec2: cf 92 push r12 22ec4: df 92 push r13 22ec6: ef 92 push r14 22ec8: ff 92 push r15 22eca: 0f 93 push r16 22ecc: 1f 93 push r17 22ece: cf 93 push r28 22ed0: df 93 push r29 22ed2: 00 d0 rcall .+0 ; 0x22ed4 22ed4: 00 d0 rcall .+0 ; 0x22ed6 22ed6: 00 d0 rcall .+0 ; 0x22ed8 22ed8: cd b7 in r28, 0x3d ; 61 22eda: de b7 in r29, 0x3e ; 62 22edc: 0d e9 ldi r16, 0x9D ; 157 22ede: 13 e1 ldi r17, 0x13 ; 19 22ee0: 1f 83 std Y+7, r17 ; 0x07 22ee2: 0e 83 std Y+6, r16 ; 0x06 22ee4: 2e 80 ldd r2, Y+6 ; 0x06 22ee6: 3f 80 ldd r3, Y+7 ; 0x07 22ee8: 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])) 22eea: f1 01 movw r30, r2 22eec: 61 81 ldd r22, Z+1 ; 0x01 22eee: 72 81 ldd r23, Z+2 ; 0x02 22ef0: 83 81 ldd r24, Z+3 ; 0x03 22ef2: 94 81 ldd r25, Z+4 ; 0x04 22ef4: 9b 01 movw r18, r22 22ef6: ac 01 movw r20, r24 22ef8: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 22efc: 88 23 and r24, r24 22efe: 09 f4 brne .+2 ; 0x22f02 22f00: 7c c0 rjmp .+248 ; 0x22ffa mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 22f02: 89 81 ldd r24, Y+1 ; 0x01 22f04: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 22f08: 20 e0 ldi r18, 0x00 ; 0 22f0a: 30 e0 ldi r19, 0x00 ; 0 22f0c: 48 eb ldi r20, 0xB8 ; 184 22f0e: 51 e4 ldi r21, 0x41 ; 65 22f10: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 22f14: 6b 01 movw r12, r22 22f16: 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)) + 22f18: 20 e0 ldi r18, 0x00 ; 0 22f1a: 30 e0 ldi r19, 0x00 ; 0 22f1c: 4c ef ldi r20, 0xFC ; 252 22f1e: 52 e4 ldi r21, 0x42 ; 66 22f20: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 22f24: 2b 01 movw r4, r22 22f26: 3c 01 movw r6, r24 22f28: 20 e0 ldi r18, 0x00 ; 0 22f2a: 30 e0 ldi r19, 0x00 ; 0 22f2c: 44 e6 ldi r20, 0x64 ; 100 22f2e: 53 e4 ldi r21, 0x43 ; 67 22f30: c7 01 movw r24, r14 22f32: b6 01 movw r22, r12 22f34: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 22f38: 4b 01 movw r8, r22 22f3a: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22f3c: 20 e0 ldi r18, 0x00 ; 0 22f3e: 30 e0 ldi r19, 0x00 ; 0 22f40: 40 ec ldi r20, 0xC0 ; 192 22f42: 51 e4 ldi r21, 0x41 ; 65 22f44: c7 01 movw r24, r14 22f46: b6 01 movw r22, r12 22f48: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 22f4c: 6b 01 movw r12, r22 22f4e: 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)) + 22f50: ee 81 ldd r30, Y+6 ; 0x06 22f52: ff 81 ldd r31, Y+7 ; 0x07 22f54: 21 81 ldd r18, Z+1 ; 0x01 22f56: 32 81 ldd r19, Z+2 ; 0x02 22f58: 43 81 ldd r20, Z+3 ; 0x03 22f5a: 54 81 ldd r21, Z+4 ; 0x04 22f5c: c3 01 movw r24, r6 22f5e: b2 01 movw r22, r4 22f60: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 22f64: a5 01 movw r20, r10 22f66: 94 01 movw r18, r8 22f68: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 22f6c: 20 e0 ldi r18, 0x00 ; 0 22f6e: 30 e9 ldi r19, 0x90 ; 144 22f70: 42 ea ldi r20, 0xA2 ; 162 22f72: 56 e4 ldi r21, 0x46 ; 70 22f74: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 22f78: 6a 83 std Y+2, r22 ; 0x02 22f7a: 7b 83 std Y+3, r23 ; 0x03 22f7c: 8c 83 std Y+4, r24 ; 0x04 22f7e: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22f80: ee 81 ldd r30, Y+6 ; 0x06 22f82: ff 81 ldd r31, Y+7 ; 0x07 22f84: 25 85 ldd r18, Z+13 ; 0x0d 22f86: 36 85 ldd r19, Z+14 ; 0x0e 22f88: 47 85 ldd r20, Z+15 ; 0x0f 22f8a: 50 89 ldd r21, Z+16 ; 0x10 22f8c: c7 01 movw r24, r14 22f8e: b6 01 movw r22, r12 22f90: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 22f94: a5 01 movw r20, r10 22f96: 94 01 movw r18, r8 22f98: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 22f9c: 20 e0 ldi r18, 0x00 ; 0 22f9e: 30 e9 ldi r19, 0x90 ; 144 22fa0: 42 e2 ldi r20, 0x22 ; 34 22fa2: 56 ec ldi r21, 0xC6 ; 198 22fa4: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 22fa8: 9b 01 movw r18, r22 22faa: 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)) + 22fac: 6a 81 ldd r22, Y+2 ; 0x02 22fae: 7b 81 ldd r23, Y+3 ; 0x03 22fb0: 8c 81 ldd r24, Y+4 ; 0x04 22fb2: 9d 81 ldd r25, Y+5 ; 0x05 22fb4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 22fb8: 4b 01 movw r8, r22 22fba: 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)); 22fbc: ee 81 ldd r30, Y+6 ; 0x06 22fbe: ff 81 ldd r31, Y+7 ; 0x07 22fc0: 21 8d ldd r18, Z+25 ; 0x19 22fc2: 32 8d ldd r19, Z+26 ; 0x1a 22fc4: 43 8d ldd r20, Z+27 ; 0x1b 22fc6: 54 8d ldd r21, Z+28 ; 0x1c 22fc8: c7 01 movw r24, r14 22fca: b6 01 movw r22, r12 22fcc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 22fd0: a3 01 movw r20, r6 22fd2: 92 01 movw r18, r4 22fd4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 22fd8: 20 e0 ldi r18, 0x00 ; 0 22fda: 30 e9 ldi r19, 0x90 ; 144 22fdc: 42 ea ldi r20, 0xA2 ; 162 22fde: 56 e4 ldi r21, 0x46 ; 70 22fe0: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 22fe4: 9b 01 movw r18, r22 22fe6: 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)) + 22fe8: c5 01 movw r24, r10 22fea: b4 01 movw r22, r8 22fec: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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] = 22ff0: f1 01 movw r30, r2 22ff2: 61 83 std Z+1, r22 ; 0x01 22ff4: 72 83 std Z+2, r23 ; 0x02 22ff6: 83 83 std Z+3, r24 ; 0x03 22ff8: 94 83 std Z+4, r25 ; 0x04 22ffa: f4 e0 ldi r31, 0x04 ; 4 22ffc: 2f 0e add r2, r31 22ffe: 31 1c adc r3, r1 23000: 29 81 ldd r18, Y+1 ; 0x01 23002: 2f 5f subi r18, 0xFF ; 255 23004: 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) { 23006: 27 30 cpi r18, 0x07 ; 7 23008: 09 f0 breq .+2 ; 0x2300c 2300a: 6f cf rjmp .-290 ; 0x22eea 2300c: 8e 81 ldd r24, Y+6 ; 0x06 2300e: 9f 81 ldd r25, Y+7 ; 0x07 23010: 4c 96 adiw r24, 0x1c ; 28 23012: 9f 83 std Y+7, r25 ; 0x07 23014: 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) { 23016: 81 56 subi r24, 0x61 ; 97 23018: 94 41 sbci r25, 0x14 ; 20 2301a: 09 f0 breq .+2 ; 0x2301e 2301c: 63 cf rjmp .-314 ; 0x22ee4 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() 2301e: 19 87 std Y+9, r17 ; 0x09 23020: 08 87 std Y+8, r16 ; 0x08 23022: f1 e0 ldi r31, 0x01 ; 1 23024: 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)) + 23026: c8 01 movw r24, r16 23028: 8b 5a subi r24, 0xAB ; 171 2302a: 9f 4f sbci r25, 0xFF ; 255 2302c: 9f 83 std Y+7, r25 ; 0x07 2302e: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 23030: 18 01 movw r2, r16 23032: 99 ea ldi r25, 0xA9 ; 169 23034: 29 0e add r2, r25 23036: 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])) 23038: e8 85 ldd r30, Y+8 ; 0x08 2303a: f9 85 ldd r31, Y+9 ; 0x09 2303c: 65 8d ldd r22, Z+29 ; 0x1d 2303e: 76 8d ldd r23, Z+30 ; 0x1e 23040: 87 8d ldd r24, Z+31 ; 0x1f 23042: 90 a1 ldd r25, Z+32 ; 0x20 23044: 9b 01 movw r18, r22 23046: ac 01 movw r20, r24 23048: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 2304c: 88 23 and r24, r24 2304e: 09 f4 brne .+2 ; 0x23052 23050: 79 c0 rjmp .+242 ; 0x23144 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 23052: 89 81 ldd r24, Y+1 ; 0x01 23054: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 23058: 20 e0 ldi r18, 0x00 ; 0 2305a: 30 e0 ldi r19, 0x00 ; 0 2305c: 40 ea ldi r20, 0xA0 ; 160 2305e: 50 e4 ldi r21, 0x40 ; 64 23060: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 23064: 6b 01 movw r12, r22 23066: 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)) + 23068: 20 e0 ldi r18, 0x00 ; 0 2306a: 30 e0 ldi r19, 0x00 ; 0 2306c: 48 ed ldi r20, 0xD8 ; 216 2306e: 52 e4 ldi r21, 0x42 ; 66 23070: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 23074: 2b 01 movw r4, r22 23076: 3c 01 movw r6, r24 23078: 20 e0 ldi r18, 0x00 ; 0 2307a: 30 e0 ldi r19, 0x00 ; 0 2307c: 42 e5 ldi r20, 0x52 ; 82 2307e: 53 e4 ldi r21, 0x43 ; 67 23080: c7 01 movw r24, r14 23082: b6 01 movw r22, r12 23084: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 23088: 4b 01 movw r8, r22 2308a: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 2308c: 20 e0 ldi r18, 0x00 ; 0 2308e: 30 e0 ldi r19, 0x00 ; 0 23090: 40 ec ldi r20, 0xC0 ; 192 23092: 50 e4 ldi r21, 0x40 ; 64 23094: c7 01 movw r24, r14 23096: b6 01 movw r22, r12 23098: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 2309c: 6b 01 movw r12, r22 2309e: 7c 01 movw r14, r24 230a0: ee 81 ldd r30, Y+6 ; 0x06 230a2: ff 81 ldd r31, Y+7 ; 0x07 230a4: 20 81 ld r18, Z 230a6: 31 81 ldd r19, Z+1 ; 0x01 230a8: 42 81 ldd r20, Z+2 ; 0x02 230aa: 53 81 ldd r21, Z+3 ; 0x03 230ac: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 230b0: a5 01 movw r20, r10 230b2: 94 01 movw r18, r8 230b4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 230b8: 20 e0 ldi r18, 0x00 ; 0 230ba: 30 e9 ldi r19, 0x90 ; 144 230bc: 42 e2 ldi r20, 0x22 ; 34 230be: 56 ec ldi r21, 0xC6 ; 198 230c0: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 230c4: 6a 83 std Y+2, r22 ; 0x02 230c6: 7b 83 std Y+3, r23 ; 0x03 230c8: 8c 83 std Y+4, r24 ; 0x04 230ca: 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)) + 230cc: f8 01 movw r30, r16 230ce: 21 81 ldd r18, Z+1 ; 0x01 230d0: 32 81 ldd r19, Z+2 ; 0x02 230d2: 43 81 ldd r20, Z+3 ; 0x03 230d4: 54 81 ldd r21, Z+4 ; 0x04 230d6: c3 01 movw r24, r6 230d8: b2 01 movw r22, r4 230da: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 230de: a5 01 movw r20, r10 230e0: 94 01 movw r18, r8 230e2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 230e6: 20 e0 ldi r18, 0x00 ; 0 230e8: 30 e9 ldi r19, 0x90 ; 144 230ea: 42 ea ldi r20, 0xA2 ; 162 230ec: 56 e4 ldi r21, 0x46 ; 70 230ee: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 230f2: 9b 01 movw r18, r22 230f4: ac 01 movw r20, r24 230f6: 6a 81 ldd r22, Y+2 ; 0x02 230f8: 7b 81 ldd r23, Y+3 ; 0x03 230fa: 8c 81 ldd r24, Y+4 ; 0x04 230fc: 9d 81 ldd r25, Y+5 ; 0x05 230fe: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 23102: 4b 01 movw r8, r22 23104: 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)); 23106: f1 01 movw r30, r2 23108: 20 81 ld r18, Z 2310a: 31 81 ldd r19, Z+1 ; 0x01 2310c: 42 81 ldd r20, Z+2 ; 0x02 2310e: 53 81 ldd r21, Z+3 ; 0x03 23110: c7 01 movw r24, r14 23112: b6 01 movw r22, r12 23114: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 23118: a3 01 movw r20, r6 2311a: 92 01 movw r18, r4 2311c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 23120: 20 e0 ldi r18, 0x00 ; 0 23122: 30 e9 ldi r19, 0x90 ; 144 23124: 42 ea ldi r20, 0xA2 ; 162 23126: 56 e4 ldi r21, 0x46 ; 70 23128: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 2312c: 9b 01 movw r18, r22 2312e: 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)) + 23130: c5 01 movw r24, r10 23132: b4 01 movw r22, r8 23134: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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] = 23138: e8 85 ldd r30, Y+8 ; 0x08 2313a: f9 85 ldd r31, Y+9 ; 0x09 2313c: 65 8f std Z+29, r22 ; 0x1d 2313e: 76 8f std Z+30, r23 ; 0x1e 23140: 87 8f std Z+31, r24 ; 0x1f 23142: 90 a3 std Z+32, r25 ; 0x20 23144: 88 85 ldd r24, Y+8 ; 0x08 23146: 99 85 ldd r25, Y+9 ; 0x09 23148: 4c 96 adiw r24, 0x1c ; 28 2314a: 99 87 std Y+9, r25 ; 0x09 2314c: 88 87 std Y+8, r24 ; 0x08 2314e: 99 81 ldd r25, Y+1 ; 0x01 23150: 9f 5f subi r25, 0xFF ; 255 23152: 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) { 23154: 96 30 cpi r25, 0x06 ; 6 23156: 09 f0 breq .+2 ; 0x2315a 23158: 6f cf rjmp .-290 ; 0x23038 2315a: 0c 5f subi r16, 0xFC ; 252 2315c: 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) { 2315e: e3 e1 ldi r30, 0x13 ; 19 23160: 09 3b cpi r16, 0xB9 ; 185 23162: 1e 07 cpc r17, r30 23164: 09 f0 breq .+2 ; 0x23168 23166: 5b cf rjmp .-330 ; 0x2301e z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 23168: 29 96 adiw r28, 0x09 ; 9 2316a: 0f b6 in r0, 0x3f ; 63 2316c: f8 94 cli 2316e: de bf out 0x3e, r29 ; 62 23170: 0f be out 0x3f, r0 ; 63 23172: cd bf out 0x3d, r28 ; 61 23174: df 91 pop r29 23176: cf 91 pop r28 23178: 1f 91 pop r17 2317a: 0f 91 pop r16 2317c: ff 90 pop r15 2317e: ef 90 pop r14 23180: df 90 pop r13 23182: cf 90 pop r12 23184: bf 90 pop r11 23186: af 90 pop r10 23188: 9f 90 pop r9 2318a: 8f 90 pop r8 2318c: 7f 90 pop r7 2318e: 6f 90 pop r6 23190: 5f 90 pop r5 23192: 4f 90 pop r4 23194: 3f 90 pop r3 23196: 2f 90 pop r2 23198: 08 95 ret 0002319a : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 2319a: 2f 92 push r2 2319c: 3f 92 push r3 2319e: 4f 92 push r4 231a0: 5f 92 push r5 231a2: 6f 92 push r6 231a4: 7f 92 push r7 231a6: 8f 92 push r8 231a8: 9f 92 push r9 231aa: af 92 push r10 231ac: bf 92 push r11 231ae: cf 92 push r12 231b0: df 92 push r13 231b2: ef 92 push r14 231b4: ff 92 push r15 231b6: 0f 93 push r16 231b8: 1f 93 push r17 231ba: cf 93 push r28 231bc: df 93 push r29 231be: cd b7 in r28, 0x3d ; 61 231c0: de b7 in r29, 0x3e ; 62 231c2: 67 97 sbiw r28, 0x17 ; 23 231c4: 0f b6 in r0, 0x3f ; 63 231c6: f8 94 cli 231c8: de bf out 0x3e, r29 ; 62 231ca: 0f be out 0x3f, r0 ; 63 231cc: cd bf out 0x3d, r28 ; 61 231ce: 08 2f mov r16, r24 231d0: ce 01 movw r24, r28 231d2: 46 96 adiw r24, 0x16 ; 22 231d4: 9f 8b std Y+23, r25 ; 0x17 231d6: 8e 8b std Y+22, r24 ; 0x16 231d8: 83 e0 ldi r24, 0x03 ; 3 231da: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 231dc: 95 e1 ldi r25, 0x15 ; 21 231de: 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 231e0: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 tool_change_extruder = slot; 231e4: 00 93 7d 13 sts 0x137D, r16 ; 0x80137d state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 231e8: 40 2f mov r20, r16 231ea: 64 e5 ldi r22, 0x54 ; 84 231ec: ce 01 movw r24, r28 231ee: 01 96 adiw r24, 0x01 ; 1 231f0: 0f 94 c1 c2 call 0x38582 ; 0x38582 231f4: 49 81 ldd r20, Y+1 ; 0x01 231f6: 5a 81 ldd r21, Y+2 ; 0x02 231f8: 6b 81 ldd r22, Y+3 ; 0x03 231fa: 7c 81 ldd r23, Y+4 ; 0x04 231fc: 8d 81 ldd r24, Y+5 ; 0x05 231fe: 0f 94 33 98 call 0x33066 ; 0x33066 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 23202: 61 e0 ldi r22, 0x01 ; 1 23204: 81 e0 ldi r24, 0x01 ; 1 23206: 0f 94 57 9f call 0x33eae ; 0x33eae 2320a: 18 2f mov r17, r24 2320c: 81 11 cpse r24, r1 2320e: 07 c0 rjmp .+14 ; 0x2321e break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 23210: 0f 94 25 c2 call 0x3844a ; 0x3844a // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 23214: 0f 94 f5 9e call 0x33dea ; 0x33dea // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 23218: 0f 94 e5 9f call 0x33fca ; 0x33fca 2321c: e1 cf rjmp .-62 ; 0x231e0 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2321e: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 23222: 0f 94 19 c3 call 0x38632 ; 0x38632 23226: 81 30 cpi r24, 0x01 ; 1 23228: 79 f1 breq .+94 ; 0x23288 // 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(); 2322a: 0f 94 e5 9f call 0x33fca ; 0x33fca if (retries == 2 && cutter_enabled()) { 2322e: 92 e0 ldi r25, 0x02 ; 2 23230: f9 12 cpse r15, r25 23232: 09 c0 rjmp .+18 ; 0x23246 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; 23234: 8e ec ldi r24, 0xCE ; 206 23236: 9e e0 ldi r25, 0x0E ; 14 23238: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2323c: 81 30 cpi r24, 0x01 ; 1 2323e: 19 f4 brne .+6 ; 0x23246 CutFilamentInner(slot); // try cutting filament tip at the last attempt 23240: 80 2f mov r24, r16 23242: 0f 94 d0 a0 call 0x341a0 ; 0x341a0 23246: 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) { 23248: f1 10 cpse r15, r1 2324a: ca cf rjmp .-108 ; 0x231e0 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()) { 2324c: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 23250: 88 23 and r24, r24 23252: 09 f4 brne .+2 ; 0x23256 23254: ef c0 rjmp .+478 ; 0x23434 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 23256: 67 96 adiw r28, 0x17 ; 23 23258: 0f b6 in r0, 0x3f ; 63 2325a: f8 94 cli 2325c: de bf out 0x3e, r29 ; 62 2325e: 0f be out 0x3f, r0 ; 63 23260: cd bf out 0x3d, r28 ; 61 23262: df 91 pop r29 23264: cf 91 pop r28 23266: 1f 91 pop r17 23268: 0f 91 pop r16 2326a: ff 90 pop r15 2326c: ef 90 pop r14 2326e: df 90 pop r13 23270: cf 90 pop r12 23272: bf 90 pop r11 23274: af 90 pop r10 23276: 9f 90 pop r9 23278: 8f 90 pop r8 2327a: 7f 90 pop r7 2327c: 6f 90 pop r6 2327e: 5f 90 pop r5 23280: 4f 90 pop r4 23282: 3f 90 pop r3 23284: 2f 90 pop r2 23286: 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(); 23288: 60 91 72 13 lds r22, 0x1372 ; 0x801372 2328c: 70 e0 ldi r23, 0x00 ; 0 2328e: 90 e0 ldi r25, 0x00 ; 0 23290: 80 e0 ldi r24, 0x00 ; 0 23292: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 23296: 9b 01 movw r18, r22 23298: ac 01 movw r20, r24 2329a: 60 e0 ldi r22, 0x00 ; 0 2329c: 70 e0 ldi r23, 0x00 ; 0 2329e: 8c e5 ldi r24, 0x5C ; 92 232a0: 92 e4 ldi r25, 0x42 ; 66 232a2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 232a6: 36 2e mov r3, r22 232a8: 87 2e mov r8, r23 232aa: 98 2e mov r9, r24 232ac: 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)) 232ae: 26 2f mov r18, r22 232b0: 37 2f mov r19, r23 232b2: 48 2f mov r20, r24 232b4: 59 2f mov r21, r25 232b6: 60 e0 ldi r22, 0x00 ; 0 232b8: 70 e0 ldi r23, 0x00 ; 0 232ba: 80 e2 ldi r24, 0x20 ; 32 232bc: 91 e4 ldi r25, 0x41 ; 65 232be: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 232c2: 2b 01 movw r4, r22 232c4: 3c 01 movw r6, r24 232c6: e7 e3 ldi r30, 0x37 ; 55 232c8: f5 e0 ldi r31, 0x05 ; 5 232ca: 82 2d mov r24, r2 232cc: 11 92 st Z+, r1 232ce: 8a 95 dec r24 232d0: e9 f7 brne .-6 ; 0x232cc lcd_status_message_idx = 0; 232d2: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.463> 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); 232d6: 83 2d mov r24, r3 232d8: 98 2d mov r25, r8 232da: a9 2d mov r26, r9 232dc: be 2d mov r27, r14 232de: bc 01 movw r22, r24 232e0: 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++) { 232e2: 91 2c mov r9, r1 232e4: 31 2c mov r3, r1 232e6: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 232e8: 5b 01 movw r10, r22 232ea: 6c 01 movw r12, r24 232ec: d7 fa bst r13, 7 232ee: d0 94 com r13 232f0: d7 f8 bld r13, 7 232f2: d0 94 com r13 232f4: 20 e0 ldi r18, 0x00 ; 0 232f6: 30 e0 ldi r19, 0x00 ; 0 232f8: 48 e4 ldi r20, 0x48 ; 72 232fa: 52 e4 ldi r21, 0x42 ; 66 232fc: 0f 94 e5 c2 call 0x385ca ; 0x385ca 23300: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 23304: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 while (planner_any_moves()) { 23308: 98 17 cp r25, r24 2330a: 09 f4 brne .+2 ; 0x2330e 2330c: 49 c0 rjmp .+146 ; 0x233a0 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 2330e: 11 23 and r17, r17 23310: 31 f0 breq .+12 ; 0x2331e 23312: 0f 94 19 c3 call 0x38632 ; 0x38632 23316: 11 e0 ldi r17, 0x01 ; 1 23318: 81 30 cpi r24, 0x01 ; 1 2331a: 09 f0 breq .+2 ; 0x2331e 2331c: 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); 2331e: 83 e0 ldi r24, 0x03 ; 3 23320: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 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); 23324: 20 91 4c 07 lds r18, 0x074C ; 0x80074c 23328: 30 91 4d 07 lds r19, 0x074D ; 0x80074d 2332c: 40 91 4e 07 lds r20, 0x074E ; 0x80074e 23330: 50 91 4f 07 lds r21, 0x074F ; 0x80074f 23334: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 23338: a3 01 movw r20, r6 2333a: 92 01 movw r18, r4 2333c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 23340: 0f 94 4c df call 0x3be98 ; 0x3be98 23344: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 23348: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 2334a: e6 16 cp r14, r22 2334c: c1 f0 breq .+48 ; 0x2337e 2334e: e3 2d mov r30, r3 23350: e4 31 cpi r30, 0x14 ; 20 23352: 08 f0 brcs .+2 ; 0x23356 23354: 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); 23356: 33 24 eor r3, r3 23358: 33 94 inc r3 2335a: 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] : '-'); 2335c: 8f ef ldi r24, 0xFF ; 255 2335e: 11 11 cpse r17, r1 23360: 01 c0 rjmp .+2 ; 0x23364 23362: 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; 23364: f0 e0 ldi r31, 0x00 ; 0 23366: e9 5c subi r30, 0xC9 ; 201 23368: fa 4f sbci r31, 0xFA ; 250 2336a: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 2336c: 91 e0 ldi r25, 0x01 ; 1 2336e: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 23372: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 23376: 81 11 cpse r24, r1 23378: 02 c0 rjmp .+4 ; 0x2337e 2337a: 0f 94 82 40 call 0x28104 ; 0x28104 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 2337e: 90 e0 ldi r25, 0x00 ; 0 23380: 80 e0 ldi r24, 0x00 ; 0 23382: 0e 94 98 8e call 0x11d30 ; 0x11d30 } 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); 23386: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 23388: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 2338c: 88 23 and r24, r24 2338e: 09 f4 brne .+2 ; 0x23392 23390: b7 cf rjmp .-146 ; 0x23300 return false; // power panic or a similar issue happened, bail out fast 23392: 10 e0 ldi r17, 0x00 ; 0 23394: 37 c0 rjmp .+110 ; 0x23404 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); 23396: c6 01 movw r24, r12 23398: b5 01 movw r22, r10 2339a: 99 24 eor r9, r9 2339c: 93 94 inc r9 2339e: aa cf rjmp .-172 ; 0x232f4 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++) { 233a0: 91 e0 ldi r25, 0x01 ; 1 233a2: 99 12 cpse r9, r25 233a4: f8 cf rjmp .-16 ; 0x23396 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 233a6: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 if (!filament_inserted) { 233aa: 11 11 cpse r17, r1 233ac: 08 c0 rjmp .+16 ; 0x233be eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 233ae: 8f ec ldi r24, 0xCF ; 207 233b0: 9e e0 ldi r25, 0x0E ; 14 233b2: 0e 94 c4 77 call 0xef88 ; 0xef88 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 233b6: 80 ed ldi r24, 0xD0 ; 208 233b8: 9e e0 ldi r25, 0x0E ; 14 233ba: 0e 94 b7 77 call 0xef6e ; 0xef6e 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); 233be: 44 e1 ldi r20, 0x14 ; 20 233c0: 50 e0 ldi r21, 0x00 ; 0 233c2: 67 e3 ldi r22, 0x37 ; 55 233c4: 75 e0 ldi r23, 0x05 ; 5 233c6: ce 01 movw r24, r28 233c8: 01 96 adiw r24, 0x01 ; 1 233ca: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c 233ce: fe 01 movw r30, r28 233d0: 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'; 233d2: 81 91 ld r24, Z+ 233d4: 87 fd sbrc r24, 7 233d6: 2c c0 rjmp .+88 ; 0x23430 233d8: 80 e3 ldi r24, 0x30 ; 48 233da: df 01 movw r26, r30 233dc: 11 97 sbiw r26, 0x01 ; 1 233de: 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++) { 233e0: 8e 89 ldd r24, Y+22 ; 0x16 233e2: 9f 89 ldd r25, Y+23 ; 0x17 233e4: 8e 17 cp r24, r30 233e6: 9f 07 cpc r25, r31 233e8: a1 f7 brne .-24 ; 0x233d2 // 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; 233ea: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 233ec: 84 e1 ldi r24, 0x14 ; 20 233ee: 9a ea ldi r25, 0xAA ; 170 233f0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 233f4: 8e eb ldi r24, 0xBE ; 190 233f6: 90 e9 ldi r25, 0x90 ; 144 233f8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 233fc: ce 01 movw r24, r28 233fe: 01 96 adiw r24, 0x01 ; 1 23400: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 23404: 8c e4 ldi r24, 0x4C ; 76 23406: 95 e0 ldi r25, 0x05 ; 5 23408: 0f 94 fe 41 call 0x283fc ; 0x283fc ::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()) { 2340c: 11 23 and r17, r17 2340e: 09 f4 brne .+2 ; 0x23412 23410: 0c cf rjmp .-488 ; 0x2322a // 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 23412: 80 2f mov r24, r16 23414: 0f 94 8a 87 call 0x30f14 ; 0x30f14 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 23418: 00 93 24 13 sts 0x1324, r16 ; 0x801324 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 2341c: 80 91 99 13 lds r24, 0x1399 ; 0x801399 23420: 90 91 9a 13 lds r25, 0x139A ; 0x80139a 23424: 01 96 adiw r24, 0x01 ; 1 23426: 90 93 9a 13 sts 0x139A, r25 ; 0x80139a 2342a: 80 93 99 13 sts 0x1399, r24 ; 0x801399 2342e: 13 cf rjmp .-474 ; 0x23256 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'; 23430: 81 e3 ldi r24, 0x31 ; 49 23432: d3 cf rjmp .-90 ; 0x233da void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 23434: 8a e2 ldi r24, 0x2A ; 42 23436: 90 e8 ldi r25, 0x80 ; 128 23438: 90 93 27 13 sts 0x1327, r25 ; 0x801327 2343c: 80 93 26 13 sts 0x1326, r24 ; 0x801326 logic.SetPrinterError(ErrorCode::LOAD_TO_EXTRUDER_FAILED); // We only have to wait for the user to fix the issue and press "Retry". // Please see CheckUserInput() for details how we "leave" manage_response. // If manage_response returns false at this spot (MMU operation interrupted aka MMU reset) // we can safely continue because the MMU is not doing an operation now. static_cast(manage_response(true, true)); // yes, I'd like to silence [[nodiscard]] warning at this spot by casting to void 23440: 61 e0 ldi r22, 0x01 ; 1 23442: 81 e0 ldi r24, 0x01 ; 1 23444: 0f 94 57 9f call 0x33eae ; 0x33eae 23448: c7 ce rjmp .-626 ; 0x231d8 0002344a : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 2344a: cf 93 push r28 2344c: df 93 push r29 2344e: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 23450: 0f 94 0b 88 call 0x31016 ; 0x31016 23454: c8 2f mov r28, r24 23456: 88 23 and r24, r24 23458: d9 f0 breq .+54 ; 0x23490 return false; } if (slot != extruder) { 2345a: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 2345e: 8d 17 cp r24, r29 23460: b9 f0 breq .+46 ; 0x23490 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(); 23462: 0e 94 a7 68 call 0xd14e ; 0xd14e if (/*FindaDetectsFilament()*/ 23466: 81 11 cpse r24, r1 23468: 02 c0 rjmp .+4 ; 0x2346e /*!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(); 2346a: 0f 94 22 a0 call 0x34044 ; 0x34044 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2346e: 0f 94 7f 87 call 0x30efe ; 0x30efe eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23472: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 23476: 10 92 86 17 sts 0x1786, r1 ; 0x801786 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2347a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 2347e: 8d 2f mov r24, r29 23480: 0f 94 cd 18 call 0x2319a ; 0x2319a #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 23484: 85 e8 ldi r24, 0x85 ; 133 23486: 97 e1 ldi r25, 0x17 ; 23 23488: 0e 94 95 75 call 0xeb2a ; 0xeb2a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2348c: 0f 94 00 88 call 0x31000 ; 0x31000 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 23490: 8c 2f mov r24, r28 23492: df 91 pop r29 23494: cf 91 pop r28 23496: 08 95 ret 00023498 : { (void)lcd_selftest(); } bool lcd_selftest() { 23498: cf 92 push r12 2349a: df 92 push r13 2349c: ef 92 push r14 2349e: ff 92 push r15 234a0: 0f 93 push r16 234a2: 1f 93 push r17 234a4: cf 93 push r28 234a6: df 93 push r29 234a8: 00 d0 rcall .+0 ; 0x234aa 234aa: 1f 92 push r1 234ac: cd b7 in r28, 0x3d ; 61 234ae: 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) { 234b0: 80 91 8e 17 lds r24, 0x178E ; 0x80178e 234b4: 8f 3f cpi r24, 0xFF ; 255 234b6: 31 f4 brne .+12 ; 0x234c4 if (!MMU2::mmu2.Enabled()) { 234b8: 80 91 95 13 lds r24, 0x1395 ; 0x801395 234bc: 81 30 cpi r24, 0x01 ; 1 234be: 11 f0 breq .+4 ; 0x234c4 lcd_detect_IRsensor(); 234c0: 0f 94 46 15 call 0x22a8c ; 0x22a8c 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(); 234c4: 0f 94 27 45 call 0x28a4e ; 0x28a4e uint8_t fanSpeedBckp = fanSpeed; 234c8: d0 90 df 03 lds r13, 0x03DF ; 0x8003df fanSpeed = 255; 234cc: 8f ef ldi r24, 0xFF ; 255 234ce: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) { lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 234d2: 8a e1 ldi r24, 0x1A ; 26 234d4: e8 2e mov r14, r24 234d6: 8c e8 ldi r24, 0x8C ; 140 234d8: 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()); 234da: 04 e1 ldi r16, 0x14 ; 20 234dc: 1c e8 ldi r17, 0x8C ; 140 void lcd_wait_for_cool_down() { disable_heater(); uint8_t fanSpeedBckp = fanSpeed; fanSpeed = 255; while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) { 234de: 20 e0 ldi r18, 0x00 ; 0 234e0: 30 e0 ldi r19, 0x00 ; 0 234e2: 48 e4 ldi r20, 0x48 ; 72 234e4: 52 e4 ldi r21, 0x42 ; 66 234e6: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 234ea: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 234ee: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 234f2: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 234f6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 234fa: 18 16 cp r1, r24 234fc: 8c f0 brlt .+34 ; 0x23520 234fe: 20 e0 ldi r18, 0x00 ; 0 23500: 30 e0 ldi r19, 0x00 ; 0 23502: 48 e4 ldi r20, 0x48 ; 72 23504: 52 e4 ldi r21, 0x42 ; 66 23506: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 2350a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 2350e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 23512: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 23516: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 2351a: 18 16 cp r1, r24 2351c: 0c f0 brlt .+2 ; 0x23520 2351e: 42 c0 rjmp .+132 ; 0x235a4 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 23520: 8d ee ldi r24, 0xED ; 237 23522: 9e e3 ldi r25, 0x3E ; 62 23524: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 23528: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 2352c: 42 e8 ldi r20, 0x82 ; 130 2352e: 64 e0 ldi r22, 0x04 ; 4 23530: 80 e0 ldi r24, 0x00 ; 0 23532: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 23536: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2353a: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 2353e: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 23542: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 23546: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2354a: 7f 93 push r23 2354c: 6f 93 push r22 2354e: ff 92 push r15 23550: ef 92 push r14 23552: 0e 94 7f 6f call 0xdefe ; 0xdefe lcd_putc(LCD_STR_DEGREE[0]); 23556: 81 e8 ldi r24, 0x81 ; 129 23558: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 2355c: 40 e8 ldi r20, 0x80 ; 128 2355e: 64 e0 ldi r22, 0x04 ; 4 23560: 89 e0 ldi r24, 0x09 ; 9 23562: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 23566: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 2356a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 2356e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 23572: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 23576: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2357a: 7f 93 push r23 2357c: 6f 93 push r22 2357e: 1f 93 push r17 23580: 0f 93 push r16 23582: 0e 94 7f 6f call 0xdefe ; 0xdefe lcd_putc(LCD_STR_DEGREE[0]); 23586: 81 e8 ldi r24, 0x81 ; 129 23588: 0e 94 95 6f call 0xdf2a ; 0xdf2a delay_keep_alive(1000); 2358c: 88 ee ldi r24, 0xE8 ; 232 2358e: 93 e0 ldi r25, 0x03 ; 3 23590: 0e 94 98 8e call 0x11d30 ; 0x11d30 serialecho_temperatures(); 23594: 0e 94 fa 78 call 0xf1f4 ; 0xf1f4 23598: 0f b6 in r0, 0x3f ; 63 2359a: f8 94 cli 2359c: de bf out 0x3e, r29 ; 62 2359e: 0f be out 0x3f, r0 ; 63 235a0: cd bf out 0x3d, r28 ; 61 235a2: 9d cf rjmp .-198 ; 0x234de } fanSpeed = fanSpeedBckp; 235a4: d0 92 df 03 sts 0x03DF, r13 ; 0x8003df lcd_update_enable(true); 235a8: 81 e0 ldi r24, 0x01 ; 1 235aa: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 235ae: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 235b2: 83 e3 ldi r24, 0x33 ; 51 235b4: 9f e3 ldi r25, 0x3F ; 63 235b6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 235ba: ac 01 movw r20, r24 235bc: 60 e0 ldi r22, 0x00 ; 0 235be: 80 e0 ldi r24, 0x00 ; 0 235c0: 0e 94 ba 6f call 0xdf74 ; 0xdf74 #ifdef TMC2130 FORCE_HIGH_POWER_START; 235c4: 81 e0 ldi r24, 0x01 ; 1 235c6: 0e 94 76 67 call 0xceec ; 0xceec #endif // TMC2130 FORCE_BL_ON_START; 235ca: 81 e0 ldi r24, 0x01 ; 1 235cc: 0e 94 8d 8b call 0x1171a ; 0x1171a _delay(2000); 235d0: 60 ed ldi r22, 0xD0 ; 208 235d2: 77 e0 ldi r23, 0x07 ; 7 235d4: 80 e0 ldi r24, 0x00 ; 0 235d6: 90 e0 ldi r25, 0x00 ; 0 235d8: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 KEEPALIVE_STATE(IN_HANDLER); 235dc: 82 e0 ldi r24, 0x02 ; 2 235de: 80 93 96 02 sts 0x0296, r24 ; 0x800296 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 235e2: 00 ed ldi r16, 0xD0 ; 208 235e4: 17 e0 ldi r17, 0x07 ; 7 235e6: 21 e0 ldi r18, 0x01 ; 1 235e8: 43 e0 ldi r20, 0x03 ; 3 235ea: 60 e0 ldi r22, 0x00 ; 0 235ec: 80 e0 ldi r24, 0x00 ; 0 235ee: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 235f2: 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 235f4: 83 e0 ldi r24, 0x03 ; 3 235f6: 0e 94 e2 76 call 0xedc4 ; 0xedc4 lcd_selftest_setfan(0); // print fan off 235fa: 80 e0 ldi r24, 0x00 ; 0 235fc: 0e 94 a6 d0 call 0x1a14c ; 0x1a14c lcd_selftest_measure_fans(2, 18, 2); 23600: 62 e0 ldi r22, 0x02 ; 2 23602: 82 e0 ldi r24, 0x02 ; 2 23604: 0e 94 3a d1 call 0x1a274 ; 0x1a274 setExtruderAutoFanState(0); // hotend fan off 23608: 80 e0 ldi r24, 0x00 ; 0 2360a: 0e 94 e2 76 call 0xedc4 ; 0xedc4 if (fan_speed[0] < failThr) { 2360e: c0 90 ae 04 lds r12, 0x04AE ; 0x8004ae 23612: d0 90 af 04 lds r13, 0x04AF ; 0x8004af 23616: 94 e1 ldi r25, 0x14 ; 20 23618: c9 16 cp r12, r25 2361a: d1 04 cpc r13, r1 2361c: 5c f1 brlt .+86 ; 0x23674 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 2361e: 21 e0 ldi r18, 0x01 ; 1 23620: 43 e0 ldi r20, 0x03 ; 3 23622: 6f 2d mov r22, r15 23624: 81 e0 ldi r24, 0x01 ; 1 23626: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 2362a: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 2362c: 8f ef ldi r24, 0xFF ; 255 2362e: 0e 94 a6 d0 call 0x1a14c ; 0x1a14c lcd_selftest_measure_fans(5, 18, 3); 23632: 63 e0 ldi r22, 0x03 ; 3 23634: 85 e0 ldi r24, 0x05 ; 5 23636: 0e 94 3a d1 call 0x1a274 ; 0x1a274 lcd_selftest_setfan(0); 2363a: 80 e0 ldi r24, 0x00 ; 0 2363c: 0e 94 a6 d0 call 0x1a14c ; 0x1a14c if (fan_speed[1] < failThr) { 23640: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 23644: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 23648: 84 31 cpi r24, 0x14 ; 20 2364a: 91 05 cpc r25, r1 2364c: cc f4 brge .+50 ; 0x23680 #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 2364e: 61 ef ldi r22, 0xF1 ; 241 23650: 72 e0 ldi r23, 0x02 ; 2 23652: 85 e0 ldi r24, 0x05 ; 5 23654: 0f 94 ca 06 call 0x20d94 ; 0x20d94 } } if (_swapped_fan) { 23658: 96 e4 ldi r25, 0x46 ; 70 2365a: c9 16 cp r12, r25 2365c: d1 04 cpc r13, r1 2365e: 9c f4 brge .+38 ; 0x23686 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 23660: 08 e8 ldi r16, 0x88 ; 136 23662: 13 e1 ldi r17, 0x13 ; 19 23664: 21 e0 ldi r18, 0x01 ; 1 23666: 43 e0 ldi r20, 0x03 ; 3 23668: 6f 2d mov r22, r15 2366a: 8d e0 ldi r24, 0x0D ; 13 2366c: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 23670: e1 2c mov r14, r1 23672: 5d c1 rjmp .+698 ; 0x2392e #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 23674: 61 ef ldi r22, 0xF1 ; 241 23676: 72 e0 ldi r23, 0x02 ; 2 23678: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 2367a: 0f 94 ca 06 call 0x20d94 ; 0x20d94 2367e: f0 cf rjmp .-32 ; 0x23660 lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 23680: 86 34 cpi r24, 0x46 ; 70 23682: 91 05 cpc r25, r1 23684: 54 f4 brge .+20 ; 0x2369a } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 23686: 60 e0 ldi r22, 0x00 ; 0 23688: 81 e0 ldi r24, 0x01 ; 1 2368a: 0e 94 ac d0 call 0x1a158 ; 0x1a158 if (_result) { 2368e: 81 11 cpse r24, r1 23690: 7c c1 rjmp .+760 ; 0x2398a lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 23692: 61 ef ldi r22, 0xF1 ; 241 23694: 72 e0 ldi r23, 0x02 ; 2 23696: 89 e0 ldi r24, 0x09 ; 9 23698: f0 cf rjmp .-32 ; 0x2367a { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 2369a: 86 e4 ldi r24, 0x46 ; 70 2369c: c8 16 cp r12, r24 2369e: d1 04 cpc r13, r1 236a0: 94 f7 brge .-28 ; 0x23686 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 236a2: 00 ed ldi r16, 0xD0 ; 208 236a4: 17 e0 ldi r17, 0x07 ; 7 236a6: 21 e0 ldi r18, 0x01 ; 1 236a8: 43 e0 ldi r20, 0x03 ; 3 236aa: 6f 2d mov r22, r15 236ac: 82 e0 ldi r24, 0x02 ; 2 236ae: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 236b2: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 236b4: 1c 9b sbis 0x03, 4 ; 3 236b6: 18 c0 rjmp .+48 ; 0x236e8 { #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; 236b8: 1c 9b sbis 0x03, 4 ; 3 236ba: 16 c0 rjmp .+44 ; 0x236e8 236bc: 20 e0 ldi r18, 0x00 ; 0 236be: 30 e0 ldi r19, 0x00 ; 0 236c0: 40 e2 ldi r20, 0x20 ; 32 236c2: 51 e4 ldi r21, 0x41 ; 65 236c4: 60 91 48 07 lds r22, 0x0748 ; 0x800748 236c8: 70 91 49 07 lds r23, 0x0749 ; 0x800749 236cc: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 236d0: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 236d4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 236d8: 60 93 48 07 sts 0x0748, r22 ; 0x800748 236dc: 70 93 49 07 sts 0x0749, r23 ; 0x800749 236e0: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 236e4: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 236e8: 60 e0 ldi r22, 0x00 ; 0 236ea: 70 e0 ldi r23, 0x00 ; 0 236ec: 84 e3 ldi r24, 0x34 ; 52 236ee: 92 e4 ldi r25, 0x42 ; 66 236f0: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 236f4: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 if ( 236f8: 1c 9b sbis 0x03, 4 ; 3 236fa: 51 c1 rjmp .+674 ; 0x2399e ((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] = ""; 236fc: 1a 82 std Y+2, r1 ; 0x02 236fe: 19 82 std Y+1, r1 ; 0x01 23700: 1c 82 std Y+4, r1 ; 0x04 23702: 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"); 23704: 1c 9b sbis 0x03, 4 ; 3 23706: 06 c0 rjmp .+12 ; 0x23714 23708: 66 ef ldi r22, 0xF6 ; 246 2370a: 72 e0 ldi r23, 0x02 ; 2 2370c: ce 01 movw r24, r28 2370e: 01 96 adiw r24, 0x01 ; 1 23710: 0f 94 92 e3 call 0x3c724 ; 0x3c724 lcd_selftest_error(TestError::Endstops, _error, ""); 23714: be 01 movw r22, r28 23716: 6f 5f subi r22, 0xFF ; 255 23718: 7f 4f sbci r23, 0xFF ; 255 2371a: 82 e0 ldi r24, 0x02 ; 2 2371c: 0f 94 ca 06 call 0x20d94 ; 0x20d94 ((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; 23720: 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(); 23722: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 23726: 81 e0 ldi r24, 0x01 ; 1 23728: 0e 94 f3 8b call 0x117e6 ; 0x117e6 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 2372c: 11 23 and r17, r17 2372e: 09 f4 brne .+2 ; 0x23732 23730: 97 cf rjmp .-210 ; 0x23660 { //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); 23732: 00 ed ldi r16, 0xD0 ; 208 23734: 17 e0 ldi r17, 0x07 ; 7 23736: 21 e0 ldi r18, 0x01 ; 1 23738: 43 e0 ldi r20, 0x03 ; 3 2373a: 6f 2d mov r22, r15 2373c: 84 e0 ldi r24, 0x04 ; 4 2373e: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 23742: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 23744: 80 e0 ldi r24, 0x00 ; 0 23746: 0f 94 df 08 call 0x211be ; 0x211be } if (_result) 2374a: 88 23 and r24, r24 2374c: 09 f4 brne .+2 ; 0x23750 2374e: 88 cf rjmp .-240 ; 0x23660 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 23750: 10 e0 ldi r17, 0x00 ; 0 23752: 00 e0 ldi r16, 0x00 ; 0 23754: 21 e0 ldi r18, 0x01 ; 1 23756: 43 e0 ldi r20, 0x03 ; 3 23758: 6f 2d mov r22, r15 2375a: 84 e0 ldi r24, 0x04 ; 4 2375c: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 23760: 0c ed ldi r16, 0xDC ; 220 23762: 15 e0 ldi r17, 0x05 ; 5 23764: 21 e0 ldi r18, 0x01 ; 1 23766: 43 e0 ldi r20, 0x03 ; 3 23768: 68 2f mov r22, r24 2376a: 85 e0 ldi r24, 0x05 ; 5 2376c: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 23770: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 23772: 81 e0 ldi r24, 0x01 ; 1 23774: 0f 94 df 08 call 0x211be ; 0x211be #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 23778: 88 23 and r24, r24 2377a: 09 f4 brne .+2 ; 0x2377e 2377c: 71 cf rjmp .-286 ; 0x23660 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 2377e: 10 e0 ldi r17, 0x00 ; 0 23780: 00 e0 ldi r16, 0x00 ; 0 23782: 21 e0 ldi r18, 0x01 ; 1 23784: 43 e0 ldi r20, 0x03 ; 3 23786: 6f 2d mov r22, r15 23788: 86 e0 ldi r24, 0x06 ; 6 2378a: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 2378e: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 23790: 0f 94 34 3b call 0x27668 ; 0x27668 23794: 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); 23798: e0 e5 ldi r30, 0x50 ; 80 2379a: f2 e9 ldi r31, 0x92 ; 146 2379c: 85 91 lpm r24, Z+ 2379e: 95 91 lpm r25, Z+ 237a0: a5 91 lpm r26, Z+ 237a2: b4 91 lpm r27, Z 237a4: 80 93 40 07 sts 0x0740, r24 ; 0x800740 237a8: 90 93 41 07 sts 0x0741, r25 ; 0x800741 237ac: a0 93 42 07 sts 0x0742, r26 ; 0x800742 237b0: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 237b4: e4 e5 ldi r30, 0x54 ; 84 237b6: f2 e9 ldi r31, 0x92 ; 146 237b8: 65 91 lpm r22, Z+ 237ba: 75 91 lpm r23, Z+ 237bc: 85 91 lpm r24, Z+ 237be: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 237c0: 20 e0 ldi r18, 0x00 ; 0 237c2: 30 e0 ldi r19, 0x00 ; 0 237c4: 40 e8 ldi r20, 0x80 ; 128 237c6: 50 e4 ldi r21, 0x40 ; 64 237c8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 237cc: 60 93 44 07 sts 0x0744, r22 ; 0x800744 237d0: 70 93 45 07 sts 0x0745, r23 ; 0x800745 237d4: 80 93 46 07 sts 0x0746, r24 ; 0x800746 237d8: 90 93 47 07 sts 0x0747, r25 ; 0x800747 #endif //TMC2130 raise_z(10); 237dc: 60 e0 ldi r22, 0x00 ; 0 237de: 70 e0 ldi r23, 0x00 ; 0 237e0: 80 e2 ldi r24, 0x20 ; 32 237e2: 91 e4 ldi r25, 0x41 ; 65 237e4: 0e 94 a7 6e call 0xdd4e ; 0xdd4e set_destination_to_current(); 237e8: 0e 94 00 69 call 0xd200 ; 0xd200 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 237ec: 0c ed ldi r16, 0xDC ; 220 237ee: 15 e0 ldi r17, 0x05 ; 5 237f0: 21 e0 ldi r18, 0x01 ; 1 237f2: 43 e0 ldi r20, 0x03 ; 3 237f4: 6f 2d mov r22, r15 237f6: 86 e0 ldi r24, 0x06 ; 6 237f8: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 237fc: 50 e0 ldi r21, 0x00 ; 0 237fe: 40 e0 ldi r20, 0x00 ; 0 23800: 61 e0 ldi r22, 0x01 ; 1 23802: 82 e0 ldi r24, 0x02 ; 2 23804: 0e 94 07 7c call 0xf80e ; 0xf80e #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); 23808: 60 e0 ldi r22, 0x00 ; 0 2380a: 70 e0 ldi r23, 0x00 ; 0 2380c: 80 ea ldi r24, 0xA0 ; 160 2380e: 91 e4 ldi r25, 0x41 ; 65 23810: 0e 94 a7 6e call 0xdd4e ; 0xdd4e } #ifdef TMC2130 if (_result) { raise_z(10); 23814: 60 e0 ldi r22, 0x00 ; 0 23816: 70 e0 ldi r23, 0x00 ; 0 23818: 80 e2 ldi r24, 0x20 ; 32 2381a: 91 e4 ldi r25, 0x41 ; 65 2381c: 0e 94 a7 6e call 0xdd4e ; 0xdd4e _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 23820: 10 e0 ldi r17, 0x00 ; 0 23822: 00 e0 ldi r16, 0x00 ; 0 23824: 21 e0 ldi r18, 0x01 ; 1 23826: 42 e0 ldi r20, 0x02 ; 2 23828: 60 e0 ldi r22, 0x00 ; 0 2382a: 8e e0 ldi r24, 0x0E ; 14 2382c: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e bool bres = tmc2130_home_calibrate(X_AXIS); 23830: 80 e0 ldi r24, 0x00 ; 0 23832: 0f 94 26 38 call 0x2704c ; 0x2704c 23836: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 23838: 21 e0 ldi r18, 0x01 ; 1 2383a: 42 e0 ldi r20, 0x02 ; 2 2383c: 61 e0 ldi r22, 0x01 ; 1 2383e: 8e e0 ldi r24, 0x0E ; 14 23840: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e bres &= tmc2130_home_calibrate(Y_AXIS); 23844: 81 e0 ldi r24, 0x01 ; 1 23846: 0f 94 26 38 call 0x2704c ; 0x2704c 2384a: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 2384c: 21 e0 ldi r18, 0x01 ; 1 2384e: 42 e0 ldi r20, 0x02 ; 2 23850: 62 e0 ldi r22, 0x02 ; 2 23852: 8e e0 ldi r24, 0x0E ; 14 23854: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 23858: f8 2e mov r15, r24 if (bres) 2385a: ee 20 and r14, r14 2385c: 09 f4 brne .+2 ; 0x23860 2385e: 00 cf rjmp .-512 ; 0x23660 23860: 61 e0 ldi r22, 0x01 ; 1 23862: 88 ef ldi r24, 0xF8 ; 248 23864: 9e e0 ldi r25, 0x0E ; 14 23866: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 2386a: 00 ed ldi r16, 0xD0 ; 208 2386c: 17 e0 ldi r17, 0x07 ; 7 2386e: 21 e0 ldi r18, 0x01 ; 1 23870: 43 e0 ldi r20, 0x03 ; 3 23872: 6f 2d mov r22, r15 23874: 87 e0 ldi r24, 0x07 ; 7 23876: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 2387a: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 2387c: 81 e0 ldi r24, 0x01 ; 1 2387e: 0f 94 e1 07 call 0x20fc2 ; 0x20fc2 } if (_result) 23882: 88 23 and r24, r24 23884: 09 f4 brne .+2 ; 0x23888 23886: ec ce rjmp .-552 ; 0x23660 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 23888: 08 ee ldi r16, 0xE8 ; 232 2388a: 13 e0 ldi r17, 0x03 ; 3 2388c: 21 e0 ldi r18, 0x01 ; 1 2388e: 43 e0 ldi r20, 0x03 ; 3 23890: 6f 2d mov r22, r15 23892: 88 e0 ldi r24, 0x08 ; 8 23894: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 23898: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 2389a: 80 e0 ldi r24, 0x00 ; 0 2389c: 0f 94 e1 07 call 0x20fc2 ; 0x20fc2 238a0: e8 2e mov r14, r24 } if (_result) 238a2: 88 23 and r24, r24 238a4: 09 f4 brne .+2 ; 0x238a8 238a6: dc ce rjmp .-584 ; 0x23660 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 238a8: 00 ed ldi r16, 0xD0 ; 208 238aa: 17 e0 ldi r17, 0x07 ; 7 238ac: 21 e0 ldi r18, 0x01 ; 1 238ae: 43 e0 ldi r20, 0x03 ; 3 238b0: 6f 2d mov r22, r15 238b2: 89 e0 ldi r24, 0x09 ; 9 238b4: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 238b8: 90 91 95 13 lds r25, 0x1395 ; 0x801395 238bc: 91 30 cpi r25, 0x01 ; 1 238be: 79 f5 brne .+94 ; 0x2391e { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 238c0: 21 e0 ldi r18, 0x01 ; 1 238c2: 43 e0 ldi r20, 0x03 ; 3 238c4: 68 2f mov r22, r24 238c6: 8a e0 ldi r24, 0x0A ; 10 238c8: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e 238cc: 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); 238ce: 82 e1 ldi r24, 0x12 ; 18 238d0: 9f e3 ldi r25, 0x3F ; 63 238d2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 238d6: 70 e0 ldi r23, 0x00 ; 0 238d8: 60 e0 ldi r22, 0x00 ; 0 238da: 0e 94 ca d9 call 0x1b394 ; 0x1b394 238de: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 238e0: 10 e0 ldi r17, 0x00 ; 0 238e2: 00 e0 ldi r16, 0x00 ; 0 238e4: 21 e0 ldi r18, 0x01 ; 1 238e6: 41 e0 ldi r20, 0x01 ; 1 238e8: 60 e0 ldi r22, 0x00 ; 0 238ea: 8a e0 ldi r24, 0x0A ; 10 238ec: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 238f0: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 238f4: 10 92 6b 02 sts 0x026B, r1 ; 0x80026b // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 238f8: 8d 2d mov r24, r13 238fa: 0f 94 25 1a call 0x2344a ; 0x2344a MMU2::mmu2.unload(); //Unload filament 238fe: 0f 94 22 a0 call 0x34044 ; 0x34044 23902: 8f ea ldi r24, 0xAF ; 175 23904: 90 e0 ldi r25, 0x00 ; 0 23906: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 2390a: 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 2390e: 00 ed ldi r16, 0xD0 ; 208 23910: 17 e0 ldi r17, 0x07 ; 7 23912: 21 e0 ldi r18, 0x01 ; 1 23914: 43 e0 ldi r20, 0x03 ; 3 23916: 6f 2d mov r22, r15 23918: 8b e0 ldi r24, 0x0B ; 11 2391a: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 2391e: 08 e8 ldi r16, 0x88 ; 136 23920: 13 e1 ldi r17, 0x13 ; 19 23922: 21 e0 ldi r18, 0x01 ; 1 23924: 43 e0 ldi r20, 0x03 ; 3 23926: 68 2f mov r22, r24 23928: 8c e0 ldi r24, 0x0C ; 12 2392a: 0e 94 bf d5 call 0x1ab7e ; 0x1ab7e lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2392e: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 23932: 61 e0 ldi r22, 0x01 ; 1 23934: 81 eb ldi r24, 0xB1 ; 177 23936: 9b e6 ldi r25, 0x6B ; 107 23938: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_update_enable(true); 2393c: 81 e0 ldi r24, 0x01 ; 1 2393e: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 if (_result) 23942: ee 20 and r14, r14 23944: 71 f1 breq .+92 ; 0x239a2 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 23946: 81 e0 ldi r24, 0x01 ; 1 23948: 0e 94 3a e7 call 0x1ce74 ; 0x1ce74 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 2394c: 85 e2 ldi r24, 0x25 ; 37 2394e: 9f e3 ldi r25, 0x3F ; 63 23950: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 23954: 0f 94 be 0b call 0x2177c ; 0x2177c lcd_return_to_status(); 23958: 0f 94 23 27 call 0x24e46 ; 0x24e46 else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 2395c: 80 e0 ldi r24, 0x00 ; 0 2395e: 0e 94 76 67 call 0xceec ; 0xceec #endif // TMC2130 FORCE_BL_ON_END; 23962: 80 e0 ldi r24, 0x00 ; 0 23964: 0e 94 8d 8b call 0x1171a ; 0x1171a KEEPALIVE_STATE(NOT_BUSY); 23968: 81 e0 ldi r24, 0x01 ; 1 2396a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(_result); } 2396e: 8e 2d mov r24, r14 23970: 0f 90 pop r0 23972: 0f 90 pop r0 23974: 0f 90 pop r0 23976: 0f 90 pop r0 23978: df 91 pop r29 2397a: cf 91 pop r28 2397c: 1f 91 pop r17 2397e: 0f 91 pop r16 23980: ff 90 pop r15 23982: ef 90 pop r14 23984: df 90 pop r13 23986: cf 90 pop r12 23988: 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); 2398a: 61 e0 ldi r22, 0x01 ; 1 2398c: 80 e0 ldi r24, 0x00 ; 0 2398e: 0e 94 ac d0 call 0x1a158 ; 0x1a158 if (!_result){ 23992: 81 11 cpse r24, r1 23994: 86 ce rjmp .-756 ; 0x236a2 lcd_selftest_error(TestError::PrintFan, "", ""); 23996: 61 ef ldi r22, 0xF1 ; 241 23998: 72 e0 ldi r23, 0x02 ; 2 2399a: 85 e0 ldi r24, 0x05 ; 5 2399c: 6e ce rjmp .-804 ; 0x2367a #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 2399e: 11 e0 ldi r17, 0x01 ; 1 239a0: c0 ce rjmp .-640 ; 0x23722 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 239a2: 86 ef ldi r24, 0xF6 ; 246 239a4: 93 e4 ldi r25, 0x43 ; 67 239a6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 239aa: 62 e0 ldi r22, 0x02 ; 2 239ac: 0f 94 9b 06 call 0x20d36 ; 0x20d36 239b0: d5 cf rjmp .-86 ; 0x2395c 000239b2 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 239b2: 0d 94 4c 1a jmp 0x23498 ; 0x23498 000239b6 : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 239b6: cf 93 push r28 239b8: 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); 239ba: 8b ec ldi r24, 0xCB ; 203 239bc: 9a e3 ldi r25, 0x3A ; 58 239be: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 239c2: 6c 2f mov r22, r28 239c4: 0f 94 06 c2 call 0x3840c ; 0x3840c return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 239c8: 8c 2f mov r24, r28 239ca: 0f 94 25 1a call 0x2344a ; 0x2344a 239ce: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 planner_synchronize(); unload(); 239d2: 0f 94 22 a0 call 0x34044 ; 0x34044 ScreenUpdateEnable(); 239d6: 0f 94 03 c2 call 0x38406 ; 0x38406 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 239da: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 239dc: 0d 94 c4 36 jmp 0x26d88 ; 0x26d88 000239e0 : 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(){ 239e0: cf 93 push r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ 239e2: c0 e0 ldi r28, 0x00 ; 0 239e4: 8b ec ldi r24, 0xCB ; 203 239e6: 9a e3 ldi r25, 0x3A ; 58 239e8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 239ec: 6c 2f mov r22, r28 239ee: 0f 94 06 c2 call 0x3840c ; 0x3840c return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 239f2: 8c 2f mov r24, r28 239f4: 0f 94 25 1a call 0x2344a ; 0x2344a 239f8: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 planner_synchronize(); unload(); 239fc: 0f 94 22 a0 call 0x34044 ; 0x34044 ScreenUpdateEnable(); 23a00: 0f 94 03 c2 call 0x38406 ; 0x38406 23a04: cf 5f subi r28, 0xFF ; 255 23a06: c5 30 cpi r28, 0x05 ; 5 23a08: 69 f7 brne .-38 ; 0x239e4 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 23a0a: cf 91 pop r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 23a0c: 0d 94 c4 36 jmp 0x26d88 ; 0x26d88 00023a10 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 23a10: cf 93 push r28 23a12: df 93 push r29 23a14: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 23a16: 0f 94 0b 88 call 0x31016 ; 0x31016 23a1a: c8 2f mov r28, r24 23a1c: 88 23 and r24, r24 23a1e: 69 f1 breq .+90 ; 0x23a7a safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 23a20: 88 ec ldi r24, 0xC8 ; 200 23a22: 90 e0 ldi r25, 0x00 ; 0 23a24: 0f 94 62 c6 call 0x38cc4 ; 0x38cc4 (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); 23a28: 82 e0 ldi r24, 0x02 ; 2 23a2a: 0f 94 34 64 call 0x2c868 ; 0x2c868 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 23a2e: 80 eb ldi r24, 0xB0 ; 176 23a30: 9c e5 ldi r25, 0x5C ; 92 23a32: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 23a36: 6d 2f mov r22, r29 23a38: 0f 94 06 c2 call 0x3840c ; 0x3840c struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 23a3c: 0f 94 7f 87 call 0x30efe ; 0x30efe eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23a40: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 23a44: 10 92 86 17 sts 0x1786, r1 ; 0x801786 { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 23a48: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 23a4c: 83 36 cpi r24, 0x63 ; 99 23a4e: 29 f0 breq .+10 ; 0x23a5a return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 23a50: 62 e1 ldi r22, 0x12 ; 18 23a52: 86 ea ldi r24, 0xA6 ; 166 23a54: 95 ea ldi r25, 0xA5 ; 165 23a56: 0f 94 e2 87 call 0x30fc4 ; 0x30fc4 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 23a5a: 8d 2f mov r24, r29 23a5c: 0f 94 cd 18 call 0x2319a ; 0x2319a // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 23a60: 0e 94 6d d1 call 0x1a2da ; 0x1a2da 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); 23a64: 83 e0 ldi r24, 0x03 ; 3 23a66: 0f 94 34 64 call 0x2c868 ; 0x2c868 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 23a6a: 85 e8 ldi r24, 0x85 ; 133 23a6c: 97 e1 ldi r25, 0x17 ; 23 23a6e: 0e 94 95 75 call 0xeb2a ; 0xeb2a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 23a72: 0f 94 00 88 call 0x31000 ; 0x31000 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 23a76: 0f 94 03 c2 call 0x38406 ; 0x38406 return true; } 23a7a: 8c 2f mov r24, r28 23a7c: df 91 pop r29 23a7e: cf 91 pop r28 23a80: 08 95 ret 00023a82 : /// 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) { 23a82: 1f 93 push r17 23a84: cf 93 push r28 23a86: df 93 push r29 23a88: c8 2f mov r28, r24 23a8a: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 23a8c: 0f 94 0b 88 call 0x31016 ; 0x31016 23a90: d8 2f mov r29, r24 23a92: 88 23 and r24, r24 23a94: a9 f0 breq .+42 ; 0x23ac0 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23a96: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 23a9a: 10 92 86 17 sts 0x1786, r1 ; 0x801786 return false; } FSensorBlockRunout blockRunout; switch (code) { 23a9e: c3 36 cpi r28, 0x63 ; 99 23aa0: 11 f1 breq .+68 ; 0x23ae6 23aa2: c8 37 cpi r28, 0x78 ; 120 23aa4: 91 f0 breq .+36 ; 0x23aca 23aa6: cf 33 cpi r28, 0x3F ; 63 23aa8: 39 f4 brne .+14 ; 0x23ab8 case '?': { waitForHotendTargetTemp(100, [] {}); 23aaa: 84 e6 ldi r24, 0x64 ; 100 23aac: 90 e0 ldi r25, 0x00 ; 0 23aae: 0f 94 62 c6 call 0x38cc4 ; 0x38cc4 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> load_filament_to_nozzle(slot); 23ab2: 81 2f mov r24, r17 23ab4: 0f 94 08 1d call 0x23a10 ; 0x23a10 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 23ab8: 85 e8 ldi r24, 0x85 ; 133 23aba: 97 e1 ldi r25, 0x17 ; 23 23abc: 0e 94 95 75 call 0xeb2a ; 0xeb2a execute_load_to_nozzle_sequence(); } break; } return true; } 23ac0: 8d 2f mov r24, r29 23ac2: df 91 pop r29 23ac4: cf 91 pop r28 23ac6: 1f 91 pop r17 23ac8: 08 95 ret 23aca: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 23ace: 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); 23ad2: 81 2f mov r24, r17 23ad4: 0f 94 25 1a call 0x2344a ; 0x2344a 23ad8: 8f ea ldi r24, 0xAF ; 175 23ada: 90 e0 ldi r25, 0x00 ; 0 23adc: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 23ae0: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 23ae4: e9 cf rjmp .-46 ; 0x23ab8 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 23ae6: 84 e6 ldi r24, 0x64 ; 100 23ae8: 90 e0 ldi r25, 0x00 ; 0 23aea: 0f 94 62 c6 call 0x38cc4 ; 0x38cc4 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> execute_load_to_nozzle_sequence(); 23aee: 0e 94 6d d1 call 0x1a2da ; 0x1a2da 23af2: e2 cf rjmp .-60 ; 0x23ab8 00023af4 : 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); 23af4: 0f 94 08 1d call 0x23a10 ; 0x23a10 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 23af8: 0e 94 59 65 call 0xcab2 ; 0xcab2 st_synchronize(); 23afc: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // Ask user if the extruded color is correct: lcd_return_to_status(); 23b00: 0f 94 23 27 call 0x24e46 ; 0x24e46 lcd_load_filament_color_check(); 23b04: 0f 94 6c 68 call 0x2d0d8 ; 0x2d0d8 lcd_setstatuspgm(MSG_WELCOME); 23b08: 8d ea ldi r24, 0xAD ; 173 23b0a: 90 e7 ldi r25, 0x70 ; 112 23b0c: 0f 94 be 0b call 0x2177c ; 0x2177c custom_message_type = CustomMsg::Status; 23b10: 10 92 72 07 sts 0x0772, r1 ; 0x800772 // Clear the filament action clearFilamentAction(); 23b14: 0d 94 c4 36 jmp 0x26d88 ; 0x26d88 00023b18 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 23b18: cf 93 push r28 23b1a: df 93 push r29 23b1c: 00 d0 rcall .+0 ; 0x23b1e 23b1e: 1f 92 push r1 23b20: 1f 92 push r1 23b22: cd b7 in r28, 0x3d ; 61 23b24: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 23b26: 48 2f mov r20, r24 23b28: 68 e5 ldi r22, 0x58 ; 88 23b2a: ce 01 movw r24, r28 23b2c: 01 96 adiw r24, 0x01 ; 1 23b2e: 0f 94 c1 c2 call 0x38582 ; 0x38582 23b32: 49 81 ldd r20, Y+1 ; 0x01 23b34: 5a 81 ldd r21, Y+2 ; 0x02 23b36: 6b 81 ldd r22, Y+3 ; 0x03 23b38: 7c 81 ldd r23, Y+4 ; 0x04 23b3a: 8d 81 ldd r24, Y+5 ; 0x05 23b3c: 0f 94 33 98 call 0x33066 ; 0x33066 } 23b40: 0f 90 pop r0 23b42: 0f 90 pop r0 23b44: 0f 90 pop r0 23b46: 0f 90 pop r0 23b48: 0f 90 pop r0 23b4a: df 91 pop r29 23b4c: cf 91 pop r28 23b4e: 08 95 ret 00023b50 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 23b50: 1f 93 push r17 23b52: cf 93 push r28 23b54: df 93 push r29 23b56: 00 d0 rcall .+0 ; 0x23b58 23b58: 1f 92 push r1 23b5a: 1f 92 push r1 23b5c: cd b7 in r28, 0x3d ; 61 23b5e: de b7 in r29, 0x3e ; 62 23b60: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 23b62: 0f 94 0b 88 call 0x31016 ; 0x31016 23b66: 88 23 and r24, r24 23b68: d9 f0 breq .+54 ; 0x23ba0 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 23b6a: 41 2f mov r20, r17 23b6c: 62 e5 ldi r22, 0x52 ; 82 23b6e: ce 01 movw r24, r28 23b70: 01 96 adiw r24, 0x01 ; 1 23b72: 0f 94 c1 c2 call 0x38582 ; 0x38582 23b76: 49 81 ldd r20, Y+1 ; 0x01 23b78: 5a 81 ldd r21, Y+2 ; 0x02 23b7a: 6b 81 ldd r22, Y+3 ; 0x03 23b7c: 7c 81 ldd r23, Y+4 ; 0x04 23b7e: 8d 81 ldd r24, Y+5 ; 0x05 23b80: 0f 94 33 98 call 0x33066 ; 0x33066 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)); 23b84: 60 e0 ldi r22, 0x00 ; 0 23b86: 80 e0 ldi r24, 0x00 ; 0 23b88: 0f 94 57 9f call 0x33eae ; 0x33eae 23b8c: 88 23 and r24, r24 23b8e: 69 f3 breq .-38 ; 0x23b6a // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 23b90: 20 91 41 13 lds r18, 0x1341 ; 0x801341 23b94: 30 91 42 13 lds r19, 0x1342 ; 0x801342 23b98: 30 93 92 13 sts 0x1392, r19 ; 0x801392 23b9c: 20 93 91 13 sts 0x1391, r18 ; 0x801391 return true; } 23ba0: 0f 90 pop r0 23ba2: 0f 90 pop r0 23ba4: 0f 90 pop r0 23ba6: 0f 90 pop r0 23ba8: 0f 90 pop r0 23baa: df 91 pop r29 23bac: cf 91 pop r28 23bae: 1f 91 pop r17 23bb0: 08 95 ret 00023bb2 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 23bb2: ff 92 push r15 23bb4: 0f 93 push r16 23bb6: 1f 93 push r17 23bb8: cf 93 push r28 23bba: df 93 push r29 23bbc: 1f 92 push r1 23bbe: cd b7 in r28, 0x3d ; 61 23bc0: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 23bc2: ce 01 movw r24, r28 23bc4: 01 96 adiw r24, 0x01 ; 1 23bc6: 0f 94 ae 47 call 0x28f5c ; 0x28f5c uint16_t pos = 0; 23bca: 10 e0 ldi r17, 0x00 ; 0 23bcc: 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]; 23bce: 85 e0 ldi r24, 0x05 ; 5 23bd0: 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()) { 23bd2: d1 99 sbic 0x1a, 1 ; 26 23bd4: 11 c0 rjmp .+34 ; 0x23bf8 // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 23bd6: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 23bda: 0e 3d cpi r16, 0xDE ; 222 23bdc: 11 05 cpc r17, r1 23bde: c9 f7 brne .-14 ; 0x23bd2 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 23be0: ce 01 movw r24, r28 23be2: 01 96 adiw r24, 0x01 ; 1 23be4: 0f 94 a1 47 call 0x28f42 ; 0x28f42 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 23be8: c8 01 movw r24, r16 23bea: 0f 90 pop r0 23bec: df 91 pop r29 23bee: cf 91 pop r28 23bf0: 1f 91 pop r17 23bf2: 0f 91 pop r16 23bf4: ff 90 pop r15 23bf6: 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(); 23bf8: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 23bfa: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.471> 23bfe: 88 23 and r24, r24 23c00: 61 f3 breq .-40 ; 0x23bda adc_values_ready = false; 23c02: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.471> adc_start_cycle(); 23c06: 0e 94 95 8f call 0x11f2a ; 0x11f2a temp_mgr_isr(); 23c0a: 0f 94 c9 4b call 0x29792 ; 0x29792 // stop recording for an hard error condition if(temp_error_state.v) 23c0e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 23c12: 81 11 cpse r24, r1 23c14: 1b c0 rjmp .+54 ; 0x23c4c return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 23c16: f0 9e mul r15, r16 23c18: f0 01 movw r30, r0 23c1a: f1 9e mul r15, r17 23c1c: f0 0d add r31, r0 23c1e: 11 24 eor r1, r1 23c20: ed 58 subi r30, 0x8D ; 141 23c22: f8 4f sbci r31, 0xF8 ; 248 entry.temp = current_temperature_isr[0]; 23c24: 80 91 17 05 lds r24, 0x0517 ; 0x800517 23c28: 90 91 18 05 lds r25, 0x0518 ; 0x800518 23c2c: a0 91 19 05 lds r26, 0x0519 ; 0x800519 23c30: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 23c34: 80 83 st Z, r24 23c36: 91 83 std Z+1, r25 ; 0x01 23c38: a2 83 std Z+2, r26 ; 0x02 23c3a: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 23c3c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 23c40: 84 83 std Z+4, r24 ; 0x04 ++pos; 23c42: 0f 5f subi r16, 0xFF ; 255 23c44: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 23c46: 0f 94 94 50 call 0x2a128 ; 0x2a128 23c4a: c7 cf rjmp .-114 ; 0x23bda adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 23c4c: 10 e0 ldi r17, 0x00 ; 0 23c4e: 00 e0 ldi r16, 0x00 ; 0 23c50: c7 cf rjmp .-114 ; 0x23be0 00023c52 : 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) { 23c52: fc 01 movw r30, r24 switch(*oCheckSetting) { 23c54: 80 81 ld r24, Z 23c56: 88 23 and r24, r24 23c58: 21 f0 breq .+8 ; 0x23c62 23c5a: 81 30 cpi r24, 0x01 ; 1 23c5c: 29 f4 brne .+10 ; 0x23c68 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23c5e: 82 e0 ldi r24, 0x02 ; 2 23c60: 01 c0 rjmp .+2 ; 0x23c64 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 23c62: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23c64: 80 83 st Z, r24 23c66: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 23c68: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 23c6a: 08 95 ret 00023c6c : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 23c6c: fc 01 movw r30, r24 23c6e: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 23c70: 90 32 cpi r25, 0x20 ; 32 23c72: 49 f0 breq .+18 ; 0x23c86 23c74: 87 ef ldi r24, 0xF7 ; 247 23c76: 89 0f add r24, r25 23c78: 82 30 cpi r24, 0x02 ; 2 23c7a: 28 f0 brcs .+10 ; 0x23c86 23c7c: 81 e0 ldi r24, 0x01 ; 1 23c7e: 9d 30 cpi r25, 0x0D ; 13 23c80: 19 f0 breq .+6 ; 0x23c88 23c82: 80 e0 ldi r24, 0x00 ; 0 23c84: 08 95 ret 23c86: 81 e0 ldi r24, 0x01 ; 1 } 23c88: 08 95 ret 00023c8a : 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; 23c8a: 88 3e cpi r24, 0xE8 ; 232 23c8c: 23 e0 ldi r18, 0x03 ; 3 23c8e: 92 07 cpc r25, r18 23c90: 10 f0 brcs .+4 ; 0x23c96 23c92: 87 ee ldi r24, 0xE7 ; 231 23c94: 93 e0 ldi r25, 0x03 ; 3 } 23c96: 08 95 ret 00023c98 : return 0; } static int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 23c98: 90 91 21 05 lds r25, 0x0521 ; 0x800521 23c9c: 80 91 20 05 lds r24, 0x0520 ; 0x800520 23ca0: 2f ef ldi r18, 0xFF ; 255 23ca2: 3f ef ldi r19, 0xFF ; 255 23ca4: 89 17 cp r24, r25 23ca6: 71 f0 breq .+28 ; 0x23cc4 _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 23ca8: e9 2f mov r30, r25 23caa: f0 e0 ldi r31, 0x00 ; 0 23cac: ed 5d subi r30, 0xDD ; 221 23cae: fa 4f sbci r31, 0xFA ; 250 23cb0: 20 81 ld r18, Z 23cb2: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 23cb4: 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 23cb6: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 23cba: 98 17 cp r25, r24 23cbc: 08 f0 brcs .+2 ; 0x23cc0 23cbe: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 23cc0: 90 93 21 05 sts 0x0521, r25 ; 0x800521 return rbuf_get(uart2_ibuf); } 23cc4: c9 01 movw r24, r18 23cc6: 08 95 ret 00023cc8 : uint8_t uart2_ibuf[20] = {0, 0}; FILE _uart2io; static int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 23cc8: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 23ccc: 95 ff sbrs r25, 5 23cce: fc cf rjmp .-8 ; 0x23cc8 UDR2 = c; // transmit byte 23cd0: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> return 0; } 23cd4: 90 e0 ldi r25, 0x00 ; 0 23cd6: 80 e0 ldi r24, 0x00 ; 0 23cd8: 08 95 ret 00023cda : } 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) { 23cda: cf 92 push r12 23cdc: df 92 push r13 23cde: ef 92 push r14 23ce0: ff 92 push r15 23ce2: 0f 93 push r16 23ce4: 1f 93 push r17 23ce6: cf 93 push r28 23ce8: df 93 push r29 23cea: 8c 01 movw r16, r24 23cec: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23cee: 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; 23cf0: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 23cf2: 61 50 subi r22, 0x01 ; 1 23cf4: 77 0b sbc r23, r23 23cf6: 29 2f mov r18, r25 23cf8: 30 e0 ldi r19, 0x00 ; 0 23cfa: 26 17 cp r18, r22 23cfc: 37 07 cpc r19, r23 23cfe: 2c f0 brlt .+10 ; 0x23d0a } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 23d00: 55 23 and r21, r21 23d02: 19 f1 breq .+70 ; 0x23d4a { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23d04: 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; 23d06: 50 e0 ldi r21, 0x00 ; 0 23d08: f6 cf rjmp .-20 ; 0x23cf6 for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 23d0a: 78 01 movw r14, r16 23d0c: e2 0e add r14, r18 23d0e: f3 1e adc r15, r19 23d10: f7 01 movw r30, r14 23d12: 80 81 ld r24, Z 23d14: d9 01 movw r26, r18 23d16: 11 96 adiw r26, 0x01 ; 1 23d18: 68 01 movw r12, r16 23d1a: ca 0e add r12, r26 23d1c: db 1e adc r13, r27 23d1e: f6 01 movw r30, r12 23d20: 40 81 ld r20, Z 23d22: 48 17 cp r20, r24 23d24: 80 f4 brcc .+32 ; 0x23d46 { uint8_t d = data[i]; data[i] = data[i+1]; 23d26: f7 01 movw r30, r14 23d28: 40 83 st Z, r20 data[i+1] = d; 23d2a: f6 01 movw r30, r12 23d2c: 80 83 st Z, r24 if (data2) 23d2e: 20 97 sbiw r28, 0x00 ; 0 23d30: 49 f0 breq .+18 ; 0x23d44 { d = data2[i]; 23d32: fe 01 movw r30, r28 23d34: e2 0f add r30, r18 23d36: f3 1f adc r31, r19 23d38: 80 81 ld r24, Z data2[i] = data2[i+1]; 23d3a: ac 0f add r26, r28 23d3c: bd 1f adc r27, r29 23d3e: 2c 91 ld r18, X 23d40: 20 83 st Z, r18 data2[i+1] = d; 23d42: 8c 93 st X, r24 } changed = 1; 23d44: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23d46: 9f 5f subi r25, 0xFF ; 255 23d48: d6 cf rjmp .-84 ; 0x23cf6 data2[i+1] = d; } changed = 1; } } } 23d4a: df 91 pop r29 23d4c: cf 91 pop r28 23d4e: 1f 91 pop r17 23d50: 0f 91 pop r16 23d52: ff 90 pop r15 23d54: ef 90 pop r14 23d56: df 90 pop r13 23d58: cf 90 pop r12 23d5a: 08 95 ret 00023d5c : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 23d5c: 81 30 cpi r24, 0x01 ; 1 23d5e: 41 f0 breq .+16 ; 0x23d70 23d60: 28 f0 brcs .+10 ; 0x23d6c 23d62: 82 30 cpi r24, 0x02 ; 2 23d64: 39 f0 breq .+14 ; 0x23d74 23d66: 83 30 cpi r24, 0x03 ; 3 23d68: 71 f0 breq .+28 ; 0x23d86 23d6a: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 23d6c: a0 9a sbi 0x14, 0 ; 20 23d6e: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 23d70: a2 9a sbi 0x14, 2 ; 20 23d72: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 23d74: 9f b7 in r25, 0x3f ; 63 23d76: f8 94 cli 23d78: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23d7c: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 23d7e: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23d82: 9f bf out 0x3f, r25 ; 63 } } 23d84: 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; 23d86: 9f b7 in r25, 0x3f ; 63 23d88: f8 94 cli 23d8a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23d8e: 80 61 ori r24, 0x10 ; 16 23d90: f6 cf rjmp .-20 ; 0x23d7e 00023d92 : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 23d92: 81 30 cpi r24, 0x01 ; 1 23d94: 41 f0 breq .+16 ; 0x23da6 23d96: 28 f0 brcs .+10 ; 0x23da2 23d98: 82 30 cpi r24, 0x02 ; 2 23d9a: 39 f0 breq .+14 ; 0x23daa 23d9c: 83 30 cpi r24, 0x03 ; 3 23d9e: 71 f0 breq .+28 ; 0x23dbc 23da0: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 23da2: a0 98 cbi 0x14, 0 ; 20 23da4: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 23da6: a2 98 cbi 0x14, 2 ; 20 23da8: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 23daa: 9f b7 in r25, 0x3f ; 63 23dac: f8 94 cli 23dae: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23db2: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 23db4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23db8: 9f bf out 0x3f, r25 ; 63 } } 23dba: 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; 23dbc: 9f b7 in r25, 0x3f ; 63 23dbe: f8 94 cli 23dc0: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23dc4: 8f 7e andi r24, 0xEF ; 239 23dc6: f6 cf rjmp .-20 ; 0x23db4 00023dc8 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 23dc8: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 23dca: 0d b4 in r0, 0x2d ; 45 23dcc: 07 fe sbrs r0, 7 23dce: fd cf rjmp .-6 ; 0x23dca return SPDR; 23dd0: 8e b5 in r24, 0x2e ; 46 } 23dd2: 08 95 ret 00023dd4 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 23dd4: 2f 92 push r2 23dd6: 3f 92 push r3 23dd8: 4f 92 push r4 23dda: 5f 92 push r5 23ddc: 6f 92 push r6 23dde: 7f 92 push r7 23de0: 8f 92 push r8 23de2: 9f 92 push r9 23de4: af 92 push r10 23de6: bf 92 push r11 23de8: cf 92 push r12 23dea: df 92 push r13 23dec: ef 92 push r14 23dee: ff 92 push r15 23df0: 0f 93 push r16 23df2: 1f 93 push r17 23df4: cf 93 push r28 23df6: df 93 push r29 23df8: cd b7 in r28, 0x3d ; 61 23dfa: de b7 in r29, 0x3e ; 62 23dfc: 2e 97 sbiw r28, 0x0e ; 14 23dfe: 0f b6 in r0, 0x3f ; 63 23e00: f8 94 cli 23e02: de bf out 0x3e, r29 ; 62 23e04: 0f be out 0x3f, r0 ; 63 23e06: 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]); 23e08: 20 90 18 06 lds r2, 0x0618 ; 0x800618 23e0c: 30 90 19 06 lds r3, 0x0619 ; 0x800619 23e10: 40 90 17 05 lds r4, 0x0517 ; 0x800517 23e14: 50 90 18 05 lds r5, 0x0518 ; 0x800518 23e18: 60 90 19 05 lds r6, 0x0519 ; 0x800519 23e1c: 70 90 1a 05 lds r7, 0x051A ; 0x80051a #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 23e20: 21 14 cp r2, r1 23e22: 31 04 cpc r3, r1 23e24: 39 f4 brne .+14 ; 0x23e34 pid_output = 0; pid_reset[e] = true; 23e26: 81 e0 ldi r24, 0x01 ; 1 23e28: 80 93 ef 05 sts 0x05EF, r24 ; 0x8005ef if (pid_output > PID_MAX) { if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration pid_output=PID_MAX; } else if (pid_output < 0) { if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration pid_output=0; 23e2c: 81 2c mov r8, r1 23e2e: 91 2c mov r9, r1 23e30: 54 01 movw r10, r8 23e32: f9 c0 rjmp .+498 ; 0x24026 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 23e34: b1 01 movw r22, r2 23e36: 03 2c mov r0, r3 23e38: 00 0c add r0, r0 23e3a: 88 0b sbc r24, r24 23e3c: 99 0b sbc r25, r25 23e3e: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 23e42: a3 01 movw r20, r6 23e44: 92 01 movw r18, r4 23e46: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 23e4a: 6b 01 movw r12, r22 23e4c: 7c 01 movw r14, r24 if(pid_reset[e]) { 23e4e: 80 91 ef 05 lds r24, 0x05EF ; 0x8005ef 23e52: 88 23 and r24, r24 23e54: 91 f0 breq .+36 ; 0x23e7a iState_sum[e] = 0.0; 23e56: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb 23e5a: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec 23e5e: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 23e62: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 23e66: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 23e6a: 10 92 e8 05 sts 0x05E8, r1 ; 0x8005e8 23e6e: 10 92 e9 05 sts 0x05E9, r1 ; 0x8005e9 23e72: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea pid_reset[e] = false; 23e76: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 23e7a: 20 91 d3 06 lds r18, 0x06D3 ; 0x8006d3 23e7e: 30 91 d4 06 lds r19, 0x06D4 ; 0x8006d4 23e82: 40 91 d5 06 lds r20, 0x06D5 ; 0x8006d5 23e86: 50 91 d6 06 lds r21, 0x06D6 ; 0x8006d6 23e8a: c7 01 movw r24, r14 23e8c: b6 01 movw r22, r12 23e8e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 23e92: 69 83 std Y+1, r22 ; 0x01 23e94: 7a 83 std Y+2, r23 ; 0x02 23e96: 8b 83 std Y+3, r24 ; 0x03 23e98: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 23e9a: 20 91 eb 05 lds r18, 0x05EB ; 0x8005eb 23e9e: 30 91 ec 05 lds r19, 0x05EC ; 0x8005ec 23ea2: 40 91 ed 05 lds r20, 0x05ED ; 0x8005ed 23ea6: 50 91 ee 05 lds r21, 0x05EE ; 0x8005ee 23eaa: c7 01 movw r24, r14 23eac: b6 01 movw r22, r12 23eae: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 23eb2: 4b 01 movw r8, r22 23eb4: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 23eb6: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa <_ZL14iState_sum_min.lto_priv.482> 23eba: 2d 87 std Y+13, r18 ; 0x0d 23ebc: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab <_ZL14iState_sum_min.lto_priv.482+0x1> 23ec0: 39 87 std Y+9, r19 ; 0x09 23ec2: 10 91 ac 04 lds r17, 0x04AC ; 0x8004ac <_ZL14iState_sum_min.lto_priv.482+0x2> 23ec6: 00 91 ad 04 lds r16, 0x04AD ; 0x8004ad <_ZL14iState_sum_min.lto_priv.482+0x3> 23eca: 41 2f mov r20, r17 23ecc: 50 2f mov r21, r16 23ece: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 23ed2: 87 fd sbrc r24, 7 23ed4: 17 c0 rjmp .+46 ; 0x23f04 23ed6: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 <_ZL14iState_sum_max.lto_priv.483> 23eda: 8d 87 std Y+13, r24 ; 0x0d 23edc: 90 91 a7 04 lds r25, 0x04A7 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.483+0x1> 23ee0: 99 87 std Y+9, r25 ; 0x09 23ee2: 10 91 a8 04 lds r17, 0x04A8 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.483+0x2> 23ee6: 00 91 a9 04 lds r16, 0x04A9 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.483+0x3> 23eea: 9c 01 movw r18, r24 23eec: 41 2f mov r20, r17 23eee: 50 2f mov r21, r16 23ef0: b4 01 movw r22, r8 23ef2: c5 01 movw r24, r10 23ef4: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 23ef8: 18 16 cp r1, r24 23efa: 24 f0 brlt .+8 ; 0x23f04 23efc: 8d 86 std Y+13, r8 ; 0x0d 23efe: 99 86 std Y+9, r9 ; 0x09 23f00: 1a 2d mov r17, r10 23f02: 0b 2d mov r16, r11 23f04: 8d 85 ldd r24, Y+13 ; 0x0d 23f06: 99 85 ldd r25, Y+9 ; 0x09 23f08: a1 2f mov r26, r17 23f0a: b0 2f mov r27, r16 23f0c: 80 93 eb 05 sts 0x05EB, r24 ; 0x8005eb 23f10: 90 93 ec 05 sts 0x05EC, r25 ; 0x8005ec 23f14: a0 93 ed 05 sts 0x05ED, r26 ; 0x8005ed 23f18: b0 93 ee 05 sts 0x05EE, r27 ; 0x8005ee iTerm[e] = cs.Ki * iState_sum[e]; 23f1c: 20 91 d7 06 lds r18, 0x06D7 ; 0x8006d7 23f20: 30 91 d8 06 lds r19, 0x06D8 ; 0x8006d8 23f24: 40 91 d9 06 lds r20, 0x06D9 ; 0x8006d9 23f28: 50 91 da 06 lds r21, 0x06DA ; 0x8006da 23f2c: bc 01 movw r22, r24 23f2e: 81 2f mov r24, r17 23f30: 90 2f mov r25, r16 23f32: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 23f36: 6d 83 std Y+5, r22 ; 0x05 23f38: 7e 83 std Y+6, r23 ; 0x06 23f3a: 8f 83 std Y+7, r24 ; 0x07 23f3c: 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 23f3e: 20 91 e3 05 lds r18, 0x05E3 ; 0x8005e3 23f42: 30 91 e4 05 lds r19, 0x05E4 ; 0x8005e4 23f46: 40 91 e5 05 lds r20, 0x05E5 ; 0x8005e5 23f4a: 50 91 e6 05 lds r21, 0x05E6 ; 0x8005e6 23f4e: c3 01 movw r24, r6 23f50: b2 01 movw r22, r4 23f52: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 23f56: 20 91 db 06 lds r18, 0x06DB ; 0x8006db 23f5a: 30 91 dc 06 lds r19, 0x06DC ; 0x8006dc 23f5e: 40 91 dd 06 lds r20, 0x06DD ; 0x8006dd 23f62: 50 91 de 06 lds r21, 0x06DE ; 0x8006de 23f66: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 23f6a: 20 ed ldi r18, 0xD0 ; 208 23f6c: 3c ec ldi r19, 0xCC ; 204 23f6e: 4c e4 ldi r20, 0x4C ; 76 23f70: 5d e3 ldi r21, 0x3D ; 61 23f72: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 23f76: 4b 01 movw r8, r22 23f78: 5c 01 movw r10, r24 23f7a: 23 e3 ldi r18, 0x33 ; 51 23f7c: 33 e3 ldi r19, 0x33 ; 51 23f7e: 43 e7 ldi r20, 0x73 ; 115 23f80: 5f e3 ldi r21, 0x3F ; 63 23f82: 60 91 e7 05 lds r22, 0x05E7 ; 0x8005e7 23f86: 70 91 e8 05 lds r23, 0x05E8 ; 0x8005e8 23f8a: 80 91 e9 05 lds r24, 0x05E9 ; 0x8005e9 23f8e: 90 91 ea 05 lds r25, 0x05EA ; 0x8005ea 23f92: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 23f96: 9b 01 movw r18, r22 23f98: ac 01 movw r20, r24 23f9a: c5 01 movw r24, r10 23f9c: b4 01 movw r22, r8 23f9e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 23fa2: 4b 01 movw r8, r22 23fa4: 5c 01 movw r10, r24 23fa6: 80 92 e7 05 sts 0x05E7, r8 ; 0x8005e7 23faa: 90 92 e8 05 sts 0x05E8, r9 ; 0x8005e8 23fae: a0 92 e9 05 sts 0x05E9, r10 ; 0x8005e9 23fb2: b0 92 ea 05 sts 0x05EA, r11 ; 0x8005ea pid_output = pTerm[e] + iTerm[e] - dTerm[e]; // subtraction due to "Derivative on Measurement" method (i.e. derivative of input instead derivative of error is used) 23fb6: 2d 81 ldd r18, Y+5 ; 0x05 23fb8: 3e 81 ldd r19, Y+6 ; 0x06 23fba: 4f 81 ldd r20, Y+7 ; 0x07 23fbc: 58 85 ldd r21, Y+8 ; 0x08 23fbe: 69 81 ldd r22, Y+1 ; 0x01 23fc0: 7a 81 ldd r23, Y+2 ; 0x02 23fc2: 8b 81 ldd r24, Y+3 ; 0x03 23fc4: 9c 81 ldd r25, Y+4 ; 0x04 23fc6: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 23fca: a5 01 movw r20, r10 23fcc: 94 01 movw r18, r8 23fce: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 23fd2: 4b 01 movw r8, r22 23fd4: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 23fd6: 20 e0 ldi r18, 0x00 ; 0 23fd8: 30 e0 ldi r19, 0x00 ; 0 23fda: 4f e7 ldi r20, 0x7F ; 127 23fdc: 53 e4 ldi r21, 0x43 ; 67 23fde: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 23fe2: 20 e0 ldi r18, 0x00 ; 0 23fe4: 30 e0 ldi r19, 0x00 ; 0 23fe6: 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) { 23fe8: 18 16 cp r1, r24 23fea: 0c f0 brlt .+2 ; 0x23fee 23fec: 6d c1 rjmp .+730 ; 0x242c8 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 23fee: c7 01 movw r24, r14 23ff0: b6 01 movw r22, r12 23ff2: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 23ff6: 18 16 cp r1, r24 23ff8: 84 f4 brge .+32 ; 0x2401a 23ffa: a7 01 movw r20, r14 23ffc: 96 01 movw r18, r12 23ffe: 6d 85 ldd r22, Y+13 ; 0x0d 24000: 79 85 ldd r23, Y+9 ; 0x09 24002: 81 2f mov r24, r17 24004: 90 2f mov r25, r16 24006: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 2400a: 60 93 eb 05 sts 0x05EB, r22 ; 0x8005eb 2400e: 70 93 ec 05 sts 0x05EC, r23 ; 0x8005ec 24012: 80 93 ed 05 sts 0x05ED, r24 ; 0x8005ed 24016: 90 93 ee 05 sts 0x05EE, r25 ; 0x8005ee pid_output=PID_MAX; 2401a: 81 2c mov r8, r1 2401c: 91 2c mov r9, r1 2401e: 3f e7 ldi r19, 0x7F ; 127 24020: a3 2e mov r10, r19 24022: 33 e4 ldi r19, 0x43 ; 67 24024: 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; 24026: 40 92 e3 05 sts 0x05E3, r4 ; 0x8005e3 2402a: 50 92 e4 05 sts 0x05E4, r5 ; 0x8005e4 2402e: 60 92 e5 05 sts 0x05E5, r6 ; 0x8005e5 24032: 70 92 e6 05 sts 0x05E6, r7 ; 0x8005e6 pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 24036: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.484> 2403a: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.484+0x1> 2403e: 07 2e mov r0, r23 24040: 00 0c add r0, r0 24042: 88 0b sbc r24, r24 24044: 99 0b sbc r25, r25 24046: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 2404a: 9b 01 movw r18, r22 2404c: ac 01 movw r20, r24 2404e: c3 01 movw r24, r6 24050: b2 01 movw r22, r4 24052: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 24056: 87 ff sbrs r24, 7 24058: 57 c1 rjmp .+686 ; 0x24308 2405a: 23 28 or r2, r3 2405c: 09 f4 brne .+2 ; 0x24060 2405e: 54 c1 rjmp .+680 ; 0x24308 soft_pwm[e] = (int)pid_output >> 1; 24060: c5 01 movw r24, r10 24062: b4 01 movw r22, r8 24064: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 24068: 75 95 asr r23 2406a: 67 95 ror r22 2406c: 60 93 16 05 sts 0x0516, r22 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 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); 24070: 20 91 11 06 lds r18, 0x0611 ; 0x800611 24074: 30 91 12 06 lds r19, 0x0612 ; 0x800612 24078: 3a 83 std Y+2, r19 ; 0x02 2407a: 29 83 std Y+1, r18 ; 0x01 2407c: 40 90 13 06 lds r4, 0x0613 ; 0x800613 24080: 50 90 14 06 lds r5, 0x0614 ; 0x800614 24084: 60 90 15 06 lds r6, 0x0615 ; 0x800615 24088: 70 90 16 06 lds r7, 0x0616 ; 0x800616 #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 2408c: b9 01 movw r22, r18 2408e: 33 0f add r19, r19 24090: 88 0b sbc r24, r24 24092: 99 0b sbc r25, r25 24094: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 24098: a3 01 movw r20, r6 2409a: 92 01 movw r18, r4 2409c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 240a0: 6b 01 movw r12, r22 240a2: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 240a4: 20 91 df 06 lds r18, 0x06DF ; 0x8006df 240a8: 30 91 e0 06 lds r19, 0x06E0 ; 0x8006e0 240ac: 40 91 e1 06 lds r20, 0x06E1 ; 0x8006e1 240b0: 50 91 e2 06 lds r21, 0x06E2 ; 0x8006e2 240b4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 240b8: 6d 83 std Y+5, r22 ; 0x05 240ba: 7e 83 std Y+6, r23 ; 0x06 240bc: 8f 83 std Y+7, r24 ; 0x07 240be: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 240c0: 20 91 f8 05 lds r18, 0x05F8 ; 0x8005f8 240c4: 30 91 f9 05 lds r19, 0x05F9 ; 0x8005f9 240c8: 40 91 fa 05 lds r20, 0x05FA ; 0x8005fa 240cc: 50 91 fb 05 lds r21, 0x05FB ; 0x8005fb 240d0: c7 01 movw r24, r14 240d2: b6 01 movw r22, r12 240d4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 240d8: 5b 01 movw r10, r22 240da: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 240dc: 30 91 a2 04 lds r19, 0x04A2 ; 0x8004a2 <_ZL19temp_iState_min_bed.lto_priv.480> 240e0: 3e 87 std Y+14, r19 ; 0x0e 240e2: 80 91 a3 04 lds r24, 0x04A3 ; 0x8004a3 <_ZL19temp_iState_min_bed.lto_priv.480+0x1> 240e6: 8d 87 std Y+13, r24 ; 0x0d 240e8: 30 90 a4 04 lds r3, 0x04A4 ; 0x8004a4 <_ZL19temp_iState_min_bed.lto_priv.480+0x2> 240ec: 20 90 a5 04 lds r2, 0x04A5 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.480+0x3> 240f0: 23 2f mov r18, r19 240f2: 38 2f mov r19, r24 240f4: 43 2d mov r20, r3 240f6: 52 2d mov r21, r2 240f8: b5 01 movw r22, r10 240fa: c8 01 movw r24, r16 240fc: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 24100: 87 fd sbrc r24, 7 24102: 18 c0 rjmp .+48 ; 0x24134 24104: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL19temp_iState_max_bed.lto_priv.481> 24108: 9e 87 std Y+14, r25 ; 0x0e 2410a: 20 91 9f 04 lds r18, 0x049F ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.481+0x1> 2410e: 2d 87 std Y+13, r18 ; 0x0d 24110: 30 90 a0 04 lds r3, 0x04A0 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.481+0x2> 24114: 20 90 a1 04 lds r2, 0x04A1 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.481+0x3> 24118: 29 2f mov r18, r25 2411a: 3d 85 ldd r19, Y+13 ; 0x0d 2411c: 43 2d mov r20, r3 2411e: 52 2d mov r21, r2 24120: b5 01 movw r22, r10 24122: c8 01 movw r24, r16 24124: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 24128: 18 16 cp r1, r24 2412a: 24 f0 brlt .+8 ; 0x24134 2412c: ae 86 std Y+14, r10 ; 0x0e 2412e: bd 86 std Y+13, r11 ; 0x0d 24130: 30 2e mov r3, r16 24132: 21 2e mov r2, r17 24134: 8e 85 ldd r24, Y+14 ; 0x0e 24136: 9d 85 ldd r25, Y+13 ; 0x0d 24138: a3 2d mov r26, r3 2413a: b2 2d mov r27, r2 2413c: 80 93 f8 05 sts 0x05F8, r24 ; 0x8005f8 24140: 90 93 f9 05 sts 0x05F9, r25 ; 0x8005f9 24144: a0 93 fa 05 sts 0x05FA, r26 ; 0x8005fa 24148: b0 93 fb 05 sts 0x05FB, r27 ; 0x8005fb iTerm_bed = cs.bedKi * temp_iState_bed; 2414c: 20 91 e3 06 lds r18, 0x06E3 ; 0x8006e3 24150: 30 91 e4 06 lds r19, 0x06E4 ; 0x8006e4 24154: 40 91 e5 06 lds r20, 0x06E5 ; 0x8006e5 24158: 50 91 e6 06 lds r21, 0x06E6 ; 0x8006e6 2415c: bc 01 movw r22, r24 2415e: 83 2d mov r24, r3 24160: 92 2d mov r25, r2 24162: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 24166: 69 87 std Y+9, r22 ; 0x09 24168: 7a 87 std Y+10, r23 ; 0x0a 2416a: 8b 87 std Y+11, r24 ; 0x0b 2416c: 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); 2416e: 20 91 f4 05 lds r18, 0x05F4 ; 0x8005f4 24172: 30 91 f5 05 lds r19, 0x05F5 ; 0x8005f5 24176: 40 91 f6 05 lds r20, 0x05F6 ; 0x8005f6 2417a: 50 91 f7 05 lds r21, 0x05F7 ; 0x8005f7 2417e: c3 01 movw r24, r6 24180: b2 01 movw r22, r4 24182: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 24186: 20 91 e7 06 lds r18, 0x06E7 ; 0x8006e7 2418a: 30 91 e8 06 lds r19, 0x06E8 ; 0x8006e8 2418e: 40 91 e9 06 lds r20, 0x06E9 ; 0x8006e9 24192: 50 91 ea 06 lds r21, 0x06EA ; 0x8006ea 24196: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2419a: 20 ed ldi r18, 0xD0 ; 208 2419c: 3c ec ldi r19, 0xCC ; 204 2419e: 4c e4 ldi r20, 0x4C ; 76 241a0: 5d e3 ldi r21, 0x3D ; 61 241a2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 241a6: 4b 01 movw r8, r22 241a8: 5c 01 movw r10, r24 241aa: 23 e3 ldi r18, 0x33 ; 51 241ac: 33 e3 ldi r19, 0x33 ; 51 241ae: 43 e7 ldi r20, 0x73 ; 115 241b0: 5f e3 ldi r21, 0x3F ; 63 241b2: 60 91 f0 05 lds r22, 0x05F0 ; 0x8005f0 241b6: 70 91 f1 05 lds r23, 0x05F1 ; 0x8005f1 241ba: 80 91 f2 05 lds r24, 0x05F2 ; 0x8005f2 241be: 90 91 f3 05 lds r25, 0x05F3 ; 0x8005f3 241c2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 241c6: 9b 01 movw r18, r22 241c8: ac 01 movw r20, r24 241ca: c5 01 movw r24, r10 241cc: b4 01 movw r22, r8 241ce: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 241d2: 4b 01 movw r8, r22 241d4: 5c 01 movw r10, r24 241d6: 80 92 f0 05 sts 0x05F0, r8 ; 0x8005f0 241da: 90 92 f1 05 sts 0x05F1, r9 ; 0x8005f1 241de: a0 92 f2 05 sts 0x05F2, r10 ; 0x8005f2 241e2: b0 92 f3 05 sts 0x05F3, r11 ; 0x8005f3 temp_dState_bed = pid_input; 241e6: 40 92 f4 05 sts 0x05F4, r4 ; 0x8005f4 241ea: 50 92 f5 05 sts 0x05F5, r5 ; 0x8005f5 241ee: 60 92 f6 05 sts 0x05F6, r6 ; 0x8005f6 241f2: 70 92 f7 05 sts 0x05F7, r7 ; 0x8005f7 pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 241f6: 29 85 ldd r18, Y+9 ; 0x09 241f8: 3a 85 ldd r19, Y+10 ; 0x0a 241fa: 4b 85 ldd r20, Y+11 ; 0x0b 241fc: 5c 85 ldd r21, Y+12 ; 0x0c 241fe: 6d 81 ldd r22, Y+5 ; 0x05 24200: 7e 81 ldd r23, Y+6 ; 0x06 24202: 8f 81 ldd r24, Y+7 ; 0x07 24204: 98 85 ldd r25, Y+8 ; 0x08 24206: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2420a: a5 01 movw r20, r10 2420c: 94 01 movw r18, r8 2420e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 24212: 4b 01 movw r8, r22 24214: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 24216: 20 e0 ldi r18, 0x00 ; 0 24218: 30 e0 ldi r19, 0x00 ; 0 2421a: 4f e7 ldi r20, 0x7F ; 127 2421c: 53 e4 ldi r21, 0x43 ; 67 2421e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 24222: 20 e0 ldi r18, 0x00 ; 0 24224: 30 e0 ldi r19, 0x00 ; 0 24226: 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) { 24228: 18 16 cp r1, r24 2422a: 0c f0 brlt .+2 ; 0x2422e 2422c: 70 c0 rjmp .+224 ; 0x2430e if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 2422e: c7 01 movw r24, r14 24230: b6 01 movw r22, r12 24232: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 24236: 18 16 cp r1, r24 24238: 84 f4 brge .+32 ; 0x2425a 2423a: a7 01 movw r20, r14 2423c: 96 01 movw r18, r12 2423e: 6e 85 ldd r22, Y+14 ; 0x0e 24240: 7d 85 ldd r23, Y+13 ; 0x0d 24242: 83 2d mov r24, r3 24244: 92 2d mov r25, r2 24246: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 2424a: 60 93 f8 05 sts 0x05F8, r22 ; 0x8005f8 2424e: 70 93 f9 05 sts 0x05F9, r23 ; 0x8005f9 24252: 80 93 fa 05 sts 0x05FA, r24 ; 0x8005fa 24256: 90 93 fb 05 sts 0x05FB, r25 ; 0x8005fb pid_output=MAX_BED_POWER; 2425a: 81 2c mov r8, r1 2425c: 91 2c mov r9, r1 2425e: 9f e7 ldi r25, 0x7F ; 127 24260: a9 2e mov r10, r25 24262: 93 e4 ldi r25, 0x43 ; 67 24264: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 24266: 20 e0 ldi r18, 0x00 ; 0 24268: 30 e0 ldi r19, 0x00 ; 0 2426a: 4a ef ldi r20, 0xFA ; 250 2426c: 52 e4 ldi r21, 0x42 ; 66 2426e: c3 01 movw r24, r6 24270: b2 01 movw r22, r4 24272: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 24276: 87 ff sbrs r24, 7 24278: 6d c0 rjmp .+218 ; 0x24354 { soft_pwm_bed = (int)pid_output >> 1; 2427a: c5 01 movw r24, r10 2427c: b4 01 movw r22, r8 2427e: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 24282: 75 95 asr r23 24284: 67 95 ror r22 24286: 60 93 17 06 sts 0x0617, r22 ; 0x800617 soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 2428a: 89 81 ldd r24, Y+1 ; 0x01 2428c: 9a 81 ldd r25, Y+2 ; 0x02 2428e: 89 2b or r24, r25 24290: 11 f4 brne .+4 ; 0x24296 { soft_pwm_bed = 0; 24292: 10 92 17 06 sts 0x0617, r1 ; 0x800617 static void temp_mgr_pid() { for(uint8_t e = 0; e < EXTRUDERS; e++) pid_heater(e, current_temperature_isr[e], target_temperature_isr[e]); pid_bed(current_temperature_bed_isr, target_temperature_bed_isr); } 24296: 2e 96 adiw r28, 0x0e ; 14 24298: 0f b6 in r0, 0x3f ; 63 2429a: f8 94 cli 2429c: de bf out 0x3e, r29 ; 62 2429e: 0f be out 0x3f, r0 ; 63 242a0: cd bf out 0x3d, r28 ; 61 242a2: df 91 pop r29 242a4: cf 91 pop r28 242a6: 1f 91 pop r17 242a8: 0f 91 pop r16 242aa: ff 90 pop r15 242ac: ef 90 pop r14 242ae: df 90 pop r13 242b0: cf 90 pop r12 242b2: bf 90 pop r11 242b4: af 90 pop r10 242b6: 9f 90 pop r9 242b8: 8f 90 pop r8 242ba: 7f 90 pop r7 242bc: 6f 90 pop r6 242be: 5f 90 pop r5 242c0: 4f 90 pop r4 242c2: 3f 90 pop r3 242c4: 2f 90 pop r2 242c6: 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) { 242c8: c5 01 movw r24, r10 242ca: b4 01 movw r22, r8 242cc: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 242d0: 87 ff sbrs r24, 7 242d2: a9 ce rjmp .-686 ; 0x24026 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 242d4: 20 e0 ldi r18, 0x00 ; 0 242d6: 30 e0 ldi r19, 0x00 ; 0 242d8: a9 01 movw r20, r18 242da: c7 01 movw r24, r14 242dc: b6 01 movw r22, r12 242de: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 242e2: 87 ff sbrs r24, 7 242e4: a3 cd rjmp .-1210 ; 0x23e2c 242e6: a7 01 movw r20, r14 242e8: 96 01 movw r18, r12 242ea: 6d 85 ldd r22, Y+13 ; 0x0d 242ec: 79 85 ldd r23, Y+9 ; 0x09 242ee: 81 2f mov r24, r17 242f0: 90 2f mov r25, r16 242f2: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 242f6: 60 93 eb 05 sts 0x05EB, r22 ; 0x8005eb 242fa: 70 93 ec 05 sts 0x05EC, r23 ; 0x8005ec 242fe: 80 93 ed 05 sts 0x05ED, r24 ; 0x8005ed 24302: 90 93 ee 05 sts 0x05EE, r25 ; 0x8005ee 24306: 92 cd rjmp .-1244 ; 0x23e2c // 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; 24308: 10 92 16 05 sts 0x0516, r1 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 2430c: b1 ce rjmp .-670 ; 0x24070 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){ 2430e: c5 01 movw r24, r10 24310: b4 01 movw r22, r8 24312: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 24316: 87 ff sbrs r24, 7 24318: a6 cf rjmp .-180 ; 0x24266 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 2431a: 20 e0 ldi r18, 0x00 ; 0 2431c: 30 e0 ldi r19, 0x00 ; 0 2431e: a9 01 movw r20, r18 24320: c7 01 movw r24, r14 24322: b6 01 movw r22, r12 24324: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 24328: 87 ff sbrs r24, 7 2432a: 10 c0 rjmp .+32 ; 0x2434c 2432c: a7 01 movw r20, r14 2432e: 96 01 movw r18, r12 24330: 6e 85 ldd r22, Y+14 ; 0x0e 24332: 7d 85 ldd r23, Y+13 ; 0x0d 24334: 83 2d mov r24, r3 24336: 92 2d mov r25, r2 24338: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 2433c: 60 93 f8 05 sts 0x05F8, r22 ; 0x8005f8 24340: 70 93 f9 05 sts 0x05F9, r23 ; 0x8005f9 24344: 80 93 fa 05 sts 0x05FA, r24 ; 0x8005fa 24348: 90 93 fb 05 sts 0x05FB, r25 ; 0x8005fb pid_output=0; 2434c: 81 2c mov r8, r1 2434e: 91 2c mov r9, r1 24350: 54 01 movw r10, r8 24352: 89 cf rjmp .-238 ; 0x24266 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 24354: 10 92 17 06 sts 0x0617, r1 ; 0x800617 24358: 98 cf rjmp .-208 ; 0x2428a 0002435a : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 2435e: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 24362: 90 93 19 06 sts 0x0619, r25 ; 0x800619 24366: 80 93 18 06 sts 0x0618, r24 ; 0x800618 target_temperature_bed_isr = target_temperature_bed; 2436a: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 2436e: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 24372: 90 93 12 06 sts 0x0612, r25 ; 0x800612 24376: 80 93 11 06 sts 0x0611, r24 ; 0x800611 } 2437a: 08 95 ret 0002437c : { // 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) 2437c: 81 30 cpi r24, 0x01 ; 1 2437e: 41 f1 breq .+80 ; 0x243d0 24380: 20 f0 brcs .+8 ; 0x2438a 24382: 82 30 cpi r24, 0x02 ; 2 24384: 09 f4 brne .+2 ; 0x24388 24386: 45 c0 rjmp .+138 ; 0x24412 24388: 08 95 ret { case X_AXIS: { enable_x(); 2438a: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); 2438c: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 24390: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 24392: 91 e0 ldi r25, 0x01 ; 1 24394: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 24396: 86 17 cp r24, r22 24398: 59 f0 breq .+22 ; 0x243b0 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 2439a: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2439e: 66 23 and r22, r22 243a0: 89 f0 breq .+34 ; 0x243c4 243a2: 91 60 ori r25, 0x01 ; 1 243a4: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 243a8: eb e4 ldi r30, 0x4B ; 75 243aa: f0 e0 ldi r31, 0x00 ; 0 243ac: 31 97 sbiw r30, 0x01 ; 1 243ae: f1 f7 brne .-4 ; 0x243ac delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 243b0: 91 e0 ldi r25, 0x01 ; 1 243b2: 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); 243b4: 88 23 and r24, r24 243b6: 41 f0 breq .+16 ; 0x243c8 243b8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 243bc: 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); 243be: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 243c2: 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); 243c4: 9e 7f andi r25, 0xFE ; 254 243c6: ee cf rjmp .-36 ; 0x243a4 #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); 243c8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 243cc: 8e 7f andi r24, 0xFE ; 254 243ce: f7 cf rjmp .-18 ; 0x243be } break; case Y_AXIS: { enable_y(); 243d0: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); 243d2: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 243d6: 81 e0 ldi r24, 0x01 ; 1 243d8: 29 2f mov r18, r25 243da: 22 70 andi r18, 0x02 ; 2 243dc: 91 ff sbrs r25, 1 243de: 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) { 243e0: 86 17 cp r24, r22 243e2: 59 f0 breq .+22 ; 0x243fa WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 243e4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 243e8: 66 23 and r22, r22 243ea: 79 f0 breq .+30 ; 0x2440a 243ec: 82 60 ori r24, 0x02 ; 2 243ee: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 243f2: 8b e4 ldi r24, 0x4B ; 75 243f4: 90 e0 ldi r25, 0x00 ; 0 243f6: 01 97 sbiw r24, 0x01 ; 1 243f8: f1 f7 brne .-4 ; 0x243f6 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 243fa: 82 e0 ldi r24, 0x02 ; 2 243fc: 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); 243fe: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24402: 22 23 and r18, r18 24404: 21 f0 breq .+8 ; 0x2440e 24406: 82 60 ori r24, 0x02 ; 2 24408: da cf rjmp .-76 ; 0x243be 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); 2440a: 8d 7f andi r24, 0xFD ; 253 2440c: f0 cf rjmp .-32 ; 0x243ee #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); 2440e: 8d 7f andi r24, 0xFD ; 253 24410: d6 cf rjmp .-84 ; 0x243be } break; case Z_AXIS: { enable_z(); 24412: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); 24414: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 24418: 81 e0 ldi r24, 0x01 ; 1 2441a: 29 2f mov r18, r25 2441c: 24 70 andi r18, 0x04 ; 4 2441e: 92 ff sbrs r25, 2 24420: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 24422: 91 e0 ldi r25, 0x01 ; 1 24424: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 24426: 86 17 cp r24, r22 24428: 59 f0 breq .+22 ; 0x24440 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 2442a: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2442e: 66 23 and r22, r22 24430: 91 f0 breq .+36 ; 0x24456 24432: 94 60 ori r25, 0x04 ; 4 24434: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24438: eb e4 ldi r30, 0x4B ; 75 2443a: f0 e0 ldi r31, 0x00 ; 0 2443c: 31 97 sbiw r30, 0x01 ; 1 2443e: f1 f7 brne .-4 ; 0x2443c delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 24440: 94 e0 ldi r25, 0x04 ; 4 24442: 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) { 24444: 86 17 cp r24, r22 24446: 09 f4 brne .+2 ; 0x2444a 24448: bc cf rjmp .-136 ; 0x243c2 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 2444a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2444e: 22 23 and r18, r18 24450: 21 f0 breq .+8 ; 0x2445a 24452: 84 60 ori r24, 0x04 ; 4 24454: b4 cf rjmp .-152 ; 0x243be 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); 24456: 9b 7f andi r25, 0xFB ; 251 24458: ed cf rjmp .-38 ; 0x24434 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); 2445a: 8b 7f andi r24, 0xFB ; 251 2445c: b0 cf rjmp .-160 ; 0x243be 0002445e : } } static void checkRx(void) { if (selectedSerialPort == 0) { 2445e: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 24462: 81 11 cpse r24, r1 24464: 25 c0 rjmp .+74 ; 0x244b0 if((M_UCSRxA & (1< 2446a: 87 ff sbrs r24, 7 2446c: 3d c0 rjmp .+122 ; 0x244e8 // Test for a framing error. if (M_UCSRxA & (1< 24472: 84 ff sbrs r24, 4 24474: 03 c0 rjmp .+6 ; 0x2447c // 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); 24476: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 2447a: 08 95 ret } else { unsigned char c = M_UDRx; 2447c: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 24480: 20 91 90 04 lds r18, 0x0490 ; 0x800490 24484: 30 91 91 04 lds r19, 0x0491 ; 0x800491 24488: c9 01 movw r24, r18 2448a: 01 96 adiw r24, 0x01 ; 1 2448c: 8f 77 andi r24, 0x7F ; 127 2448e: 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) { 24490: 60 91 92 04 lds r22, 0x0492 ; 0x800492 24494: 70 91 93 04 lds r23, 0x0493 ; 0x800493 24498: 86 17 cp r24, r22 2449a: 97 07 cpc r25, r23 2449c: 29 f1 breq .+74 ; 0x244e8 // 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; 2449e: 20 5f subi r18, 0xF0 ; 240 244a0: 3b 4f sbci r19, 0xFB ; 251 244a2: f9 01 movw r30, r18 244a4: 40 83 st Z, r20 rx_buffer.head = i; 244a6: 90 93 91 04 sts 0x0491, r25 ; 0x800491 244aa: 80 93 90 04 sts 0x0490, r24 ; 0x800490 244ae: 1c c0 rjmp .+56 ; 0x244e8 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 244b4: 87 ff sbrs r24, 7 244b6: 18 c0 rjmp .+48 ; 0x244e8 // Test for a framing error. if (UCSR1A & (1< 244bc: 84 ff sbrs r24, 4 244be: 03 c0 rjmp .+6 ; 0x244c6 // 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); 244c0: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 244c4: 08 95 ret } else { unsigned char c = UDR1; 244c6: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 244ca: 20 91 90 04 lds r18, 0x0490 ; 0x800490 244ce: 30 91 91 04 lds r19, 0x0491 ; 0x800491 244d2: c9 01 movw r24, r18 244d4: 01 96 adiw r24, 0x01 ; 1 244d6: 8f 77 andi r24, 0x7F ; 127 244d8: 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) { 244da: 60 91 92 04 lds r22, 0x0492 ; 0x800492 244de: 70 91 93 04 lds r23, 0x0493 ; 0x800493 244e2: 68 17 cp r22, r24 244e4: 79 07 cpc r23, r25 244e6: d9 f6 brne .-74 ; 0x2449e M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 244e8: 08 95 ret 000244ea : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 244ea: 23 e0 ldi r18, 0x03 ; 3 244ec: 81 11 cpse r24, r1 244ee: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 24502: 94 60 ori r25, 0x04 ; 4 24504: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24508: 3f bf out 0x3f, r19 ; 63 2450a: fb 01 movw r30, r22 2450c: 31 97 sbiw r30, 0x01 ; 1 2450e: f1 f7 brne .-4 ; 0x2450c delayMicroseconds(200); WRITE(BEEPER,LOW); 24510: 3f b7 in r19, 0x3f ; 63 24512: f8 94 cli 24514: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24518: 9b 7f andi r25, 0xFB ; 251 2451a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2451e: 3f bf out 0x3f, r19 ; 63 24520: fa 01 movw r30, r20 24522: 31 97 sbiw r30, 0x01 ; 1 24524: f1 f7 brne .-4 ; 0x24522 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); } } 2452c: 08 95 ret 0002452e : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 2452e: 8a e0 ldi r24, 0x0A ; 10 24530: 2b e8 ldi r18, 0x8B ; 139 24532: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 24534: 4f b7 in r20, 0x3f ; 63 24536: f8 94 cli 24538: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2453c: 94 60 ori r25, 0x04 ; 4 2453e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24542: 4f bf out 0x3f, r20 ; 63 24544: f9 01 movw r30, r18 24546: 31 97 sbiw r30, 0x01 ; 1 24548: f1 f7 brne .-4 ; 0x24546 delayMicroseconds(100); WRITE(BEEPER,LOW); 2454a: 4f b7 in r20, 0x3f ; 63 2454c: f8 94 cli 2454e: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24552: 9b 7f andi r25, 0xFB ; 251 24554: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24558: 4f bf out 0x3f, r20 ; 63 2455a: f9 01 movw r30, r18 2455c: 31 97 sbiw r30, 0x01 ; 1 2455e: f1 f7 brne .-4 ; 0x2455c 24560: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 24562: 41 f7 brne .-48 ; 0x24534 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 24564: 08 95 ret 00024566 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 24566: 87 ea ldi r24, 0xA7 ; 167 24568: 9c e0 ldi r25, 0x0C ; 12 2456a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c if (eeprom_setting != 0) 2456e: 81 11 cpse r24, r1 24570: 05 c0 rjmp .+10 ; 0x2457c return false; switch(eFilamentAction) { 24572: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 24576: 81 50 subi r24, 0x01 ; 1 24578: 88 30 cpi r24, 0x08 ; 8 2457a: 10 f0 brcs .+4 ; 0x24580 #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; 2457c: 80 e0 ldi r24, 0x00 ; 0 2457e: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 24580: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 24582: 08 95 ret 00024584 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 24584: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 24588: 10 92 12 05 sts 0x0512, r1 ; 0x800512 2458c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24590: 84 30 cpi r24, 0x04 ; 4 24592: a8 f5 brcc .+106 ; 0x245fe 24594: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 24598: 8b e5 ldi r24, 0x5B ; 91 2459a: 9d e3 ldi r25, 0x3D ; 61 2459c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 245a0: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 245a4: 8d e2 ldi r24, 0x2D ; 45 245a6: 9e e4 ldi r25, 0x4E ; 78 245a8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 245ac: 68 e0 ldi r22, 0x08 ; 8 245ae: 7a e3 ldi r23, 0x3A ; 58 245b0: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 245b4: 84 e2 ldi r24, 0x24 ; 36 245b6: 9e e4 ldi r25, 0x4E ; 78 245b8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 245bc: 66 ee ldi r22, 0xE6 ; 230 245be: 7a e3 ldi r23, 0x3A ; 58 245c0: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 245c4: 8b e1 ldi r24, 0x1B ; 27 245c6: 9e e4 ldi r25, 0x4E ; 78 245c8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 245cc: 66 ef ldi r22, 0xF6 ; 246 245ce: 7a e3 ldi r23, 0x3A ; 58 245d0: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 245d4: 80 e1 ldi r24, 0x10 ; 16 245d6: 9e e4 ldi r25, 0x4E ; 78 245d8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 245dc: 62 ea ldi r22, 0xA2 ; 162 245de: 79 e3 ldi r23, 0x39 ; 57 245e0: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_END(); 245e4: 0f 94 99 ce call 0x39d32 ; 0x39d32 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 245e8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 245ec: 8f 5f subi r24, 0xFF ; 255 245ee: 80 93 12 05 sts 0x0512, r24 ; 0x800512 245f2: 80 91 14 05 lds r24, 0x0514 ; 0x800514 245f6: 8f 5f subi r24, 0xFF ; 255 245f8: 80 93 14 05 sts 0x0514, r24 ; 0x800514 245fc: c7 cf rjmp .-114 ; 0x2458c 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(); } 245fe: 08 95 ret 00024600 : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 24600: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 24604: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24608: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2460c: 84 30 cpi r24, 0x04 ; 4 2460e: 28 f5 brcc .+74 ; 0x2465a 24610: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 24614: 8c ea ldi r24, 0xAC ; 172 24616: 9d e3 ldi r25, 0x3D ; 61 24618: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2461c: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 24620: 8f ea ldi r24, 0xAF ; 175 24622: 9a e4 ldi r25, 0x4A ; 74 24624: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24628: 60 ee ldi r22, 0xE0 ; 224 2462a: 7a e3 ldi r23, 0x3A ; 58 2462c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 24630: 87 ea ldi r24, 0xA7 ; 167 24632: 9a e4 ldi r25, 0x4A ; 74 24634: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24638: 6a e8 ldi r22, 0x8A ; 138 2463a: 79 e3 ldi r23, 0x39 ; 57 2463c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_END(); 24640: 0f 94 99 ce call 0x39d32 ; 0x39d32 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 24644: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24648: 8f 5f subi r24, 0xFF ; 255 2464a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2464e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 24652: 8f 5f subi r24, 0xFF ; 255 24654: 80 93 14 05 sts 0x0514, r24 ; 0x800514 24658: d7 cf rjmp .-82 ; 0x24608 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(); } 2465a: 08 95 ret 0002465c : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 2465c: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 24660: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24664: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24668: 84 30 cpi r24, 0x04 ; 4 2466a: 68 f5 brcc .+90 ; 0x246c6 2466c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 24670: 8c ea ldi r24, 0xAC ; 172 24672: 9d e3 ldi r25, 0x3D ; 61 24674: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24678: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 2467c: 8f ea ldi r24, 0xAF ; 175 2467e: 9a e4 ldi r25, 0x4A ; 74 24680: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24684: 6e e1 ldi r22, 0x1E ; 30 24686: 7b e3 ldi r23, 0x3B ; 59 24688: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 2468c: 87 ea ldi r24, 0xA7 ; 167 2468e: 9a e4 ldi r25, 0x4A ; 74 24690: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24694: 6c ef ldi r22, 0xFC ; 252 24696: 79 e3 ldi r23, 0x39 ; 57 24698: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 2469c: 85 e4 ldi r24, 0x45 ; 69 2469e: 9a e4 ldi r25, 0x4A ; 74 246a0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 246a4: 60 e9 ldi r22, 0x90 ; 144 246a6: 7b e3 ldi r23, 0x3B ; 59 246a8: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_END(); 246ac: 0f 94 99 ce call 0x39d32 ; 0x39d32 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 246b0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 246b4: 8f 5f subi r24, 0xFF ; 255 246b6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 246ba: 80 91 14 05 lds r24, 0x0514 ; 0x800514 246be: 8f 5f subi r24, 0xFF ; 255 246c0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 246c4: cf cf rjmp .-98 ; 0x24664 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(); } 246c6: 08 95 ret 000246c8 : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 246c8: 89 ea ldi r24, 0xA9 ; 169 246ca: 9d e0 ldi r25, 0x0D ; 13 246cc: 0c 94 d0 77 jmp 0xefa0 ; 0xefa0 000246d0 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 246d0: 8c ea ldi r24, 0xAC ; 172 246d2: 9c e0 ldi r25, 0x0C ; 12 246d4: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c if (current_state) 246d8: 88 23 and r24, r24 246da: 61 f0 breq .+24 ; 0x246f4 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 246dc: 10 92 95 13 sts 0x1395, r1 ; 0x801395 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 246e0: 10 92 43 13 sts 0x1343, r1 ; 0x801343 currentScope = Scope::Stopped; 246e4: 10 92 28 13 sts 0x1328, r1 ; 0x801328 else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 246e8: 8c ea ldi r24, 0xAC ; 172 246ea: 9c e0 ldi r25, 0x0C ; 12 246ec: 0e 94 d0 77 call 0xefa0 ; 0xefa0 MMU2::mmu2.Status(); 246f0: 0d 94 bc 76 jmp 0x2ed78 ; 0x2ed78 { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 246f4: 0e 94 33 db call 0x1b666 ; 0x1b666 246f8: f7 cf rjmp .-18 ; 0x246e8 000246fa : 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) 246fa: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 246fe: 88 23 and r24, r24 24700: 21 f0 breq .+8 ; 0x2470a 24702: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 24706: 88 23 and r24, r24 24708: 51 f0 breq .+20 ; 0x2471e { _md->status = 1; 2470a: 81 e0 ldi r24, 0x01 ; 1 2470c: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 24710: 60 e0 ldi r22, 0x00 ; 0 24712: 8a e2 ldi r24, 0x2A ; 42 24714: 9d e0 ldi r25, 0x0D ; 13 24716: 0e 94 a5 77 call 0xef4a ; 0xef4a 2471a: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 } MENU_BEGIN(); 2471e: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 24722: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24726: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2472a: 84 30 cpi r24, 0x04 ; 4 2472c: 08 f0 brcs .+2 ; 0x24730 2472e: 81 c0 rjmp .+258 ; 0x24832 24730: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 24734: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 24738: 81 11 cpse r24, r1 2473a: 4a c0 rjmp .+148 ; 0x247d0 2473c: 8d e0 ldi r24, 0x0D ; 13 2473e: 90 e4 ldi r25, 0x40 ; 64 24740: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24744: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 24748: 8d e3 ldi r24, 0x3D ; 61 2474a: 9b e3 ldi r25, 0x3B ; 59 2474c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24750: 60 e2 ldi r22, 0x20 ; 32 24752: 7b e3 ldi r23, 0x3B ; 59 24754: 0f 94 43 d1 call 0x3a286 ; 0x3a286 SETTINGS_NOZZLE; 24758: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 2475c: 8c 33 cpi r24, 0x3C ; 60 2475e: 09 f4 brne .+2 ; 0x24762 24760: 54 c0 rjmp .+168 ; 0x2480a 24762: c8 f5 brcc .+114 ; 0x247d6 24764: 89 31 cpi r24, 0x19 ; 25 24766: 09 f4 brne .+2 ; 0x2476a 24768: 44 c0 rjmp .+136 ; 0x247f2 2476a: 88 32 cpi r24, 0x28 ; 40 2476c: c1 f1 breq .+112 ; 0x247de MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 2476e: 81 e8 ldi r24, 0x81 ; 129 24770: 97 e5 ldi r25, 0x57 ; 87 24772: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24776: 60 eb ldi r22, 0xB0 ; 176 24778: 7a e3 ldi r23, 0x3A ; 58 2477a: 0f 94 42 ce call 0x39c84 ; 0x39c84 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 2477e: 88 e7 ldi r24, 0x78 ; 120 24780: 97 e5 ldi r25, 0x57 ; 87 24782: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24786: 68 e8 ldi r22, 0x88 ; 136 24788: 7a e3 ldi r23, 0x3A ; 58 2478a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #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); 2478e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 24792: 81 30 cpi r24, 0x01 ; 1 24794: 31 f0 breq .+12 ; 0x247a2 24796: 6c e3 ldi r22, 0x3C ; 60 24798: 7a e3 ldi r23, 0x3A ; 58 2479a: 84 eb ldi r24, 0xB4 ; 180 2479c: 94 ea ldi r25, 0xA4 ; 164 2479e: 0f 94 42 ce call 0x39c84 ; 0x39c84 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (_md->experimental_menu_visibility) 247a2: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 247a6: 88 23 and r24, r24 247a8: 31 f0 breq .+12 ; 0x247b6 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 247aa: 62 e5 ldi r22, 0x52 ; 82 247ac: 7a e3 ldi r23, 0x3A ; 58 247ae: 87 ea ldi r24, 0xA7 ; 167 247b0: 94 ea ldi r25, 0xA4 ; 164 247b2: 0f 94 43 d1 call 0x3a286 ; 0x3a286 //! //! 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(); 247b6: 0f 94 99 ce call 0x39d32 ; 0x39d32 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 247ba: 80 91 12 05 lds r24, 0x0512 ; 0x800512 247be: 8f 5f subi r24, 0xFF ; 255 247c0: 80 93 12 05 sts 0x0512, r24 ; 0x800512 247c4: 80 91 14 05 lds r24, 0x0514 ; 0x800514 247c8: 8f 5f subi r24, 0xFF ; 255 247ca: 80 93 14 05 sts 0x0514, r24 ; 0x800514 247ce: ab cf rjmp .-170 ; 0x24726 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 247d0: 8b e5 ldi r24, 0x5B ; 91 247d2: 9d e3 ldi r25, 0x3D ; 61 247d4: b5 cf rjmp .-150 ; 0x24740 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 247d6: 80 35 cpi r24, 0x50 ; 80 247d8: 11 f1 breq .+68 ; 0x2481e 247da: 8f 3f cpi r24, 0xFF ; 255 247dc: 41 f6 brne .-112 ; 0x2476e 247de: 81 e9 ldi r24, 0x91 ; 145 247e0: 97 e5 ldi r25, 0x57 ; 87 247e2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 247e6: 22 e0 ldi r18, 0x02 ; 2 247e8: 44 ea ldi r20, 0xA4 ; 164 247ea: 5a e3 ldi r21, 0x3A ; 58 247ec: 60 ed ldi r22, 0xD0 ; 208 247ee: 74 ea ldi r23, 0xA4 ; 164 247f0: 09 c0 rjmp .+18 ; 0x24804 247f2: 81 e9 ldi r24, 0x91 ; 145 247f4: 97 e5 ldi r25, 0x57 ; 87 247f6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 247fa: 22 e0 ldi r18, 0x02 ; 2 247fc: 44 ea ldi r20, 0xA4 ; 164 247fe: 5a e3 ldi r21, 0x3A ; 58 24800: 65 ed ldi r22, 0xD5 ; 213 24802: 74 ea ldi r23, 0xA4 ; 164 24804: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 24808: b2 cf rjmp .-156 ; 0x2476e 2480a: 81 e9 ldi r24, 0x91 ; 145 2480c: 97 e5 ldi r25, 0x57 ; 87 2480e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24812: 22 e0 ldi r18, 0x02 ; 2 24814: 44 ea ldi r20, 0xA4 ; 164 24816: 5a e3 ldi r21, 0x3A ; 58 24818: 6b ec ldi r22, 0xCB ; 203 2481a: 74 ea ldi r23, 0xA4 ; 164 2481c: f3 cf rjmp .-26 ; 0x24804 2481e: 81 e9 ldi r24, 0x91 ; 145 24820: 97 e5 ldi r25, 0x57 ; 87 24822: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24826: 22 e0 ldi r18, 0x02 ; 2 24828: 44 ea ldi r20, 0xA4 ; 164 2482a: 5a e3 ldi r21, 0x3A ; 58 2482c: 66 ec ldi r22, 0xC6 ; 198 2482e: 74 ea ldi r23, 0xA4 ; 164 24830: e9 cf rjmp .-46 ; 0x24804 //! 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(); } 24832: 08 95 ret 00024834 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 24834: 80 e0 ldi r24, 0x00 ; 0 24836: 0d 94 8c 1d jmp 0x23b18 ; 0x23b18 0002483a : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 2483a: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 2483e: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24842: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24846: 84 30 cpi r24, 0x04 ; 4 24848: 08 f0 brcs .+2 ; 0x2484c 2484a: 45 c0 rjmp .+138 ; 0x248d6 2484c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 24850: 88 ef ldi r24, 0xF8 ; 248 24852: 97 e5 ldi r25, 0x57 ; 87 24854: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24858: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 2485c: 6e e3 ldi r22, 0x3E ; 62 2485e: 74 ed ldi r23, 0xD4 ; 212 24860: 89 e4 ldi r24, 0x49 ; 73 24862: 9d e0 ldi r25, 0x0D ; 13 24864: 0f 94 f3 d0 call 0x3a1e6 ; 0x3a1e6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 24868: 69 e3 ldi r22, 0x39 ; 57 2486a: 74 ed ldi r23, 0xD4 ; 212 2486c: 84 e5 ldi r24, 0x54 ; 84 2486e: 9d e0 ldi r25, 0x0D ; 13 24870: 0f 94 f3 d0 call 0x3a1e6 ; 0x3a1e6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 24874: 64 e3 ldi r22, 0x34 ; 52 24876: 74 ed ldi r23, 0xD4 ; 212 24878: 8f e5 ldi r24, 0x5F ; 95 2487a: 9d e0 ldi r25, 0x0D ; 13 2487c: 0f 94 f3 d0 call 0x3a1e6 ; 0x3a1e6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 24880: 6f e2 ldi r22, 0x2F ; 47 24882: 74 ed ldi r23, 0xD4 ; 212 24884: 8a e6 ldi r24, 0x6A ; 106 24886: 9d e0 ldi r25, 0x0D ; 13 24888: 0f 94 f3 d0 call 0x3a1e6 ; 0x3a1e6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 2488c: 6a e2 ldi r22, 0x2A ; 42 2488e: 74 ed ldi r23, 0xD4 ; 212 24890: 85 e7 ldi r24, 0x75 ; 117 24892: 9d e0 ldi r25, 0x0D ; 13 24894: 0f 94 f3 d0 call 0x3a1e6 ; 0x3a1e6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 24898: 65 e2 ldi r22, 0x25 ; 37 2489a: 74 ed ldi r23, 0xD4 ; 212 2489c: 80 e8 ldi r24, 0x80 ; 128 2489e: 9d e0 ldi r25, 0x0D ; 13 248a0: 0f 94 f3 d0 call 0x3a1e6 ; 0x3a1e6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 248a4: 60 e2 ldi r22, 0x20 ; 32 248a6: 74 ed ldi r23, 0xD4 ; 212 248a8: 8b e8 ldi r24, 0x8B ; 139 248aa: 9d e0 ldi r25, 0x0D ; 13 248ac: 0f 94 f3 d0 call 0x3a1e6 ; 0x3a1e6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 248b0: 6b e1 ldi r22, 0x1B ; 27 248b2: 74 ed ldi r23, 0xD4 ; 212 248b4: 86 e9 ldi r24, 0x96 ; 150 248b6: 9d e0 ldi r25, 0x0D ; 13 248b8: 0f 94 f3 d0 call 0x3a1e6 ; 0x3a1e6 MENU_END(); 248bc: 0f 94 99 ce call 0x39d32 ; 0x39d32 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 248c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 248c4: 8f 5f subi r24, 0xFF ; 255 248c6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 248ca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 248ce: 8f 5f subi r24, 0xFF ; 255 248d0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 248d4: b6 cf rjmp .-148 ; 0x24842 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(); } 248d6: 08 95 ret 000248d8 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 248d8: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 248dc: 10 92 12 05 sts 0x0512, r1 ; 0x800512 248e0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 248e4: 84 30 cpi r24, 0x04 ; 4 248e6: d8 f5 brcc .+118 ; 0x2495e 248e8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 248ec: 88 ef ldi r24, 0xF8 ; 248 248ee: 97 e5 ldi r25, 0x57 ; 87 248f0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 248f4: 0f 94 90 d1 call 0x3a320 ; 0x3a320 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 248f8: 8f e6 ldi r24, 0x6F ; 111 248fa: 97 e5 ldi r25, 0x57 ; 87 248fc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24900: 48 e9 ldi r20, 0x98 ; 152 24902: 5a e3 ldi r21, 0x3A ; 58 24904: bc 01 movw r22, r24 24906: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 2490a: 0e 94 8c f9 call 0x1f318 ; 0x1f318 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 2490e: 87 e6 ldi r24, 0x67 ; 103 24910: 97 e5 ldi r25, 0x57 ; 87 24912: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24916: 4c e5 ldi r20, 0x5C ; 92 24918: 5a e3 ldi r21, 0x3A ; 58 2491a: bc 01 movw r22, r24 2491c: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 24920: 0e 94 8c f9 call 0x1f318 ; 0x1f318 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 24924: 40 e5 ldi r20, 0x50 ; 80 24926: 5b e3 ldi r21, 0x3B ; 59 24928: 6e e8 ldi r22, 0x8E ; 142 2492a: 70 e7 ldi r23, 0x70 ; 112 2492c: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 24930: 0e 94 8c f9 call 0x1f318 ; 0x1f318 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 24934: 44 ef ldi r20, 0xF4 ; 244 24936: 59 e3 ldi r21, 0x39 ; 57 24938: 67 e4 ldi r22, 0x47 ; 71 2493a: 7e e6 ldi r23, 0x6E ; 110 2493c: 80 91 e7 04 lds r24, 0x04E7 ; 0x8004e7 24940: 0e 94 8c f9 call 0x1f318 ; 0x1f318 MENU_END(); 24944: 0f 94 99 ce call 0x39d32 ; 0x39d32 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 24948: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2494c: 8f 5f subi r24, 0xFF ; 255 2494e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 24952: 80 91 14 05 lds r24, 0x0514 ; 0x800514 24956: 8f 5f subi r24, 0xFF ; 255 24958: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2495c: c1 cf rjmp .-126 ; 0x248e0 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(); } 2495e: 08 95 ret 00024960 : 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); 24960: 87 ee ldi r24, 0xE7 ; 231 24962: 94 e0 ldi r25, 0x04 ; 4 24964: 0f 94 29 1e call 0x23c52 ; 0x23c52 24968: 60 91 e7 04 lds r22, 0x04E7 ; 0x8004e7 2496c: 80 e2 ldi r24, 0x20 ; 32 2496e: 9c e0 ldi r25, 0x0C ; 12 24970: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 00024974 : 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); 24974: 89 ee ldi r24, 0xE9 ; 233 24976: 94 e0 ldi r25, 0x04 ; 4 24978: 0f 94 29 1e call 0x23c52 ; 0x23c52 2497c: 60 91 e9 04 lds r22, 0x04E9 ; 0x8004e9 24980: 83 ea ldi r24, 0xA3 ; 163 24982: 9d e0 ldi r25, 0x0D ; 13 24984: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 00024988 : 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); 24988: 8a ee ldi r24, 0xEA ; 234 2498a: 94 e0 ldi r25, 0x04 ; 4 2498c: 0f 94 29 1e call 0x23c52 ; 0x23c52 24990: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 24994: 84 ea ldi r24, 0xA4 ; 164 24996: 9d e0 ldi r25, 0x0D ; 13 24998: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0002499c : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 2499c: 8c ee ldi r24, 0xEC ; 236 2499e: 94 e0 ldi r25, 0x04 ; 4 249a0: 0f 94 29 1e call 0x23c52 ; 0x23c52 249a4: 60 91 ec 04 lds r22, 0x04EC ; 0x8004ec 249a8: 88 ea ldi r24, 0xA8 ; 168 249aa: 9d e0 ldi r25, 0x0D ; 13 249ac: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 000249b0 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 249b0: 80 91 8d 17 lds r24, 0x178D ; 0x80178d case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 249b4: 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) { 249b6: 81 11 cpse r24, r1 249b8: 01 c0 rjmp .+2 ; 0x249bc case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 249ba: 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; 249bc: 60 93 8d 17 sts 0x178D, r22 ; 0x80178d 249c0: 87 e4 ldi r24, 0x47 ; 71 249c2: 9d e0 ldi r25, 0x0D ; 13 249c4: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 000249c8 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 249c8: cf 93 push r28 249ca: df 93 push r29 MENU_BEGIN(); 249cc: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 249d0: 10 92 12 05 sts 0x0512, r1 ; 0x800512 249d4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 249d8: 84 30 cpi r24, 0x04 ; 4 249da: 08 f0 brcs .+2 ; 0x249de 249dc: 96 c0 rjmp .+300 ; 0x24b0a 249de: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 249e2: 8d e0 ldi r24, 0x0D ; 13 249e4: 90 e4 ldi r25, 0x40 ; 64 249e6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 249ea: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 249ee: 80 91 85 17 lds r24, 0x1785 ; 0x801785 249f2: 88 23 and r24, r24 249f4: f1 f1 breq .+124 ; 0x24a72 249f6: 82 e8 ldi r24, 0x82 ; 130 249f8: 9d e5 ldi r25, 0x5D ; 93 249fa: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 249fe: ec 01 movw r28, r24 24a00: 8c eb ldi r24, 0xBC ; 188 24a02: 9c e3 ldi r25, 0x3C ; 60 24a04: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24a08: 22 e0 ldi r18, 0x02 ; 2 24a0a: 46 e7 ldi r20, 0x76 ; 118 24a0c: 5a e3 ldi r21, 0x3A ; 58 24a0e: be 01 movw r22, r28 24a10: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 24a14: 80 91 85 17 lds r24, 0x1785 ; 0x801785 if (fsensor.isEnabled()) { 24a18: 88 23 and r24, r24 24a1a: 09 f4 brne .+2 ; 0x24a1e 24a1c: 66 c0 rjmp .+204 ; 0x24aea if (fsensor.isError()) { 24a1e: 83 30 cpi r24, 0x03 ; 3 24a20: 59 f5 brne .+86 ; 0x24a78 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 24a22: 8b ef ldi r24, 0xFB ; 251 24a24: 9c e3 ldi r25, 0x3C ; 60 24a26: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24a2a: ec 01 movw r28, r24 24a2c: 81 e1 ldi r24, 0x11 ; 17 24a2e: 97 e5 ldi r25, 0x57 ; 87 24a30: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24a34: 22 e0 ldi r18, 0x02 ; 2 24a36: 4c e6 ldi r20, 0x6C ; 108 24a38: 5a e3 ldi r21, 0x3A ; 58 24a3a: be 01 movw r22, r28 24a3c: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 24a40: 8b ef ldi r24, 0xFB ; 251 24a42: 9c e3 ldi r25, 0x3C ; 60 24a44: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24a48: ec 01 movw r28, r24 24a4a: 83 e0 ldi r24, 0x03 ; 3 24a4c: 97 e5 ldi r25, 0x57 ; 87 24a4e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24a52: 22 e0 ldi r18, 0x02 ; 2 24a54: 4c e6 ldi r20, 0x6C ; 108 24a56: 5a e3 ldi r21, 0x3A ; 58 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } else { MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), fsensor.getRunoutEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_runout_set); MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24a58: be 01 movw r22, r28 24a5a: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #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()) { 24a5e: 80 91 8d 17 lds r24, 0x178D ; 0x80178d 24a62: 88 23 and r24, r24 24a64: 99 f1 breq .+102 ; 0x24acc 24a66: 81 30 cpi r24, 0x01 ; 1 24a68: 09 f4 brne .+2 ; 0x24a6c 24a6a: 4c c0 rjmp .+152 ; 0x24b04 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(); 24a6c: 0f 94 d8 24 call 0x249b0 ; 0x249b0 24a70: 3c c0 rjmp .+120 ; 0x24aea 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); 24a72: 8c e7 ldi r24, 0x7C ; 124 24a74: 9d e5 ldi r25, 0x5D ; 93 24a76: c1 cf rjmp .-126 ; 0x249fa #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); 24a78: 80 91 87 17 lds r24, 0x1787 ; 0x801787 24a7c: 88 23 and r24, r24 24a7e: 01 f1 breq .+64 ; 0x24ac0 24a80: 82 e8 ldi r24, 0x82 ; 130 24a82: 9d e5 ldi r25, 0x5D ; 93 24a84: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24a88: ec 01 movw r28, r24 24a8a: 81 e1 ldi r24, 0x11 ; 17 24a8c: 97 e5 ldi r25, 0x57 ; 87 24a8e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24a92: 22 e0 ldi r18, 0x02 ; 2 24a94: 4c ef ldi r20, 0xFC ; 252 24a96: 5a e3 ldi r21, 0x3A ; 58 24a98: be 01 movw r22, r28 24a9a: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24a9e: 80 91 86 17 lds r24, 0x1786 ; 0x801786 24aa2: 88 23 and r24, r24 24aa4: 81 f0 breq .+32 ; 0x24ac6 24aa6: 82 e8 ldi r24, 0x82 ; 130 24aa8: 9d e5 ldi r25, 0x5D ; 93 24aaa: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24aae: ec 01 movw r28, r24 24ab0: 83 e0 ldi r24, 0x03 ; 3 24ab2: 97 e5 ldi r25, 0x57 ; 87 24ab4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24ab8: 22 e0 ldi r18, 0x02 ; 2 24aba: 4e e2 ldi r20, 0x2E ; 46 24abc: 5a e3 ldi r21, 0x3A ; 58 24abe: cc cf rjmp .-104 ; 0x24a58 #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); 24ac0: 8c e7 ldi r24, 0x7C ; 124 24ac2: 9d e5 ldi r25, 0x5D ; 93 24ac4: df cf rjmp .-66 ; 0x24a84 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24ac6: 8c e7 ldi r24, 0x7C ; 124 24ac8: 9d e5 ldi r25, 0x5D ; 93 24aca: ef cf rjmp .-34 ; 0x24aaa #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); 24acc: 8b ef ldi r24, 0xFB ; 251 24ace: 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); 24ad0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24ad4: ec 01 movw r28, r24 24ad6: 8f ee ldi r24, 0xEF ; 239 24ad8: 96 e5 ldi r25, 0x56 ; 86 24ada: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24ade: 22 e0 ldi r18, 0x02 ; 2 24ae0: 4c eb ldi r20, 0xBC ; 188 24ae2: 59 e3 ldi r21, 0x39 ; 57 24ae4: be 01 movw r22, r28 24ae6: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 24aea: 0f 94 99 ce call 0x39d32 ; 0x39d32 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 24aee: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24af2: 8f 5f subi r24, 0xFF ; 255 24af4: 80 93 12 05 sts 0x0512, r24 ; 0x800512 24af8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 24afc: 8f 5f subi r24, 0xFF ; 255 24afe: 80 93 14 05 sts 0x0514, r24 ; 0x800514 24b02: 68 cf rjmp .-304 ; 0x249d4 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); 24b04: 87 ee ldi r24, 0xE7 ; 231 24b06: 96 e5 ldi r25, 0x56 ; 86 24b08: e3 cf rjmp .-58 ; 0x24ad0 lcd_fsensor_actionNA_set(); } } MENU_END(); } 24b0a: df 91 pop r29 24b0c: cf 91 pop r28 24b0e: 08 95 ret 00024b10 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 24b10: e5 e8 ldi r30, 0x85 ; 133 24b12: f7 e1 ldi r31, 0x17 ; 23 24b14: 61 81 ldd r22, Z+1 ; 0x01 24b16: 81 e0 ldi r24, 0x01 ; 1 24b18: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 24b1a: 61 83 std Z+1, r22 ; 0x01 24b1c: 87 e0 ldi r24, 0x07 ; 7 24b1e: 9f e0 ldi r25, 0x0F ; 15 24b20: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 00024b24 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 24b24: e5 e8 ldi r30, 0x85 ; 133 24b26: f7 e1 ldi r31, 0x17 ; 23 24b28: 62 81 ldd r22, Z+2 ; 0x02 24b2a: 81 e0 ldi r24, 0x01 ; 1 24b2c: 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; 24b2e: 62 83 std Z+2, r22 ; 0x02 24b30: 85 ed ldi r24, 0xD5 ; 213 24b32: 9e e0 ldi r25, 0x0E ; 14 24b34: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 00024b38 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 24b38: ec ed ldi r30, 0xDC ; 220 24b3a: f6 e1 ldi r31, 0x16 ; 22 24b3c: 60 81 ld r22, Z 24b3e: 81 e0 ldi r24, 0x01 ; 1 24b40: 68 27 eor r22, r24 24b42: 60 83 st Z, r22 24b44: 8b eb ldi r24, 0xBB ; 187 24b46: 9f e0 ldi r25, 0x0F ; 15 24b48: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 00024b4c : 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; 24b4c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 24b50: 81 30 cpi r24, 0x01 ; 1 24b52: 51 f4 brne .+20 ; 0x24b68 24b54: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e 24b58: 60 91 1e 05 lds r22, 0x051E ; 0x80051e 24b5c: 88 e0 ldi r24, 0x08 ; 8 24b5e: 9f e0 ldi r25, 0x0F ; 15 24b60: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 24b64: 0c 94 91 db jmp 0x1b722 ; 0x1b722 } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 24b68: 81 e0 ldi r24, 0x01 ; 1 24b6a: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e 24b6e: f4 cf rjmp .-24 ; 0x24b58 00024b70 : 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); 24b70: 8f ea ldi r24, 0xAF ; 175 24b72: 9f e0 ldi r25, 0x0F ; 15 24b74: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c temp_cal_active = !temp_cal_active; 24b78: 61 e0 ldi r22, 0x01 ; 1 24b7a: 81 11 cpse r24, r1 24b7c: 60 e0 ldi r22, 0x00 ; 0 24b7e: 8f ea ldi r24, 0xAF ; 175 24b80: 9f e0 ldi r25, 0x0F ; 15 24b82: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 00024b86 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 24b86: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 24b8a: 81 30 cpi r24, 0x01 ; 1 24b8c: 71 f0 breq .+28 ; 0x24baa 24b8e: 20 f0 brcs .+8 ; 0x24b98 24b90: 82 30 cpi r24, 0x02 ; 2 24b92: 69 f4 brne .+26 ; 0x24bae break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 24b94: 83 e0 ldi r24, 0x03 ; 3 24b96: 01 c0 rjmp .+2 ; 0x24b9a void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 24b98: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 24b9a: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de 24b9e: 60 91 de 04 lds r22, 0x04DE ; 0x8004de 24ba2: 87 ed ldi r24, 0xD7 ; 215 24ba4: 9e e0 ldi r25, 0x0E ; 14 24ba6: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 24baa: 82 e0 ldi r24, 0x02 ; 2 24bac: f6 cf rjmp .-20 ; 0x24b9a break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 24bae: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de 24bb2: f5 cf rjmp .-22 ; 0x24b9e 00024bb4 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 24bb4: 89 e0 ldi r24, 0x09 ; 9 24bb6: 9f e0 ldi r25, 0x0F ; 15 24bb8: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 24bbc: 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) { 24bbe: 88 23 and r24, r24 24bc0: 21 f0 breq .+8 ; 0x24bca case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 24bc2: 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) { 24bc4: 81 30 cpi r24, 0x01 ; 1 24bc6: 09 f0 breq .+2 ; 0x24bca case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 24bc8: 60 e0 ldi r22, 0x00 ; 0 24bca: 89 e0 ldi r24, 0x09 ; 9 24bcc: 9f e0 ldi r25, 0x0F ; 15 24bce: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 24bd2: 81 e0 ldi r24, 0x01 ; 1 24bd4: 80 93 ba 14 sts 0x14BA, r24 ; 0x8014ba } 24bd8: 08 95 ret 00024bda : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 24bda: ef 92 push r14 24bdc: ff 92 push r15 24bde: 0f 93 push r16 24be0: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 24be2: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 24be6: 81 11 cpse r24, r1 24be8: 35 c0 rjmp .+106 ; 0x24c54 { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 24bea: 80 ec ldi r24, 0xC0 ; 192 24bec: 9f e0 ldi r25, 0x0F ; 15 24bee: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 24bf2: 81 30 cpi r24, 0x01 ; 1 24bf4: 61 f5 brne .+88 ; 0x24c4e { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 24bf6: 8f eb ldi r24, 0xBF ; 191 24bf8: 9f e0 ldi r25, 0x0F ; 15 24bfa: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 24bfe: 08 2e mov r0, r24 24c00: 00 0c add r0, r0 24c02: 99 0b sbc r25, r25 24c04: 90 93 b4 03 sts 0x03B4, r25 ; 0x8003b4 24c08: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 24c0c: 8e eb ldi r24, 0xBE ; 190 24c0e: 9f e0 ldi r25, 0x0F ; 15 24c10: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 24c14: 08 2e mov r0, r24 24c16: 00 0c add r0, r0 24c18: 99 0b sbc r25, r25 24c1a: 90 93 b6 03 sts 0x03B6, r25 ; 0x8003b6 24c1e: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 24c22: 8d eb ldi r24, 0xBD ; 189 24c24: 9f e0 ldi r25, 0x0F ; 15 24c26: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 24c2a: 08 2e mov r0, r24 24c2c: 00 0c add r0, r0 24c2e: 99 0b sbc r25, r25 24c30: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 24c34: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 24c38: 8c eb ldi r24, 0xBC ; 188 24c3a: 9f e0 ldi r25, 0x0F ; 15 24c3c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 24c40: 08 2e mov r0, r24 24c42: 00 0c add r0, r0 24c44: 99 0b sbc r25, r25 24c46: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 24c4a: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 } _md->status = 1; 24c4e: 81 e0 ldi r24, 0x01 ; 1 24c50: 80 93 b2 03 sts 0x03B2, r24 ; 0x8003b2 } MENU_BEGIN(); 24c54: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 24c58: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24c5c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24c60: 84 30 cpi r24, 0x04 ; 4 24c62: 08 f0 brcs .+2 ; 0x24c66 24c64: 6e c0 rjmp .+220 ; 0x24d42 24c66: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 24c6a: 0f 94 45 cd call 0x39a8a ; 0x39a8a 24c6e: 88 23 and r24, r24 24c70: e9 f0 breq .+58 ; 0x24cac 24c72: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 24c76: 8f eb ldi r24, 0xBF ; 191 24c78: 9f e0 ldi r25, 0x0F ; 15 24c7a: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 24c7e: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 24c82: 8d eb ldi r24, 0xBD ; 189 24c84: 9f e0 ldi r25, 0x0F ; 15 24c86: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 24c8a: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 24c8e: 8c eb ldi r24, 0xBC ; 188 24c90: 9f e0 ldi r25, 0x0F ; 15 24c92: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 24c96: 60 91 b5 03 lds r22, 0x03B5 ; 0x8003b5 24c9a: 8e eb ldi r24, 0xBE ; 190 24c9c: 9f e0 ldi r25, 0x0F ; 15 24c9e: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 24ca2: 61 e0 ldi r22, 0x01 ; 1 24ca4: 80 ec ldi r24, 0xC0 ; 192 24ca6: 9f e0 ldi r25, 0x0F ; 15 24ca8: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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)); 24cac: 8d e0 ldi r24, 0x0D ; 13 24cae: 90 e4 ldi r25, 0x40 ; 64 24cb0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24cb4: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24cb8: 85 e7 ldi r24, 0x75 ; 117 24cba: 9d e4 ldi r25, 0x4D ; 77 24cbc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24cc0: f1 2c mov r15, r1 24cc2: e1 2c mov r14, r1 24cc4: 04 e6 ldi r16, 0x64 ; 100 24cc6: 10 e0 ldi r17, 0x00 ; 0 24cc8: 2c e9 ldi r18, 0x9C ; 156 24cca: 3f ef ldi r19, 0xFF ; 255 24ccc: 40 e1 ldi r20, 0x10 ; 16 24cce: 63 eb ldi r22, 0xB3 ; 179 24cd0: 73 e0 ldi r23, 0x03 ; 3 24cd2: 0f 94 15 cf call 0x39e2a ; 0x39e2a MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24cd6: 84 e6 ldi r24, 0x64 ; 100 24cd8: 9d e4 ldi r25, 0x4D ; 77 24cda: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24cde: 2c e9 ldi r18, 0x9C ; 156 24ce0: 3f ef ldi r19, 0xFF ; 255 24ce2: 40 e1 ldi r20, 0x10 ; 16 24ce4: 65 eb ldi r22, 0xB5 ; 181 24ce6: 73 e0 ldi r23, 0x03 ; 3 24ce8: 0f 94 15 cf call 0x39e2a ; 0x39e2a MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24cec: 83 e5 ldi r24, 0x53 ; 83 24cee: 9d e4 ldi r25, 0x4D ; 77 24cf0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24cf4: 2c e9 ldi r18, 0x9C ; 156 24cf6: 3f ef ldi r19, 0xFF ; 255 24cf8: 40 e1 ldi r20, 0x10 ; 16 24cfa: 67 eb ldi r22, 0xB7 ; 183 24cfc: 73 e0 ldi r23, 0x03 ; 3 24cfe: 0f 94 15 cf call 0x39e2a ; 0x39e2a MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d02: 82 e4 ldi r24, 0x42 ; 66 24d04: 9d e4 ldi r25, 0x4D ; 77 24d06: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24d0a: 2c e9 ldi r18, 0x9C ; 156 24d0c: 3f ef ldi r19, 0xFF ; 255 24d0e: 40 e1 ldi r20, 0x10 ; 16 24d10: 69 eb ldi r22, 0xB9 ; 185 24d12: 73 e0 ldi r23, 0x03 ; 3 24d14: 0f 94 15 cf call 0x39e2a ; 0x39e2a MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 24d18: 80 e1 ldi r24, 0x10 ; 16 24d1a: 9b e3 ldi r25, 0x3B ; 59 24d1c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24d20: 64 e1 ldi r22, 0x14 ; 20 24d22: 7a e3 ldi r23, 0x3A ; 58 24d24: 0f 94 42 ce call 0x39c84 ; 0x39c84 MENU_END(); 24d28: 0f 94 99 ce call 0x39d32 ; 0x39d32 _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(); 24d2c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24d30: 8f 5f subi r24, 0xFF ; 255 24d32: 80 93 12 05 sts 0x0512, r24 ; 0x800512 24d36: 80 91 14 05 lds r24, 0x0514 ; 0x800514 24d3a: 8f 5f subi r24, 0xFF ; 255 24d3c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 24d40: 8d cf rjmp .-230 ; 0x24c5c 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(); } 24d42: 1f 91 pop r17 24d44: 0f 91 pop r16 24d46: ff 90 pop r15 24d48: ef 90 pop r14 24d4a: 08 95 ret 00024d4c : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 24d4c: 8e ec ldi r24, 0xCE ; 206 24d4e: 9e e0 ldi r25, 0x0E ; 14 24d50: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 24d54: 60 e0 ldi r22, 0x00 ; 0 24d56: 81 30 cpi r24, 0x01 ; 1 24d58: 09 f0 breq .+2 ; 0x24d5c 24d5a: 61 e0 ldi r22, 0x01 ; 1 24d5c: 8e ec ldi r24, 0xCE ; 206 24d5e: 9e e0 ldi r25, 0x0E ; 14 24d60: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 00024d64 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 24d64: 60 91 38 02 lds r22, 0x0238 ; 0x800238 24d68: 81 e0 ldi r24, 0x01 ; 1 24d6a: 68 27 eor r22, r24 24d6c: 60 93 38 02 sts 0x0238, r22 ; 0x800238 24d70: 87 e8 ldi r24, 0x87 ; 135 24d72: 9f e0 ldi r25, 0x0F ; 15 24d74: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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. 24d78: 80 91 38 02 lds r24, 0x0238 ; 0x800238 24d7c: 81 11 cpse r24, r1 24d7e: 02 c0 rjmp .+4 ; 0x24d84 24d80: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de #endif //FANCHECK } 24d84: 08 95 ret 00024d86 : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 24d86: 86 ed ldi r24, 0xD6 ; 214 24d88: 9e e0 ldi r25, 0x0E ; 14 24d8a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 24d8e: 61 e0 ldi r22, 0x01 ; 1 24d90: 82 30 cpi r24, 0x02 ; 2 24d92: 09 f0 breq .+2 ; 0x24d96 24d94: 62 e0 ldi r22, 0x02 ; 2 24d96: 86 ed ldi r24, 0xD6 ; 214 24d98: 9e e0 ldi r25, 0x0E ; 14 24d9a: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 00024d9e : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 24d9e: cf 93 push r28 24da0: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 24da2: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 24da6: 8c 33 cpi r24, 0x3C ; 60 24da8: e1 f0 breq .+56 ; 0x24de2 24daa: 80 35 cpi r24, 0x50 ; 80 24dac: 01 f1 breq .+64 ; 0x24dee 24dae: 88 32 cpi r24, 0x28 ; 40 24db0: 91 f0 breq .+36 ; 0x24dd6 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 24db2: 88 e2 ldi r24, 0x28 ; 40 24db4: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=400; 24db8: c0 e9 ldi r28, 0x90 ; 144 24dba: d1 e0 ldi r29, 0x01 ; 1 24dbc: 60 91 eb 04 lds r22, 0x04EB ; 0x8004eb 24dc0: 87 ea ldi r24, 0xA7 ; 167 24dc2: 9d e0 ldi r25, 0x0D ; 13 24dc4: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 24dc8: be 01 movw r22, r28 24dca: 85 ea ldi r24, 0xA5 ; 165 24dcc: 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); } 24dce: df 91 pop r29 24dd0: cf 91 pop r28 24dd2: 0d 94 88 dd jmp 0x3bb10 ; 0x3bb10 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 24dd6: 8c e3 ldi r24, 0x3C ; 60 24dd8: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=600; 24ddc: c8 e5 ldi r28, 0x58 ; 88 24dde: d2 e0 ldi r29, 0x02 ; 2 24de0: ed cf rjmp .-38 ; 0x24dbc break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 24de2: 80 e5 ldi r24, 0x50 ; 80 24de4: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=800; 24de8: c0 e2 ldi r28, 0x20 ; 32 24dea: d3 e0 ldi r29, 0x03 ; 3 24dec: e7 cf rjmp .-50 ; 0x24dbc break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 24dee: 89 e1 ldi r24, 0x19 ; 25 24df0: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=250; 24df4: ca ef ldi r28, 0xFA ; 250 24df6: d0 e0 ldi r29, 0x00 ; 0 24df8: e1 cf rjmp .-62 ; 0x24dbc 00024dfa : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 24dfa: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 24dfe: 86 e3 ldi r24, 0x36 ; 54 24e00: 9e e4 ldi r25, 0x4E ; 78 24e02: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24e06: 0e 94 91 6f call 0xdf22 ; 0xdf22 menu_back_if_clicked(); 24e0a: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00024e0e : } static void lcd_crash_mode_info2() { lcd_home(); 24e0e: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 24e12: 8d e6 ldi r24, 0x6D ; 109 24e14: 9e e4 ldi r25, 0x4E ; 78 24e16: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24e1a: 0e 94 91 6f call 0xdf22 ; 0xdf22 menu_back_if_clicked(); 24e1e: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00024e22 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 24e22: 81 30 cpi r24, 0x01 ; 1 24e24: 21 f4 brne .+8 ; 0x24e2e case STATE_ON: lcd_puts_P(_N(" 1")); 24e26: 8e e5 ldi r24, 0x5E ; 94 24e28: 90 e7 ldi r25, 0x70 ; 112 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 24e2a: 0c 94 91 6f jmp 0xdf22 ; 0xdf22 24e2e: 8a e5 ldi r24, 0x5A ; 90 24e30: 90 e7 ldi r25, 0x70 ; 112 24e32: fb cf rjmp .-10 ; 0x24e2a 00024e34 : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 24e34: 81 e0 ldi r24, 0x01 ; 1 24e36: 90 91 85 17 lds r25, 0x1785 ; 0x801785 24e3a: 91 11 cpse r25, r1 24e3c: 80 e0 ldi r24, 0x00 ; 0 24e3e: 0c 94 c5 75 jmp 0xeb8a ; 0xeb8a 00024e42 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 24e42: 0d 94 29 87 jmp 0x30e52 ; 0x30e52 00024e46 : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 24e46: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_status_message_idx = 0; // Re-draw message from beginning 24e4a: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.463> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 24e4e: 20 e0 ldi r18, 0x00 ; 0 24e50: 41 e0 ldi r20, 0x01 ; 1 24e52: 70 e0 ldi r23, 0x00 ; 0 24e54: 60 e0 ldi r22, 0x00 ; 0 24e56: 8c e8 ldi r24, 0x8C ; 140 24e58: 99 e3 ldi r25, 0x39 ; 57 24e5a: 0f 94 ef ce call 0x39dde ; 0x39dde menu_depth = 0; 24e5e: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 24e62: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 } 24e66: 08 95 ret 00024e68 : } } #if (LANG_MODE != 0) void lcd_language() { 24e68: cf 93 push r28 24e6a: df 93 push r29 lcd_update_enable(true); 24e6c: 81 e0 ldi r24, 0x01 ; 1 24e6e: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 menu_goto(lcd_language_menu, 0, true, true); 24e72: 21 e0 ldi r18, 0x01 ; 1 24e74: 41 e0 ldi r20, 0x01 ; 1 24e76: 70 e0 ldi r23, 0x00 ; 0 24e78: 60 e0 ldi r22, 0x00 ; 0 24e7a: 8a e3 ldi r24, 0x3A ; 58 24e7c: 9b e3 ldi r25, 0x3B ; 59 24e7e: 0f 94 ef ce call 0x39dde ; 0x39dde 24e82: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 24e86: c0 91 66 0e lds r28, 0x0E66 ; 0x800e66 24e8a: d0 91 67 0e lds r29, 0x0E67 ; 0x800e67 24e8e: 0e 94 e3 71 call 0xe3c6 ; 0xe3c6 24e92: cc 58 subi r28, 0x8C ; 140 24e94: d9 43 sbci r29, 0x39 ; 57 24e96: 39 f0 breq .+14 ; 0x24ea6 24e98: 81 11 cpse r24, r1 24e9a: 07 c0 rjmp .+14 ; 0x24eaa { delay_keep_alive(50); 24e9c: 82 e3 ldi r24, 0x32 ; 50 24e9e: 90 e0 ldi r25, 0x00 ; 0 24ea0: 0e 94 98 8e call 0x11d30 ; 0x11d30 24ea4: f0 cf rjmp .-32 ; 0x24e86 } if (lang_is_selected()) 24ea6: 88 23 and r24, r24 24ea8: 21 f0 breq .+8 ; 0x24eb2 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 24eaa: df 91 pop r29 24eac: 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(); 24eae: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 else lang_select(LANG_ID_PRI); 24eb2: 80 e0 ldi r24, 0x00 ; 0 } 24eb4: df 91 pop r29 24eb6: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 24eb8: 0c 94 fa 72 jmp 0xe5f4 ; 0xe5f4 00024ebc : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 24ebc: 61 e0 ldi r22, 0x01 ; 1 24ebe: 8f e7 ldi r24, 0x7F ; 127 24ec0: 94 ea ldi r25, 0xA4 ; 164 24ec2: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_return_to_status(); 24ec6: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 00024eca : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 24eca: 61 e0 ldi r22, 0x01 ; 1 24ecc: 89 e7 ldi r24, 0x79 ; 121 24ece: 94 ea ldi r25, 0xA4 ; 164 24ed0: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_return_to_status(); 24ed4: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 00024ed8 : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 24ed8: 61 e0 ldi r22, 0x01 ; 1 24eda: 85 e7 ldi r24, 0x75 ; 117 24edc: 94 ea ldi r25, 0xA4 ; 164 24ede: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_return_to_status(); 24ee2: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 00024ee6 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 24ee6: 61 e0 ldi r22, 0x01 ; 1 24ee8: 81 e7 ldi r24, 0x71 ; 113 24eea: 94 ea ldi r25, 0xA4 ; 164 24eec: 0e 94 5c 89 call 0x112b8 ; 0x112b8 lcd_return_to_status(); 24ef0: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 00024ef4 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 24ef4: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 24ef8: 86 e8 ldi r24, 0x86 ; 134 24efa: 9d e4 ldi r25, 0x4D ; 77 24efc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24f00: ac 01 movw r20, r24 24f02: 60 e0 ldi r22, 0x00 ; 0 24f04: 80 e0 ldi r24, 0x00 ; 0 24f06: 0e 94 ba 6f call 0xdf74 ; 0xdf74 pid_temp += lcd_encoder; 24f0a: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.456> 24f0e: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.456+0x1> 24f12: 20 91 34 05 lds r18, 0x0534 ; 0x800534 24f16: 30 91 35 05 lds r19, 0x0535 ; 0x800535 24f1a: 82 0f add r24, r18 24f1c: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 24f1e: 82 33 cpi r24, 0x32 ; 50 24f20: 21 e0 ldi r18, 0x01 ; 1 24f22: 92 07 cpc r25, r18 24f24: 50 f1 brcs .+84 ; 0x24f7a 24f26: 81 e3 ldi r24, 0x31 ; 49 24f28: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 24f2a: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.456+0x1> 24f2e: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.456> lcd_encoder = 0; 24f32: 10 92 35 05 sts 0x0535, r1 ; 0x800535 24f36: 10 92 34 05 sts 0x0534, r1 ; 0x800534 lcd_set_cursor(1, 2); 24f3a: 62 e0 ldi r22, 0x02 ; 2 24f3c: 81 e0 ldi r24, 0x01 ; 1 24f3e: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%3u"), pid_temp); 24f42: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.456+0x1> 24f46: 8f 93 push r24 24f48: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.456> 24f4c: 8f 93 push r24 24f4e: 89 ef ldi r24, 0xF9 ; 249 24f50: 93 ea ldi r25, 0xA3 ; 163 24f52: 9f 93 push r25 24f54: 8f 93 push r24 24f56: 0e 94 7f 6f call 0xdefe ; 0xdefe if (lcd_clicked()) { 24f5a: 0e 94 c3 71 call 0xe386 ; 0xe386 24f5e: 0f 90 pop r0 24f60: 0f 90 pop r0 24f62: 0f 90 pop r0 24f64: 0f 90 pop r0 24f66: 88 23 and r24, r24 24f68: 71 f0 breq .+28 ; 0x24f86 lcd_commands_type = LcdCommands::PidExtruder; 24f6a: 83 e0 ldi r24, 0x03 ; 3 24f6c: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 lcd_return_to_status(); 24f70: 0f 94 23 27 call 0x24e46 ; 0x24e46 lcd_update(2); 24f74: 82 e0 ldi r24, 0x02 ; 2 24f76: 0c 94 6d 6f jmp 0xdeda ; 0xdeda { 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; 24f7a: 8a 30 cpi r24, 0x0A ; 10 24f7c: 91 05 cpc r25, r1 24f7e: a8 f6 brcc .-86 ; 0x24f2a 24f80: 8a e0 ldi r24, 0x0A ; 10 24f82: 90 e0 ldi r25, 0x00 ; 0 24f84: d2 cf rjmp .-92 ; 0x24f2a lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 24f86: 08 95 ret 00024f88 : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 24f88: df 92 push r13 24f8a: ef 92 push r14 24f8c: ff 92 push r15 24f8e: 0f 93 push r16 24f90: 1f 93 push r17 24f92: cf 93 push r28 24f94: df 93 push r29 24f96: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 24f9a: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 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] ); 24f9e: ce ea ldi r28, 0xAE ; 174 24fa0: d4 e0 ldi r29, 0x04 ; 4 24fa2: 8a 81 ldd r24, Y+2 ; 0x02 24fa4: 9b 81 ldd r25, Y+3 ; 0x03 24fa6: 2c e3 ldi r18, 0x3C ; 60 24fa8: f2 2e mov r15, r18 24faa: f8 9e mul r15, r24 24fac: 80 01 movw r16, r0 24fae: f9 9e mul r15, r25 24fb0: 10 0d add r17, r0 24fb2: 11 24 eor r1, r1 24fb4: 84 e4 ldi r24, 0x44 ; 68 24fb6: 9f e3 ldi r25, 0x3F ; 63 24fb8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24fbc: e8 2e mov r14, r24 24fbe: d9 2e mov r13, r25 24fc0: 88 81 ld r24, Y 24fc2: 99 81 ldd r25, Y+1 ; 0x01 24fc4: f8 9e mul r15, r24 24fc6: e0 01 movw r28, r0 24fc8: f9 9e mul r15, r25 24fca: d0 0d add r29, r0 24fcc: 11 24 eor r1, r1 24fce: 81 e5 ldi r24, 0x51 ; 81 24fd0: 9f e3 ldi r25, 0x3F ; 63 24fd2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 24fd6: 1f 93 push r17 24fd8: 0f 93 push r16 24fda: df 92 push r13 24fdc: ef 92 push r14 24fde: df 93 push r29 24fe0: cf 93 push r28 24fe2: 9f 93 push r25 24fe4: 8f 93 push r24 24fe6: 8a e0 ldi r24, 0x0A ; 10 24fe8: 91 ea ldi r25, 0xA1 ; 161 24fea: 9f 93 push r25 24fec: 8f 93 push r24 24fee: 0e 94 7f 6f call 0xdefe ; 0xdefe menu_back_if_clicked(); 24ff2: 8d b7 in r24, 0x3d ; 61 24ff4: 9e b7 in r25, 0x3e ; 62 24ff6: 0a 96 adiw r24, 0x0a ; 10 24ff8: 0f b6 in r0, 0x3f ; 63 24ffa: f8 94 cli 24ffc: 9e bf out 0x3e, r25 ; 62 24ffe: 0f be out 0x3f, r0 ; 63 25000: 8d bf out 0x3d, r24 ; 61 } 25002: df 91 pop r29 25004: cf 91 pop r28 25006: 1f 91 pop r17 25008: 0f 91 pop r16 2500a: ff 90 pop r15 2500c: ef 90 pop r14 2500e: 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(); 25010: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00025014 : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 25014: 0f 93 push r16 25016: 1f 93 push r17 25018: cf 93 push r28 2501a: df 93 push r29 lcd_home(); 2501c: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 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))); 25020: 8b e5 ldi r24, 0x5B ; 91 25022: 9f e0 ldi r25, 0x0F ; 15 25024: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 25028: 18 2f mov r17, r24 2502a: 09 2f mov r16, r25 2502c: 8d e5 ldi r24, 0x5D ; 93 2502e: 9f e0 ldi r25, 0x0F ; 15 25030: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 25034: ec 01 movw r28, r24 25036: 80 ee ldi r24, 0xE0 ; 224 25038: 9a e4 ldi r25, 0x4A ; 74 2503a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2503e: 0f 93 push r16 25040: 1f 93 push r17 25042: df 93 push r29 25044: cf 93 push r28 25046: 9f 93 push r25 25048: 8f 93 push r24 2504a: 88 ee ldi r24, 0xE8 ; 232 2504c: 91 ea ldi r25, 0xA1 ; 161 2504e: 9f 93 push r25 25050: 8f 93 push r24 25052: 0e 94 7f 6f call 0xdefe ; 0xdefe menu_back_if_clicked(); 25056: 8d b7 in r24, 0x3d ; 61 25058: 9e b7 in r25, 0x3e ; 62 2505a: 08 96 adiw r24, 0x08 ; 8 2505c: 0f b6 in r0, 0x3f ; 63 2505e: f8 94 cli 25060: 9e bf out 0x3e, r25 ; 62 25062: 0f be out 0x3f, r0 ; 63 25064: 8d bf out 0x3d, r24 ; 61 } 25066: df 91 pop r29 25068: cf 91 pop r28 2506a: 1f 91 pop r17 2506c: 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(); 2506e: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00025072 : #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){ 25072: cf 93 push r28 25074: df 93 push r29 25076: cd b7 in r28, 0x3d ; 61 25078: de b7 in r29, 0x3e ; 62 2507a: 2f 97 sbiw r28, 0x0f ; 15 2507c: 0f b6 in r0, 0x3f ; 63 2507e: f8 94 cli 25080: de bf out 0x3e, r29 ; 62 25082: 0f be out 0x3f, r0 ; 63 25084: cd bf out 0x3d, r28 ; 61 25086: fc 01 movw r30, r24 25088: de 01 movw r26, r28 2508a: 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; 2508c: 90 e0 ldi r25, 0x00 ; 0 2508e: 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); 25090: 84 91 lpm r24, Z 25092: 41 e0 ldi r20, 0x01 ; 1 25094: 49 0f add r20, r25 if( ! b ) 25096: 88 23 and r24, r24 25098: 29 f0 breq .+10 ; 0x250a4 break; dst[i] = b; 2509a: 8d 93 st X+, r24 2509c: 31 96 adiw r30, 0x01 ; 1 2509e: 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 250a0: 4d 30 cpi r20, 0x0D ; 13 250a2: b1 f7 brne .-20 ; 0x25090 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 250a4: f9 01 movw r30, r18 250a6: e9 0f add r30, r25 250a8: f1 1d adc r31, r1 250aa: 8a e3 ldi r24, 0x3A ; 58 250ac: 80 83 st Z, r24 ++i; 250ae: 9f 5f subi r25, 0xFF ; 255 250b0: f9 01 movw r30, r18 250b2: e9 0f add r30, r25 250b4: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 250b6: 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 250b8: 9e 30 cpi r25, 0x0E ; 14 250ba: 19 f0 breq .+6 ; 0x250c2 dst[i] = ' '; 250bc: 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 250be: 9f 5f subi r25, 0xFF ; 255 250c0: fb cf rjmp .-10 ; 0x250b8 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 250c2: 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 250c4: 7f 93 push r23 250c6: 6f 93 push r22 250c8: 3f 93 push r19 250ca: 2f 93 push r18 250cc: 86 ea ldi r24, 0xA6 ; 166 250ce: 91 ea ldi r25, 0xA1 ; 161 250d0: 9f 93 push r25 250d2: 8f 93 push r24 250d4: 0e 94 7f 6f call 0xdefe ; 0xdefe 250d8: 0f 90 pop r0 250da: 0f 90 pop r0 250dc: 0f 90 pop r0 250de: 0f 90 pop r0 250e0: 0f 90 pop r0 250e2: 0f 90 pop r0 } 250e4: 2f 96 adiw r28, 0x0f ; 15 250e6: 0f b6 in r0, 0x3f ; 63 250e8: f8 94 cli 250ea: de bf out 0x3e, r29 ; 62 250ec: 0f be out 0x3f, r0 ; 63 250ee: cd bf out 0x3d, r28 ; 61 250f0: df 91 pop r29 250f2: cf 91 pop r28 250f4: 08 95 ret 000250f6 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 250f6: cf 92 push r12 250f8: df 92 push r13 250fa: ef 92 push r14 250fc: ff 92 push r15 250fe: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25102: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 25106: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2510a: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 2510e: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 25112: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 25116: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2511a: 6b 01 movw r12, r22 2511c: 8f e6 ldi r24, 0x6F ; 111 2511e: 97 e5 ldi r25, 0x57 ; 87 25120: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25124: b6 01 movw r22, r12 25126: 0f 94 39 28 call 0x25072 ; 0x25072 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 2512a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 2512e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 25132: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 25136: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 2513a: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2513e: 6b 01 movw r12, r22 25140: 84 e5 ldi r24, 0x54 ; 84 25142: 97 e5 ldi r25, 0x57 ; 87 25144: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25148: b6 01 movw r22, r12 2514a: 0f 94 39 28 call 0x25072 ; 0x25072 #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 2514e: 60 91 50 06 lds r22, 0x0650 ; 0x800650 25152: 70 91 51 06 lds r23, 0x0651 ; 0x800651 25156: 80 91 52 06 lds r24, 0x0652 ; 0x800652 2515a: 90 91 53 06 lds r25, 0x0653 ; 0x800653 2515e: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 25162: 6b 01 movw r12, r22 25164: 8c eb ldi r24, 0xBC ; 188 25166: 9a e4 ldi r25, 0x4A ; 74 25168: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2516c: b6 01 movw r22, r12 2516e: 0f 94 39 28 call 0x25072 ; 0x25072 #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 25172: 60 91 95 03 lds r22, 0x0395 ; 0x800395 25176: 70 91 96 03 lds r23, 0x0396 ; 0x800396 2517a: 80 91 97 03 lds r24, 0x0397 ; 0x800397 2517e: 90 91 98 03 lds r25, 0x0398 ; 0x800398 25182: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 25186: 88 e6 ldi r24, 0x68 ; 104 25188: 90 e7 ldi r25, 0x70 ; 112 2518a: 0f 94 39 28 call 0x25072 ; 0x25072 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 2518e: ff 90 pop r15 25190: ef 90 pop r14 25192: df 90 pop r13 25194: 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(); 25196: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 0002519a : //! | 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() { 2519a: af 92 push r10 2519c: bf 92 push r11 2519e: cf 92 push r12 251a0: df 92 push r13 251a2: ef 92 push r14 251a4: ff 92 push r15 251a6: 0f 93 push r16 251a8: 1f 93 push r17 251aa: cf 93 push r28 251ac: df 93 push r29 251ae: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 251b2: 84 e6 ldi r24, 0x64 ; 100 251b4: 9f e0 ldi r25, 0x0F ; 15 251b6: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 251ba: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 251bc: 85 e6 ldi r24, 0x65 ; 101 251be: 9f e0 ldi r25, 0x0F ; 15 251c0: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 251c4: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 251c6: 86 e6 ldi r24, 0x66 ; 102 251c8: 9f e0 ldi r25, 0x0F ; 15 251ca: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 251ce: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 251d0: 88 e6 ldi r24, 0x68 ; 104 251d2: 9f e0 ldi r25, 0x0F ; 15 251d4: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 251d8: a8 2e mov r10, r24 lcd_home(); 251da: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_printf_P(failStatsFmt, 251de: 8f e9 ldi r24, 0x9F ; 159 251e0: 9a e4 ldi r25, 0x4A ; 74 251e2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 251e6: d8 2e mov r13, r24 251e8: c9 2e mov r12, r25 251ea: 80 e9 ldi r24, 0x90 ; 144 251ec: 9a e4 ldi r25, 0x4A ; 74 251ee: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 251f2: 08 2f mov r16, r24 251f4: f9 2e mov r15, r25 251f6: 8f e7 ldi r24, 0x7F ; 127 251f8: 9a e4 ldi r25, 0x4A ; 74 251fa: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 251fe: ec 01 movw r28, r24 25200: 89 e6 ldi r24, 0x69 ; 105 25202: 9a e4 ldi r25, 0x4A ; 74 25204: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25208: 1f 92 push r1 2520a: af 92 push r10 2520c: 1f 92 push r1 2520e: bf 92 push r11 25210: cf 92 push r12 25212: df 92 push r13 25214: 1f 92 push r1 25216: ef 92 push r14 25218: ff 92 push r15 2521a: 0f 93 push r16 2521c: 1f 92 push r1 2521e: 1f 93 push r17 25220: df 93 push r29 25222: cf 93 push r28 25224: 9f 93 push r25 25226: 8f 93 push r24 25228: 81 e7 ldi r24, 0x71 ; 113 2522a: 91 ea ldi r25, 0xA1 ; 161 2522c: 9f 93 push r25 2522e: 8f 93 push r24 25230: 0e 94 7f 6f call 0xdefe ; 0xdefe _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 25234: 8d b7 in r24, 0x3d ; 61 25236: 9e b7 in r25, 0x3e ; 62 25238: 42 96 adiw r24, 0x12 ; 18 2523a: 0f b6 in r0, 0x3f ; 63 2523c: f8 94 cli 2523e: 9e bf out 0x3e, r25 ; 62 25240: 0f be out 0x3f, r0 ; 63 25242: 8d bf out 0x3d, r24 ; 61 } 25244: df 91 pop r29 25246: cf 91 pop r28 25248: 1f 91 pop r17 2524a: 0f 91 pop r16 2524c: ff 90 pop r15 2524e: ef 90 pop r14 25250: df 90 pop r13 25252: cf 90 pop r12 25254: bf 90 pop r11 25256: 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(); 25258: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 0002525c : //! | 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() { 2525c: 6f 92 push r6 2525e: 7f 92 push r7 25260: 8f 92 push r8 25262: 9f 92 push r9 25264: af 92 push r10 25266: bf 92 push r11 25268: cf 92 push r12 2526a: df 92 push r13 2526c: ef 92 push r14 2526e: ff 92 push r15 25270: 0f 93 push r16 25272: 1f 93 push r17 25274: cf 93 push r28 25276: df 93 push r29 25278: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 2527c: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_printf_P(failStatsFmt, 25280: 83 e0 ldi r24, 0x03 ; 3 25282: 9f e0 ldi r25, 0x0F ; 15 25284: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 25288: 0f 94 45 1e call 0x23c8a ; 0x23c8a 2528c: 78 2e mov r7, r24 2528e: 69 2e mov r6, r25 25290: 85 e0 ldi r24, 0x05 ; 5 25292: 9f e0 ldi r25, 0x0F ; 15 25294: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 25298: 0f 94 45 1e call 0x23c8a ; 0x23c8a 2529c: 98 2e mov r9, r24 2529e: 89 2e mov r8, r25 252a0: 8f e9 ldi r24, 0x9F ; 159 252a2: 9a e4 ldi r25, 0x4A ; 74 252a4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 252a8: b8 2e mov r11, r24 252aa: a9 2e mov r10, r25 252ac: 81 e0 ldi r24, 0x01 ; 1 252ae: 9f e0 ldi r25, 0x0F ; 15 252b0: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 252b4: 0f 94 45 1e call 0x23c8a ; 0x23c8a 252b8: d8 2e mov r13, r24 252ba: c9 2e mov r12, r25 252bc: 80 e9 ldi r24, 0x90 ; 144 252be: 9a e4 ldi r25, 0x4A ; 74 252c0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 252c4: f8 2e mov r15, r24 252c6: e9 2e mov r14, r25 252c8: 8f ef ldi r24, 0xFF ; 255 252ca: 9e e0 ldi r25, 0x0E ; 14 252cc: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 252d0: 0f 94 45 1e call 0x23c8a ; 0x23c8a 252d4: 18 2f mov r17, r24 252d6: 09 2f mov r16, r25 252d8: 8f e7 ldi r24, 0x7F ; 127 252da: 9a e4 ldi r25, 0x4A ; 74 252dc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 252e0: ec 01 movw r28, r24 252e2: 88 e5 ldi r24, 0x58 ; 88 252e4: 9a e4 ldi r25, 0x4A ; 74 252e6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 252ea: 6f 92 push r6 252ec: 7f 92 push r7 252ee: 8f 92 push r8 252f0: 9f 92 push r9 252f2: af 92 push r10 252f4: bf 92 push r11 252f6: cf 92 push r12 252f8: df 92 push r13 252fa: ef 92 push r14 252fc: ff 92 push r15 252fe: 0f 93 push r16 25300: 1f 93 push r17 25302: df 93 push r29 25304: cf 93 push r28 25306: 9f 93 push r25 25308: 8f 93 push r24 2530a: 81 e7 ldi r24, 0x71 ; 113 2530c: 91 ea ldi r25, 0xA1 ; 161 2530e: 9f 93 push r25 25310: 8f 93 push r24 25312: 0e 94 7f 6f call 0xdefe ; 0xdefe _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(); 25316: 8d b7 in r24, 0x3d ; 61 25318: 9e b7 in r25, 0x3e ; 62 2531a: 42 96 adiw r24, 0x12 ; 18 2531c: 0f b6 in r0, 0x3f ; 63 2531e: f8 94 cli 25320: 9e bf out 0x3e, r25 ; 62 25322: 0f be out 0x3f, r0 ; 63 25324: 8d bf out 0x3d, r24 ; 61 } 25326: df 91 pop r29 25328: cf 91 pop r28 2532a: 1f 91 pop r17 2532c: 0f 91 pop r16 2532e: ff 90 pop r15 25330: ef 90 pop r14 25332: df 90 pop r13 25334: cf 90 pop r12 25336: bf 90 pop r11 25338: af 90 pop r10 2533a: 9f 90 pop r9 2533c: 8f 90 pop r8 2533e: 7f 90 pop r7 25340: 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(); 25342: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00025346 : //! | 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() { 25346: 8f 92 push r8 25348: 9f 92 push r9 2534a: af 92 push r10 2534c: bf 92 push r11 2534e: cf 92 push r12 25350: df 92 push r13 25352: ef 92 push r14 25354: ff 92 push r15 25356: 0f 93 push r16 25358: 1f 93 push r17 2535a: cf 93 push r28 2535c: df 93 push r29 2535e: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25362: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_printf_P( 25366: 80 91 9b 13 lds r24, 0x139B ; 0x80139b 2536a: 90 91 9c 13 lds r25, 0x139C ; 0x80139c 2536e: 0f 94 45 1e call 0x23c8a ; 0x23c8a 25372: 98 2e mov r9, r24 25374: 89 2e mov r8, r25 25376: 83 e3 ldi r24, 0x33 ; 51 25378: 9a e4 ldi r25, 0x4A ; 74 2537a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2537e: b8 2e mov r11, r24 25380: a9 2e mov r10, r25 25382: 80 ed ldi r24, 0xD0 ; 208 25384: 9e e0 ldi r25, 0x0E ; 14 25386: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 2538a: 0f 94 45 1e call 0x23c8a ; 0x23c8a 2538e: d8 2e mov r13, r24 25390: c9 2e mov r12, r25 25392: 82 e2 ldi r24, 0x22 ; 34 25394: 9a e4 ldi r25, 0x4A ; 74 25396: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2539a: f8 2e mov r15, r24 2539c: e9 2e mov r14, r25 2539e: 83 ed ldi r24, 0xD3 ; 211 253a0: 9e e0 ldi r25, 0x0E ; 14 253a2: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 253a6: 0f 94 45 1e call 0x23c8a ; 0x23c8a 253aa: 18 2f mov r17, r24 253ac: 09 2f mov r16, r25 253ae: 86 e1 ldi r24, 0x16 ; 22 253b0: 9a e4 ldi r25, 0x4A ; 74 253b2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 253b6: ec 01 movw r28, r24 253b8: 88 e5 ldi r24, 0x58 ; 88 253ba: 9a e4 ldi r25, 0x4A ; 74 253bc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 253c0: 8f 92 push r8 253c2: 9f 92 push r9 253c4: af 92 push r10 253c6: bf 92 push r11 253c8: cf 92 push r12 253ca: df 92 push r13 253cc: ef 92 push r14 253ce: ff 92 push r15 253d0: 0f 93 push r16 253d2: 1f 93 push r17 253d4: df 93 push r29 253d6: cf 93 push r28 253d8: 9f 93 push r25 253da: 8f 93 push r24 253dc: 84 e4 ldi r24, 0x44 ; 68 253de: 91 ea ldi r25, 0xA1 ; 161 253e0: 9f 93 push r25 253e2: 8f 93 push r24 253e4: 0e 94 7f 6f call 0xdefe ; 0xdefe ), _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(); 253e8: 8d b7 in r24, 0x3d ; 61 253ea: 9e b7 in r25, 0x3e ; 62 253ec: 40 96 adiw r24, 0x10 ; 16 253ee: 0f b6 in r0, 0x3f ; 63 253f0: f8 94 cli 253f2: 9e bf out 0x3e, r25 ; 62 253f4: 0f be out 0x3f, r0 ; 63 253f6: 8d bf out 0x3d, r24 ; 61 } 253f8: df 91 pop r29 253fa: cf 91 pop r28 253fc: 1f 91 pop r17 253fe: 0f 91 pop r16 25400: ff 90 pop r15 25402: ef 90 pop r14 25404: df 90 pop r13 25406: cf 90 pop r12 25408: bf 90 pop r11 2540a: af 90 pop r10 2540c: 9f 90 pop r9 2540e: 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(); 25410: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00025414 : //! | 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() { 25414: cf 92 push r12 25416: df 92 push r13 25418: ef 92 push r14 2541a: ff 92 push r15 2541c: 0f 93 push r16 2541e: 1f 93 push r17 25420: cf 93 push r28 25422: df 93 push r29 25424: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25428: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 " %-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) )); 2542c: 8f ec ldi r24, 0xCF ; 207 2542e: 9e e0 ldi r25, 0x0E ; 14 25430: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 25434: 90 e0 ldi r25, 0x00 ; 0 25436: 0f 94 45 1e call 0x23c8a ; 0x23c8a 2543a: d8 2e mov r13, r24 2543c: c9 2e mov r12, r25 2543e: 82 e2 ldi r24, 0x22 ; 34 25440: 9a e4 ldi r25, 0x4A ; 74 25442: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25446: f8 2e mov r15, r24 25448: 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) ), 2544a: 82 ed ldi r24, 0xD2 ; 210 2544c: 9e e0 ldi r25, 0x0E ; 14 2544e: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 25452: 90 e0 ldi r25, 0x00 ; 0 25454: 0f 94 45 1e call 0x23c8a ; 0x23c8a 25458: 18 2f mov r17, r24 2545a: 09 2f mov r16, r25 2545c: 86 e1 ldi r24, 0x16 ; 22 2545e: 9a e4 ldi r25, 0x4A ; 74 25460: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25464: ec 01 movw r28, r24 25466: 89 e6 ldi r24, 0x69 ; 105 25468: 9a e4 ldi r25, 0x4A ; 74 2546a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2546e: cf 92 push r12 25470: df 92 push r13 25472: ef 92 push r14 25474: ff 92 push r15 25476: 0f 93 push r16 25478: 1f 93 push r17 2547a: df 93 push r29 2547c: cf 93 push r28 2547e: 9f 93 push r25 25480: 8f 93 push r24 25482: 85 e2 ldi r24, 0x25 ; 37 25484: 91 ea ldi r25, 0xA1 ; 161 25486: 9f 93 push r25 25488: 8f 93 push r24 2548a: 0e 94 7f 6f call 0xdefe ; 0xdefe " %-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(); 2548e: 8d b7 in r24, 0x3d ; 61 25490: 9e b7 in r25, 0x3e ; 62 25492: 0c 96 adiw r24, 0x0c ; 12 25494: 0f b6 in r0, 0x3f ; 63 25496: f8 94 cli 25498: 9e bf out 0x3e, r25 ; 62 2549a: 0f be out 0x3f, r0 ; 63 2549c: 8d bf out 0x3d, r24 ; 61 } 2549e: df 91 pop r29 254a0: cf 91 pop r28 254a2: 1f 91 pop r17 254a4: 0f 91 pop r16 254a6: ff 90 pop r15 254a8: ef 90 pop r14 254aa: df 90 pop r13 254ac: 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(); 254ae: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 000254b2 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 254b2: af 92 push r10 254b4: bf 92 push r11 254b6: cf 92 push r12 254b8: df 92 push r13 254ba: ef 92 push r14 254bc: ff 92 push r15 254be: 0f 93 push r16 254c0: 1f 93 push r17 254c2: cf 93 push r28 254c4: df 93 push r29 254c6: 00 d0 rcall .+0 ; 0x254c8 254c8: 00 d0 rcall .+0 ; 0x254ca 254ca: 1f 92 push r1 254cc: cd b7 in r28, 0x3d ; 61 254ce: 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)) || 254d0: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 254d4: 81 11 cpse r24, r1 254d6: 18 c0 rjmp .+48 ; 0x25508 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))) || 254d8: 81 ea ldi r24, 0xA1 ; 161 254da: 9d e0 ldi r25, 0x0D ; 13 254dc: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 254e0: 18 2f mov r17, r24 254e2: 0e 94 dd 77 call 0xefba ; 0xefba 254e6: 88 23 and r24, r24 254e8: 79 f0 breq .+30 ; 0x25508 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 254ea: 80 e1 ldi r24, 0x10 ; 16 254ec: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 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))) || 254f0: 88 23 and r24, r24 254f2: 51 f0 breq .+20 ; 0x25508 (!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))))) 254f4: 2b e0 ldi r18, 0x0B ; 11 254f6: 12 9f mul r17, r18 254f8: c0 01 movw r24, r0 254fa: 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 254fc: 80 5b subi r24, 0xB0 ; 176 254fe: 92 4f sbci r25, 0xF2 ; 242 25500: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 } 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)) || 25504: 89 2b or r24, r25 25506: f1 f4 brne .+60 ; 0x25544 (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) 25508: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 2550c: 88 23 and r24, r24 2550e: 71 f0 breq .+28 ; 0x2552c { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 25510: 81 ea ldi r24, 0xA1 ; 161 25512: 9d e0 ldi r25, 0x0D ; 13 25514: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 25518: 2b e0 ldi r18, 0x0B ; 11 2551a: 82 9f mul r24, r18 2551c: c0 01 movw r24, r0 2551e: 11 24 eor r1, r1 25520: 6f ef ldi r22, 0xFF ; 255 25522: 7f ef ldi r23, 0xFF ; 255 25524: 80 5b subi r24, 0xB0 ; 176 25526: 92 4f sbci r25, 0xF2 ; 242 25528: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 } // 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()); 2552c: 0e 94 c3 71 call 0xe386 ; 0xe386 25530: 21 e0 ldi r18, 0x01 ; 1 25532: 81 11 cpse r24, r1 25534: 20 e0 ldi r18, 0x00 ; 0 25536: 41 e0 ldi r20, 0x01 ; 1 25538: 70 e0 ldi r23, 0x00 ; 0 2553a: 60 e0 ldi r22, 0x00 ; 0 2553c: 8c e4 ldi r24, 0x4C ; 76 2553e: 9b e3 ldi r25, 0x3B ; 59 25540: 0f 94 ef ce call 0x39dde ; 0x39dde } if (lcd_encoder) { 25544: 20 91 34 05 lds r18, 0x0534 ; 0x800534 25548: 30 91 35 05 lds r19, 0x0535 ; 0x800535 2554c: 21 15 cp r18, r1 2554e: 31 05 cpc r19, r1 25550: 59 f0 breq .+22 ; 0x25568 menuData->reset = lcd_encoder > 0; 25552: 81 e0 ldi r24, 0x01 ; 1 25554: 12 16 cp r1, r18 25556: 13 06 cpc r1, r19 25558: 0c f0 brlt .+2 ; 0x2555c 2555a: 80 e0 ldi r24, 0x00 ; 0 2555c: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 lcd_encoder = 0; // Reset 25560: 10 92 35 05 sts 0x0535, r1 ; 0x800535 25564: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } char sheet_name[sizeof(Sheet::name)]; eeprom_read_block(sheet_name, &EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].name, sizeof(Sheet::name)); 25568: 81 ea ldi r24, 0xA1 ; 161 2556a: 9d e0 ldi r25, 0x0D ; 13 2556c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 25570: 1b e0 ldi r17, 0x0B ; 11 25572: 81 9f mul r24, r17 25574: b0 01 movw r22, r0 25576: 11 24 eor r1, r1 25578: 67 5b subi r22, 0xB7 ; 183 2557a: 72 4f sbci r23, 0xF2 ; 242 2557c: 47 e0 ldi r20, 0x07 ; 7 2557e: 50 e0 ldi r21, 0x00 ; 0 25580: ce 01 movw r24, r28 25582: 01 96 adiw r24, 0x01 ; 1 25584: 7c 01 movw r14, r24 25586: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c lcd_home(); 2558a: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 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]; 2558e: 81 ea ldi r24, 0xA1 ; 161 25590: 9d e0 ldi r25, 0x0D ; 13 25592: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 25596: 81 9f mul r24, r17 25598: c0 01 movw r24, r0 2559a: 11 24 eor r1, r1 2559c: 80 5b subi r24, 0xB0 ; 176 2559e: 92 4f sbci r25, 0xF2 ; 242 255a0: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 255a4: bc 01 movw r22, r24 255a6: 99 0f add r25, r25 255a8: 88 0b sbc r24, r24 255aa: 99 0b sbc r25, r25 255ac: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 255b0: 20 91 77 06 lds r18, 0x0677 ; 0x800677 255b4: 30 91 78 06 lds r19, 0x0678 ; 0x800678 255b8: 40 91 79 06 lds r20, 0x0679 ; 0x800679 255bc: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 255c0: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 255c4: d6 2e mov r13, r22 255c6: c7 2e mov r12, r23 255c8: b8 2e mov r11, r24 255ca: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 255cc: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 255d0: 0e e3 ldi r16, 0x3E ; 62 255d2: 10 e2 ldi r17, 0x20 ; 32 255d4: 81 11 cpse r24, r1 255d6: 02 c0 rjmp .+4 ; 0x255dc 255d8: 00 e2 ldi r16, 0x20 ; 32 255da: 1e e3 ldi r17, 0x3E ; 62 255dc: 89 ee ldi r24, 0xE9 ; 233 255de: 9e e4 ldi r25, 0x4E ; 78 255e0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 255e4: 1f 92 push r1 255e6: 0f 93 push r16 255e8: 1f 92 push r1 255ea: 1f 93 push r17 255ec: af 92 push r10 255ee: bf 92 push r11 255f0: cf 92 push r12 255f2: df 92 push r13 255f4: ff 92 push r15 255f6: ef 92 push r14 255f8: 9f 93 push r25 255fa: 8f 93 push r24 255fc: 0e 94 7f 6f call 0xdefe ; 0xdefe 25600: 0f b6 in r0, 0x3f ; 63 25602: f8 94 cli 25604: de bf out 0x3e, r29 ; 62 25606: 0f be out 0x3f, r0 ; 63 25608: 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. } 2560a: 27 96 adiw r28, 0x07 ; 7 2560c: 0f b6 in r0, 0x3f ; 63 2560e: f8 94 cli 25610: de bf out 0x3e, r29 ; 62 25612: 0f be out 0x3f, r0 ; 63 25614: cd bf out 0x3d, r28 ; 61 25616: df 91 pop r29 25618: cf 91 pop r28 2561a: 1f 91 pop r17 2561c: 0f 91 pop r16 2561e: ff 90 pop r15 25620: ef 90 pop r14 25622: df 90 pop r13 25624: cf 90 pop r12 25626: bf 90 pop r11 25628: af 90 pop r10 2562a: 08 95 ret 0002562c : //! |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() { 2562c: 2f 92 push r2 2562e: 3f 92 push r3 25630: 4f 92 push r4 25632: 5f 92 push r5 25634: 6f 92 push r6 25636: 7f 92 push r7 25638: 8f 92 push r8 2563a: 9f 92 push r9 2563c: af 92 push r10 2563e: bf 92 push r11 25640: cf 92 push r12 25642: df 92 push r13 25644: ef 92 push r14 25646: ff 92 push r15 25648: 0f 93 push r16 2564a: 1f 93 push r17 2564c: cf 93 push r28 2564e: df 93 push r29 25650: cd b7 in r28, 0x3d ; 61 25652: de b7 in r29, 0x3e ; 62 25654: a8 97 sbiw r28, 0x28 ; 40 25656: 0f b6 in r0, 0x3f ; 63 25658: f8 94 cli 2565a: de bf out 0x3e, r29 ; 62 2565c: 0f be out 0x3f, r0 ; 63 2565e: 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); 25660: 48 e0 ldi r20, 0x08 ; 8 25662: 50 e0 ldi r21, 0x00 ; 0 25664: 65 ee ldi r22, 0xE5 ; 229 25666: 7f e0 ldi r23, 0x0F ; 15 25668: ce 01 movw r24, r28 2566a: 41 96 adiw r24, 0x11 ; 17 2566c: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 25670: 48 e0 ldi r20, 0x08 ; 8 25672: 50 e0 ldi r21, 0x00 ; 0 25674: 6d ed ldi r22, 0xDD ; 221 25676: 7f e0 ldi r23, 0x0F ; 15 25678: ce 01 movw r24, r28 2567a: 09 96 adiw r24, 0x09 ; 9 2567c: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 25680: 48 e0 ldi r20, 0x08 ; 8 25682: 50 e0 ldi r21, 0x00 ; 0 25684: 65 ed ldi r22, 0xD5 ; 213 25686: 7f e0 ldi r23, 0x0F ; 15 25688: ce 01 movw r24, r28 2568a: 01 96 adiw r24, 0x01 ; 1 2568c: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c 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]; 25690: 8d 84 ldd r8, Y+13 ; 0x0d 25692: 9e 84 ldd r9, Y+14 ; 0x0e 25694: af 84 ldd r10, Y+15 ; 0x0f 25696: b8 88 ldd r11, Y+16 ; 0x10 25698: e0 e5 ldi r30, 0x50 ; 80 2569a: f2 e9 ldi r31, 0x92 ; 146 2569c: 25 91 lpm r18, Z+ 2569e: 35 91 lpm r19, Z+ 256a0: 45 91 lpm r20, Z+ 256a2: 54 91 lpm r21, Z 256a4: cd 80 ldd r12, Y+5 ; 0x05 256a6: de 80 ldd r13, Y+6 ; 0x06 256a8: ef 80 ldd r14, Y+7 ; 0x07 256aa: f8 84 ldd r15, Y+8 ; 0x08 256ac: e4 e5 ldi r30, 0x54 ; 84 256ae: f2 e9 ldi r31, 0x92 ; 146 256b0: 85 91 lpm r24, Z+ 256b2: 95 91 lpm r25, Z+ 256b4: a5 91 lpm r26, Z+ 256b6: b4 91 lpm r27, Z 256b8: 8d a3 std Y+37, r24 ; 0x25 256ba: 9e a3 std Y+38, r25 ; 0x26 256bc: af a3 std Y+39, r26 ; 0x27 256be: b8 a7 std Y+40, r27 ; 0x28 256c0: 8d 89 ldd r24, Y+21 ; 0x15 256c2: 9e 89 ldd r25, Y+22 ; 0x16 256c4: af 89 ldd r26, Y+23 ; 0x17 256c6: b8 8d ldd r27, Y+24 ; 0x18 256c8: 89 a3 std Y+33, r24 ; 0x21 256ca: 9a a3 std Y+34, r25 ; 0x22 256cc: ab a3 std Y+35, r26 ; 0x23 256ce: bc a3 std Y+36, r27 ; 0x24 256d0: c5 01 movw r24, r10 256d2: b4 01 movw r22, r8 256d4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 256d8: 2b 01 movw r4, r22 256da: 3c 01 movw r6, r24 256dc: 2d a1 ldd r18, Y+37 ; 0x25 256de: 3e a1 ldd r19, Y+38 ; 0x26 256e0: 4f a1 ldd r20, Y+39 ; 0x27 256e2: 58 a5 ldd r21, Y+40 ; 0x28 256e4: c7 01 movw r24, r14 256e6: b6 01 movw r22, r12 256e8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 256ec: 9b 01 movw r18, r22 256ee: ac 01 movw r20, r24 256f0: c3 01 movw r24, r6 256f2: b2 01 movw r22, r4 256f4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 256f8: 29 a1 ldd r18, Y+33 ; 0x21 256fa: 3a a1 ldd r19, Y+34 ; 0x22 256fc: 4b a1 ldd r20, Y+35 ; 0x23 256fe: 5c a1 ldd r21, Y+36 ; 0x24 25700: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 25704: 20 e0 ldi r18, 0x00 ; 0 25706: 30 e0 ldi r19, 0x00 ; 0 25708: 40 e9 ldi r20, 0x90 ; 144 2570a: 50 e4 ldi r21, 0x40 ; 64 2570c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 25710: 1b 01 movw r2, r22 25712: 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]; 25714: e8 e5 ldi r30, 0x58 ; 88 25716: f2 e9 ldi r31, 0x92 ; 146 25718: 25 91 lpm r18, Z+ 2571a: 35 91 lpm r19, Z+ 2571c: 45 91 lpm r20, Z+ 2571e: 54 91 lpm r21, Z 25720: ec e5 ldi r30, 0x5C ; 92 25722: f2 e9 ldi r31, 0x92 ; 146 25724: 45 90 lpm r4, Z+ 25726: 55 90 lpm r5, Z+ 25728: 65 90 lpm r6, Z+ 2572a: 74 90 lpm r7, Z 2572c: c5 01 movw r24, r10 2572e: b4 01 movw r22, r8 25730: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 25734: 4b 01 movw r8, r22 25736: 5c 01 movw r10, r24 25738: a3 01 movw r20, r6 2573a: 92 01 movw r18, r4 2573c: c7 01 movw r24, r14 2573e: b6 01 movw r22, r12 25740: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 25744: 9b 01 movw r18, r22 25746: ac 01 movw r20, r24 25748: c5 01 movw r24, r10 2574a: b4 01 movw r22, r8 2574c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 25750: 29 a1 ldd r18, Y+33 ; 0x21 25752: 3a a1 ldd r19, Y+34 ; 0x22 25754: 4b a1 ldd r20, Y+35 ; 0x23 25756: 5c a1 ldd r21, Y+36 ; 0x24 25758: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 2575c: 20 e0 ldi r18, 0x00 ; 0 2575e: 30 e0 ldi r19, 0x00 ; 0 25760: 40 e9 ldi r20, 0x90 ; 144 25762: 50 e4 ldi r21, 0x40 ; 64 25764: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 25768: 6d 8f std Y+29, r22 ; 0x1d 2576a: 7e 8f std Y+30, r23 ; 0x1e 2576c: 8f 8f std Y+31, r24 ; 0x1f 2576e: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 25770: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_printf_P(_N( 25774: 8b ee ldi r24, 0xEB ; 235 25776: 9c e4 ldi r25, 0x4C ; 76 25778: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2577c: d8 2e mov r13, r24 2577e: c9 2e mov r12, r25 25780: 84 ee ldi r24, 0xE4 ; 228 25782: 9c e4 ldi r25, 0x4C ; 76 25784: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25788: f8 2e mov r15, r24 2578a: e9 2e mov r14, r25 2578c: 8e ec ldi r24, 0xCE ; 206 2578e: 9c e4 ldi r25, 0x4C ; 76 25790: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25794: cf 92 push r12 25796: df 92 push r13 25798: ef 92 push r14 2579a: ff 92 push r15 2579c: 21 e4 ldi r18, 0x41 ; 65 2579e: 3c e8 ldi r19, 0x8C ; 140 257a0: 3f 93 push r19 257a2: 2f 93 push r18 257a4: 9f 93 push r25 257a6: 8f 93 push r24 257a8: 88 e1 ldi r24, 0x18 ; 24 257aa: 90 e7 ldi r25, 0x70 ; 112 257ac: 9f 93 push r25 257ae: 8f 93 push r24 257b0: 0e 94 7f 6f call 0xdefe ; 0xdefe _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 257b4: 62 e0 ldi r22, 0x02 ; 2 257b6: 8b e0 ldi r24, 0x0B ; 11 257b8: 0e 94 a6 6f call 0xdf4c ; 0xdf4c if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 257bc: 0f b6 in r0, 0x3f ; 63 257be: f8 94 cli 257c0: de bf out 0x3e, r29 ; 62 257c2: 0f be out 0x3f, r0 ; 63 257c4: cd bf out 0x3d, r28 ; 61 257c6: 20 e0 ldi r18, 0x00 ; 0 257c8: 30 e0 ldi r19, 0x00 ; 0 257ca: 48 e4 ldi r20, 0x48 ; 72 257cc: 53 e4 ldi r21, 0x43 ; 67 257ce: 62 2d mov r22, r2 257d0: 73 2d mov r23, r3 257d2: 80 2f mov r24, r16 257d4: 91 2f mov r25, r17 257d6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 257da: 87 ff sbrs r24, 7 257dc: 51 c0 rjmp .+162 ; 0x25880 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 257de: 1f 93 push r17 257e0: 0f 93 push r16 257e2: 3f 92 push r3 257e4: 2f 92 push r2 257e6: 80 e1 ldi r24, 0x10 ; 16 257e8: 90 e7 ldi r25, 0x70 ; 112 257ea: 9f 93 push r25 257ec: 8f 93 push r24 257ee: 0e 94 7f 6f call 0xdefe ; 0xdefe 257f2: 0f 90 pop r0 257f4: 0f 90 pop r0 257f6: 0f 90 pop r0 257f8: 0f 90 pop r0 257fa: 0f 90 pop r0 257fc: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 257fe: 63 e0 ldi r22, 0x03 ; 3 25800: 8b e0 ldi r24, 0x0B ; 11 25802: 0e 94 a6 6f call 0xdf4c ; 0xdf4c if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 25806: 1d 8d ldd r17, Y+29 ; 0x1d 25808: 0e 8d ldd r16, Y+30 ; 0x1e 2580a: ff 8c ldd r15, Y+31 ; 0x1f 2580c: e8 a0 ldd r14, Y+32 ; 0x20 2580e: 20 e0 ldi r18, 0x00 ; 0 25810: 30 e0 ldi r19, 0x00 ; 0 25812: 48 e4 ldi r20, 0x48 ; 72 25814: 53 e4 ldi r21, 0x43 ; 67 25816: d8 01 movw r26, r16 25818: f7 01 movw r30, r14 2581a: 6b 2f mov r22, r27 2581c: 7a 2f mov r23, r26 2581e: 8f 2f mov r24, r31 25820: 9e 2f mov r25, r30 25822: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 25826: 87 fd sbrc r24, 7 25828: 32 c0 rjmp .+100 ; 0x2588e 2582a: 8b ef ldi r24, 0xFB ; 251 2582c: 9c e3 ldi r25, 0x3C ; 60 2582e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25832: 0e 94 91 6f call 0xdf22 ; 0xdf22 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 25836: 0e 94 c3 71 call 0xe386 ; 0xe386 2583a: 88 23 and r24, r24 2583c: 41 f0 breq .+16 ; 0x2584e menu_goto(lcd_menu_xyz_skew, 0, true); 2583e: 20 e0 ldi r18, 0x00 ; 0 25840: 41 e0 ldi r20, 0x01 ; 1 25842: 70 e0 ldi r23, 0x00 ; 0 25844: 60 e0 ldi r22, 0x00 ; 0 25846: 80 ee ldi r24, 0xE0 ; 224 25848: 99 e3 ldi r25, 0x39 ; 57 2584a: 0f 94 ef ce call 0x39dde ; 0x39dde } 2584e: a8 96 adiw r28, 0x28 ; 40 25850: 0f b6 in r0, 0x3f ; 63 25852: f8 94 cli 25854: de bf out 0x3e, r29 ; 62 25856: 0f be out 0x3f, r0 ; 63 25858: cd bf out 0x3d, r28 ; 61 2585a: df 91 pop r29 2585c: cf 91 pop r28 2585e: 1f 91 pop r17 25860: 0f 91 pop r16 25862: ff 90 pop r15 25864: ef 90 pop r14 25866: df 90 pop r13 25868: cf 90 pop r12 2586a: bf 90 pop r11 2586c: af 90 pop r10 2586e: 9f 90 pop r9 25870: 8f 90 pop r8 25872: 7f 90 pop r7 25874: 6f 90 pop r6 25876: 5f 90 pop r5 25878: 4f 90 pop r4 2587a: 3f 90 pop r3 2587c: 2f 90 pop r2 2587e: 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)); 25880: 8b ef ldi r24, 0xFB ; 251 25882: 9c e3 ldi r25, 0x3C ; 60 25884: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25888: 0e 94 91 6f call 0xdf22 ; 0xdf22 2588c: b8 cf rjmp .-144 ; 0x257fe else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 2588e: ef 92 push r14 25890: ff 92 push r15 25892: 0f 93 push r16 25894: 1f 93 push r17 25896: 80 e1 ldi r24, 0x10 ; 16 25898: 90 e7 ldi r25, 0x70 ; 112 2589a: 9f 93 push r25 2589c: 8f 93 push r24 2589e: 0e 94 7f 6f call 0xdefe ; 0xdefe 258a2: 0f 90 pop r0 258a4: 0f 90 pop r0 258a6: 0f 90 pop r0 258a8: 0f 90 pop r0 258aa: 0f 90 pop r0 258ac: 0f 90 pop r0 258ae: c3 cf rjmp .-122 ; 0x25836 000258b0 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 258b0: 89 e7 ldi r24, 0x79 ; 121 258b2: 9f e6 ldi r25, 0x6F ; 111 258b4: 0c 94 17 7b jmp 0xf62e ; 0xf62e 000258b8 : * 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) { 258b8: af 92 push r10 258ba: bf 92 push r11 258bc: cf 92 push r12 258be: df 92 push r13 258c0: ef 92 push r14 258c2: ff 92 push r15 258c4: 0f 93 push r16 258c6: 1f 93 push r17 258c8: cf 93 push r28 258ca: df 93 push r29 258cc: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 258ce: 0e 94 5a 6f call 0xdeb4 ; 0xdeb4 * @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; 258d2: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 258d4: 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; 258d6: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 258d8: 6f 2d mov r22, r15 258da: 80 e0 ldi r24, 0x00 ; 0 258dc: 0e 94 a6 6f call 0xdf4c ; 0xdf4c // 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) 258e0: c6 01 movw r24, r12 258e2: 0f 94 36 1e call 0x23c6c ; 0x23c6c 258e6: 88 23 and r24, r24 258e8: 29 f0 breq .+10 ; 0x258f4 258ea: 8f ef ldi r24, 0xFF ; 255 258ec: c8 1a sub r12, r24 258ee: d8 0a sbc r13, r24 258f0: 09 f4 brne .+2 ; 0x258f4 258f2: 49 c0 rjmp .+146 ; 0x25986 258f4: c6 01 movw r24, r12 258f6: 0f 94 04 db call 0x3b608 ; 0x3b608 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 258fa: 84 31 cpi r24, 0x14 ; 20 258fc: 91 05 cpc r25, r1 258fe: 10 f0 brcs .+4 ; 0x25904 25900: 84 e1 ldi r24, 0x14 ; 20 25902: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 25904: e6 01 movw r28, r12 25906: c8 0f add r28, r24 25908: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 2590a: e3 e0 ldi r30, 0x03 ; 3 2590c: fe 12 cpse r15, r30 2590e: 0a c0 rjmp .+20 ; 0x25924 25910: 84 31 cpi r24, 0x14 ; 20 25912: 41 f4 brne .+16 ; 0x25924 // 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; 25914: fe 01 movw r30, r28 25916: 84 91 lpm r24, Z 25918: e1 2c mov r14, r1 if (multi_screen) 2591a: 88 23 and r24, r24 2591c: 19 f0 breq .+6 ; 0x25924 msgend = (msgend2 -= 2); 2591e: 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; 25920: ee 24 eor r14, r14 25922: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 25924: fe 01 movw r30, r28 25926: 84 91 lpm r24, Z 25928: 88 23 and r24, r24 2592a: 09 f4 brne .+2 ; 0x2592e 2592c: 40 c0 rjmp .+128 ; 0x259ae 2592e: ce 01 movw r24, r28 25930: 0f 94 36 1e call 0x23c6c ; 0x23c6c 25934: 81 11 cpse r24, r1 25936: 3b c0 rjmp .+118 ; 0x259ae 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); 25938: fe 01 movw r30, r28 2593a: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 2593c: 92 ed ldi r25, 0xD2 ; 210 2593e: 98 0f add r25, r24 25940: 92 30 cpi r25, 0x02 ; 2 25942: a8 f1 brcs .+106 ; 0x259ae 25944: 8c 32 cpi r24, 0x2C ; 44 25946: 99 f1 breq .+102 ; 0x259ae 25948: 96 ec ldi r25, 0xC6 ; 198 2594a: 98 0f add r25, r24 2594c: 92 30 cpi r25, 0x02 ; 2 2594e: 78 f1 brcs .+94 ; 0x259ae 25950: 8f 33 cpi r24, 0x3F ; 63 25952: 69 f1 breq .+90 ; 0x259ae 25954: 81 32 cpi r24, 0x21 ; 33 25956: 59 f1 breq .+86 ; 0x259ae 25958: 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)) 2595a: c0 16 cp r12, r16 2595c: d1 06 cpc r13, r17 2595e: 58 f4 brcc .+22 ; 0x25976 25960: 58 01 movw r10, r16 25962: f1 e0 ldi r31, 0x01 ; 1 25964: af 1a sub r10, r31 25966: b1 08 sbc r11, r1 25968: c5 01 movw r24, r10 2596a: 0f 94 36 1e call 0x23c6c ; 0x23c6c 2596e: 81 11 cpse r24, r1 25970: 1d c0 rjmp .+58 ; 0x259ac -- msgend; 25972: 85 01 movw r16, r10 25974: f2 cf rjmp .-28 ; 0x2595a if (msgend == msg) 25976: c0 16 cp r12, r16 25978: d1 06 cpc r13, r17 2597a: c9 f0 breq .+50 ; 0x259ae 2597c: 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) { 2597e: f3 94 inc r15 25980: 84 e0 ldi r24, 0x04 ; 4 25982: f8 12 cpse r15, r24 25984: a9 cf rjmp .-174 ; 0x258d8 } lcd_print(c); } } if (multi_screen) { 25986: ee 20 and r14, r14 25988: f9 f0 breq .+62 ; 0x259c8 // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 2598a: 48 e8 ldi r20, 0x88 ; 136 2598c: 63 e0 ldi r22, 0x03 ; 3 2598e: 83 e1 ldi r24, 0x13 ; 19 25990: 0e 94 c6 6f call 0xdf8c ; 0xdf8c } return multi_screen ? msgend : NULL; } 25994: ce 01 movw r24, r28 25996: df 91 pop r29 25998: cf 91 pop r28 2599a: 1f 91 pop r17 2599c: 0f 91 pop r16 2599e: ff 90 pop r15 259a0: ef 90 pop r14 259a2: df 90 pop r13 259a4: cf 90 pop r12 259a6: bf 90 pop r11 259a8: af 90 pop r10 259aa: 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)) 259ac: 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) { 259ae: cc 16 cp r12, r28 259b0: dd 06 cpc r13, r29 259b2: 28 f7 brcc .-54 ; 0x2597e char c = char(pgm_read_byte(msg)); 259b4: f6 01 movw r30, r12 259b6: 84 91 lpm r24, Z if (c == '\n') { 259b8: 8a 30 cpi r24, 0x0A ; 10 259ba: 09 f3 breq .-62 ; 0x2597e 259bc: 0e 94 55 70 call 0xe0aa ; 0xe0aa -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 259c0: ff ef ldi r31, 0xFF ; 255 259c2: cf 1a sub r12, r31 259c4: df 0a sbc r13, r31 259c6: f3 cf rjmp .-26 ; 0x259ae if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 259c8: d0 e0 ldi r29, 0x00 ; 0 259ca: c0 e0 ldi r28, 0x00 ; 0 259cc: e3 cf rjmp .-58 ; 0x25994 000259ce : } #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)); 259ce: 81 e2 ldi r24, 0x21 ; 33 259d0: 9c e4 ldi r25, 0x4C ; 76 259d2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 259d6: 0f 94 5c 2c call 0x258b8 ; 0x258b8 menu_back_if_clicked(); 259da: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 000259de : } _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(); 259de: 0e 94 34 78 call 0xf068 ; 0xf068 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 259e2: 10 92 b2 03 sts 0x03B2, r1 ; 0x8003b2 } 259e6: 08 95 ret 000259e8 : //! |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() { 259e8: cf 93 push r28 259ea: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 259ec: 8f e1 ldi r24, 0x1F ; 31 259ee: 9d e4 ldi r25, 0x4D ; 77 259f0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 259f4: ac 01 movw r20, r24 259f6: 60 e0 ldi r22, 0x00 ; 0 259f8: 80 e0 ldi r24, 0x00 ; 0 259fa: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 1, STR_SEPARATOR); 259fe: 41 e4 ldi r20, 0x41 ; 65 25a00: 5c e8 ldi r21, 0x8C ; 140 25a02: 61 e0 ldi r22, 0x01 ; 1 25a04: 80 e0 ldi r24, 0x00 ; 0 25a06: 0e 94 ba 6f call 0xdf74 ; 0xdf74 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 25a0a: 62 e0 ldi r22, 0x02 ; 2 25a0c: 80 e0 ldi r24, 0x00 ; 0 25a0e: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25a12: 85 ee ldi r24, 0xE5 ; 229 25a14: 9f e0 ldi r25, 0x0F ; 15 25a16: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 25a1a: 9f 93 push r25 25a1c: 8f 93 push r24 25a1e: 7f 93 push r23 25a20: 6f 93 push r22 25a22: 1f 92 push r1 25a24: 88 e5 ldi r24, 0x58 ; 88 25a26: 8f 93 push r24 25a28: c4 ed ldi r28, 0xD4 ; 212 25a2a: d3 ea ldi r29, 0xA3 ; 163 25a2c: df 93 push r29 25a2e: cf 93 push r28 25a30: 0e 94 7f 6f call 0xdefe ; 0xdefe { 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); 25a34: 63 e0 ldi r22, 0x03 ; 3 25a36: 80 e0 ldi r24, 0x00 ; 0 25a38: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25a3c: 89 ee ldi r24, 0xE9 ; 233 25a3e: 9f e0 ldi r25, 0x0F ; 15 25a40: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 25a44: 9f 93 push r25 25a46: 8f 93 push r24 25a48: 7f 93 push r23 25a4a: 6f 93 push r22 25a4c: 1f 92 push r1 25a4e: 89 e5 ldi r24, 0x59 ; 89 25a50: 8f 93 push r24 25a52: df 93 push r29 25a54: cf 93 push r28 25a56: 0e 94 7f 6f call 0xdefe ; 0xdefe } menu_back_if_clicked(); 25a5a: 8d b7 in r24, 0x3d ; 61 25a5c: 9e b7 in r25, 0x3e ; 62 25a5e: 40 96 adiw r24, 0x10 ; 16 25a60: 0f b6 in r0, 0x3f ; 63 25a62: f8 94 cli 25a64: 9e bf out 0x3e, r25 ; 62 25a66: 0f be out 0x3f, r0 ; 63 25a68: 8d bf out 0x3d, r24 ; 61 } 25a6a: df 91 pop r29 25a6c: 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(); 25a6e: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00025a72 : //! ---------------------- //! 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() { 25a72: cf 92 push r12 25a74: df 92 push r13 25a76: ef 92 push r14 25a78: ff 92 push r15 25a7a: 0f 93 push r16 25a7c: 1f 93 push r17 25a7e: cf 93 push r28 25a80: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 25a82: 80 e6 ldi r24, 0x60 ; 96 25a84: 9f e0 ldi r25, 0x0F ; 15 25a86: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 25a8a: 6b 01 movw r12, r22 25a8c: 7c 01 movw r14, r24 lcd_home(); 25a8e: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_printf_P(_N( 25a92: 81 e1 ldi r24, 0x11 ; 17 25a94: 9d e4 ldi r25, 0x4D ; 77 25a96: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25a9a: 18 2f mov r17, r24 25a9c: 09 2f mov r16, r25 25a9e: 83 e0 ldi r24, 0x03 ; 3 25aa0: 9d e4 ldi r25, 0x4D ; 77 25aa2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25aa6: ec 01 movw r28, r24 25aa8: 83 ef ldi r24, 0xF3 ; 243 25aaa: 9c e4 ldi r25, 0x4C ; 76 25aac: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25ab0: 2e e3 ldi r18, 0x3E ; 62 25ab2: 2f 93 push r18 25ab4: 20 e8 ldi r18, 0x80 ; 128 25ab6: 2f 93 push r18 25ab8: 1f 92 push r1 25aba: 1f 92 push r1 25abc: 0f 93 push r16 25abe: 1f 93 push r17 25ac0: 2d e3 ldi r18, 0x3D ; 61 25ac2: 2f 93 push r18 25ac4: 25 ef ldi r18, 0xF5 ; 245 25ac6: 2f 93 push r18 25ac8: 22 ec ldi r18, 0xC2 ; 194 25aca: 2f 93 push r18 25acc: 20 e9 ldi r18, 0x90 ; 144 25ace: 2f 93 push r18 25ad0: df 93 push r29 25ad2: cf 93 push r28 25ad4: 21 e4 ldi r18, 0x41 ; 65 25ad6: 3c e8 ldi r19, 0x8C ; 140 25ad8: 3f 93 push r19 25ada: 2f 93 push r18 25adc: 9f 93 push r25 25ade: 8f 93 push r24 25ae0: 8d e2 ldi r24, 0x2D ; 45 25ae2: 90 e7 ldi r25, 0x70 ; 112 25ae4: 9f 93 push r25 25ae6: 8f 93 push r24 25ae8: 0e 94 7f 6f call 0xdefe ; 0xdefe _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); 25aec: 60 e0 ldi r22, 0x00 ; 0 25aee: 8f e0 ldi r24, 0x0F ; 15 25af0: 0e 94 a6 6f call 0xdf4c ; 0xdf4c if (angleDiff < 100){ 25af4: 8d b7 in r24, 0x3d ; 61 25af6: 9e b7 in r25, 0x3e ; 62 25af8: 42 96 adiw r24, 0x12 ; 18 25afa: 0f b6 in r0, 0x3f ; 63 25afc: f8 94 cli 25afe: 9e bf out 0x3e, r25 ; 62 25b00: 0f be out 0x3f, r0 ; 63 25b02: 8d bf out 0x3d, r24 ; 61 25b04: 20 e0 ldi r18, 0x00 ; 0 25b06: 30 e0 ldi r19, 0x00 ; 0 25b08: 48 ec ldi r20, 0xC8 ; 200 25b0a: 52 e4 ldi r21, 0x42 ; 66 25b0c: c7 01 movw r24, r14 25b0e: b6 01 movw r22, r12 25b10: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 25b14: 87 ff sbrs r24, 7 25b16: 32 c0 rjmp .+100 ; 0x25b7c } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 25b18: 20 e0 ldi r18, 0x00 ; 0 25b1a: 30 e0 ldi r19, 0x00 ; 0 25b1c: 44 e3 ldi r20, 0x34 ; 52 25b1e: 53 e4 ldi r21, 0x43 ; 67 25b20: c7 01 movw r24, r14 25b22: b6 01 movw r22, r12 25b24: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 25b28: 2b ed ldi r18, 0xDB ; 219 25b2a: 3f e0 ldi r19, 0x0F ; 15 25b2c: 49 e4 ldi r20, 0x49 ; 73 25b2e: 50 e4 ldi r21, 0x40 ; 64 25b30: 0f 94 6d df call 0x3beda ; 0x3beda <__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)); 25b34: 9f 93 push r25 25b36: 8f 93 push r24 25b38: 7f 93 push r23 25b3a: 6f 93 push r22 25b3c: 86 e2 ldi r24, 0x26 ; 38 25b3e: 90 e7 ldi r25, 0x70 ; 112 25b40: 9f 93 push r25 25b42: 8f 93 push r24 25b44: 0e 94 7f 6f call 0xdefe ; 0xdefe 25b48: 0f 90 pop r0 25b4a: 0f 90 pop r0 25b4c: 0f 90 pop r0 25b4e: 0f 90 pop r0 25b50: 0f 90 pop r0 25b52: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 25b54: 0e 94 c3 71 call 0xe386 ; 0xe386 25b58: 88 23 and r24, r24 25b5a: b9 f0 breq .+46 ; 0x25b8a menu_goto(lcd_menu_xyz_offset, 0, true); 25b5c: 20 e0 ldi r18, 0x00 ; 0 25b5e: 41 e0 ldi r20, 0x01 ; 1 25b60: 70 e0 ldi r23, 0x00 ; 0 25b62: 60 e0 ldi r22, 0x00 ; 0 25b64: 88 e5 ldi r24, 0x58 ; 88 25b66: 9b e3 ldi r25, 0x3B ; 59 } 25b68: df 91 pop r29 25b6a: cf 91 pop r28 25b6c: 1f 91 pop r17 25b6e: 0f 91 pop r16 25b70: ff 90 pop r15 25b72: ef 90 pop r14 25b74: df 90 pop r13 25b76: 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); 25b78: 0d 94 ef ce jmp 0x39dde ; 0x39dde ); 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)); 25b7c: 8b ef ldi r24, 0xFB ; 251 25b7e: 9c e3 ldi r25, 0x3C ; 60 25b80: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25b84: 0e 94 91 6f call 0xdf22 ; 0xdf22 25b88: e5 cf rjmp .-54 ; 0x25b54 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 25b8a: df 91 pop r29 25b8c: cf 91 pop r28 25b8e: 1f 91 pop r17 25b90: 0f 91 pop r16 25b92: ff 90 pop r15 25b94: ef 90 pop r14 25b96: df 90 pop r13 25b98: cf 90 pop r12 25b9a: 08 95 ret 00025b9c <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 25b9c: 2f 92 push r2 25b9e: 3f 92 push r3 25ba0: 4f 92 push r4 25ba2: 5f 92 push r5 25ba4: 6f 92 push r6 25ba6: 7f 92 push r7 25ba8: 9f 92 push r9 25baa: af 92 push r10 25bac: bf 92 push r11 25bae: cf 92 push r12 25bb0: df 92 push r13 25bb2: ef 92 push r14 25bb4: ff 92 push r15 25bb6: 0f 93 push r16 25bb8: 1f 93 push r17 25bba: cf 93 push r28 25bbc: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 25bbe: 70 91 55 0e lds r23, 0x0E55 ; 0x800e55 25bc2: 71 11 cpse r23, r1 25bc4: 04 c0 rjmp .+8 ; 0x25bce <_lcd_move(char const*, unsigned char, int, int)+0x32> 25bc6: 70 91 56 0e lds r23, 0x0E56 ; 0x800e56 25bca: 77 23 and r23, r23 25bcc: 99 f0 breq .+38 ; 0x25bf4 <_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(); } 25bce: df 91 pop r29 25bd0: cf 91 pop r28 25bd2: 1f 91 pop r17 25bd4: 0f 91 pop r16 25bd6: ff 90 pop r15 25bd8: ef 90 pop r14 25bda: df 90 pop r13 25bdc: cf 90 pop r12 25bde: bf 90 pop r11 25be0: af 90 pop r10 25be2: 9f 90 pop r9 25be4: 7f 90 pop r7 25be6: 6f 90 pop r6 25be8: 5f 90 pop r5 25bea: 4f 90 pop r4 25bec: 3f 90 pop r3 25bee: 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(); 25bf0: 0d 94 8d d1 jmp 0x3a31a ; 0x3a31a 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) 25bf4: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 25bf8: 71 11 cpse r23, r1 25bfa: 09 c0 rjmp .+18 ; 0x25c0e <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 25bfc: 70 91 8f 02 lds r23, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 25c00: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> { _md->endstopsEnabledPrevious = enable_endstops(false); 25c04: 70 93 a6 03 sts 0x03A6, r23 ; 0x8003a6 _md->initialized = true; 25c08: 71 e0 ldi r23, 0x01 ; 1 25c0a: 70 93 a5 03 sts 0x03A5, r23 ; 0x8003a5 25c0e: 19 01 movw r2, r18 25c10: 6a 01 movw r12, r20 25c12: c6 2f mov r28, r22 25c14: d9 2f mov r29, r25 25c16: 98 2e mov r9, r24 } if (lcd_encoder != 0) 25c18: 80 91 34 05 lds r24, 0x0534 ; 0x800534 25c1c: 90 91 35 05 lds r25, 0x0535 ; 0x800535 25c20: 89 2b or r24, r25 25c22: 09 f4 brne .+2 ; 0x25c26 <_lcd_move(char const*, unsigned char, int, int)+0x8a> 25c24: 71 c0 rjmp .+226 ; 0x25d08 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 25c26: 0e 94 89 67 call 0xcf12 ; 0xcf12 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; 25c2a: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 if (++ next_block_index == BLOCK_BUFFER_SIZE) 25c2e: 8f 5f subi r24, 0xFF ; 255 25c30: 80 31 cpi r24, 0x10 ; 16 25c32: 09 f4 brne .+2 ; 0x25c36 <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 25c34: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 25c36: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 if (! planner_queue_full()) 25c3a: 98 17 cp r25, r24 25c3c: 09 f4 brne .+2 ; 0x25c40 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 25c3e: 64 c0 rjmp .+200 ; 0x25d08 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 25c40: 84 e0 ldi r24, 0x04 ; 4 25c42: c8 9f mul r28, r24 25c44: 80 01 movw r16, r0 25c46: 11 24 eor r1, r1 25c48: f8 01 movw r30, r16 25c4a: e0 5c subi r30, 0xC0 ; 192 25c4c: f8 4f sbci r31, 0xF8 ; 248 25c4e: 5f 01 movw r10, r30 25c50: 60 91 34 05 lds r22, 0x0534 ; 0x800534 25c54: 70 91 35 05 lds r23, 0x0535 ; 0x800535 25c58: 07 2e mov r0, r23 25c5a: 00 0c add r0, r0 25c5c: 88 0b sbc r24, r24 25c5e: 99 0b sbc r25, r25 25c60: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 25c64: f5 01 movw r30, r10 25c66: 20 81 ld r18, Z 25c68: 31 81 ldd r19, Z+1 ; 0x01 25c6a: 42 81 ldd r20, Z+2 ; 0x02 25c6c: 53 81 ldd r21, Z+3 ; 0x03 25c6e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 25c72: 2b 01 movw r4, r22 25c74: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25c76: b6 01 movw r22, r12 25c78: dd 0c add r13, r13 25c7a: 88 0b sbc r24, r24 25c7c: 99 0b sbc r25, r25 25c7e: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 25c82: 6b 01 movw r12, r22 25c84: 7c 01 movw r14, r24 25c86: ac 01 movw r20, r24 25c88: 9b 01 movw r18, r22 25c8a: c3 01 movw r24, r6 25c8c: b2 01 movw r22, r4 25c8e: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 25c92: f5 01 movw r30, r10 25c94: 87 fd sbrc r24, 7 25c96: 7d c0 rjmp .+250 ; 0x25d92 <_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; 25c98: 40 82 st Z, r4 25c9a: 51 82 std Z+1, r5 ; 0x01 25c9c: 62 82 std Z+2, r6 ; 0x02 25c9e: 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; 25ca0: b1 01 movw r22, r2 25ca2: 33 0c add r3, r3 25ca4: 88 0b sbc r24, r24 25ca6: 99 0b sbc r25, r25 25ca8: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 25cac: 2b 01 movw r4, r22 25cae: 3c 01 movw r6, r24 25cb0: c8 01 movw r24, r16 25cb2: 80 5c subi r24, 0xC0 ; 192 25cb4: 98 4f sbci r25, 0xF8 ; 248 25cb6: 7c 01 movw r14, r24 25cb8: a3 01 movw r20, r6 25cba: 92 01 movw r18, r4 25cbc: fc 01 movw r30, r24 25cbe: 60 81 ld r22, Z 25cc0: 71 81 ldd r23, Z+1 ; 0x01 25cc2: 82 81 ldd r24, Z+2 ; 0x02 25cc4: 93 81 ldd r25, Z+3 ; 0x03 25cc6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 25cca: 18 16 cp r1, r24 25ccc: 2c f4 brge .+10 ; 0x25cd8 <_lcd_move(char const*, unsigned char, int, int)+0x13c> 25cce: f7 01 movw r30, r14 25cd0: 40 82 st Z, r4 25cd2: 51 82 std Z+1, r5 ; 0x01 25cd4: 62 82 std Z+2, r6 ; 0x02 25cd6: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 25cd8: 10 92 35 05 sts 0x0535, r1 ; 0x800535 25cdc: 10 92 34 05 sts 0x0534, r1 ; 0x800534 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 25ce0: 64 e4 ldi r22, 0x44 ; 68 25ce2: 77 e0 ldi r23, 0x07 ; 7 25ce4: 80 e4 ldi r24, 0x40 ; 64 25ce6: 97 e0 ldi r25, 0x07 ; 7 25ce8: 0e 94 70 6b call 0xd6e0 ; 0xd6e0 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 25cec: f8 01 movw r30, r16 25cee: e8 50 subi r30, 0x08 ; 8 25cf0: fd 4f sbci r31, 0xFD ; 253 25cf2: 60 81 ld r22, Z 25cf4: 71 81 ldd r23, Z+1 ; 0x01 25cf6: 82 81 ldd r24, Z+2 ; 0x02 25cf8: 93 81 ldd r25, Z+3 ; 0x03 25cfa: 0e 94 8d 67 call 0xcf1a ; 0xcf1a 25cfe: 0f 94 48 ba call 0x37490 ; 0x37490 lcd_draw_update = 1; 25d02: 81 e0 ldi r24, 0x01 ; 1 25d04: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 25d08: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25d0c: 88 23 and r24, r24 25d0e: 11 f1 breq .+68 ; 0x25d54 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 25d10: 61 e0 ldi r22, 0x01 ; 1 25d12: 80 e0 ldi r24, 0x00 ; 0 25d14: 0e 94 a6 6f call 0xdf4c ; 0xdf4c menu_draw_float31(name, current_position[axis]); 25d18: 84 e0 ldi r24, 0x04 ; 4 25d1a: c8 9f mul r28, r24 25d1c: f0 01 movw r30, r0 25d1e: 11 24 eor r1, r1 25d20: e0 5c subi r30, 0xC0 ; 192 25d22: 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); 25d24: 83 81 ldd r24, Z+3 ; 0x03 25d26: 8f 93 push r24 25d28: 82 81 ldd r24, Z+2 ; 0x02 25d2a: 8f 93 push r24 25d2c: 81 81 ldd r24, Z+1 ; 0x01 25d2e: 8f 93 push r24 25d30: 80 81 ld r24, Z 25d32: 8f 93 push r24 25d34: df 93 push r29 25d36: 9f 92 push r9 25d38: 8b eb ldi r24, 0xBB ; 187 25d3a: 93 ea ldi r25, 0xA3 ; 163 25d3c: 9f 93 push r25 25d3e: 8f 93 push r24 25d40: 0e 94 7f 6f call 0xdefe ; 0xdefe 25d44: ed b7 in r30, 0x3d ; 61 25d46: fe b7 in r31, 0x3e ; 62 25d48: 38 96 adiw r30, 0x08 ; 8 25d4a: 0f b6 in r0, 0x3f ; 63 25d4c: f8 94 cli 25d4e: fe bf out 0x3e, r31 ; 62 25d50: 0f be out 0x3f, r0 ; 63 25d52: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 25d54: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf 25d58: 81 11 cpse r24, r1 25d5a: 04 c0 rjmp .+8 ; 0x25d64 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 25d5c: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 25d60: 88 23 and r24, r24 25d62: 21 f0 breq .+8 ; 0x25d6c <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 25d64: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 25d68: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> menu_back_if_clicked(); } 25d6c: df 91 pop r29 25d6e: cf 91 pop r28 25d70: 1f 91 pop r17 25d72: 0f 91 pop r16 25d74: ff 90 pop r15 25d76: ef 90 pop r14 25d78: df 90 pop r13 25d7a: cf 90 pop r12 25d7c: bf 90 pop r11 25d7e: af 90 pop r10 25d80: 9f 90 pop r9 25d82: 7f 90 pop r7 25d84: 6f 90 pop r6 25d86: 5f 90 pop r5 25d88: 4f 90 pop r4 25d8a: 3f 90 pop r3 25d8c: 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(); 25d8e: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25d92: c0 82 st Z, r12 25d94: d1 82 std Z+1, r13 ; 0x01 25d96: e2 82 std Z+2, r14 ; 0x02 25d98: f3 82 std Z+3, r15 ; 0x03 25d9a: 82 cf rjmp .-252 ; 0x25ca0 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00025d9c : } // 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); 25d9c: 2f ef ldi r18, 0xFF ; 255 25d9e: 30 e0 ldi r19, 0x00 ; 0 25da0: 50 e0 ldi r21, 0x00 ; 0 25da2: 40 e0 ldi r20, 0x00 ; 0 25da4: 60 e0 ldi r22, 0x00 ; 0 25da6: 8f ed ldi r24, 0xDF ; 223 25da8: 93 ea ldi r25, 0xA3 ; 163 25daa: 0d 94 ce 2d jmp 0x25b9c ; 0x25b9c <_lcd_move(char const*, unsigned char, int, int)> 00025dae : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 25dae: 24 ed ldi r18, 0xD4 ; 212 25db0: 30 e0 ldi r19, 0x00 ; 0 25db2: 4c ef ldi r20, 0xFC ; 252 25db4: 5f ef ldi r21, 0xFF ; 255 25db6: 61 e0 ldi r22, 0x01 ; 1 25db8: 82 ee ldi r24, 0xE2 ; 226 25dba: 93 ea ldi r25, 0xA3 ; 163 25dbc: 0d 94 ce 2d jmp 0x25b9c ; 0x25b9c <_lcd_move(char const*, unsigned char, int, int)> 00025dc0 : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 25dc0: 22 ed ldi r18, 0xD2 ; 210 25dc2: 30 e0 ldi r19, 0x00 ; 0 25dc4: 50 e0 ldi r21, 0x00 ; 0 25dc6: 40 e0 ldi r20, 0x00 ; 0 25dc8: 62 e0 ldi r22, 0x02 ; 2 25dca: 85 ee ldi r24, 0xE5 ; 229 25dcc: 93 ea ldi r25, 0xA3 ; 163 25dce: 0d 94 ce 2d jmp 0x25b9c ; 0x25b9c <_lcd_move(char const*, unsigned char, int, int)> 00025dd2 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 25dd2: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 25dd6: 81 11 cpse r24, r1 25dd8: 03 c0 rjmp .+6 ; 0x25de0 25dda: 82 e0 ldi r24, 0x02 ; 2 25ddc: 0d 94 71 d1 jmp 0x3a2e2 ; 0x3a2e2 25de0: 81 e0 ldi r24, 0x01 ; 1 25de2: fc cf rjmp .-8 ; 0x25ddc 00025de4 : } // 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); 25de4: 5f 93 push r21 25de6: 4f 93 push r20 25de8: 7f 93 push r23 25dea: 6f 93 push r22 25dec: 28 2f mov r18, r24 25dee: 08 2e mov r0, r24 25df0: 00 0c add r0, r0 25df2: 33 0b sbc r19, r19 25df4: 3f 93 push r19 25df6: 8f 93 push r24 25df8: 8b e0 ldi r24, 0x0B ; 11 25dfa: 9f e6 ldi r25, 0x6F ; 111 25dfc: 9f 93 push r25 25dfe: 8f 93 push r24 25e00: 0e 94 7f 6f call 0xdefe ; 0xdefe lcd_space(9 - chars); 25e04: 2d b7 in r18, 0x3d ; 61 25e06: 3e b7 in r19, 0x3e ; 62 25e08: 28 5f subi r18, 0xF8 ; 248 25e0a: 3f 4f sbci r19, 0xFF ; 255 25e0c: 0f b6 in r0, 0x3f ; 63 25e0e: f8 94 cli 25e10: 3e bf out 0x3e, r19 ; 62 25e12: 0f be out 0x3f, r0 ; 63 25e14: 2d bf out 0x3d, r18 ; 61 25e16: 99 e0 ldi r25, 0x09 ; 9 25e18: 98 1b sub r25, r24 25e1a: 89 2f mov r24, r25 25e1c: 0c 94 9c 6f jmp 0xdf38 ; 0xdf38 00025e20 : default: return false; } } void lcd_print_target_temps_first_line() { 25e20: cf 93 push r28 25e22: df 93 push r29 lcd_home(); 25e24: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 25e28: c0 91 6a 0e lds r28, 0x0E6A ; 0x800e6a 25e2c: d0 91 6b 0e lds r29, 0x0E6B ; 0x800e6b 25e30: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 25e34: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 25e38: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 25e3c: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 25e40: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 25e44: ae 01 movw r20, r28 25e46: 82 e8 ldi r24, 0x82 ; 130 25e48: 0f 94 f2 2e call 0x25de4 ; 0x25de4 lcd_set_cursor(10, 0); 25e4c: 60 e0 ldi r22, 0x00 ; 0 25e4e: 8a e0 ldi r24, 0x0A ; 10 25e50: 0e 94 a6 6f call 0xdf4c ; 0xdf4c FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 25e54: c0 91 68 0e lds r28, 0x0E68 ; 0x800e68 25e58: d0 91 69 0e lds r29, 0x0E69 ; 0x800e69 int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 25e5c: 20 97 sbiw r28, 0x00 ; 0 25e5e: 81 f0 breq .+32 ; 0x25e80 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 25e60: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 25e64: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 25e68: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 25e6c: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 25e70: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 25e74: ae 01 movw r20, r28 25e76: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 25e78: df 91 pop r29 25e7a: 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); 25e7c: 0d 94 f2 2e jmp 0x25de4 ; 0x25de4 } else { lcd_space(10); 25e80: 8a e0 ldi r24, 0x0A ; 10 } } 25e82: df 91 pop r29 25e84: 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); 25e86: 0c 94 9c 6f jmp 0xdf38 ; 0xdf38 00025e8a : 25e8a: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 25e8e: 0f 94 10 2f call 0x25e20 ; 0x25e20 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 25e92: 8c e7 ldi r24, 0x7C ; 124 25e94: 9b e4 ldi r25, 0x4B ; 75 25e96: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25e9a: ac 01 movw r20, r24 25e9c: 61 e0 ldi r22, 0x01 ; 1 25e9e: 80 e0 ldi r24, 0x00 ; 0 25ea0: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(0,2); 25ea4: 62 e0 ldi r22, 0x02 ; 2 25ea6: 80 e0 ldi r24, 0x00 ; 0 25ea8: 0e 94 a6 6f call 0xdf4c ; 0xdf4c switch(eFilamentAction) { 25eac: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 25eb0: 83 30 cpi r24, 0x03 ; 3 25eb2: 81 f1 breq .+96 ; 0x25f14 25eb4: 48 f4 brcc .+18 ; 0x25ec8 25eb6: 81 30 cpi r24, 0x01 ; 1 25eb8: 60 f0 brcs .+24 ; 0x25ed2 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 25eba: 89 e6 ldi r24, 0x69 ; 105 25ebc: 9b e4 ldi r25, 0x4B ; 75 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 25ebe: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 25ec2: 0e 94 91 6f call 0xdf22 ; 0xdf22 25ec6: 05 c0 rjmp .+10 ; 0x25ed2 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) { 25ec8: 85 30 cpi r24, 0x05 ; 5 25eca: 21 f1 breq .+72 ; 0x25f14 25ecc: b0 f3 brcs .-20 ; 0x25eba 25ece: 88 30 cpi r24, 0x08 ; 8 25ed0: a1 f3 breq .-24 ; 0x25eba case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 25ed2: 0e 94 c3 71 call 0xe386 ; 0xe386 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 25ed6: 81 11 cpse r24, r1 25ed8: 09 c0 rjmp .+18 ; 0x25eec 25eda: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 25ede: 81 50 subi r24, 0x01 ; 1 25ee0: 82 30 cpi r24, 0x02 ; 2 25ee2: 28 f5 brcc .+74 ; 0x25f2e 25ee4: 80 91 89 17 lds r24, 0x1789 ; 0x801789 25ee8: 88 23 and r24, r24 25eea: 09 f1 breq .+66 ; 0x25f2e #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 25eec: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 25ef0: 81 11 cpse r24, r1 25ef2: 13 c0 rjmp .+38 ; 0x25f1a 25ef4: 83 e0 ldi r24, 0x03 ; 3 25ef6: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 switch(eFilamentAction) { 25efa: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 25efe: 82 30 cpi r24, 0x02 ; 2 25f00: 71 f0 breq .+28 ; 0x25f1e 25f02: 83 30 cpi r24, 0x03 ; 3 25f04: 81 f0 breq .+32 ; 0x25f26 25f06: 81 30 cpi r24, 0x01 ; 1 25f08: 91 f4 brne .+36 ; 0x25f2e case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 25f0a: 61 e0 ldi r22, 0x01 ; 1 25f0c: 83 ec ldi r24, 0xC3 ; 195 25f0e: 9f e6 ldi r25, 0x6F ; 111 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25f10: 0c 94 5c 89 jmp 0x112b8 ; 0x112b8 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)); 25f14: 84 e5 ldi r24, 0x54 ; 84 25f16: 9b e4 ldi r25, 0x4B ; 75 25f18: d2 cf rjmp .-92 ; 0x25ebe #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); 25f1a: 82 e0 ldi r24, 0x02 ; 2 25f1c: ec cf rjmp .-40 ; 0x25ef6 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 25f1e: 81 e0 ldi r24, 0x01 ; 1 25f20: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 25f24: f2 cf rjmp .-28 ; 0x25f0a [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25f26: 61 e0 ldi r22, 0x01 ; 1 25f28: 82 e5 ldi r24, 0x52 ; 82 25f2a: 9c e6 ldi r25, 0x6C ; 108 25f2c: f1 cf rjmp .-30 ; 0x25f10 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 25f2e: 08 95 ret 00025f30 : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 25f30: cf 92 push r12 25f32: df 92 push r13 25f34: ef 92 push r14 25f36: ff 92 push r15 25f38: 0f 93 push r16 25f3a: 1f 93 push r17 25f3c: cf 93 push r28 25f3e: df 93 push r29 25f40: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25f44: 60 91 56 06 lds r22, 0x0656 ; 0x800656 25f48: 70 91 57 06 lds r23, 0x0657 ; 0x800657 25f4c: 07 2e mov r0, r23 25f4e: 00 0c add r0, r0 25f50: 88 0b sbc r24, r24 25f52: 99 0b sbc r25, r25 25f54: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 25f58: 20 e0 ldi r18, 0x00 ; 0 25f5a: 30 ec ldi r19, 0xC0 ; 192 25f5c: 4f e7 ldi r20, 0x7F ; 127 25f5e: 56 e4 ldi r21, 0x46 ; 70 25f60: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 25f64: 20 e0 ldi r18, 0x00 ; 0 25f66: 30 e0 ldi r19, 0x00 ; 0 25f68: 40 ea ldi r20, 0xA0 ; 160 25f6a: 50 e4 ldi r21, 0x40 ; 64 25f6c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 25f70: 27 ed ldi r18, 0xD7 ; 215 25f72: 30 e3 ldi r19, 0x30 ; 48 25f74: 44 e4 ldi r20, 0x44 ; 68 25f76: 5e e3 ldi r21, 0x3E ; 62 25f78: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 25f7c: eb 01 movw r28, r22 25f7e: 18 2f mov r17, r24 25f80: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25f82: 60 91 54 06 lds r22, 0x0654 ; 0x800654 25f86: 70 91 55 06 lds r23, 0x0655 ; 0x800655 25f8a: 07 2e mov r0, r23 25f8c: 00 0c add r0, r0 25f8e: 88 0b sbc r24, r24 25f90: 99 0b sbc r25, r25 25f92: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 25f96: 20 e0 ldi r18, 0x00 ; 0 25f98: 30 ec ldi r19, 0xC0 ; 192 25f9a: 4f e7 ldi r20, 0x7F ; 127 25f9c: 56 e4 ldi r21, 0x46 ; 70 25f9e: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 25fa2: 20 e0 ldi r18, 0x00 ; 0 25fa4: 30 e0 ldi r19, 0x00 ; 0 25fa6: 40 ea ldi r20, 0xA0 ; 160 25fa8: 50 e4 ldi r21, 0x40 ; 64 25faa: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 25fae: 27 ed ldi r18, 0xD7 ; 215 25fb0: 30 e3 ldi r19, 0x30 ; 48 25fb2: 44 e4 ldi r20, 0x44 ; 68 25fb4: 5e e3 ldi r21, 0x3E ; 62 25fb6: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 25fba: f6 2e mov r15, r22 25fbc: e7 2e mov r14, r23 25fbe: d8 2e mov r13, r24 25fc0: c9 2e mov r12, r25 lcd_home(); 25fc2: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 25fc6: cf 92 push r12 25fc8: df 92 push r13 25fca: ef 92 push r14 25fcc: ff 92 push r15 25fce: 0f 93 push r16 25fd0: 1f 93 push r17 25fd2: df 93 push r29 25fd4: cf 93 push r28 25fd6: 84 ec ldi r24, 0xC4 ; 196 25fd8: 91 ea ldi r25, 0xA1 ; 161 25fda: 9f 93 push r25 25fdc: 8f 93 push r24 25fde: 0e 94 7f 6f call 0xdefe ; 0xdefe #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) lcd_printf_P(PSTR("\n IR : %3.1fV"), Raw2Voltage(fsensor.getVoltRaw())); 25fe2: 0f 94 9c 7c call 0x2f938 ; 0x2f938 25fe6: bc 01 movw r22, r24 25fe8: 90 e0 ldi r25, 0x00 ; 0 25fea: 80 e0 ldi r24, 0x00 ; 0 25fec: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 25ff0: 20 e0 ldi r18, 0x00 ; 0 25ff2: 30 ec ldi r19, 0xC0 ; 192 25ff4: 4f e7 ldi r20, 0x7F ; 127 25ff6: 56 e4 ldi r21, 0x46 ; 70 25ff8: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 25ffc: 20 e0 ldi r18, 0x00 ; 0 25ffe: 30 e0 ldi r19, 0x00 ; 0 26000: 40 ea ldi r20, 0xA0 ; 160 26002: 50 e4 ldi r21, 0x40 ; 64 26004: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 26008: 9f 93 push r25 2600a: 8f 93 push r24 2600c: 7f 93 push r23 2600e: 6f 93 push r22 26010: 80 eb ldi r24, 0xB0 ; 176 26012: 91 ea ldi r25, 0xA1 ; 161 26014: 9f 93 push r25 26016: 8f 93 push r24 26018: 0e 94 7f 6f call 0xdefe ; 0xdefe #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) menu_back_if_clicked(); 2601c: 8d b7 in r24, 0x3d ; 61 2601e: 9e b7 in r25, 0x3e ; 62 26020: 40 96 adiw r24, 0x10 ; 16 26022: 0f b6 in r0, 0x3f ; 63 26024: f8 94 cli 26026: 9e bf out 0x3e, r25 ; 62 26028: 0f be out 0x3f, r0 ; 63 2602a: 8d bf out 0x3d, r24 ; 61 } 2602c: df 91 pop r29 2602e: cf 91 pop r28 26030: 1f 91 pop r17 26032: 0f 91 pop r16 26034: ff 90 pop r15 26036: ef 90 pop r14 26038: df 90 pop r13 2603a: 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(); 2603c: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00026040 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 26040: ef 92 push r14 26042: ff 92 push r15 26044: 0f 93 push r16 26046: 1f 93 push r17 26048: cf 93 push r28 2604a: 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) 2604c: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 26050: 88 23 and r24, r24 26052: 29 f0 breq .+10 ; 0x2605e 26054: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 26058: 92 30 cpi r25, 0x02 ; 2 2605a: 09 f0 breq .+2 ; 0x2605e 2605c: 8c c1 rjmp .+792 ; 0x26376 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 2605e: 81 e0 ldi r24, 0x01 ; 1 26060: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 26064: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 26068: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 if (_md->is_flash_air) { 2606c: 88 23 and r24, r24 2606e: 21 f0 breq .+8 ; 0x26078 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 26070: 87 ea ldi r24, 0xA7 ; 167 26072: 93 e0 ldi r25, 0x03 ; 3 26074: 0f 94 39 86 call 0x30c72 ; 0x30c72 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 26078: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 2607c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if (((menu_item - 1) == menu_line) && lcd_draw_update) { lcd_set_cursor(6, menu_row); MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 26080: 88 e2 ldi r24, 0x28 ; 40 26082: e8 2e mov r14, r24 26084: 82 ea ldi r24, 0xA2 ; 162 26086: 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]); 26088: c7 ef ldi r28, 0xF7 ; 247 2608a: d1 ea ldi r29, 0xA1 ; 161 2608c: 0b ea ldi r16, 0xAB ; 171 2608e: 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(); 26090: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26094: 84 30 cpi r24, 0x04 ; 4 26096: 08 f0 brcs .+2 ; 0x2609a 26098: 95 c1 rjmp .+810 ; 0x263c4 2609a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2609e: 8c ea ldi r24, 0xAC ; 172 260a0: 9d e3 ldi r25, 0x3D ; 61 260a2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 260a6: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR("Firmware:")); 260aa: 8c e9 ldi r24, 0x9C ; 156 260ac: 92 ea ldi r25, 0xA2 ; 162 260ae: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 260b2: 8f e8 ldi r24, 0x8F ; 143 260b4: 92 ea ldi r25, 0xA2 ; 162 260b6: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 260ba: 81 e8 ldi r24, 0x81 ; 129 260bc: 92 ea ldi r25, 0xA2 ; 162 260be: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 260c2: 81 e7 ldi r24, 0x71 ; 113 260c4: 92 ea ldi r25, 0xA2 ; 162 260c6: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 260ca: 87 eb ldi r24, 0xB7 ; 183 260cc: 9f e6 ldi r25, 0x6F ; 111 260ce: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 260d2: 85 ea ldi r24, 0xA5 ; 165 260d4: 9f e6 ldi r25, 0x6F ; 111 260d6: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 260da: 84 e9 ldi r24, 0x94 ; 148 260dc: 9f e6 ldi r25, 0x6F ; 111 260de: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(STR_SEPARATOR); 260e2: 81 e4 ldi r24, 0x41 ; 65 260e4: 9c e8 ldi r25, 0x8C ; 140 260e6: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 260ea: 85 e6 ldi r24, 0x65 ; 101 260ec: 92 ea ldi r25, 0xA2 ; 162 260ee: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 260f2: 8b e5 ldi r24, 0x5B ; 91 260f4: 92 ea ldi r25, 0xA2 ; 162 260f6: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 260fa: 81 e5 ldi r24, 0x51 ; 81 260fc: 92 ea ldi r25, 0xA2 ; 162 260fe: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(STR_SEPARATOR); 26102: 81 e4 ldi r24, 0x41 ; 65 26104: 9c e8 ldi r25, 0x8C ; 140 26106: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(_T(MSG_DATE)); 2610a: 8c e4 ldi r24, 0x4C ; 76 2610c: 9b e4 ldi r25, 0x4B ; 75 2610e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26112: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 26116: 86 e4 ldi r24, 0x46 ; 70 26118: 92 ea ldi r25, 0xA2 ; 162 2611a: 0f 94 90 d1 call 0x3a320 ; 0x3a320 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 2611e: 81 e4 ldi r24, 0x41 ; 65 26120: 9c e8 ldi r25, 0x8C ; 140 26122: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR("Fil. sensor v.:")); 26126: 86 e3 ldi r24, 0x36 ; 54 26128: 92 ea ldi r25, 0xA2 ; 162 2612a: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(fsensor.getIRVersionText()); 2612e: 0f 94 a4 7c call 0x2f948 ; 0x2f948 26132: 0f 94 90 d1 call 0x3a320 ; 0x3a320 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 26136: 81 e4 ldi r24, 0x41 ; 65 26138: 9c e8 ldi r25, 0x8C ; 140 2613a: 0f 94 90 d1 call 0x3a320 ; 0x3a320 if (MMU2::mmu2.Enabled()) 2613e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 26142: 81 30 cpi r24, 0x01 ; 1 26144: 09 f0 breq .+2 ; 0x26148 26146: 39 c1 rjmp .+626 ; 0x263ba { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 26148: 8c e3 ldi r24, 0x3C ; 60 2614a: 9b e4 ldi r25, 0x4B ; 75 2614c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26150: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 26154: 81 e3 ldi r24, 0x31 ; 49 26156: 92 ea ldi r25, 0xA2 ; 162 26158: 0f 94 90 d1 call 0x3a320 ; 0x3a320 if (((menu_item - 1) == menu_line) && lcd_draw_update) 2615c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26160: 81 50 subi r24, 0x01 ; 1 26162: 99 0b sbc r25, r25 26164: 20 91 14 05 lds r18, 0x0514 ; 0x800514 26168: 28 17 cp r18, r24 2616a: 19 06 cpc r1, r25 2616c: 49 f5 brne .+82 ; 0x261c0 2616e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 26172: 88 23 and r24, r24 26174: 29 f1 breq .+74 ; 0x261c0 { lcd_set_cursor(6, menu_row); 26176: 60 91 12 05 lds r22, 0x0512 ; 0x800512 2617a: 86 e0 ldi r24, 0x06 ; 6 2617c: 0e 94 a6 6f call 0xdf4c ; 0xdf4c 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) { 26180: 80 91 95 13 lds r24, 0x1395 ; 0x801395 26184: 81 30 cpi r24, 0x01 ; 1 26186: 09 f0 breq .+2 ; 0x2618a 26188: 11 c1 rjmp .+546 ; 0x263ac 2618a: 80 91 75 13 lds r24, 0x1375 ; 0x801375 2618e: 90 91 76 13 lds r25, 0x1376 ; 0x801376 26192: 20 91 77 13 lds r18, 0x1377 ; 0x801377 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 26196: 88 23 and r24, r24 26198: 09 f4 brne .+2 ; 0x2619c 2619a: 08 c1 rjmp .+528 ; 0x263ac lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 2619c: 1f 92 push r1 2619e: 2f 93 push r18 261a0: 1f 92 push r1 261a2: 9f 93 push r25 261a4: 1f 92 push r1 261a6: 8f 93 push r24 261a8: ff 92 push r15 261aa: ef 92 push r14 261ac: 0e 94 7f 6f call 0xdefe ; 0xdefe 261b0: 8d b7 in r24, 0x3d ; 61 261b2: 9e b7 in r25, 0x3e ; 62 261b4: 08 96 adiw r24, 0x08 ; 8 261b6: 0f b6 in r0, 0x3f ; 63 261b8: f8 94 cli 261ba: 9e bf out 0x3e, r25 ; 62 261bc: 0f be out 0x3f, r0 ; 63 261be: 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) { 261c0: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 261c4: 88 23 and r24, r24 261c6: 09 f4 brne .+2 ; 0x261ca 261c8: 40 c0 rjmp .+128 ; 0x2624a MENU_ITEM_BACK_P(STR_SEPARATOR); 261ca: 81 e4 ldi r24, 0x41 ; 65 261cc: 9c e8 ldi r25, 0x8C ; 140 261ce: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 261d2: 87 e0 ldi r24, 0x07 ; 7 261d4: 92 ea ldi r25, 0xA2 ; 162 261d6: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(" ")); 261da: 85 e0 ldi r24, 0x05 ; 5 261dc: 92 ea ldi r25, 0xA2 ; 162 261de: 0f 94 90 d1 call 0x3a320 ; 0x3a320 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 261e2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 261e6: 81 50 subi r24, 0x01 ; 1 261e8: 99 0b sbc r25, r25 261ea: 20 91 14 05 lds r18, 0x0514 ; 0x800514 261ee: 28 17 cp r18, r24 261f0: 19 06 cpc r1, r25 261f2: 59 f5 brne .+86 ; 0x2624a 261f4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 261f8: 88 23 and r24, r24 261fa: 39 f1 breq .+78 ; 0x2624a lcd_set_cursor(2, menu_row); 261fc: 60 91 12 05 lds r22, 0x0512 ; 0x800512 26200: 82 e0 ldi r24, 0x02 ; 2 26202: 0e 94 a6 6f call 0xdf4c ; 0xdf4c 26206: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 2620a: 1f 92 push r1 2620c: 8f 93 push r24 2620e: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 26212: 1f 92 push r1 26214: 8f 93 push r24 26216: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 2621a: 1f 92 push r1 2621c: 8f 93 push r24 2621e: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 26222: 1f 92 push r1 26224: 8f 93 push r24 26226: df 93 push r29 26228: cf 93 push r28 2622a: 1f 93 push r17 2622c: 0f 93 push r16 2622e: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 26232: 8b ea ldi r24, 0xAB ; 171 26234: 93 e0 ldi r25, 0x03 ; 3 26236: 0e 94 ad 71 call 0xe35a ; 0xe35a 2623a: 8d b7 in r24, 0x3d ; 61 2623c: 9e b7 in r25, 0x3e ; 62 2623e: 0c 96 adiw r24, 0x0c ; 12 26240: 0f b6 in r0, 0x3f ; 63 26242: f8 94 cli 26244: 9e bf out 0x3e, r25 ; 62 26246: 0f be out 0x3f, r0 ; 63 26248: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 2624a: 80 91 58 06 lds r24, 0x0658 ; 0x800658 2624e: 90 91 59 06 lds r25, 0x0659 ; 0x800659 26252: a0 91 5a 06 lds r26, 0x065A ; 0x80065a 26256: b0 91 5b 06 lds r27, 0x065B ; 0x80065b 2625a: 89 2b or r24, r25 2625c: 8a 2b or r24, r26 2625e: 8b 2b or r24, r27 26260: 09 f4 brne .+2 ; 0x26264 26262: 42 c0 rjmp .+132 ; 0x262e8 MENU_ITEM_BACK_P(STR_SEPARATOR); 26264: 81 e4 ldi r24, 0x41 ; 65 26266: 9c e8 ldi r25, 0x8C ; 140 26268: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 2626c: 8f e1 ldi r24, 0x1F ; 31 2626e: 9b e4 ldi r25, 0x4B ; 75 26270: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26274: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_BACK_P(PSTR(" ")); 26278: 83 e0 ldi r24, 0x03 ; 3 2627a: 92 ea ldi r25, 0xA2 ; 162 2627c: 0f 94 90 d1 call 0x3a320 ; 0x3a320 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 26280: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26284: 81 50 subi r24, 0x01 ; 1 26286: 99 0b sbc r25, r25 26288: 20 91 14 05 lds r18, 0x0514 ; 0x800514 2628c: 28 17 cp r18, r24 2628e: 19 06 cpc r1, r25 26290: 59 f5 brne .+86 ; 0x262e8 26292: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 26296: 88 23 and r24, r24 26298: 39 f1 breq .+78 ; 0x262e8 lcd_set_cursor(2, menu_row); 2629a: 60 91 12 05 lds r22, 0x0512 ; 0x800512 2629e: 82 e0 ldi r24, 0x02 ; 2 262a0: 0e 94 a6 6f call 0xdf4c ; 0xdf4c 262a4: 80 91 5b 06 lds r24, 0x065B ; 0x80065b 262a8: 1f 92 push r1 262aa: 8f 93 push r24 262ac: 80 91 5a 06 lds r24, 0x065A ; 0x80065a 262b0: 1f 92 push r1 262b2: 8f 93 push r24 262b4: 80 91 59 06 lds r24, 0x0659 ; 0x800659 262b8: 1f 92 push r1 262ba: 8f 93 push r24 262bc: 80 91 58 06 lds r24, 0x0658 ; 0x800658 262c0: 1f 92 push r1 262c2: 8f 93 push r24 262c4: df 93 push r29 262c6: cf 93 push r28 262c8: 1f 93 push r17 262ca: 0f 93 push r16 262cc: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 262d0: 8b ea ldi r24, 0xAB ; 171 262d2: 93 e0 ldi r25, 0x03 ; 3 262d4: 0e 94 ad 71 call 0xe35a ; 0xe35a 262d8: 8d b7 in r24, 0x3d ; 61 262da: 9e b7 in r25, 0x3e ; 62 262dc: 0c 96 adiw r24, 0x0c ; 12 262de: 0f b6 in r0, 0x3f ; 63 262e0: f8 94 cli 262e2: 9e bf out 0x3e, r25 ; 62 262e4: 0f be out 0x3f, r0 ; 63 262e6: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 262e8: 81 e4 ldi r24, 0x41 ; 65 262ea: 9c e8 ldi r25, 0x8C ; 140 262ec: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 262f0: 8c e0 ldi r24, 0x0C ; 12 262f2: 9b e4 ldi r25, 0x4B ; 75 262f4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 262f8: 64 eb ldi r22, 0xB4 ; 180 262fa: 7a e3 ldi r23, 0x3A ; 58 262fc: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 26300: 8c ef ldi r24, 0xFC ; 252 26302: 9a e4 ldi r25, 0x4A ; 74 26304: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26308: 68 e1 ldi r22, 0x18 ; 24 2630a: 7a e3 ldi r23, 0x3A ; 58 2630c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 26310: 8e ee ldi r24, 0xEE ; 238 26312: 9a e4 ldi r25, 0x4A ; 74 26314: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26318: 60 e7 ldi r22, 0x70 ; 112 2631a: 7b e3 ldi r23, 0x3B ; 59 2631c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 26320: 80 ee ldi r24, 0xE0 ; 224 26322: 9a e4 ldi r25, 0x4A ; 74 26324: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26328: 60 e7 ldi r22, 0x70 ; 112 2632a: 7a e3 ldi r23, 0x3A ; 58 2632c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 26330: 81 ed ldi r24, 0xD1 ; 209 26332: 9a e4 ldi r25, 0x4A ; 74 26334: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26338: 6a e1 ldi r22, 0x1A ; 26 2633a: 7a e3 ldi r23, 0x3A ; 58 2633c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 26340: 86 ec ldi r24, 0xC6 ; 198 26342: 9a e4 ldi r25, 0x4A ; 74 26344: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26348: 6a e0 ldi r22, 0x0A ; 10 2634a: 7a e3 ldi r23, 0x3A ; 58 2634c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 26350: 66 ed ldi r22, 0xD6 ; 214 26352: 79 e3 ldi r23, 0x39 ; 57 26354: 88 e8 ldi r24, 0x88 ; 136 26356: 9f e6 ldi r25, 0x6F ; 111 26358: 0f 94 42 ce call 0x39c84 ; 0x39c84 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(); 2635c: 0f 94 99 ce call 0x39d32 ; 0x39d32 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 26360: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26364: 8f 5f subi r24, 0xFF ; 255 26366: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2636a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2636e: 8f 5f subi r24, 0xFF ; 255 26370: 80 93 14 05 sts 0x0514, r24 ; 0x800514 26374: 8d ce rjmp .-742 ; 0x26090 _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) 26376: 90 91 a6 03 lds r25, 0x03A6 ; 0x8003a6 2637a: 99 23 and r25, r25 2637c: 09 f4 brne .+2 ; 0x26380 2637e: 7c ce rjmp .-776 ; 0x26078 26380: 40 91 a7 03 lds r20, 0x03A7 ; 0x8003a7 26384: 50 91 a8 03 lds r21, 0x03A8 ; 0x8003a8 26388: 60 91 a9 03 lds r22, 0x03A9 ; 0x8003a9 2638c: 70 91 aa 03 lds r23, 0x03AA ; 0x8003aa 26390: 45 2b or r20, r21 26392: 46 2b or r20, r22 26394: 47 2b or r20, r23 26396: 09 f0 breq .+2 ; 0x2639a 26398: 6f ce rjmp .-802 ; 0x26078 2639a: 8f 5f subi r24, 0xFF ; 255 2639c: 80 31 cpi r24, 0x10 ; 16 2639e: 19 f0 breq .+6 ; 0x263a6 263a0: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 263a4: 69 ce rjmp .-814 ; 0x26078 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 263a6: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 263aa: 66 ce rjmp .-820 ; 0x26078 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)); 263ac: 82 e3 ldi r24, 0x32 ; 50 263ae: 9b e4 ldi r25, 0x4B ; 75 263b0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 263b4: 0e 94 91 6f call 0xdf22 ; 0xdf22 263b8: 03 cf rjmp .-506 ; 0x261c0 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 263ba: 89 e1 ldi r24, 0x19 ; 25 263bc: 92 ea ldi r25, 0xA2 ; 162 263be: 0f 94 90 d1 call 0x3a320 ; 0x3a320 263c2: fe ce rjmp .-516 ; 0x261c0 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 263c4: df 91 pop r29 263c6: cf 91 pop r28 263c8: 1f 91 pop r17 263ca: 0f 91 pop r16 263cc: ff 90 pop r15 263ce: ef 90 pop r14 263d0: 08 95 ret 000263d2 : { 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) { 263d2: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 263d6: 81 11 cpse r24, r1 263d8: 19 c0 rjmp .+50 ; 0x2640c lcd_clear(); 263da: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 263de: 85 e4 ldi r24, 0x45 ; 69 263e0: 9a e4 ldi r25, 0x4A ; 74 263e2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 263e6: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_putc(':'); 263ea: 8a e3 ldi r24, 0x3A ; 58 263ec: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_set_cursor(10, 1); 263f0: 61 e0 ldi r22, 0x01 ; 1 263f2: 8a e0 ldi r24, 0x0A ; 10 263f4: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 263f8: 88 ea ldi r24, 0xA8 ; 168 263fa: 9c e0 ldi r25, 0x0C ; 12 263fc: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 26400: 4a e0 ldi r20, 0x0A ; 10 26402: 0e 94 fa 70 call 0xe1f4 ; 0xe1f4 _md->initialized = true; 26406: 81 e0 ldi r24, 0x01 ; 1 26408: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 } menu_back_if_clicked(); 2640c: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 00026410 : } 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){ 26410: 0f 93 push r16 26412: 1f 93 push r17 26414: cf 93 push r28 26416: df 93 push r29 26418: ec 01 movw r28, r24 2641a: cb 01 movw r24, r22 2641c: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 2641e: 4a 81 ldd r20, Y+2 ; 0x02 26420: 41 30 cpi r20, 0x01 ; 1 26422: 29 f0 breq .+10 ; 0x2642e 26424: 88 f0 brcs .+34 ; 0x26448 26426: 42 30 cpi r20, 0x02 ; 2 26428: 09 f1 breq .+66 ; 0x2646c 2642a: 43 30 cpi r20, 0x03 ; 3 2642c: d1 f4 brne .+52 ; 0x26462 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 ){ 2642e: 8b 81 ldd r24, Y+3 ; 0x03 26430: 81 11 cpse r24, r1 26432: 25 c0 rjmp .+74 ; 0x2647e state = next_state; // advance to the next state 26434: 82 e0 ldi r24, 0x02 ; 2 26436: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 26438: 63 e0 ldi r22, 0x03 ; 3 2643a: 8d e0 ldi r24, 0x0D ; 13 2643c: 9f e9 ldi r25, 0x9F ; 159 2643e: 0f 94 9b 06 call 0x20d36 ; 0x20d36 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 26442: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 26444: 8b 83 std Y+3, r24 ; 0x03 26446: 0d c0 rjmp .+26 ; 0x26462 //! @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 ){ 26448: a9 01 movw r20, r18 2644a: 98 01 movw r18, r16 2644c: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 26450: 18 16 cp r1, r24 26452: 3c f4 brge .+14 ; 0x26462 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 26454: 63 e0 ldi r22, 0x03 ; 3 26456: 88 81 ld r24, Y 26458: 99 81 ldd r25, Y+1 ; 0x01 2645a: 0f 94 9b 06 call 0x20d36 ; 0x20d36 state = States::TempAboveMintemp; 2645e: 81 e0 ldi r24, 0x01 ; 1 26460: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 26462: df 91 pop r29 26464: cf 91 pop r28 26466: 1f 91 pop r17 26468: 0f 91 pop r16 2646a: 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 ){ 2646c: 8b 81 ldd r24, Y+3 ; 0x03 2646e: 81 11 cpse r24, r1 26470: 06 c0 rjmp .+12 ; 0x2647e 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); 26472: 88 81 ld r24, Y 26474: 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 26476: 23 e0 ldi r18, 0x03 ; 3 26478: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 2647a: 63 e0 ldi r22, 0x03 ; 3 2647c: e0 cf rjmp .-64 ; 0x2643e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 2647e: 81 50 subi r24, 0x01 ; 1 26480: e1 cf rjmp .-62 ; 0x26444 00026482 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 26482: cf 93 push r28 if(IsStopped() == false) { 26484: 90 91 11 05 lds r25, 0x0511 ; 0x800511 26488: 91 11 cpse r25, r1 2648a: 18 c0 rjmp .+48 ; 0x264bc 2648c: c6 2f mov r28, r22 if (isPreheat) { 2648e: 88 23 and r24, r24 26490: c9 f0 breq .+50 ; 0x264c4 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 26492: 81 eb ldi r24, 0xB1 ; 177 26494: 9e e9 ldi r25, 0x9E ; 158 26496: 66 23 and r22, r22 26498: 11 f0 breq .+4 ; 0x2649e 2649a: 8f eb ldi r24, 0xBF ; 191 2649c: 9e e9 ldi r25, 0x9E ; 158 2649e: 63 e0 ldi r22, 0x03 ; 3 264a0: 0f 94 9b 06 call 0x20d36 ; 0x20d36 SERIAL_ERROR_START; 264a4: 8c ee ldi r24, 0xEC ; 236 264a6: 99 ea ldi r25, 0xA9 ; 169 264a8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 264ac: 8e e8 ldi r24, 0x8E ; 142 264ae: 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) { 264b0: c1 11 cpse r28, r1 264b2: 02 c0 rjmp .+4 ; 0x264b8 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 264b4: 8c e6 ldi r24, 0x6C ; 108 264b6: 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"); 264b8: 0e 94 17 7b call 0xf62e ; 0xf62e } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 264bc: 80 e0 ldi r24, 0x00 ; 0 } 264be: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 264c0: 0c 94 48 7b jmp 0xf690 ; 0xf690 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); 264c4: 88 e4 ldi r24, 0x48 ; 72 264c6: 9e e9 ldi r25, 0x9E ; 158 264c8: 66 23 and r22, r22 264ca: 11 f0 breq .+4 ; 0x264d0 264cc: 88 e5 ldi r24, 0x58 ; 88 264ce: 9e e9 ldi r25, 0x9E ; 158 264d0: 63 e0 ldi r22, 0x03 ; 3 264d2: 0f 94 9b 06 call 0x20d36 ; 0x20d36 SERIAL_ERROR_START; 264d6: 8c ee ldi r24, 0xEC ; 236 264d8: 99 ea ldi r25, 0xA9 ; 169 264da: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 264de: 8f e2 ldi r24, 0x2F ; 47 264e0: 9e e9 ldi r25, 0x9E ; 158 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); } } else { lcd_setalertstatuspgm(isBed? PSTR("BED THERMAL RUNAWAY") : PSTR("THERMAL RUNAWAY"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 264e2: c1 11 cpse r28, r1 264e4: e9 cf rjmp .-46 ; 0x264b8 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 264e6: 87 e1 ldi r24, 0x17 ; 23 264e8: 9e e9 ldi r25, 0x9E ; 158 264ea: e6 cf rjmp .-52 ; 0x264b8 000264ec : } } static void Sound_DoSound_Prompt(void) { backlight_wake(2); 264ec: 82 e0 ldi r24, 0x02 ; 2 264ee: 0e 94 b1 8b call 0x11762 ; 0x11762 WRITE(BEEPER,HIGH); 264f2: 9f b7 in r25, 0x3f ; 63 264f4: f8 94 cli 264f6: e2 e0 ldi r30, 0x02 ; 2 264f8: f1 e0 ldi r31, 0x01 ; 1 264fa: 80 81 ld r24, Z 264fc: 84 60 ori r24, 0x04 ; 4 264fe: 80 83 st Z, r24 26500: 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); 26502: 2f ef ldi r18, 0xFF ; 255 26504: 89 e6 ldi r24, 0x69 ; 105 26506: 98 e1 ldi r25, 0x18 ; 24 26508: 21 50 subi r18, 0x01 ; 1 2650a: 80 40 sbci r24, 0x00 ; 0 2650c: 90 40 sbci r25, 0x00 ; 0 2650e: e1 f7 brne .-8 ; 0x26508 26510: 00 c0 rjmp .+0 ; 0x26512 26512: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 26514: 9f b7 in r25, 0x3f ; 63 26516: f8 94 cli 26518: 80 81 ld r24, Z 2651a: 8b 7f andi r24, 0xFB ; 251 2651c: 80 83 st Z, r24 2651e: 9f bf out 0x3f, r25 ; 63 } 26520: 08 95 ret 00026522 : 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() { 26522: cf 93 push r28 26524: 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); 26526: 80 91 38 02 lds r24, 0x0238 ; 0x800238 2652a: 88 23 and r24, r24 2652c: 89 f0 breq .+34 ; 0x26550 2652e: 82 e8 ldi r24, 0x82 ; 130 26530: 9d e5 ldi r25, 0x5D ; 93 26532: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26536: ec 01 movw r28, r24 26538: 8a e5 ldi r24, 0x5A ; 90 2653a: 97 e5 ldi r25, 0x57 ; 87 2653c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26540: 22 e0 ldi r18, 0x02 ; 2 26542: 40 e4 ldi r20, 0x40 ; 64 26544: 5b e3 ldi r21, 0x3B ; 59 26546: be 01 movw r22, r28 } 26548: df 91 pop r29 2654a: 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); 2654c: 0d 94 54 d0 jmp 0x3a0a8 ; 0x3a0a8 26550: 8c e7 ldi r24, 0x7C ; 124 26552: 9d e5 ldi r25, 0x5D ; 93 26554: ee cf rjmp .-36 ; 0x26532 00026556 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 26556: ef 92 push r14 26558: ff 92 push r15 2655a: 0f 93 push r16 2655c: 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); 2655e: 8f e6 ldi r24, 0x6F ; 111 26560: 97 e5 ldi r25, 0x57 ; 87 26562: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26566: 28 ec ldi r18, 0xC8 ; 200 26568: e2 2e mov r14, r18 2656a: f1 2c mov r15, r1 2656c: 07 e2 ldi r16, 0x27 ; 39 2656e: 11 e0 ldi r17, 0x01 ; 1 26570: 30 e0 ldi r19, 0x00 ; 0 26572: 20 e0 ldi r18, 0x00 ; 0 26574: 40 e1 ldi r20, 0x10 ; 16 26576: 6a e6 ldi r22, 0x6A ; 106 26578: 7e e0 ldi r23, 0x0E ; 14 2657a: 0f 94 15 cf call 0x39e2a ; 0x39e2a #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); 2657e: 84 e5 ldi r24, 0x54 ; 84 26580: 97 e5 ldi r25, 0x57 ; 87 26582: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26586: 32 e3 ldi r19, 0x32 ; 50 26588: e3 2e mov r14, r19 2658a: f1 2c mov r15, r1 2658c: 08 e7 ldi r16, 0x78 ; 120 2658e: 10 e0 ldi r17, 0x00 ; 0 26590: 30 e0 ldi r19, 0x00 ; 0 26592: 20 e0 ldi r18, 0x00 ; 0 26594: 40 e1 ldi r20, 0x10 ; 16 26596: 68 e6 ldi r22, 0x68 ; 104 26598: 7e e0 ldi r23, 0x0E ; 14 2659a: 0f 94 15 cf call 0x39e2a ; 0x39e2a #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 2659e: 88 e4 ldi r24, 0x48 ; 72 265a0: 97 e5 ldi r25, 0x57 ; 87 265a2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 265a6: 4f e7 ldi r20, 0x7F ; 127 265a8: e4 2e mov r14, r20 265aa: f1 2c mov r15, r1 265ac: 0f ef ldi r16, 0xFF ; 255 265ae: 10 e0 ldi r17, 0x00 ; 0 265b0: 30 e0 ldi r19, 0x00 ; 0 265b2: 20 e0 ldi r18, 0x00 ; 0 265b4: 48 e0 ldi r20, 0x08 ; 8 265b6: 6f ed ldi r22, 0xDF ; 223 265b8: 73 e0 ldi r23, 0x03 ; 3 265ba: 0f 94 15 cf call 0x39e2a ; 0x39e2a } 265be: 1f 91 pop r17 265c0: 0f 91 pop r16 265c2: ff 90 pop r15 265c4: ef 90 pop r14 265c6: 08 95 ret 000265c8 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 265c8: cf 93 push r28 265ca: 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); 265cc: 8f ef ldi r24, 0xFF ; 255 265ce: 9f e0 ldi r25, 0x0F ; 15 265d0: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c bool bDesync = tmc2130_mode ^ eeprom_mode; 265d4: 90 91 69 06 lds r25, 0x0669 ; 0x800669 if (eeprom_mode == SILENT_MODE_NORMAL) 265d8: 81 11 cpse r24, r1 265da: 35 c0 rjmp .+106 ; 0x26646 { if (bDesync) 265dc: 99 23 and r25, r25 265de: 11 f1 breq .+68 ; 0x26624 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 265e0: 80 e2 ldi r24, 0x20 ; 32 265e2: 9d e3 ldi r25, 0x3D ; 61 265e4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 265e8: 22 e0 ldi r18, 0x02 ; 2 265ea: 48 e3 ldi r20, 0x38 ; 56 265ec: 5a e3 ldi r21, 0x3A ; 58 265ee: 62 ea ldi r22, 0xA2 ; 162 265f0: 74 ea ldi r23, 0xA4 ; 164 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 265f2: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 265f6: 89 e6 ldi r24, 0x69 ; 105 265f8: 9f e0 ldi r25, 0x0F ; 15 265fa: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 265fe: 88 23 and r24, r24 26600: f9 f0 breq .+62 ; 0x26640 26602: 82 e8 ldi r24, 0x82 ; 130 26604: 9d e5 ldi r25, 0x5D ; 93 26606: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2660a: ec 01 movw r28, r24 2660c: 8b e3 ldi r24, 0x3B ; 59 2660e: 97 e5 ldi r25, 0x57 ; 87 26610: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26614: 22 e0 ldi r18, 0x02 ; 2 26616: 4e e8 ldi r20, 0x8E ; 142 26618: 5a e3 ldi r21, 0x3A ; 58 2661a: 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 } } 2661c: df 91 pop r29 2661e: 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); 26620: 0d 94 54 d0 jmp 0x3a0a8 ; 0x3a0a8 { 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); 26624: 86 eb ldi r24, 0xB6 ; 182 26626: 97 e5 ldi r25, 0x57 ; 87 26628: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2662c: ec 01 movw r28, r24 2662e: 80 e2 ldi r24, 0x20 ; 32 26630: 9d e3 ldi r25, 0x3D ; 61 26632: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26636: 22 e0 ldi r18, 0x02 ; 2 26638: 48 e3 ldi r20, 0x38 ; 56 2663a: 5a e3 ldi r21, 0x3A ; 58 2663c: be 01 movw r22, r28 2663e: d9 cf rjmp .-78 ; 0x265f2 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 26640: 8c e7 ldi r24, 0x7C ; 124 26642: 9d e5 ldi r25, 0x5D ; 93 26644: e0 cf rjmp .-64 ; 0x26606 } else { if (bDesync) 26646: 98 17 cp r25, r24 26648: a9 f0 breq .+42 ; 0x26674 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 2664a: 80 e2 ldi r24, 0x20 ; 32 2664c: 9d e3 ldi r25, 0x3D ; 61 2664e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26652: 22 e0 ldi r18, 0x02 ; 2 26654: 48 e3 ldi r20, 0x38 ; 56 26656: 5a e3 ldi r21, 0x3A ; 58 26658: 6d e9 ldi r22, 0x9D ; 157 2665a: 74 ea ldi r23, 0xA4 ; 164 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 2665c: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 26660: 8b e3 ldi r24, 0x3B ; 59 26662: 97 e5 ldi r25, 0x57 ; 87 26664: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26668: 22 e0 ldi r18, 0x02 ; 2 2666a: 42 ef ldi r20, 0xF2 ; 242 2666c: 5a e3 ldi r21, 0x3A ; 58 2666e: 70 e0 ldi r23, 0x00 ; 0 26670: 60 e0 ldi r22, 0x00 ; 0 26672: d4 cf rjmp .-88 ; 0x2661c { 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); 26674: 81 e3 ldi r24, 0x31 ; 49 26676: 97 e5 ldi r25, 0x57 ; 87 26678: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2667c: ec 01 movw r28, r24 2667e: 80 e2 ldi r24, 0x20 ; 32 26680: 9d e3 ldi r25, 0x3D ; 61 26682: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26686: 22 e0 ldi r18, 0x02 ; 2 26688: 48 e3 ldi r20, 0x38 ; 56 2668a: 5a e3 ldi r21, 0x3A ; 58 2668c: be 01 movw r22, r28 2668e: e6 cf rjmp .-52 ; 0x2665c 00026690 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 26690: cf 93 push r28 26692: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 26694: 86 ed ldi r24, 0xD6 ; 214 26696: 9e e0 ldi r25, 0x0E ; 14 26698: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2669c: 81 30 cpi r24, 0x01 ; 1 2669e: c1 f5 brne .+112 ; 0x26710 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 266a0: 82 e8 ldi r24, 0x82 ; 130 266a2: 9d e5 ldi r25, 0x5D ; 93 266a4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 266a8: 22 e0 ldi r18, 0x02 ; 2 266aa: 4e e2 ldi r20, 0x2E ; 46 266ac: 5b e3 ldi r21, 0x3B ; 59 266ae: bc 01 movw r22, r24 266b0: 84 e8 ldi r24, 0x84 ; 132 266b2: 90 e7 ldi r25, 0x70 ; 112 266b4: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 266b8: 8e ec ldi r24, 0xCE ; 206 266ba: 9e e0 ldi r25, 0x0E ; 14 266bc: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 266c0: 81 30 cpi r24, 0x01 ; 1 266c2: 49 f5 brne .+82 ; 0x26716 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 266c4: 82 e8 ldi r24, 0x82 ; 130 266c6: 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); 266c8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 266cc: ec 01 movw r28, r24 266ce: 88 e2 ldi r24, 0x28 ; 40 266d0: 97 e5 ldi r25, 0x57 ; 87 266d2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 266d6: 22 e0 ldi r18, 0x02 ; 2 266d8: 4a e6 ldi r20, 0x6A ; 106 266da: 5b e3 ldi r21, 0x3B ; 59 266dc: be 01 movw r22, r28 266de: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 } #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); 266e2: 89 ea ldi r24, 0xA9 ; 169 266e4: 9d e0 ldi r25, 0x0D ; 13 266e6: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 266ea: 88 23 and r24, r24 266ec: b9 f0 breq .+46 ; 0x2671c 266ee: 81 e3 ldi r24, 0x31 ; 49 266f0: 97 e5 ldi r25, 0x57 ; 87 266f2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 266f6: ec 01 movw r28, r24 266f8: 8d e1 ldi r24, 0x1D ; 29 266fa: 97 e5 ldi r25, 0x57 ; 87 266fc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26700: 22 e0 ldi r18, 0x02 ; 2 26702: 48 eb ldi r20, 0xB8 ; 184 26704: 59 e3 ldi r21, 0x39 ; 57 26706: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 26708: df 91 pop r29 2670a: 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); 2670c: 0d 94 54 d0 jmp 0x3a0a8 ; 0x3a0a8 #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); 26710: 8c e7 ldi r24, 0x7C ; 124 26712: 9d e5 ldi r25, 0x5D ; 93 26714: c7 cf rjmp .-114 ; 0x266a4 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); 26716: 8c e7 ldi r24, 0x7C ; 124 26718: 9d e5 ldi r25, 0x5D ; 93 2671a: d6 cf rjmp .-84 ; 0x266c8 } #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); 2671c: 86 eb ldi r24, 0xB6 ; 182 2671e: 97 e5 ldi r25, 0x57 ; 87 26720: e8 cf rjmp .-48 ; 0x266f2 00026722 : MENU_END(); } static void lcd_settings_menu() { 26722: 1f 93 push r17 26724: cf 93 push r28 26726: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 26728: 8f ef ldi r24, 0xFF ; 255 2672a: 9f e0 ldi r25, 0x0F ; 15 2672c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 26730: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 MENU_BEGIN(); 26734: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 26738: 10 92 12 05 sts 0x0512, r1 ; 0x800512 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 2673c: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 2673e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26742: 84 30 cpi r24, 0x04 ; 4 26744: 08 f0 brcs .+2 ; 0x26748 26746: 5c c1 rjmp .+696 ; 0x26a00 26748: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2674c: 8c ea ldi r24, 0xAC ; 172 2674e: 9d e3 ldi r25, 0x3D ; 61 26750: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26754: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 26758: 81 e3 ldi r24, 0x31 ; 49 2675a: 98 e5 ldi r25, 0x58 ; 88 2675c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26760: 6b ed ldi r22, 0xDB ; 219 26762: 74 ed ldi r23, 0xD4 ; 212 26764: 0f 94 43 d1 call 0x3a286 ; 0x3a286 if (!printer_active() || printingIsPaused()) 26768: 0e 94 a7 68 call 0xd14e ; 0xd14e 2676c: 88 23 and r24, r24 2676e: 21 f0 breq .+8 ; 0x26778 26770: 0e 94 4b 68 call 0xd096 ; 0xd096 26774: 88 23 and r24, r24 26776: 81 f0 breq .+32 ; 0x26798 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 26778: 85 e2 ldi r24, 0x25 ; 37 2677a: 98 e5 ldi r25, 0x58 ; 88 2677c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26780: 6e e9 ldi r22, 0x9E ; 158 26782: 79 e3 ldi r23, 0x39 ; 57 26784: 0f 94 43 d1 call 0x3a286 ; 0x3a286 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 26788: 82 e1 ldi r24, 0x12 ; 18 2678a: 98 e5 ldi r25, 0x58 ; 88 2678c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26790: 61 eb ldi r22, 0xB1 ; 177 26792: 7b e6 ldi r23, 0x6B ; 107 26794: 0f 94 bb cd call 0x39b76 ; 0x39b76 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 26798: 8c eb ldi r24, 0xBC ; 188 2679a: 9c e3 ldi r25, 0x3C ; 60 2679c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 267a0: 60 ea ldi r22, 0xA0 ; 160 267a2: 79 e3 ldi r23, 0x39 ; 57 267a4: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #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); 267a8: 8c ea ldi r24, 0xAC ; 172 267aa: 9c e0 ldi r25, 0x0C ; 12 267ac: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 267b0: 88 23 and r24, r24 267b2: 09 f4 brne .+2 ; 0x267b6 267b4: ac c0 rjmp .+344 ; 0x2690e 267b6: 82 e8 ldi r24, 0x82 ; 130 267b8: 9d e5 ldi r25, 0x5D ; 93 267ba: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 267be: 22 e0 ldi r18, 0x02 ; 2 267c0: 4e e6 ldi r20, 0x6E ; 110 267c2: 5a e3 ldi r21, 0x3A ; 58 267c4: bc 01 movw r22, r24 267c6: 84 ee ldi r24, 0xE4 ; 228 267c8: 94 ea ldi r25, 0xA4 ; 164 267ca: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 267ce: 8c ea ldi r24, 0xAC ; 172 267d0: 9c e0 ldi r25, 0x0C ; 12 267d2: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 267d6: 88 23 and r24, r24 267d8: 31 f0 breq .+12 ; 0x267e6 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 267da: 62 e6 ldi r22, 0x62 ; 98 267dc: 7a e3 ldi r23, 0x3A ; 58 267de: 8a ed ldi r24, 0xDA ; 218 267e0: 94 ea ldi r25, 0xA4 ; 164 267e2: 0f 94 42 ce call 0x39c84 ; 0x39c84 } if (MMU2::mmu2.Enabled()) 267e6: 80 91 95 13 lds r24, 0x1395 ; 0x801395 267ea: 81 30 cpi r24, 0x01 ; 1 267ec: 51 f4 brne .+20 ; 0x26802 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 267ee: 0f 94 48 33 call 0x26690 ; 0x26690 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 267f2: 83 e0 ldi r24, 0x03 ; 3 267f4: 98 e5 ldi r25, 0x58 ; 88 267f6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 267fa: 68 e0 ldi r22, 0x08 ; 8 267fc: 79 ed ldi r23, 0xD9 ; 217 267fe: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } SETTINGS_FANS_CHECK(); 26802: 0f 94 91 32 call 0x26522 ; 0x26522 SETTINGS_SILENT_MODE(); 26806: 0f 94 e4 32 call 0x265c8 ; 0x265c8 if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 2680a: 10 93 f5 03 sts 0x03F5, r17 ; 0x8003f5 MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 2680e: 88 ef ldi r24, 0xF8 ; 248 26810: 97 e5 ldi r25, 0x57 ; 87 26812: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26816: 6a e2 ldi r22, 0x2A ; 42 26818: 7a e3 ldi r23, 0x3A ; 58 2681a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } 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); 2681e: 89 e7 ldi r24, 0x79 ; 121 26820: 9a e3 ldi r25, 0x3A ; 58 26822: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26826: 64 e3 ldi r22, 0x34 ; 52 26828: 78 ed ldi r23, 0xD8 ; 216 2682a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 2682e: 86 ee ldi r24, 0xE6 ; 230 26830: 97 e5 ldi r25, 0x57 ; 87 26832: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26836: 66 e0 ldi r22, 0x06 ; 6 26838: 7b e3 ldi r23, 0x3B ; 59 2683a: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 2683e: 20 e0 ldi r18, 0x00 ; 0 26840: 30 e0 ldi r19, 0x00 ; 0 26842: 40 e2 ldi r20, 0x20 ; 32 26844: 51 e4 ldi r21, 0x41 ; 65 26846: 60 91 95 03 lds r22, 0x0395 ; 0x800395 2684a: 70 91 96 03 lds r23, 0x0396 ; 0x800396 2684e: 80 91 97 03 lds r24, 0x0397 ; 0x800397 26852: 90 91 98 03 lds r25, 0x0398 ; 0x800398 26856: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 2685a: 87 fd sbrc r24, 7 2685c: 16 c0 rjmp .+44 ; 0x2688a 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); 2685e: 8f ea ldi r24, 0xAF ; 175 26860: 9f e0 ldi r25, 0x0F ; 15 26862: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 26866: 88 23 and r24, r24 26868: 09 f4 brne .+2 ; 0x2686c 2686a: 54 c0 rjmp .+168 ; 0x26914 2686c: 82 e8 ldi r24, 0x82 ; 130 2686e: 9d e5 ldi r25, 0x5D ; 93 26870: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26874: ec 01 movw r28, r24 26876: 82 e3 ldi r24, 0x32 ; 50 26878: 9a e3 ldi r25, 0x3A ; 58 2687a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2687e: 22 e0 ldi r18, 0x02 ; 2 26880: 4c e8 ldi r20, 0x8C ; 140 26882: 5a e3 ldi r21, 0x3A ; 58 26884: be 01 movw r22, r28 26886: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #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); 2688a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 2688e: 81 11 cpse r24, r1 26890: 44 c0 rjmp .+136 ; 0x2691a 26892: 8c e7 ldi r24, 0x7C ; 124 26894: 9d e5 ldi r25, 0x5D ; 93 26896: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2689a: ec 01 movw r28, r24 2689c: 8b ed ldi r24, 0xDB ; 219 2689e: 97 e5 ldi r25, 0x57 ; 87 268a0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 268a4: 22 e0 ldi r18, 0x02 ; 2 268a6: 42 e7 ldi r20, 0x72 ; 114 268a8: 5b e3 ldi r21, 0x3B ; 59 268aa: be 01 movw r22, r28 268ac: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 268b0: 0e 94 4b 68 call 0xd096 ; 0xd096 268b4: 81 11 cpse r24, r1 268b6: 08 c0 rjmp .+16 ; 0x268c8 268b8: 8f e5 ldi r24, 0x5F ; 95 268ba: 9c e3 ldi r25, 0x3C ; 60 268bc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 268c0: 6a ed ldi r22, 0xDA ; 218 268c2: 7a e3 ldi r23, 0x3A ; 58 268c4: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 268c8: 89 ec ldi r24, 0xC9 ; 201 268ca: 97 e5 ldi r25, 0x57 ; 87 268cc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 268d0: 6a e3 ldi r22, 0x3A ; 58 268d2: 7b e3 ldi r23, 0x3B ; 59 268d4: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 268d8: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 268dc: 88 23 and r24, r24 268de: 01 f1 breq .+64 ; 0x26920 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 268e0: 8f eb ldi r24, 0xBF ; 191 268e2: 97 e5 ldi r25, 0x57 ; 87 268e4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 268e8: 22 e0 ldi r18, 0x02 ; 2 268ea: 48 e4 ldi r20, 0x48 ; 72 268ec: 5a e3 ldi r21, 0x3A ; 58 268ee: 64 ea ldi r22, 0xA4 ; 164 268f0: 70 e7 ldi r23, 0x70 ; 112 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 268f2: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 268f6: 89 e0 ldi r24, 0x09 ; 9 268f8: 9f e0 ldi r25, 0x0F ; 15 268fa: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 268fe: 88 23 and r24, r24 26900: e9 f0 breq .+58 ; 0x2693c 26902: 81 30 cpi r24, 0x01 ; 1 26904: 09 f4 brne .+2 ; 0x26908 26906: 6d c0 rjmp .+218 ; 0x269e2 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); 26908: 84 e2 ldi r24, 0x24 ; 36 2690a: 90 e4 ldi r25, 0x40 ; 64 2690c: 19 c0 rjmp .+50 ; 0x26940 #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); 2690e: 8c e7 ldi r24, 0x7C ; 124 26910: 9d e5 ldi r25, 0x5D ; 93 26912: 53 cf rjmp .-346 ; 0x267ba #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); 26914: 8c e7 ldi r24, 0x7C ; 124 26916: 9d e5 ldi r25, 0x5D ; 93 26918: ab cf rjmp .-170 ; 0x26870 #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); 2691a: 82 e8 ldi r24, 0x82 ; 130 2691c: 9d e5 ldi r25, 0x5D ; 93 2691e: bb cf rjmp .-138 ; 0x26896 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); 26920: 86 eb ldi r24, 0xB6 ; 182 26922: 97 e5 ldi r25, 0x57 ; 87 26924: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26928: ec 01 movw r28, r24 2692a: 8f eb ldi r24, 0xBF ; 191 2692c: 97 e5 ldi r25, 0x57 ; 87 2692e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26932: 22 e0 ldi r18, 0x02 ; 2 26934: 48 e4 ldi r20, 0x48 ; 72 26936: 5a e3 ldi r21, 0x3A ; 58 26938: be 01 movw r22, r28 2693a: db cf rjmp .-74 ; 0x268f2 #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; 2693c: 8f ea ldi r24, 0xAF ; 175 2693e: 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); 26940: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26944: ec 01 movw r28, r24 26946: 88 ea ldi r24, 0xA8 ; 168 26948: 97 e5 ldi r25, 0x57 ; 87 2694a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2694e: 22 e0 ldi r18, 0x02 ; 2 26950: 40 ef ldi r20, 0xF0 ; 240 26952: 59 e3 ldi r21, 0x39 ; 57 26954: be 01 movw r22, r28 26956: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 2695a: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 2695e: 82 30 cpi r24, 0x02 ; 2 26960: 09 f4 brne .+2 ; 0x26964 26962: 45 c0 rjmp .+138 ; 0x269ee 26964: 83 30 cpi r24, 0x03 ; 3 26966: 09 f4 brne .+2 ; 0x2696a 26968: 45 c0 rjmp .+138 ; 0x269f4 2696a: 81 30 cpi r24, 0x01 ; 1 2696c: e9 f1 breq .+122 ; 0x269e8 2696e: 85 eb ldi r24, 0xB5 ; 181 26970: 9c e3 ldi r25, 0x3C ; 60 26972: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26976: ec 01 movw r28, r24 26978: 8d ea ldi r24, 0xAD ; 173 2697a: 9c e3 ldi r25, 0x3C ; 60 2697c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26980: 22 e0 ldi r18, 0x02 ; 2 26982: 44 e3 ldi r20, 0x34 ; 52 26984: 5b e3 ldi r21, 0x3B ; 59 26986: be 01 movw r22, r28 26988: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 #ifdef LCD_BL_PIN if (backlightSupport) 2698c: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 26990: 88 23 and r24, r24 26992: 41 f0 breq .+16 ; 0x269a4 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 26994: 87 e8 ldi r24, 0x87 ; 135 26996: 9c e3 ldi r25, 0x3C ; 60 26998: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2699c: 6b ea ldi r22, 0xAB ; 171 2699e: 77 ed ldi r23, 0xD7 ; 215 269a0: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } #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 269a4: 87 ea ldi r24, 0xA7 ; 167 269a6: 9c e0 ldi r25, 0x0C ; 12 269a8: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 269ac: 88 23 and r24, r24 269ae: 29 f1 breq .+74 ; 0x269fa 269b0: 86 e6 ldi r24, 0x66 ; 102 269b2: 9d e3 ldi r25, 0x3D ; 61 269b4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 269b8: 22 e0 ldi r18, 0x02 ; 2 269ba: 41 e7 ldi r20, 0x71 ; 113 269bc: 52 ed ldi r21, 0xD2 ; 210 269be: bc 01 movw r22, r24 269c0: 87 e9 ldi r24, 0x97 ; 151 269c2: 90 e7 ldi r25, 0x70 ; 112 269c4: 0f 94 54 d0 call 0x3a0a8 ; 0x3a0a8 if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 269c8: 0f 94 99 ce call 0x39d32 ; 0x39d32 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 269cc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 269d0: 8f 5f subi r24, 0xFF ; 255 269d2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 269d6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 269da: 8f 5f subi r24, 0xFF ; 255 269dc: 80 93 14 05 sts 0x0514, r24 ; 0x800514 269e0: ae ce rjmp .-676 ; 0x2673e 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; 269e2: 8d e9 ldi r24, 0x9D ; 157 269e4: 97 e5 ldi r25, 0x57 ; 87 269e6: ac cf rjmp .-168 ; 0x26940 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 269e8: 86 ea ldi r24, 0xA6 ; 166 269ea: 9c e3 ldi r25, 0x3C ; 60 269ec: c2 cf rjmp .-124 ; 0x26972 269ee: 8d e9 ldi r24, 0x9D ; 157 269f0: 9c e3 ldi r25, 0x3C ; 60 269f2: bf cf rjmp .-130 ; 0x26972 269f4: 84 e9 ldi r24, 0x94 ; 148 269f6: 9c e3 ldi r25, 0x3C ; 60 269f8: bc cf rjmp .-136 ; 0x26972 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 269fa: 8c e6 ldi r24, 0x6C ; 108 269fc: 9d e3 ldi r25, 0x3D ; 61 269fe: da cf rjmp .-76 ; 0x269b4 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 26a00: df 91 pop r29 26a02: cf 91 pop r28 26a04: 1f 91 pop r17 26a06: 08 95 ret 00026a08 : //! @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) { 26a08: cf 92 push r12 26a0a: df 92 push r13 26a0c: ef 92 push r14 26a0e: ff 92 push r15 26a10: 0f 93 push r16 26a12: 1f 93 push r17 26a14: cf 93 push r28 26a16: df 93 push r29 26a18: d8 2f mov r29, r24 26a1a: 6b 01 movw r12, r22 26a1c: 7a 01 movw r14, r20 26a1e: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 26a20: 40 e2 ldi r20, 0x20 ; 32 26a22: 81 11 cpse r24, r1 26a24: 01 c0 rjmp .+2 ; 0x26a28 26a26: 4e e3 ldi r20, 0x3E ; 62 26a28: 63 e0 ldi r22, 0x03 ; 3 26a2a: 80 e0 ldi r24, 0x00 ; 0 26a2c: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_puts_P(first_choice); 26a30: c6 01 movw r24, r12 26a32: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 26a36: 40 e2 ldi r20, 0x20 ; 32 26a38: d1 30 cpi r29, 0x01 ; 1 26a3a: 09 f4 brne .+2 ; 0x26a3e 26a3c: 4e e3 ldi r20, 0x3E ; 62 26a3e: 63 e0 ldi r22, 0x03 ; 3 26a40: 8c 2f mov r24, r28 26a42: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_puts_P(second_choice); 26a46: c7 01 movw r24, r14 26a48: 0e 94 91 6f call 0xdf22 ; 0xdf22 if (third_choice) { 26a4c: 01 15 cp r16, r1 26a4e: 11 05 cpc r17, r1 26a50: 19 f1 breq .+70 ; 0x26a98 26a52: c8 01 movw r24, r16 26a54: 0f 94 04 db call 0x3b608 ; 0x3b608 <__strlen_P> 26a58: d8 2e mov r13, r24 26a5a: c7 01 movw r24, r14 26a5c: 0f 94 04 db call 0x3b608 ; 0x3b608 <__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; 26a60: 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;} 26a62: 93 e1 ldi r25, 0x13 ; 19 26a64: 9d 19 sub r25, r13 26a66: 8c 0f add r24, r28 26a68: 89 17 cp r24, r25 26a6a: 08 f4 brcc .+2 ; 0x26a6e 26a6c: 89 2f mov r24, r25 26a6e: 83 31 cpi r24, 0x13 ; 19 26a70: 08 f0 brcs .+2 ; 0x26a74 26a72: 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 ? '>': ' '); 26a74: 40 e2 ldi r20, 0x20 ; 32 26a76: d2 30 cpi r29, 0x02 ; 2 26a78: 09 f4 brne .+2 ; 0x26a7c 26a7a: 4e e3 ldi r20, 0x3E ; 62 26a7c: 63 e0 ldi r22, 0x03 ; 3 26a7e: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_puts_P(third_choice); 26a82: c8 01 movw r24, r16 } } 26a84: df 91 pop r29 26a86: cf 91 pop r28 26a88: 1f 91 pop r17 26a8a: 0f 91 pop r16 26a8c: ff 90 pop r15 26a8e: ef 90 pop r14 26a90: df 90 pop r13 26a92: 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); 26a94: 0c 94 91 6f jmp 0xdf22 ; 0xdf22 } } 26a98: df 91 pop r29 26a9a: cf 91 pop r28 26a9c: 1f 91 pop r17 26a9e: 0f 91 pop r16 26aa0: ff 90 pop r15 26aa2: ef 90 pop r14 26aa4: df 90 pop r13 26aa6: cf 90 pop r12 26aa8: 08 95 ret 00026aaa : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 26aaa: cf 93 push r28 26aac: df 93 push r29 26aae: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 26ab0: 80 e0 ldi r24, 0x00 ; 0 26ab2: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_clear(); 26ab6: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 return lcd_display_message_fullscreen_nonBlocking_P(msg); 26aba: ce 01 movw r24, r28 } 26abc: df 91 pop r29 26abe: 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); 26ac0: 0d 94 5c 2c jmp 0x258b8 ; 0x258b8 00026ac4 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 26ac4: cf 92 push r12 26ac6: df 92 push r13 26ac8: ef 92 push r14 26aca: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 26acc: 80 e0 ldi r24, 0x00 ; 0 26ace: 90 e0 ldi r25, 0x00 ; 0 26ad0: a8 ec ldi r26, 0xC8 ; 200 26ad2: b2 e4 ldi r27, 0x42 ; 66 26ad4: 80 93 48 07 sts 0x0748, r24 ; 0x800748 26ad8: 90 93 49 07 sts 0x0749, r25 ; 0x800749 26adc: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 26ae0: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 26ae4: 65 e5 ldi r22, 0x55 ; 85 26ae6: 75 e5 ldi r23, 0x55 ; 85 26ae8: 85 e5 ldi r24, 0x55 ; 85 26aea: 91 e4 ldi r25, 0x41 ; 65 26aec: 0f 94 48 ba call 0x37490 ; 0x37490 delay_keep_alive(2000); 26af0: 80 ed ldi r24, 0xD0 ; 208 26af2: 97 e0 ldi r25, 0x07 ; 7 26af4: 0e 94 98 8e call 0x11d30 ; 0x11d30 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 26af8: 8a e9 ldi r24, 0x9A ; 154 26afa: 9f e4 ldi r25, 0x4F ; 79 26afc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26b00: 0f 94 55 35 call 0x26aaa ; 0x26aaa return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 26b04: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 26b08: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 26b0c: 07 2e mov r0, r23 26b0e: 00 0c add r0, r0 26b10: 88 0b sbc r24, r24 26b12: 99 0b sbc r25, r25 26b14: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 26b18: 9b 01 movw r18, r22 26b1a: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 26b1c: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 26b20: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 26b24: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 26b28: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 26b2c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 26b30: 9f 77 andi r25, 0x7F ; 127 26b32: 20 e0 ldi r18, 0x00 ; 0 26b34: 30 e0 ldi r19, 0x00 ; 0 26b36: 40 ea ldi r20, 0xA0 ; 160 26b38: 50 e4 ldi r21, 0x40 ; 64 26b3a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 26b3e: 18 16 cp r1, r24 26b40: b4 f5 brge .+108 ; 0x26bae lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 26b42: 8a e9 ldi r24, 0x9A ; 154 26b44: 9f e4 ldi r25, 0x4F ; 79 26b46: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26b4a: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_set_cursor(0, 4); 26b4e: 64 e0 ldi r22, 0x04 ; 4 26b50: 80 e0 ldi r24, 0x00 ; 0 26b52: 0e 94 a6 6f call 0xdf4c ; 0xdf4c 26b56: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 26b5a: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 26b5e: 07 2e mov r0, r23 26b60: 00 0c add r0, r0 26b62: 88 0b sbc r24, r24 26b64: 99 0b sbc r25, r25 26b66: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__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)); 26b6a: 20 e0 ldi r18, 0x00 ; 0 26b6c: 30 e0 ldi r19, 0x00 ; 0 26b6e: 40 e0 ldi r20, 0x00 ; 0 26b70: 5f e3 ldi r21, 0x3F ; 63 26b72: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 26b76: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 26b7a: 6b 01 movw r12, r22 26b7c: 20 e0 ldi r18, 0x00 ; 0 26b7e: 30 e0 ldi r19, 0x00 ; 0 26b80: 40 e0 ldi r20, 0x00 ; 0 26b82: 5f e3 ldi r21, 0x3F ; 63 26b84: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 26b88: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 26b8c: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 26b90: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 26b94: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 26b98: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 26b9c: a6 01 movw r20, r12 26b9e: 82 e8 ldi r24, 0x82 ; 130 26ba0: 0f 94 f2 2e call 0x25de4 ; 0x25de4 delay_keep_alive(1000); 26ba4: 88 ee ldi r24, 0xE8 ; 232 26ba6: 93 e0 ldi r25, 0x03 ; 3 26ba8: 0e 94 98 8e call 0x11d30 ; 0x11d30 26bac: ab cf rjmp .-170 ; 0x26b04 } } 26bae: ff 90 pop r15 26bb0: ef 90 pop r14 26bb2: df 90 pop r13 26bb4: cf 90 pop r12 26bb6: 08 95 ret 00026bb8 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 26bb8: cf 92 push r12 26bba: df 92 push r13 26bbc: ef 92 push r14 26bbe: ff 92 push r15 26bc0: 0f 93 push r16 26bc2: 1f 93 push r17 26bc4: cf 93 push r28 26bc6: df 93 push r29 26bc8: d8 2e mov r13, r24 26bca: 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) 26bcc: 01 e0 ldi r16, 0x01 ; 1 26bce: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 26bd2: 81 11 cpse r24, r1 26bd4: 01 c0 rjmp .+2 ; 0x26bd8 26bd6: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 26bd8: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 26bdc: 8d 2d mov r24, r13 26bde: 9c 2d mov r25, r12 26be0: 0f 94 55 35 call 0x26aaa ; 0x26aaa 26be4: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 26be6: 0e 94 be 71 call 0xe37c ; 0xe37c KEEPALIVE_STATE(PAUSED_FOR_USER); 26bea: 84 e0 ldi r24, 0x04 ; 4 26bec: 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); 26bf0: 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) { 26bf2: 20 97 sbiw r28, 0x00 ; 0 26bf4: 29 f4 brne .+10 ; 0x26c00 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 26bf6: 49 e8 ldi r20, 0x89 ; 137 26bf8: 63 e0 ldi r22, 0x03 ; 3 26bfa: 83 e1 ldi r24, 0x13 ; 19 26bfc: 0e 94 c6 6f call 0xdf8c ; 0xdf8c * @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); 26c00: 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); 26c02: 82 e3 ldi r24, 0x32 ; 50 26c04: 90 e0 ldi r25, 0x00 ; 0 26c06: 0e 94 98 8e call 0x11d30 ; 0x11d30 if (lcd_clicked()) { 26c0a: 0e 94 c3 71 call 0xe386 ; 0xe386 26c0e: 88 23 and r24, r24 26c10: 81 f0 breq .+32 ; 0x26c32 if (msg_next == NULL) { 26c12: 20 97 sbiw r28, 0x00 ; 0 26c14: 81 f4 brne .+32 ; 0x26c36 KEEPALIVE_STATE(IN_HANDLER); 26c16: 82 e0 ldi r24, 0x02 ; 2 26c18: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 26c1c: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 26c20: df 91 pop r29 26c22: cf 91 pop r28 26c24: 1f 91 pop r17 26c26: 0f 91 pop r16 26c28: ff 90 pop r15 26c2a: ef 90 pop r14 26c2c: df 90 pop r13 26c2e: cf 90 pop r12 26c30: 08 95 ret 26c32: 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) { 26c34: 31 f7 brne .-52 ; 0x26c02 else { break; } } } if (multi_screen) { 26c36: e1 14 cp r14, r1 26c38: f1 04 cpc r15, r1 26c3a: d9 f2 breq .-74 ; 0x26bf2 if (msg_next == NULL) 26c3c: 20 97 sbiw r28, 0x00 ; 0 26c3e: 11 f4 brne .+4 ; 0x26c44 msg_next = msg; 26c40: cd 2d mov r28, r13 26c42: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 26c44: ce 01 movw r24, r28 26c46: 0f 94 55 35 call 0x26aaa ; 0x26aaa 26c4a: ec 01 movw r28, r24 26c4c: d2 cf rjmp .-92 ; 0x26bf2 00026c4e : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 26c4e: cf 93 push r28 26c50: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 26c52: 8c e8 ldi r24, 0x8C ; 140 26c54: 91 e5 ldi r25, 0x51 ; 81 26c56: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26c5a: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 26c5e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 26c62: 81 30 cpi r24, 0x01 ; 1 26c64: 69 f4 brne .+26 ; 0x26c80 { lcd_show_fullscreen_message_and_wait_P( 26c66: 83 e3 ldi r24, 0x33 ; 51 26c68: 91 e5 ldi r25, 0x51 ; 81 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 26c6a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26c6e: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 26c72: 81 e6 ldi r24, 0x61 ; 97 26c74: 90 e5 ldi r25, 0x50 ; 80 26c76: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 _T(MSG_WIZARD_V2_CAL_2)); } 26c7a: 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( 26c7c: 0d 94 dc 35 jmp 0x26bb8 ; 0x26bb8 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 26c80: cc 23 and r28, r28 26c82: b9 f3 breq .-18 ; 0x26c72 { lcd_show_fullscreen_message_and_wait_P( 26c84: 81 e0 ldi r24, 0x01 ; 1 26c86: 91 e5 ldi r25, 0x51 ; 81 26c88: f0 cf rjmp .-32 ; 0x26c6a 00026c8a : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 26c8a: 80 91 95 13 lds r24, 0x1395 ; 0x801395 26c8e: 81 30 cpi r24, 0x01 ; 1 26c90: 71 f4 brne .+28 ; 0x26cae lcd_show_fullscreen_message_and_wait_P( 26c92: 88 e0 ldi r24, 0x08 ; 8 26c94: 90 e5 ldi r25, 0x50 ; 80 26c96: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26c9a: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 _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; 26c9e: 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; 26ca0: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 26ca4: 61 e0 ldi r22, 0x01 ; 1 26ca6: 83 e8 ldi r24, 0x83 ; 131 26ca8: 94 ea ldi r25, 0xA4 ; 164 26caa: 0c 94 5c 89 jmp 0x112b8 ; 0x112b8 // 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( 26cae: 8c eb ldi r24, 0xBC ; 188 26cb0: 9f e4 ldi r25, 0x4F ; 79 26cb2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26cb6: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 26cba: 80 e0 ldi r24, 0x00 ; 0 26cbc: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_clear(); 26cc0: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 26cc4: 80 eb ldi r24, 0xB0 ; 176 26cc6: 9c e5 ldi r25, 0x5C ; 92 26cc8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26ccc: ac 01 movw r20, r24 26cce: 62 e0 ldi r22, 0x02 ; 2 26cd0: 80 e0 ldi r24, 0x00 ; 0 26cd2: 0e 94 ba 6f call 0xdf74 ; 0xdf74 eFilamentAction = FilamentAction::Load; 26cd6: 81 e0 ldi r24, 0x01 ; 1 26cd8: e3 cf rjmp .-58 ; 0x26ca0 00026cda : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 26cda: cf 93 push r28 26cdc: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 26cde: 10 92 72 07 sts 0x0772, r1 ; 0x800772 disable_x(); 26ce2: 17 9a sbi 0x02, 7 ; 2 26ce4: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); 26ce8: 16 9a sbi 0x02, 6 ; 2 26cea: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_z(); disable_e0(); 26cee: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 26cf0: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 26cf4: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 26cf8: 68 2f mov r22, r24 26cfa: 86 ea ldi r24, 0xA6 ; 166 26cfc: 9f e0 ldi r25, 0x0F ; 15 26cfe: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 26d02: 6c 2f mov r22, r28 26d04: 8f ea ldi r24, 0xAF ; 175 26d06: 9f e0 ldi r25, 0x0F ; 15 26d08: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 // 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) { 26d0c: cc 23 and r28, r28 26d0e: 89 f0 breq .+34 ; 0x26d32 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 26d10: 88 e3 ldi r24, 0x38 ; 56 26d12: 94 ea ldi r25, 0xA4 ; 164 26d14: 0e 94 17 7b call 0xf62e ; 0xf62e lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 26d18: 84 eb ldi r24, 0xB4 ; 180 26d1a: 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)); 26d1c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26d20: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 } lcd_update_enable(true); 26d24: 81 e0 ldi r24, 0x01 ; 1 26d26: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_update(2); 26d2a: 82 e0 ldi r24, 0x02 ; 2 } 26d2c: 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); 26d2e: 0c 94 6d 6f jmp 0xdeda ; 0xdeda 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."); 26d32: 8d ef ldi r24, 0xFD ; 253 26d34: 93 ea ldi r25, 0xA3 ; 163 26d36: 0e 94 17 7b call 0xf62e ; 0xf62e lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 26d3a: 89 e9 ldi r24, 0x99 ; 153 26d3c: 9d e4 ldi r25, 0x4D ; 77 26d3e: ee cf rjmp .-36 ; 0x26d1c 00026d40 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 26d40: 1f 93 push r17 26d42: cf 93 push r28 26d44: 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); 26d46: 64 e6 ldi r22, 0x64 ; 100 26d48: 70 e0 ldi r23, 0x00 ; 0 26d4a: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 26d4e: 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++) { 26d50: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 26d52: 4e e2 ldi r20, 0x2E ; 46 26d54: 63 e0 ldi r22, 0x03 ; 3 26d56: 81 2f mov r24, r17 26d58: 0e 94 c6 6f call 0xdf8c ; 0xdf8c //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 26d5c: ce 01 movw r24, r28 26d5e: 0e 94 98 8e call 0x11d30 ; 0x11d30 26d62: ce 01 movw r24, r28 26d64: 0e 94 98 8e call 0x11d30 ; 0x11d30 26d68: ce 01 movw r24, r28 26d6a: 0e 94 98 8e call 0x11d30 ; 0x11d30 26d6e: ce 01 movw r24, r28 26d70: 0e 94 98 8e call 0x11d30 ; 0x11d30 26d74: ce 01 movw r24, r28 26d76: 0e 94 98 8e call 0x11d30 ; 0x11d30 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 26d7a: 1f 5f subi r17, 0xFF ; 255 26d7c: 14 31 cpi r17, 0x14 ; 20 26d7e: 49 f7 brne .-46 ; 0x26d52 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 26d80: df 91 pop r29 26d82: cf 91 pop r28 26d84: 1f 91 pop r17 26d86: 08 95 ret 00026d88 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 26d88: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 26d8c: 08 95 ret 00026d8e : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 26d8e: cf 93 push r28 MENU_BEGIN(); 26d90: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 26d94: 10 92 12 05 sts 0x0512, r1 ; 0x800512 26d98: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26d9c: 84 30 cpi r24, 0x04 ; 4 26d9e: 08 f0 brcs .+2 ; 0x26da2 26da0: a1 c0 rjmp .+322 ; 0x26ee4 26da2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 26da6: 8f e5 ldi r24, 0x5F ; 95 26da8: 9f e0 ldi r25, 0x0F ; 15 26daa: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 26dae: 81 11 cpse r24, r1 26db0: 10 c0 rjmp .+32 ; 0x26dd2 { ON_MENU_LEAVE( 26db2: 0f 94 45 cd call 0x39a8a ; 0x39a8a 26db6: 81 11 cpse r24, r1 26db8: 0f 94 c4 36 call 0x26d88 ; 0x26d88 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 26dbc: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 26dc0: 8a 30 cpi r24, 0x0A ; 10 26dc2: 09 f4 brne .+2 ; 0x26dc6 26dc4: 8c c0 rjmp .+280 ; 0x26ede 26dc6: 8c ea ldi r24, 0xAC ; 172 26dc8: 9d e3 ldi r25, 0x3D ; 61 26dca: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26dce: 0f 94 90 d1 call 0x3a320 ; 0x3a320 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(); 26dd2: 0f 94 b3 22 call 0x24566 ; 0x24566 26dd6: 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); 26dd8: 80 ea ldi r24, 0xA0 ; 160 26dda: 93 ea ldi r25, 0xA3 ; 163 26ddc: cc 23 and r28, r28 26dde: 11 f0 breq .+4 ; 0x26de4 26de0: 8f ea ldi r24, 0xAF ; 175 26de2: 93 ea ldi r25, 0xA3 ; 163 26de4: 6e e8 ldi r22, 0x8E ; 142 26de6: 7b e3 ldi r23, 0x3B ; 59 26de8: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26dec: 85 e8 ldi r24, 0x85 ; 133 26dee: 93 ea ldi r25, 0xA3 ; 163 26df0: cc 23 and r28, r28 26df2: 11 f0 breq .+4 ; 0x26df8 26df4: 84 e9 ldi r24, 0x94 ; 148 26df6: 93 ea ldi r25, 0xA3 ; 163 26df8: 6e ec ldi r22, 0xCE ; 206 26dfa: 79 e3 ldi r23, 0x39 ; 57 26dfc: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26e00: 89 e6 ldi r24, 0x69 ; 105 26e02: 93 ea ldi r25, 0xA3 ; 163 26e04: cc 23 and r28, r28 26e06: 11 f0 breq .+4 ; 0x26e0c 26e08: 89 e7 ldi r24, 0x79 ; 121 26e0a: 93 ea ldi r25, 0xA3 ; 163 26e0c: 6c e2 ldi r22, 0x2C ; 44 26e0e: 7a e3 ldi r23, 0x3A ; 58 26e10: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26e14: 8d e4 ldi r24, 0x4D ; 77 26e16: 93 ea ldi r25, 0xA3 ; 163 26e18: cc 23 and r28, r28 26e1a: 11 f0 breq .+4 ; 0x26e20 26e1c: 8d e5 ldi r24, 0x5D ; 93 26e1e: 93 ea ldi r25, 0xA3 ; 163 26e20: 66 e4 ldi r22, 0x46 ; 70 26e22: 7b e3 ldi r23, 0x3B ; 59 26e24: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26e28: 82 e3 ldi r24, 0x32 ; 50 26e2a: 93 ea ldi r25, 0xA3 ; 163 26e2c: cc 23 and r28, r28 26e2e: 11 f0 breq .+4 ; 0x26e34 26e30: 81 e4 ldi r24, 0x41 ; 65 26e32: 93 ea ldi r25, 0xA3 ; 163 26e34: 64 e3 ldi r22, 0x34 ; 52 26e36: 7a e3 ldi r23, 0x3A ; 58 26e38: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26e3c: 87 e1 ldi r24, 0x17 ; 23 26e3e: 93 ea ldi r25, 0xA3 ; 163 26e40: cc 23 and r28, r28 26e42: 11 f0 breq .+4 ; 0x26e48 26e44: 86 e2 ldi r24, 0x26 ; 38 26e46: 93 ea ldi r25, 0xA3 ; 163 26e48: 6e e5 ldi r22, 0x5E ; 94 26e4a: 7b e3 ldi r23, 0x3B ; 59 26e4c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26e50: 8b ef ldi r24, 0xFB ; 251 26e52: 92 ea ldi r25, 0xA2 ; 162 26e54: cc 23 and r28, r28 26e56: 11 f0 breq .+4 ; 0x26e5c 26e58: 8b e0 ldi r24, 0x0B ; 11 26e5a: 93 ea ldi r25, 0xA3 ; 163 26e5c: 68 e6 ldi r22, 0x68 ; 104 26e5e: 7a e3 ldi r23, 0x3A ; 58 26e60: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26e64: 8f ed ldi r24, 0xDF ; 223 26e66: 92 ea ldi r25, 0xA2 ; 162 26e68: cc 23 and r28, r28 26e6a: 11 f0 breq .+4 ; 0x26e70 26e6c: 8f ee ldi r24, 0xEF ; 239 26e6e: 92 ea ldi r25, 0xA2 ; 162 26e70: 6e eb ldi r22, 0xBE ; 190 26e72: 79 e3 ldi r23, 0x39 ; 57 26e74: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26e78: 83 ec ldi r24, 0xC3 ; 195 26e7a: 92 ea ldi r25, 0xA2 ; 162 26e7c: cc 23 and r28, r28 26e7e: 11 f0 breq .+4 ; 0x26e84 26e80: 83 ed ldi r24, 0xD3 ; 211 26e82: 92 ea ldi r25, 0xA2 ; 162 26e84: 6c e8 ldi r22, 0x8C ; 140 26e86: 7b e3 ldi r23, 0x3B ; 59 26e88: 0f 94 43 d1 call 0x3a286 ; 0x3a286 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); 26e8c: 88 ea ldi r24, 0xA8 ; 168 26e8e: 92 ea ldi r25, 0xA2 ; 162 26e90: cc 23 and r28, r28 26e92: 11 f0 breq .+4 ; 0x26e98 26e94: 87 eb ldi r24, 0xB7 ; 183 26e96: 92 ea ldi r25, 0xA2 ; 162 26e98: 6c e7 ldi r22, 0x7C ; 124 26e9a: 79 e3 ldi r23, 0x39 ; 57 26e9c: 0f 94 43 d1 call 0x3a286 ; 0x3a286 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 26ea0: 8f e5 ldi r24, 0x5F ; 95 26ea2: 9f e0 ldi r25, 0x0F ; 15 26ea4: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 26ea8: 81 11 cpse r24, r1 26eaa: 0c c0 rjmp .+24 ; 0x26ec4 26eac: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 26eb0: 89 30 cpi r24, 0x09 ; 9 26eb2: 41 f4 brne .+16 ; 0x26ec4 26eb4: 83 ee ldi r24, 0xE3 ; 227 26eb6: 9b e4 ldi r25, 0x4B ; 75 26eb8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 26ebc: 6c e5 ldi r22, 0x5C ; 92 26ebe: 7b e3 ldi r23, 0x3B ; 59 26ec0: 0f 94 42 ce call 0x39c84 ; 0x39c84 MENU_END(); 26ec4: 0f 94 99 ce call 0x39d32 ; 0x39d32 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 26ec8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26ecc: 8f 5f subi r24, 0xFF ; 255 26ece: 80 93 12 05 sts 0x0512, r24 ; 0x800512 26ed2: 80 91 14 05 lds r24, 0x0514 ; 0x800514 26ed6: 8f 5f subi r24, 0xFF ; 255 26ed8: 80 93 14 05 sts 0x0514, r24 ; 0x800514 26edc: 5d cf rjmp .-326 ; 0x26d98 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)); 26ede: 8d e0 ldi r24, 0x0D ; 13 26ee0: 90 e4 ldi r25, 0x40 ; 64 26ee2: 73 cf rjmp .-282 ; 0x26dca 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(); } 26ee4: cf 91 pop r28 26ee6: 08 95 ret 00026ee8 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 26ee8: 89 e0 ldi r24, 0x09 ; 9 26eea: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 lcd_generic_preheat_menu(); 26eee: 0d 94 c7 36 jmp 0x26d8e ; 0x26d8e 00026ef2 : // 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); 26ef2: 81 e0 ldi r24, 0x01 ; 1 26ef4: 0e 94 9c 6f call 0xdf38 ; 0xdf38 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 26ef8: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 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; 26efc: 90 91 7d 13 lds r25, 0x137D ; 0x80137d 26f00: 93 36 cpi r25, 0x63 ; 99 26f02: 09 f4 brne .+2 ; 0x26f06 26f04: 9f ef ldi r25, 0xFF ; 255 26f06: 89 13 cpse r24, r25 26f08: 0e c0 rjmp .+28 ; 0x26f26 lcd_putc('F'); 26f0a: 86 e4 ldi r24, 0x46 ; 70 26f0c: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26f10: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 26f14: 8f 3f cpi r24, 0xFF ; 255 26f16: 29 f0 breq .+10 ; 0x26f22 26f18: 8f 5c subi r24, 0xCF ; 207 26f1a: 0e 94 95 6f call 0xdf2a ; 0xdf2a 26f1e: 83 e0 ldi r24, 0x03 ; 3 26f20: 08 95 ret 26f22: 8f e3 ldi r24, 0x3F ; 63 26f24: fa cf rjmp .-12 ; 0x26f1a chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26f26: 8f 3f cpi r24, 0xFF ; 255 26f28: 89 f0 breq .+34 ; 0x26f4c 26f2a: 8f 5c subi r24, 0xCF ; 207 26f2c: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_putc('>'); 26f30: 8e e3 ldi r24, 0x3E ; 62 26f32: 0e 94 95 6f call 0xdf2a ; 0xdf2a 26f36: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 26f3a: 83 36 cpi r24, 0x63 ; 99 26f3c: 49 f0 breq .+18 ; 0x26f50 lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26f3e: 8f 3f cpi r24, 0xFF ; 255 26f40: 39 f0 breq .+14 ; 0x26f50 26f42: 8f 5c subi r24, 0xCF ; 207 26f44: 0e 94 95 6f call 0xdf2a ; 0xdf2a chars += 3; 26f48: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 26f4a: 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'); 26f4c: 8f e3 ldi r24, 0x3F ; 63 26f4e: ee cf rjmp .-36 ; 0x26f2c lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26f50: 8f e3 ldi r24, 0x3F ; 63 26f52: f8 cf rjmp .-16 ; 0x26f44 00026f54 <__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) { 26f54: 1f 92 push r1 26f56: 0f 92 push r0 26f58: 0f b6 in r0, 0x3f ; 63 26f5a: 0f 92 push r0 26f5c: 11 24 eor r1, r1 26f5e: 0b b6 in r0, 0x3b ; 59 26f60: 0f 92 push r0 26f62: 2f 93 push r18 26f64: 3f 93 push r19 26f66: 4f 93 push r20 26f68: 5f 93 push r21 26f6a: 6f 93 push r22 26f6c: 7f 93 push r23 26f6e: 8f 93 push r24 26f70: 9f 93 push r25 26f72: af 93 push r26 26f74: bf 93 push r27 26f76: ef 93 push r30 26f78: ff 93 push r31 if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 26f7a: 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 26f7e: 80 91 20 05 lds r24, 0x0520 ; 0x800520 uint8_t buf_r = ptr[2]; //get read index 26f82: 90 91 21 05 lds r25, 0x0521 ; 0x800521 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 26f86: e8 2f mov r30, r24 26f88: f0 e0 ldi r31, 0x00 ; 0 26f8a: ed 5d subi r30, 0xDD ; 221 26f8c: fa 4f sbci r31, 0xFA ; 250 26f8e: 20 83 st Z, r18 buf_w++; //incerment write index 26f90: 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 26f92: 20 91 1f 05 lds r18, 0x051F ; 0x80051f 26f96: 82 17 cp r24, r18 26f98: 08 f0 brcs .+2 ; 0x26f9c <__vector_51+0x48> 26f9a: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 26f9c: 98 13 cpse r25, r24 26f9e: 17 c0 rjmp .+46 ; 0x26fce <__vector_51+0x7a> { //rx buffer full puts_P(PSTR("USART2 rx Full!!!")); 26fa0: 81 ed ldi r24, 0xD1 ; 209 26fa2: 90 ea ldi r25, 0xA0 ; 160 26fa4: 0f 94 2f dc call 0x3b85e ; 0x3b85e } } 26fa8: ff 91 pop r31 26faa: ef 91 pop r30 26fac: bf 91 pop r27 26fae: af 91 pop r26 26fb0: 9f 91 pop r25 26fb2: 8f 91 pop r24 26fb4: 7f 91 pop r23 26fb6: 6f 91 pop r22 26fb8: 5f 91 pop r21 26fba: 4f 91 pop r20 26fbc: 3f 91 pop r19 26fbe: 2f 91 pop r18 26fc0: 0f 90 pop r0 26fc2: 0b be out 0x3b, r0 ; 59 26fc4: 0f 90 pop r0 26fc6: 0f be out 0x3f, r0 ; 63 26fc8: 0f 90 pop r0 26fca: 1f 90 pop r1 26fcc: 18 95 reti ptr[1] = buf_w; //store write index 26fce: 80 93 20 05 sts 0x0520, r24 ; 0x800520 26fd2: ea cf rjmp .-44 ; 0x26fa8 <__vector_51+0x54> 00026fd4 <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 26fd4: 1f 92 push r1 26fd6: 0f 92 push r0 26fd8: 0f b6 in r0, 0x3f ; 63 26fda: 0f 92 push r0 26fdc: 11 24 eor r1, r1 26fde: 0b b6 in r0, 0x3b ; 59 26fe0: 0f 92 push r0 26fe2: 8f 93 push r24 26fe4: 9f 93 push r25 26fe6: ef 93 push r30 26fe8: ff 93 push r31 WRITE(BEEPER, 0); 26fea: 9f b7 in r25, 0x3f ; 63 26fec: f8 94 cli 26fee: e2 e0 ldi r30, 0x02 ; 2 26ff0: f1 e0 ldi r31, 0x01 ; 1 26ff2: 80 81 ld r24, Z 26ff4: 8b 7f andi r24, 0xFB ; 251 26ff6: 80 83 st Z, r24 26ff8: 9f bf out 0x3f, r25 ; 63 } 26ffa: ff 91 pop r31 26ffc: ef 91 pop r30 26ffe: 9f 91 pop r25 27000: 8f 91 pop r24 27002: 0f 90 pop r0 27004: 0b be out 0x3b, r0 ; 59 27006: 0f 90 pop r0 27008: 0f be out 0x3f, r0 ; 63 2700a: 0f 90 pop r0 2700c: 1f 90 pop r1 2700e: 18 95 reti 00027010 <__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) { 27010: 1f 92 push r1 27012: 0f 92 push r0 27014: 0f b6 in r0, 0x3f ; 63 27016: 0f 92 push r0 27018: 11 24 eor r1, r1 2701a: 0b b6 in r0, 0x3b ; 59 2701c: 0f 92 push r0 2701e: 8f 93 push r24 27020: 9f 93 push r25 27022: ef 93 push r30 27024: ff 93 push r31 WRITE(BEEPER, 1); 27026: 9f b7 in r25, 0x3f ; 63 27028: f8 94 cli 2702a: e2 e0 ldi r30, 0x02 ; 2 2702c: f1 e0 ldi r31, 0x01 ; 1 2702e: 80 81 ld r24, Z 27030: 84 60 ori r24, 0x04 ; 4 27032: 80 83 st Z, r24 27034: 9f bf out 0x3f, r25 ; 63 } 27036: ff 91 pop r31 27038: ef 91 pop r30 2703a: 9f 91 pop r25 2703c: 8f 91 pop r24 2703e: 0f 90 pop r0 27040: 0b be out 0x3b, r0 ; 59 27042: 0f 90 pop r0 27044: 0f be out 0x3f, r0 ; 63 27046: 0f 90 pop r0 27048: 1f 90 pop r1 2704a: 18 95 reti 0002704c : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 2704c: 6f 92 push r6 2704e: 7f 92 push r7 27050: 8f 92 push r8 27052: 9f 92 push r9 27054: af 92 push r10 27056: bf 92 push r11 27058: df 92 push r13 2705a: ef 92 push r14 2705c: ff 92 push r15 2705e: 0f 93 push r16 27060: 1f 93 push r17 27062: cf 93 push r28 27064: df 93 push r29 27066: cd b7 in r28, 0x3d ; 61 27068: de b7 in r29, 0x3e ; 62 2706a: e0 97 sbiw r28, 0x30 ; 48 2706c: 0f b6 in r0, 0x3f ; 63 2706e: f8 94 cli 27070: de bf out 0x3e, r29 ; 62 27072: 0f be out 0x3f, r0 ; 63 27074: cd bf out 0x3d, r28 ; 61 27076: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 27078: ae 01 movw r20, r28 2707a: 4f 5f subi r20, 0xFF ; 255 2707c: 5f 4f sbci r21, 0xFF ; 255 2707e: 60 e1 ldi r22, 0x10 ; 16 27080: 0e 94 07 7c call 0xf80e ; 0xf80e bubblesort_uint8(step, 16, 0); 27084: 50 e0 ldi r21, 0x00 ; 0 27086: 40 e0 ldi r20, 0x00 ; 0 27088: 60 e1 ldi r22, 0x10 ; 16 2708a: ce 01 movw r24, r28 2708c: 01 96 adiw r24, 0x01 ; 1 2708e: 0f 94 6d 1e call 0x23cda ; 0x23cda puts_P(PSTR("sorted samples:")); 27092: 81 ec ldi r24, 0xC1 ; 193 27094: 90 ea ldi r25, 0xA0 ; 160 27096: 0f 94 2f dc call 0x3b85e ; 0x3b85e 2709a: 9e 01 movw r18, r28 2709c: 2f 5f subi r18, 0xFF ; 255 2709e: 3f 4f sbci r19, 0xFF ; 255 270a0: 59 01 movw r10, r18 270a2: 10 e0 ldi r17, 0x00 ; 0 270a4: 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]); 270a6: 20 eb ldi r18, 0xB0 ; 176 270a8: e2 2e mov r14, r18 270aa: 20 ea ldi r18, 0xA0 ; 160 270ac: f2 2e mov r15, r18 270ae: d5 01 movw r26, r10 270b0: 8d 91 ld r24, X+ 270b2: 5d 01 movw r10, r26 270b4: 1f 92 push r1 270b6: 8f 93 push r24 270b8: 1f 93 push r17 270ba: 0f 93 push r16 270bc: ff 92 push r15 270be: ef 92 push r14 270c0: 0f 94 08 dc call 0x3b810 ; 0x3b810 270c4: 0f 5f subi r16, 0xFF ; 255 270c6: 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++) 270c8: 0f 90 pop r0 270ca: 0f 90 pop r0 270cc: 0f 90 pop r0 270ce: 0f 90 pop r0 270d0: 0f 90 pop r0 270d2: 0f 90 pop r0 270d4: 00 31 cpi r16, 0x10 ; 16 270d6: 11 05 cpc r17, r1 270d8: 51 f7 brne .-44 ; 0x270ae } 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]; 270da: 09 81 ldd r16, Y+1 ; 0x01 270dc: 10 e0 ldi r17, 0x00 ; 0 270de: 5e 01 movw r10, r28 270e0: b2 e0 ldi r27, 0x02 ; 2 270e2: ab 0e add r10, r27 270e4: b1 1c adc r11, r1 270e6: ee 24 eor r14, r14 270e8: e3 94 inc r14 270ea: f1 2c mov r15, r1 270ec: ec 0e add r14, r28 270ee: fd 1e adc r15, r29 270f0: e0 e1 ldi r30, 0x10 ; 16 270f2: ee 0e add r14, r30 270f4: f1 1c adc r15, r1 uint8_t cl = 0; 270f6: 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; 270f8: 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]; 270fa: d5 01 movw r26, r10 270fc: 3d 91 ld r19, X+ 270fe: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 27100: 62 2f mov r22, r18 27102: 70 e0 ldi r23, 0x00 ; 0 27104: c8 01 movw r24, r16 27106: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 2710a: 46 2f mov r20, r22 2710c: 43 1b sub r20, r19 2710e: 36 17 cp r19, r22 27110: 10 f0 brcs .+4 ; 0x27116 else dif = d - val; 27112: 43 2f mov r20, r19 27114: 46 1b sub r20, r22 27116: 83 2f mov r24, r19 27118: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 2711a: 42 30 cpi r20, 0x02 ; 2 2711c: 08 f0 brcs .+2 ; 0x27120 2711e: 47 c0 rjmp .+142 ; 0x271ae { cnt += 1; 27120: 2f 5f subi r18, 0xFF ; 255 sum += d; 27122: 08 0f add r16, r24 27124: 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++) 27126: ae 14 cp r10, r14 27128: bf 04 cpc r11, r15 2712a: 39 f7 brne .-50 ; 0x270fa cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 2712c: ae 2e mov r10, r30 2712e: b1 2c mov r11, r1 27130: a1 e1 ldi r26, 0x11 ; 17 27132: b0 e0 ldi r27, 0x00 ; 0 27134: ac 0f add r26, r28 27136: bd 1f adc r27, r29 27138: aa 0d add r26, r10 2713a: bb 1d adc r27, r11 2713c: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 2713e: 7e 01 movw r14, r28 27140: b1 e2 ldi r27, 0x21 ; 33 27142: eb 0e add r14, r27 27144: f1 1c adc r15, r1 27146: ae 0c add r10, r14 27148: bf 1c adc r11, r15 2714a: 62 2f mov r22, r18 2714c: 70 e0 ldi r23, 0x00 ; 0 2714e: c8 01 movw r24, r16 27150: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 27154: d5 01 movw r26, r10 27156: 6c 93 st X, r22 return ++cl; 27158: 11 e0 ldi r17, 0x01 ; 1 2715a: 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:")); 2715c: 86 ea ldi r24, 0xA6 ; 166 2715e: 90 ea ldi r25, 0xA0 ; 160 27160: 0f 94 2f dc call 0x3b85e ; 0x3b85e 27164: fe 01 movw r30, r28 27166: 71 96 adiw r30, 0x11 ; 17 27168: 3f 01 movw r6, r30 2716a: 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]); 2716c: 8e e8 ldi r24, 0x8E ; 142 2716e: 88 2e mov r8, r24 27170: 80 ea ldi r24, 0xA0 ; 160 27172: 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++) 27174: 8a 2d mov r24, r10 27176: 8e 19 sub r24, r14 27178: 81 17 cp r24, r17 2717a: 70 f5 brcc .+92 ; 0x271d8 2717c: c5 01 movw r24, r10 2717e: 8e 19 sub r24, r14 27180: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 27182: d5 01 movw r26, r10 27184: 3d 91 ld r19, X+ 27186: 5d 01 movw r10, r26 27188: f3 01 movw r30, r6 2718a: 21 91 ld r18, Z+ 2718c: 3f 01 movw r6, r30 2718e: 1f 92 push r1 27190: 3f 93 push r19 27192: 1f 92 push r1 27194: 2f 93 push r18 27196: 9f 93 push r25 27198: 8f 93 push r24 2719a: 9f 92 push r9 2719c: 8f 92 push r8 2719e: 0f 94 08 dc call 0x3b810 ; 0x3b810 271a2: 0f b6 in r0, 0x3f ; 63 271a4: f8 94 cli 271a6: de bf out 0x3e, r29 ; 62 271a8: 0f be out 0x3f, r0 ; 63 271aa: cd bf out 0x3d, r28 ; 61 271ac: e3 cf rjmp .-58 ; 0x27174 271ae: 4e 2f mov r20, r30 271b0: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 271b2: a1 e1 ldi r26, 0x11 ; 17 271b4: b0 e0 ldi r27, 0x00 ; 0 271b6: ac 0f add r26, r28 271b8: bd 1f adc r27, r29 271ba: a4 0f add r26, r20 271bc: b5 1f adc r27, r21 271be: ef 5f subi r30, 0xFF ; 255 271c0: 2c 93 st X, r18 if (cval) cval[cl] = val; 271c2: 21 e2 ldi r18, 0x21 ; 33 271c4: 30 e0 ldi r19, 0x00 ; 0 271c6: 2c 0f add r18, r28 271c8: 3d 1f adc r19, r29 271ca: 42 0f add r20, r18 271cc: 53 1f adc r21, r19 271ce: da 01 movw r26, r20 271d0: 6c 93 st X, r22 cnt = 1; sum = d; 271d2: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 271d4: 21 e0 ldi r18, 0x01 ; 1 271d6: a7 cf rjmp .-178 ; 0x27126 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); 271d8: a7 01 movw r20, r14 271da: 61 2f mov r22, r17 271dc: ce 01 movw r24, r28 271de: 41 96 adiw r24, 0x11 ; 17 271e0: 0f 94 6d 1e call 0x23cda ; 0x23cda tmc2130_home_origin[axis] = val[cl-1]; 271e4: fe 01 movw r30, r28 271e6: e1 0f add r30, r17 271e8: f1 1d adc r31, r1 271ea: 80 a1 ldd r24, Z+32 ; 0x20 271ec: ed 2d mov r30, r13 271ee: f0 e0 ldi r31, 0x00 ; 0 271f0: ed 50 subi r30, 0x0D ; 13 271f2: fb 4f sbci r31, 0xFB ; 251 271f4: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 271f6: 1f 92 push r1 271f8: 8f 93 push r24 271fa: 8c e7 ldi r24, 0x7C ; 124 271fc: 90 ea ldi r25, 0xA0 ; 160 271fe: 9f 93 push r25 27200: 8f 93 push r24 27202: 0f 94 08 dc call 0x3b810 ; 0x3b810 if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 27206: 0f 90 pop r0 27208: 0f 90 pop r0 2720a: 0f 90 pop r0 2720c: 0f 90 pop r0 2720e: 60 91 f3 04 lds r22, 0x04F3 ; 0x8004f3 27212: 8e ef ldi r24, 0xFE ; 254 27214: 9e e0 ldi r25, 0x0E ; 14 27216: dd 20 and r13, r13 27218: 21 f0 breq .+8 ; 0x27222 2721a: 60 91 f4 04 lds r22, 0x04F4 ; 0x8004f4 2721e: 8b ef ldi r24, 0xFB ; 251 27220: 9e e0 ldi r25, 0x0E ; 14 27222: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 27226: 81 e0 ldi r24, 0x01 ; 1 27228: e0 96 adiw r28, 0x30 ; 48 2722a: 0f b6 in r0, 0x3f ; 63 2722c: f8 94 cli 2722e: de bf out 0x3e, r29 ; 62 27230: 0f be out 0x3f, r0 ; 63 27232: cd bf out 0x3d, r28 ; 61 27234: df 91 pop r29 27236: cf 91 pop r28 27238: 1f 91 pop r17 2723a: 0f 91 pop r16 2723c: ff 90 pop r15 2723e: ef 90 pop r14 27240: df 90 pop r13 27242: bf 90 pop r11 27244: af 90 pop r10 27246: 9f 90 pop r9 27248: 8f 90 pop r8 2724a: 7f 90 pop r7 2724c: 6f 90 pop r6 2724e: 08 95 ret 00027250 : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 27250: 81 30 cpi r24, 0x01 ; 1 27252: 49 f0 breq .+18 ; 0x27266 27254: 28 f0 brcs .+10 ; 0x27260 27256: 82 30 cpi r24, 0x02 ; 2 27258: 41 f0 breq .+16 ; 0x2726a 2725a: 83 30 cpi r24, 0x03 ; 3 2725c: 41 f0 breq .+16 ; 0x2726e 2725e: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 27260: 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; 27262: 86 b9 out 0x06, r24 ; 6 } } 27264: 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; 27266: 82 e0 ldi r24, 0x02 ; 2 27268: fc cf rjmp .-8 ; 0x27262 case Z_AXIS: _DO_STEP_Z; break; 2726a: 84 e0 ldi r24, 0x04 ; 4 2726c: fa cf rjmp .-12 ; 0x27262 case E_AXIS: _DO_STEP_E; break; 2726e: 88 e0 ldi r24, 0x08 ; 8 27270: f8 cf rjmp .-16 ; 0x27262 00027272 : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 27272: 81 30 cpi r24, 0x01 ; 1 27274: d1 f0 breq .+52 ; 0x272aa 27276: 48 f0 brcs .+18 ; 0x2728a 27278: 82 30 cpi r24, 0x02 ; 2 2727a: 21 f1 breq .+72 ; 0x272c4 2727c: 83 30 cpi r24, 0x03 ; 3 2727e: 79 f1 breq .+94 ; 0x272de 27280: 8b e4 ldi r24, 0x4B ; 75 27282: 90 e0 ldi r25, 0x00 ; 0 27284: 01 97 sbiw r24, 0x01 ; 1 27286: f1 f7 brne .-4 ; 0x27284 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); } 27288: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 2728a: 9f b7 in r25, 0x3f ; 63 2728c: 66 23 and r22, r22 2728e: 41 f0 breq .+16 ; 0x272a0 27290: f8 94 cli 27292: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27296: 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; 27298: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2729c: 9f bf out 0x3f, r25 ; 63 2729e: f0 cf rjmp .-32 ; 0x27280 void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 272a0: f8 94 cli 272a2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272a6: 8e 7f andi r24, 0xFE ; 254 272a8: f7 cf rjmp .-18 ; 0x27298 case Y_AXIS: _SET_DIR_Y(dir); break; 272aa: 9f b7 in r25, 0x3f ; 63 272ac: 61 11 cpse r22, r1 272ae: 05 c0 rjmp .+10 ; 0x272ba 272b0: f8 94 cli 272b2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272b6: 82 60 ori r24, 0x02 ; 2 272b8: ef cf rjmp .-34 ; 0x27298 272ba: f8 94 cli 272bc: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272c0: 8d 7f andi r24, 0xFD ; 253 272c2: ea cf rjmp .-44 ; 0x27298 case Z_AXIS: _SET_DIR_Z(dir); break; 272c4: 9f b7 in r25, 0x3f ; 63 272c6: 66 23 and r22, r22 272c8: 29 f0 breq .+10 ; 0x272d4 272ca: f8 94 cli 272cc: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272d0: 84 60 ori r24, 0x04 ; 4 272d2: e2 cf rjmp .-60 ; 0x27298 272d4: f8 94 cli 272d6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272da: 8b 7f andi r24, 0xFB ; 251 272dc: dd cf rjmp .-70 ; 0x27298 case E_AXIS: _SET_DIR_E(dir); break; 272de: 9f b7 in r25, 0x3f ; 63 272e0: 61 11 cpse r22, r1 272e2: 05 c0 rjmp .+10 ; 0x272ee 272e4: f8 94 cli 272e6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272ea: 80 64 ori r24, 0x40 ; 64 272ec: d5 cf rjmp .-86 ; 0x27298 272ee: f8 94 cli 272f0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272f4: 8f 7b andi r24, 0xBF ; 191 272f6: d0 cf rjmp .-96 ; 0x27298 000272f8 : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 272f8: cf 92 push r12 272fa: df 92 push r13 272fc: ef 92 push r14 272fe: ff 92 push r15 27300: 0f 93 push r16 27302: 1f 93 push r17 27304: cf 93 push r28 27306: df 93 push r29 27308: 18 2f mov r17, r24 2730a: f6 2e mov r15, r22 2730c: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 2730e: 0c e5 ldi r16, 0x5C ; 92 27310: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 27312: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27314: 0f 94 c9 1e call 0x23d92 ; 0x23d92 TMC2130_SPI_TXRX(addr); // address 27318: 8f 2d mov r24, r15 2731a: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 TMC2130_SPI_TXRX(0); // MSB 2731e: 80 e0 ldi r24, 0x00 ; 0 27320: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 TMC2130_SPI_TXRX(0); 27324: 80 e0 ldi r24, 0x00 ; 0 27326: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 TMC2130_SPI_TXRX(0); 2732a: 80 e0 ldi r24, 0x00 ; 0 2732c: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 TMC2130_SPI_TXRX(0); // LSB 27330: 80 e0 ldi r24, 0x00 ; 0 27332: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 tmc2130_cs_high(axis); 27336: 81 2f mov r24, r17 27338: 0f 94 ae 1e call 0x23d5c ; 0x23d5c SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 2733c: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 2733e: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27340: 81 2f mov r24, r17 27342: 0f 94 c9 1e call 0x23d92 ; 0x23d92 uint8_t stat = TMC2130_SPI_TXRX(0); // status 27346: 80 e0 ldi r24, 0x00 ; 0 27348: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 2734c: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 2734e: 80 e0 ldi r24, 0x00 ; 0 27350: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 27354: 90 e0 ldi r25, 0x00 ; 0 27356: b0 e0 ldi r27, 0x00 ; 0 27358: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 2735a: cc 24 eor r12, r12 2735c: d8 2e mov r13, r24 2735e: e9 2e mov r14, r25 27360: fa 2e mov r15, r26 27362: 80 e0 ldi r24, 0x00 ; 0 27364: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 27368: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 2736a: fe 2c mov r15, r14 2736c: ed 2c mov r14, r13 2736e: dc 2c mov r13, r12 27370: cc 24 eor r12, r12 27372: 80 e0 ldi r24, 0x00 ; 0 27374: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 27378: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 2737a: fe 2c mov r15, r14 2737c: ed 2c mov r14, r13 2737e: dc 2c mov r13, r12 27380: cc 24 eor r12, r12 27382: 80 e0 ldi r24, 0x00 ; 0 27384: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 27388: c8 2a or r12, r24 tmc2130_cs_high(axis); 2738a: 81 2f mov r24, r17 2738c: 0f 94 ae 1e call 0x23d5c ; 0x23d5c TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 27390: c8 82 st Y, r12 27392: d9 82 std Y+1, r13 ; 0x01 27394: ea 82 std Y+2, r14 ; 0x02 27396: fb 82 std Y+3, r15 ; 0x03 return stat; } 27398: 80 2f mov r24, r16 2739a: df 91 pop r29 2739c: cf 91 pop r28 2739e: 1f 91 pop r17 273a0: 0f 91 pop r16 273a2: ff 90 pop r15 273a4: ef 90 pop r14 273a6: df 90 pop r13 273a8: cf 90 pop r12 273aa: 08 95 ret 000273ac : #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) { 273ac: ef 92 push r14 273ae: ff 92 push r15 273b0: 0f 93 push r16 273b2: 1f 93 push r17 273b4: cf 93 push r28 273b6: df 93 push r29 273b8: c8 2f mov r28, r24 273ba: e6 2e mov r14, r22 273bc: d2 2f mov r29, r18 273be: 13 2f mov r17, r19 273c0: 04 2f mov r16, r20 273c2: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 273c4: 8c e5 ldi r24, 0x5C ; 92 273c6: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 273c8: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 273ca: 8c 2f mov r24, r28 273cc: 0f 94 c9 1e call 0x23d92 ; 0x23d92 TMC2130_SPI_TXRX(addr); // address 273d0: 8e 2d mov r24, r14 273d2: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 273d6: 8f 2d mov r24, r15 273d8: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 TMC2130_SPI_TXRX((wval >> 16) & 0xff); 273dc: 80 2f mov r24, r16 273de: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 TMC2130_SPI_TXRX((wval >> 8) & 0xff); 273e2: 81 2f mov r24, r17 273e4: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 TMC2130_SPI_TXRX(wval & 0xff); // LSB 273e8: 8d 2f mov r24, r29 273ea: 0f 94 e4 1e call 0x23dc8 ; 0x23dc8 tmc2130_cs_high(axis); 273ee: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 273f0: df 91 pop r29 273f2: cf 91 pop r28 273f4: 1f 91 pop r17 273f6: 0f 91 pop r16 273f8: ff 90 pop r15 273fa: 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); 273fc: 0d 94 ae 1e jmp 0x23d5c ; 0x23d5c 00027400 : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 27400: cf 93 push r28 27402: df 93 push r29 27404: 00 d0 rcall .+0 ; 0x27406 27406: 1f 92 push r1 27408: cd b7 in r28, 0x3d ; 61 2740a: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 2740c: 19 82 std Y+1, r1 ; 0x01 2740e: 1a 82 std Y+2, r1 ; 0x02 27410: 1b 82 std Y+3, r1 ; 0x03 27412: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 27414: ae 01 movw r20, r28 27416: 4f 5f subi r20, 0xFF ; 255 27418: 5f 4f sbci r21, 0xFF ; 255 2741a: 6a e6 ldi r22, 0x6A ; 106 2741c: 0f 94 7c 39 call 0x272f8 ; 0x272f8 return val32 & 0x3ff; 27420: 89 81 ldd r24, Y+1 ; 0x01 27422: 9a 81 ldd r25, Y+2 ; 0x02 } 27424: 93 70 andi r25, 0x03 ; 3 27426: 0f 90 pop r0 27428: 0f 90 pop r0 2742a: 0f 90 pop r0 2742c: 0f 90 pop r0 2742e: df 91 pop r29 27430: cf 91 pop r28 27432: 08 95 ret 00027434 : #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 */) { 27434: ff 92 push r15 27436: 0f 93 push r16 27438: 1f 93 push r17 2743a: cf 93 push r28 2743c: df 93 push r29 2743e: f8 2e mov r15, r24 27440: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 27442: e8 2f mov r30, r24 27444: f0 e0 ldi r31, 0x00 ; 0 27446: 83 e0 ldi r24, 0x03 ; 3 27448: f8 9e mul r15, r24 2744a: 80 01 movw r16, r0 2744c: 11 24 eor r1, r1 2744e: 03 5a subi r16, 0xA3 ; 163 27450: 1d 4f sbci r17, 0xFD ; 253 27452: d8 01 movw r26, r16 27454: 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) {} 27456: 30 e0 ldi r19, 0x00 ; 0 27458: 37 7f andi r19, 0xF7 ; 247 2745a: 3f 7e andi r19, 0xEF ; 239 2745c: 3f 7d andi r19, 0xDF ; 223 2745e: 3f 7b andi r19, 0xBF ; 191 27460: 40 e0 ldi r20, 0x00 ; 0 27462: 80 fb bst r24, 0 27464: 41 f9 bld r20, 1 27466: 43 70 andi r20, 0x03 ; 3 27468: 56 2f mov r21, r22 2746a: 5f 70 andi r21, 0x0F ; 15 2746c: 50 62 ori r21, 0x20 ; 32 2746e: 5f 7b andi r21, 0xBF ; 191 27470: 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 27472: 81 e0 ldi r24, 0x01 ; 1 27474: 61 11 cpse r22, r1 27476: 01 c0 rjmp .+2 ; 0x2747a 27478: 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); 2747a: 80 fb bst r24, 0 2747c: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 2747e: bf 01 movw r22, r30 27480: 66 0f add r22, r22 27482: 77 1f adc r23, r23 27484: fb 01 movw r30, r22 27486: e3 58 subi r30, 0x83 ; 131 27488: fd 4f sbci r31, 0xFD ; 253 2748a: 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 2748c: 92 2f mov r25, r18 2748e: 99 1f adc r25, r25 27490: 99 27 eor r25, r25 27492: 99 1f adc r25, r25 27494: 81 81 ldd r24, Z+1 ; 0x01 27496: 87 70 andi r24, 0x07 ; 7 27498: 88 0f add r24, r24 2749a: 89 2b or r24, r25 2749c: 80 fb bst r24, 0 2749e: 27 f9 bld r18, 7 274a0: 86 95 lsr r24 274a2: 87 70 andi r24, 0x07 ; 7 274a4: 38 7f andi r19, 0xF8 ; 248 274a6: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 274a8: 62 58 subi r22, 0x82 ; 130 274aa: 7d 4f sbci r23, 0xFD ; 253 274ac: fb 01 movw r30, r22 274ae: 80 81 ld r24, Z 274b0: 86 95 lsr r24 274b2: 86 95 lsr r24 274b4: 86 95 lsr r24 274b6: 80 fb bst r24, 0 274b8: 37 f9 bld r19, 7 274ba: 81 fb bst r24, 1 274bc: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 274be: 6c ee ldi r22, 0xEC ; 236 274c0: 8f 2d mov r24, r15 274c2: 0f 94 d6 39 call 0x273ac ; 0x273ac if (curr == nullptr) { 274c6: 20 97 sbiw r28, 0x00 ; 0 274c8: 09 f4 brne .+2 ; 0x274cc curr = ¤ts[axis]; 274ca: e8 01 movw r28, r16 274cc: 19 81 ldd r17, Y+1 ; 0x01 274ce: 8a 81 ldd r24, Y+2 ; 0x02 274d0: c1 2f mov r28, r17 274d2: 81 17 cp r24, r17 274d4: 08 f4 brcc .+2 ; 0x274d8 274d6: 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()) { 274d8: 18 17 cp r17, r24 274da: 40 f4 brcc .+16 ; 0x274ec // Let user know firmware modified the value SERIAL_ECHO_START; 274dc: 84 e1 ldi r24, 0x14 ; 20 274de: 9a ea ldi r25, 0xAA ; 170 274e0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 274e4: 85 ee ldi r24, 0xE5 ; 229 274e6: 9e e6 ldi r25, 0x6E ; 110 274e8: 0e 94 17 7b call 0xf62e ; 0xf62e struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 274ec: 2c 2f mov r18, r28 274ee: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 274f0: 31 2f mov r19, r17 274f2: 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); 274f4: 4f e0 ldi r20, 0x0F ; 15 274f6: 50 e0 ldi r21, 0x00 ; 0 274f8: 60 e9 ldi r22, 0x90 ; 144 274fa: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 274fc: df 91 pop r29 274fe: cf 91 pop r28 27500: 1f 91 pop r17 27502: 0f 91 pop r16 27504: 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); 27506: 0d 94 d6 39 jmp 0x273ac ; 0x273ac 0002750a : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 2750a: e8 2f mov r30, r24 2750c: 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--; 2750e: 98 e0 ldi r25, 0x08 ; 8 27510: 76 95 lsr r23 27512: 67 95 ror r22 27514: 61 15 cp r22, r1 27516: 71 05 cpc r23, r1 27518: 11 f0 breq .+4 ; 0x2751e 2751a: 91 50 subi r25, 0x01 ; 1 2751c: f9 cf rjmp .-14 ; 0x27510 return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 2751e: eb 50 subi r30, 0x0B ; 11 27520: fb 4f sbci r31, 0xFB ; 251 27522: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 27524: 50 e0 ldi r21, 0x00 ; 0 27526: 40 e0 ldi r20, 0x00 ; 0 27528: 69 2f mov r22, r25 2752a: 0d 94 1a 3a jmp 0x27434 ; 0x27434 0002752e : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 2752e: 0f 93 push r16 27530: 1f 93 push r17 27532: cf 93 push r28 27534: df 93 push r29 27536: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 27538: 08 2f mov r16, r24 2753a: 10 e0 ldi r17, 0x00 ; 0 2753c: f8 01 movw r30, r16 2753e: eb 50 subi r30, 0x0B ; 11 27540: fb 4f sbci r31, 0xFB ; 251 27542: 50 e0 ldi r21, 0x00 ; 0 27544: 40 e0 ldi r20, 0x00 ; 0 27546: 60 81 ld r22, Z 27548: 0f 94 1a 3a call 0x27434 ; 0x27434 tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 2754c: 20 e0 ldi r18, 0x00 ; 0 2754e: 30 e0 ldi r19, 0x00 ; 0 27550: a9 01 movw r20, r18 27552: 61 e9 ldi r22, 0x91 ; 145 27554: 8c 2f mov r24, r28 27556: 0f 94 d6 39 call 0x273ac ; 0x273ac const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 2755a: d0 91 69 06 lds r29, 0x0669 ; 0x800669 if (axis == Z_AXIS) { 2755e: c2 30 cpi r28, 0x02 ; 2 27560: e1 f5 brne .+120 ; 0x275da #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 27562: 20 e0 ldi r18, 0x00 ; 0 27564: 30 e0 ldi r19, 0x00 ; 0 27566: 44 e0 ldi r20, 0x04 ; 4 27568: 51 e0 ldi r21, 0x01 ; 1 2756a: 6d ee ldi r22, 0xED ; 237 2756c: 82 e0 ldi r24, 0x02 ; 2 2756e: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 27572: 24 ef ldi r18, 0xF4 ; 244 27574: 31 e0 ldi r19, 0x01 ; 1 27576: 40 e0 ldi r20, 0x00 ; 0 27578: 50 e0 ldi r21, 0x00 ; 0 2757a: d1 30 cpi r29, 0x01 ; 1 2757c: 19 f4 brne .+6 ; 0x27584 2757e: 20 e0 ldi r18, 0x00 ; 0 27580: 30 e0 ldi r19, 0x00 ; 0 27582: a9 01 movw r20, r18 27584: 64 e9 ldi r22, 0x94 ; 148 27586: 82 e0 ldi r24, 0x02 ; 2 27588: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 2758c: 24 e8 ldi r18, 0x84 ; 132 2758e: 31 e0 ldi r19, 0x01 ; 1 27590: 40 e0 ldi r20, 0x00 ; 0 27592: 50 e0 ldi r21, 0x00 ; 0 27594: d1 30 cpi r29, 0x01 ; 1 27596: 21 f4 brne .+8 ; 0x275a0 27598: 24 e0 ldi r18, 0x04 ; 4 2759a: 30 e0 ldi r19, 0x00 ; 0 2759c: 40 e0 ldi r20, 0x00 ; 0 2759e: 50 e0 ldi r21, 0x00 ; 0 275a0: 60 e8 ldi r22, 0x80 ; 128 275a2: 82 e0 ldi r24, 0x02 ; 2 275a4: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 275a8: 28 ec ldi r18, 0xC8 ; 200 275aa: 34 e0 ldi r19, 0x04 ; 4 275ac: 46 e0 ldi r20, 0x06 ; 6 275ae: 50 e0 ldi r21, 0x00 ; 0 275b0: 60 ef ldi r22, 0xF0 ; 240 275b2: 82 e0 ldi r24, 0x02 ; 2 275b4: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 275b8: 20 ef ldi r18, 0xF0 ; 240 275ba: 3f ef ldi r19, 0xFF ; 255 275bc: 4f e0 ldi r20, 0x0F ; 15 275be: 50 e0 ldi r21, 0x00 ; 0 275c0: d1 30 cpi r29, 0x01 ; 1 275c2: 19 f4 brne .+6 ; 0x275ca 275c4: 20 e0 ldi r18, 0x00 ; 0 275c6: 30 e0 ldi r19, 0x00 ; 0 275c8: a9 01 movw r20, r18 275ca: 63 e9 ldi r22, 0x93 ; 147 275cc: 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); } } 275ce: df 91 pop r29 275d0: cf 91 pop r28 275d2: 1f 91 pop r17 275d4: 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); 275d6: 0d 94 d6 39 jmp 0x273ac ; 0x273ac 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)); 275da: f8 01 movw r30, r16 275dc: e8 5e subi r30, 0xE8 ; 232 275de: fc 4f sbci r31, 0xFC ; 252 275e0: 20 81 ld r18, Z 275e2: 30 e0 ldi r19, 0x00 ; 0 275e4: 50 e0 ldi r21, 0x00 ; 0 275e6: 40 e0 ldi r20, 0x00 ; 0 275e8: a9 01 movw r20, r18 275ea: 33 27 eor r19, r19 275ec: 22 27 eor r18, r18 275ee: 51 60 ori r21, 0x01 ; 1 275f0: 6d ee ldi r22, 0xED ; 237 275f2: 8c 2f mov r24, r28 275f4: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 275f8: 20 e0 ldi r18, 0x00 ; 0 275fa: 30 e0 ldi r19, 0x00 ; 0 275fc: a9 01 movw r20, r18 275fe: d1 30 cpi r29, 0x01 ; 1 27600: 61 f0 breq .+24 ; 0x2761a uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 27602: 2e ea ldi r18, 0xAE ; 174 27604: 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) 27606: c2 30 cpi r28, 0x02 ; 2 27608: 30 f0 brcs .+12 ; 0x27616 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 2760a: 24 ef ldi r18, 0xF4 ; 244 2760c: 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) 2760e: c2 30 cpi r28, 0x02 ; 2 27610: 11 f0 breq .+4 ; 0x27616 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 27612: 30 e0 ldi r19, 0x00 ; 0 27614: 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)); 27616: 50 e0 ldi r21, 0x00 ; 0 27618: 40 e0 ldi r20, 0x00 ; 0 2761a: 64 e9 ldi r22, 0x94 ; 148 2761c: 8c 2f mov r24, r28 2761e: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 27622: 20 e8 ldi r18, 0x80 ; 128 27624: 31 e0 ldi r19, 0x01 ; 1 27626: 40 e0 ldi r20, 0x00 ; 0 27628: 50 e0 ldi r21, 0x00 ; 0 2762a: d1 30 cpi r29, 0x01 ; 1 2762c: 21 f4 brne .+8 ; 0x27636 2762e: 24 e0 ldi r18, 0x04 ; 4 27630: 30 e0 ldi r19, 0x00 ; 0 27632: 40 e0 ldi r20, 0x00 ; 0 27634: 50 e0 ldi r21, 0x00 ; 0 27636: 60 e8 ldi r22, 0x80 ; 128 27638: 8c 2f mov r24, r28 2763a: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 2763e: 00 0f add r16, r16 27640: 11 1f adc r17, r17 27642: 00 0f add r16, r16 27644: 11 1f adc r17, r17 27646: f8 01 movw r30, r16 27648: e8 5f subi r30, 0xF8 ; 248 2764a: fc 4f sbci r31, 0xFC ; 252 2764c: 20 81 ld r18, Z 2764e: 31 81 ldd r19, Z+1 ; 0x01 27650: 42 81 ldd r20, Z+2 ; 0x02 27652: 53 81 ldd r21, Z+3 ; 0x03 27654: 60 ef ldi r22, 0xF0 ; 240 27656: 8c 2f mov r24, r28 27658: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 2765c: 20 e0 ldi r18, 0x00 ; 0 2765e: 30 e0 ldi r19, 0x00 ; 0 27660: a9 01 movw r20, r18 27662: 63 e9 ldi r22, 0x93 ; 147 27664: 8c 2f mov r24, r28 27666: b3 cf rjmp .-154 ; 0x275ce 00027668 : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 27668: 1f 93 push r17 2766a: cf 93 push r28 2766c: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 2766e: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 27672: 1f 92 push r1 27674: 8f 93 push r24 27676: 86 e4 ldi r24, 0x46 ; 70 27678: 90 ea ldi r25, 0xA0 ; 160 2767a: 9f 93 push r25 2767c: 8f 93 push r24 2767e: 0f 94 08 dc call 0x3b810 ; 0x3b810 #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 27682: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 27686: 83 70 andi r24, 0x03 ; 3 27688: 0f 90 pop r0 2768a: 0f 90 pop r0 2768c: 0f 90 pop r0 2768e: 0f 90 pop r0 27690: 11 f0 breq .+4 ; 0x27696 tmc2130_wait_standstill_xy(1000); 27692: 0f 94 9f 87 call 0x30f3e ; 0x30f3e if (tmc2130_sg_homing_axes_mask) 27696: 10 91 3d 06 lds r17, 0x063D ; 0x80063d 2769a: 11 23 and r17, r17 2769c: 71 f0 breq .+28 ; 0x276ba { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 2769e: d1 e0 ldi r29, 0x01 ; 1 276a0: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 276a2: 81 2f mov r24, r17 276a4: 8d 23 and r24, r29 276a6: 19 f0 breq .+6 ; 0x276ae tmc2130_XYZ_reg_init(axis); 276a8: 8c 2f mov r24, r28 276aa: 0f 94 97 3a call 0x2752e ; 0x2752e #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 276ae: cf 5f subi r28, 0xFF ; 255 276b0: dd 0f add r29, r29 276b2: c3 30 cpi r28, 0x03 ; 3 276b4: b1 f7 brne .-20 ; 0x276a2 { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 276b6: 10 92 3d 06 sts 0x063D, r1 ; 0x80063d } tmc2130_sg_crash = false; 276ba: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d #endif } 276be: df 91 pop r29 276c0: cf 91 pop r28 276c2: 1f 91 pop r17 276c4: 08 95 ret 000276c6 : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 276c6: df 92 push r13 276c8: ef 92 push r14 276ca: ff 92 push r15 276cc: 0f 93 push r16 276ce: 1f 93 push r17 276d0: cf 93 push r28 276d2: df 93 push r29 276d4: 00 d0 rcall .+0 ; 0x276d6 276d6: cd b7 in r28, 0x3d ; 61 276d8: de b7 in r29, 0x3e ; 62 276da: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 276dc: 1f 92 push r1 276de: 8f 93 push r24 276e0: 80 e2 ldi r24, 0x20 ; 32 276e2: 90 ea ldi r25, 0xA0 ; 160 276e4: 9f 93 push r25 276e6: 8f 93 push r24 276e8: 0f 94 08 dc call 0x3b810 ; 0x3b810 #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 276ec: 8d 2d mov r24, r13 276ee: 83 70 andi r24, 0x03 ; 3 276f0: 0f 90 pop r0 276f2: 0f 90 pop r0 276f4: 0f 90 pop r0 276f6: 0f 90 pop r0 276f8: 11 f0 breq .+4 ; 0x276fe tmc2130_wait_standstill_xy(1000); 276fa: 0f 94 9f 87 call 0x30f3e ; 0x30f3e } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 276fe: 10 e0 ldi r17, 0x00 ; 0 27700: 00 e0 ldi r16, 0x00 ; 0 27702: ff 24 eor r15, r15 27704: f3 94 inc r15 27706: 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) 27708: 8d 2d mov r24, r13 2770a: 8f 21 and r24, r15 2770c: 09 f4 brne .+2 ; 0x27710 2770e: 46 c0 rjmp .+140 ; 0x2779c { tmc2130_sg_homing_axes_mask |= mask; 27710: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 27714: 8f 29 or r24, r15 27716: 80 93 3d 06 sts 0x063D, r24 ; 0x80063d //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 2771a: 20 e0 ldi r18, 0x00 ; 0 2771c: 30 e0 ldi r19, 0x00 ; 0 2771e: a9 01 movw r20, r18 27720: 60 e8 ldi r22, 0x80 ; 128 27722: 80 2f mov r24, r16 27724: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 27728: f8 01 movw r30, r16 2772a: e8 5e subi r30, 0xE8 ; 232 2772c: fc 4f sbci r31, 0xFC ; 252 2772e: 20 81 ld r18, Z 27730: 30 e0 ldi r19, 0x00 ; 0 27732: 50 e0 ldi r21, 0x00 ; 0 27734: 40 e0 ldi r20, 0x00 ; 0 27736: a9 01 movw r20, r18 27738: 33 27 eor r19, r19 2773a: 22 27 eor r18, r18 2773c: 6d ee ldi r22, 0xED ; 237 2773e: 80 2f mov r24, r16 27740: 0f 94 d6 39 call 0x273ac ; 0x273ac 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) 27744: 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; 27746: 24 ef ldi r18, 0xF4 ; 244 27748: 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) 2774a: 08 17 cp r16, r24 2774c: 11 f0 breq .+4 ; 0x27752 { case X_AXIS: return TMC2130_TCOOLTHRS_X; 2774e: 2e ea ldi r18, 0xAE ; 174 27750: 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)); 27752: 50 e0 ldi r21, 0x00 ; 0 27754: 40 e0 ldi r20, 0x00 ; 0 27756: 64 e9 ldi r22, 0x94 ; 148 27758: 8e 2d mov r24, r14 2775a: 0f 94 d6 39 call 0x273ac ; 0x273ac iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 2775e: b8 01 movw r22, r16 27760: 66 0f add r22, r22 27762: 77 1f adc r23, r23 27764: 60 0f add r22, r16 27766: 71 1f adc r23, r17 27768: 6c 5e subi r22, 0xEC ; 236 2776a: 7f 45 sbci r23, 0x5F ; 95 2776c: 43 e0 ldi r20, 0x03 ; 3 2776e: 50 e0 ldi r21, 0x00 ; 0 27770: ce 01 movw r24, r28 27772: 01 96 adiw r24, 0x01 ; 1 27774: 0f 94 e0 da call 0x3b5c0 ; 0x3b5c0 MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 27778: ae 01 movw r20, r28 2777a: 4f 5f subi r20, 0xFF ; 255 2777c: 5f 4f sbci r21, 0xFF ; 255 2777e: f8 01 movw r30, r16 27780: eb 50 subi r30, 0x0B ; 11 27782: fb 4f sbci r31, 0xFB ; 251 27784: 60 81 ld r22, Z 27786: 8e 2d mov r24, r14 27788: 0f 94 1a 3a call 0x27434 ; 0x27434 tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 2778c: 20 e8 ldi r18, 0x80 ; 128 2778e: 31 e0 ldi r19, 0x01 ; 1 27790: 40 e0 ldi r20, 0x00 ; 0 27792: 50 e0 ldi r21, 0x00 ; 0 27794: 60 e8 ldi r22, 0x80 ; 128 27796: 8e 2d mov r24, r14 27798: 0f 94 d6 39 call 0x273ac ; 0x273ac { 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 2779c: ff 0c add r15, r15 2779e: 0f 5f subi r16, 0xFF ; 255 277a0: 1f 4f sbci r17, 0xFF ; 255 277a2: 03 30 cpi r16, 0x03 ; 3 277a4: 11 05 cpc r17, r1 277a6: 09 f0 breq .+2 ; 0x277aa 277a8: ae cf rjmp .-164 ; 0x27706 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 } 277aa: 0f 90 pop r0 277ac: 0f 90 pop r0 277ae: 0f 90 pop r0 277b0: df 91 pop r29 277b2: cf 91 pop r28 277b4: 1f 91 pop r17 277b6: 0f 91 pop r16 277b8: ff 90 pop r15 277ba: ef 90 pop r14 277bc: df 90 pop r13 277be: 08 95 ret 000277c0 : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 277c0: 89 e6 ldi r24, 0x69 ; 105 277c2: 9f e0 ldi r25, 0x0F ; 15 277c4: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 277c8: 91 e0 ldi r25, 0x01 ; 1 277ca: 81 11 cpse r24, r1 277cc: 01 c0 rjmp .+2 ; 0x277d0 277ce: 90 e0 ldi r25, 0x00 ; 0 277d0: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 277d4: 08 95 ret 000277d6 : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 277d6: 89 e6 ldi r24, 0x69 ; 105 277d8: 9f e0 ldi r25, 0x0F ; 15 277da: 0e 94 d0 77 call 0xefa0 ; 0xefa0 crashdet_use_eeprom_setting(); 277de: 0d 94 e0 3b jmp 0x277c0 ; 0x277c0 000277e2 : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 277e2: cf 93 push r28 277e4: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 277e6: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 277e8: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 277ea: 9f b7 in r25, 0x3f ; 63 277ec: f8 94 cli 277ee: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 277f2: 80 62 ori r24, 0x20 ; 32 277f4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 277f8: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, HIGH); 277fa: 9f b7 in r25, 0x3f ; 63 277fc: f8 94 cli 277fe: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27802: 80 61 ori r24, 0x10 ; 16 27804: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27808: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 2780a: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 2780c: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 2780e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27812: 80 62 ori r24, 0x20 ; 32 27814: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 27818: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2781c: 80 61 ori r24, 0x10 ; 16 2781e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 27822: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27826: 8b 7f andi r24, 0xFB ; 251 27828: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 2782c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27830: 8f 77 andi r24, 0x7F ; 127 27832: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 27836: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2783a: 8f 7b andi r24, 0xBF ; 191 2783c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 27840: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27844: 87 7f andi r24, 0xF7 ; 247 27846: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,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: 84 60 ori r24, 0x04 ; 4 27854: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27858: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 2785a: 9f b7 in r25, 0x3f ; 63 2785c: f8 94 cli 2785e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27862: 80 68 ori r24, 0x80 ; 128 27864: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27868: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 2786a: 9f b7 in r25, 0x3f ; 63 2786c: f8 94 cli 2786e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27872: 80 64 ori r24, 0x40 ; 64 27874: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27878: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 2787a: 9f b7 in r25, 0x3f ; 63 2787c: f8 94 cli 2787e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27882: 88 60 ori r24, 0x08 ; 8 27884: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27888: 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); 2788a: 80 e0 ldi r24, 0x00 ; 0 2788c: 0f 94 97 3a call 0x2752e ; 0x2752e 27890: 81 e0 ldi r24, 0x01 ; 1 27892: 0f 94 97 3a call 0x2752e ; 0x2752e 27896: 82 e0 ldi r24, 0x02 ; 2 27898: 0f 94 97 3a call 0x2752e ; 0x2752e } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 2789c: 50 e0 ldi r21, 0x00 ; 0 2789e: 40 e0 ldi r20, 0x00 ; 0 278a0: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 278a4: 83 e0 ldi r24, 0x03 ; 3 278a6: 0f 94 1a 3a call 0x27434 ; 0x27434 tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 278aa: 20 e0 ldi r18, 0x00 ; 0 278ac: 30 e0 ldi r19, 0x00 ; 0 278ae: a9 01 movw r20, r18 278b0: 61 e9 ldi r22, 0x91 ; 145 278b2: 83 e0 ldi r24, 0x03 ; 3 278b4: 0f 94 d6 39 call 0x273ac ; 0x273ac #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 278b8: c1 fd sbrc r28, 1 278ba: 1d c0 rjmp .+58 ; 0x278f6 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 278bc: 20 e8 ldi r18, 0x80 ; 128 278be: 31 e0 ldi r19, 0x01 ; 1 278c0: 40 e0 ldi r20, 0x00 ; 0 278c2: 50 e0 ldi r21, 0x00 ; 0 278c4: 60 e8 ldi r22, 0x80 ; 128 278c6: 83 e0 ldi r24, 0x03 ; 3 278c8: 0f 94 d6 39 call 0x273ac ; 0x273ac 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]); 278cc: 60 91 f9 04 lds r22, 0x04F9 ; 0x8004f9 278d0: 80 e0 ldi r24, 0x00 ; 0 278d2: 0f 94 13 88 call 0x31026 ; 0x31026 tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 278d6: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 278da: 81 e0 ldi r24, 0x01 ; 1 278dc: 0f 94 13 88 call 0x31026 ; 0x31026 tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 278e0: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 278e4: 82 e0 ldi r24, 0x02 ; 2 278e6: 0f 94 13 88 call 0x31026 ; 0x31026 #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 278ea: 60 91 fc 04 lds r22, 0x04FC ; 0x8004fc 278ee: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 278f0: 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]); 278f2: 0d 94 13 88 jmp 0x31026 ; 0x31026 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)); 278f6: 20 e0 ldi r18, 0x00 ; 0 278f8: 30 e0 ldi r19, 0x00 ; 0 278fa: 43 e0 ldi r20, 0x03 ; 3 278fc: 50 e0 ldi r21, 0x00 ; 0 278fe: 6d ee ldi r22, 0xED ; 237 27900: 83 e0 ldi r24, 0x03 ; 3 27902: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 27906: 20 e0 ldi r18, 0x00 ; 0 27908: 30 e0 ldi r19, 0x00 ; 0 2790a: a9 01 movw r20, r18 2790c: 64 e9 ldi r22, 0x94 ; 148 2790e: 83 e0 ldi r24, 0x03 ; 3 27910: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 27914: 24 e0 ldi r18, 0x04 ; 4 27916: 30 e0 ldi r19, 0x00 ; 0 27918: 40 e0 ldi r20, 0x00 ; 0 2791a: 50 e0 ldi r21, 0x00 ; 0 2791c: 60 e8 ldi r22, 0x80 ; 128 2791e: 83 e0 ldi r24, 0x03 ; 3 27920: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 27924: 2b e2 ldi r18, 0x2B ; 43 27926: 34 e5 ldi r19, 0x54 ; 84 27928: 42 e0 ldi r20, 0x02 ; 2 2792a: 50 e0 ldi r21, 0x00 ; 0 2792c: 60 ef ldi r22, 0xF0 ; 240 2792e: 83 e0 ldi r24, 0x03 ; 3 27930: 0f 94 d6 39 call 0x273ac ; 0x273ac tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 27934: 23 e9 ldi r18, 0x93 ; 147 27936: 31 e0 ldi r19, 0x01 ; 1 27938: 40 e0 ldi r20, 0x00 ; 0 2793a: 50 e0 ldi r21, 0x00 ; 0 2793c: 63 e9 ldi r22, 0x93 ; 147 2793e: 83 e0 ldi r24, 0x03 ; 3 27940: 0f 94 d6 39 call 0x273ac ; 0x273ac SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 27944: 84 ef ldi r24, 0xF4 ; 244 27946: 9f e9 ldi r25, 0x9F ; 159 27948: 0e 94 17 7b call 0xf62e ; 0xf62e 2794c: bf cf rjmp .-130 ; 0x278cc 0002794e : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 2794e: df 92 push r13 27950: ef 92 push r14 27952: ff 92 push r15 27954: 0f 93 push r16 27956: 1f 93 push r17 27958: cf 93 push r28 2795a: df 93 push r29 MENU_BEGIN(); 2795c: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 27960: 10 92 12 05 sts 0x0512, r1 ; 0x800512 27964: 80 91 12 05 lds r24, 0x0512 ; 0x800512 27968: 84 30 cpi r24, 0x04 ; 4 2796a: 08 f0 brcs .+2 ; 0x2796e 2796c: 66 c0 rjmp .+204 ; 0x27a3a 2796e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 27972: 0f 94 45 cd call 0x39a8a ; 0x39a8a 27976: 88 23 and r24, r24 27978: e9 f0 breq .+58 ; 0x279b4 2797a: 09 ef ldi r16, 0xF9 ; 249 2797c: 14 e0 ldi r17, 0x04 ; 4 2797e: c7 ef ldi r28, 0xF7 ; 247 27980: 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) { 27982: f8 01 movw r30, r16 27984: 80 81 ld r24, Z 27986: 8e 31 cpi r24, 0x1E ; 30 27988: 08 f4 brcc .+2 ; 0x2798c tmc2130_wave_fac[axis] = 0; 2798a: 10 82 st Z, r1 2798c: f8 01 movw r30, r16 2798e: 61 91 ld r22, Z+ 27990: 8f 01 movw r16, r30 27992: ce 01 movw r24, r28 27994: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 27998: 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++) { 2799a: c3 3f cpi r28, 0xF3 ; 243 2799c: fe e0 ldi r31, 0x0E ; 14 2799e: df 07 cpc r29, r31 279a0: 81 f7 brne .-32 ; 0x27982 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(); 279a2: 0e 94 aa f9 call 0x1f354 ; 0x1f354 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) { } 279a6: e8 94 clt 279a8: d0 f8 bld r13, 0 279aa: 80 fb bst r24, 0 279ac: 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())); 279ae: 8d 2d mov r24, r13 279b0: 0f 94 f1 3b call 0x277e2 ; 0x277e2 { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 279b4: 8b e5 ldi r24, 0x5B ; 91 279b6: 9d e3 ldi r25, 0x3D ; 61 279b8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 279bc: 0f 94 90 d1 call 0x3a320 ; 0x3a320 #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); 279c0: 8b ed ldi r24, 0xDB ; 219 279c2: 96 e5 ldi r25, 0x56 ; 86 279c4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 279c8: f1 2c mov r15, r1 279ca: e1 2c mov r14, r1 279cc: 08 ec ldi r16, 0xC8 ; 200 279ce: 10 e0 ldi r17, 0x00 ; 0 279d0: 2d e1 ldi r18, 0x1D ; 29 279d2: 30 e0 ldi r19, 0x00 ; 0 279d4: 48 e0 ldi r20, 0x08 ; 8 279d6: 69 ef ldi r22, 0xF9 ; 249 279d8: 74 e0 ldi r23, 0x04 ; 4 279da: 0f 94 15 cf call 0x39e2a ; 0x39e2a 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); 279de: 8f ec ldi r24, 0xCF ; 207 279e0: 96 e5 ldi r25, 0x56 ; 86 279e2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 279e6: 2d e1 ldi r18, 0x1D ; 29 279e8: 30 e0 ldi r19, 0x00 ; 0 279ea: 48 e0 ldi r20, 0x08 ; 8 279ec: 6a ef ldi r22, 0xFA ; 250 279ee: 74 e0 ldi r23, 0x04 ; 4 279f0: 0f 94 15 cf call 0x39e2a ; 0x39e2a 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); 279f4: 83 ec ldi r24, 0xC3 ; 195 279f6: 96 e5 ldi r25, 0x56 ; 86 279f8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 279fc: 2d e1 ldi r18, 0x1D ; 29 279fe: 30 e0 ldi r19, 0x00 ; 0 27a00: 48 e0 ldi r20, 0x08 ; 8 27a02: 6b ef ldi r22, 0xFB ; 251 27a04: 74 e0 ldi r23, 0x04 ; 4 27a06: 0f 94 15 cf call 0x39e2a ; 0x39e2a #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); 27a0a: 87 eb ldi r24, 0xB7 ; 183 27a0c: 96 e5 ldi r25, 0x56 ; 86 27a0e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 27a12: 2d e1 ldi r18, 0x1D ; 29 27a14: 30 e0 ldi r19, 0x00 ; 0 27a16: 48 e0 ldi r20, 0x08 ; 8 27a18: 6c ef ldi r22, 0xFC ; 252 27a1a: 74 e0 ldi r23, 0x04 ; 4 27a1c: 0f 94 15 cf call 0x39e2a ; 0x39e2a MENU_END(); 27a20: 0f 94 99 ce call 0x39d32 ; 0x39d32 } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 27a24: 80 91 12 05 lds r24, 0x0512 ; 0x800512 27a28: 8f 5f subi r24, 0xFF ; 255 27a2a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 27a2e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 27a32: 8f 5f subi r24, 0xFF ; 255 27a34: 80 93 14 05 sts 0x0514, r24 ; 0x800514 27a38: 95 cf rjmp .-214 ; 0x27964 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(); } 27a3a: df 91 pop r29 27a3c: cf 91 pop r28 27a3e: 1f 91 pop r17 27a40: 0f 91 pop r16 27a42: ff 90 pop r15 27a44: ef 90 pop r14 27a46: df 90 pop r13 27a48: 08 95 ret 00027a4a : , 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()); } 27a4a: fc 01 movw r30, r24 27a4c: 20 81 ld r18, Z 27a4e: 92 81 ldd r25, Z+2 ; 0x02 27a50: 49 2f mov r20, r25 27a52: 50 e0 ldi r21, 0x00 ; 0 27a54: 21 11 cpse r18, r1 27a56: 02 c0 rjmp .+4 ; 0x27a5c 27a58: 44 0f add r20, r20 27a5a: 55 1f adc r21, r21 27a5c: 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; } 27a5e: 21 11 cpse r18, r1 27a60: 01 c0 rjmp .+2 ; 0x27a64 27a62: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 27a64: 84 17 cp r24, r20 27a66: 15 06 cpc r1, r21 27a68: 31 f0 breq .+12 ; 0x27a76 27a6a: 2c f0 brlt .+10 ; 0x27a76 27a6c: 89 2f mov r24, r25 27a6e: 21 11 cpse r18, r1 27a70: 02 c0 rjmp .+4 ; 0x27a76 27a72: 88 0f add r24, r24 27a74: 08 95 ret 27a76: 08 95 ret 00027a78 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 27a78: 3f b7 in r19, 0x3f ; 63 cli(); 27a7a: f8 94 cli m = timer2_overflow_count; 27a7c: 80 91 39 06 lds r24, 0x0639 ; 0x800639 27a80: 90 91 3a 06 lds r25, 0x063A ; 0x80063a 27a84: a0 91 3b 06 lds r26, 0x063B ; 0x80063b 27a88: b0 91 3c 06 lds r27, 0x063C ; 0x80063c #if defined(TCNT2) t = TCNT2; 27a8c: 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)) 27a90: b8 9b sbis 0x17, 0 ; 23 27a92: 05 c0 rjmp .+10 ; 0x27a9e 27a94: 2f 3f cpi r18, 0xFF ; 255 27a96: 19 f0 breq .+6 ; 0x27a9e m++; 27a98: 01 96 adiw r24, 0x01 ; 1 27a9a: a1 1d adc r26, r1 27a9c: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 27a9e: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 27aa0: ba 2f mov r27, r26 27aa2: a9 2f mov r26, r25 27aa4: 98 2f mov r25, r24 27aa6: 88 27 eor r24, r24 27aa8: bc 01 movw r22, r24 27aaa: cd 01 movw r24, r26 27aac: 62 0f add r22, r18 27aae: 71 1d adc r23, r1 27ab0: 81 1d adc r24, r1 27ab2: 91 1d adc r25, r1 27ab4: 42 e0 ldi r20, 0x02 ; 2 27ab6: 66 0f add r22, r22 27ab8: 77 1f adc r23, r23 27aba: 88 1f adc r24, r24 27abc: 99 1f adc r25, r25 27abe: 4a 95 dec r20 27ac0: d1 f7 brne .-12 ; 0x27ab6 } 27ac2: 08 95 ret 00027ac4 : void delay2(unsigned long ms) { 27ac4: 8f 92 push r8 27ac6: 9f 92 push r9 27ac8: af 92 push r10 27aca: bf 92 push r11 27acc: cf 92 push r12 27ace: df 92 push r13 27ad0: ef 92 push r14 27ad2: ff 92 push r15 27ad4: 6b 01 movw r12, r22 27ad6: 7c 01 movw r14, r24 uint32_t start = micros2(); 27ad8: 0f 94 3c 3d call 0x27a78 ; 0x27a78 27adc: 4b 01 movw r8, r22 27ade: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 27ae0: c1 14 cp r12, r1 27ae2: d1 04 cpc r13, r1 27ae4: e1 04 cpc r14, r1 27ae6: f1 04 cpc r15, r1 27ae8: b9 f0 breq .+46 ; 0x27b18 27aea: 0f 94 3c 3d call 0x27a78 ; 0x27a78 27aee: 68 19 sub r22, r8 27af0: 79 09 sbc r23, r9 27af2: 8a 09 sbc r24, r10 27af4: 9b 09 sbc r25, r11 27af6: 68 3e cpi r22, 0xE8 ; 232 27af8: 73 40 sbci r23, 0x03 ; 3 27afa: 81 05 cpc r24, r1 27afc: 91 05 cpc r25, r1 27afe: 80 f3 brcs .-32 ; 0x27ae0 { ms--; 27b00: 21 e0 ldi r18, 0x01 ; 1 27b02: c2 1a sub r12, r18 27b04: d1 08 sbc r13, r1 27b06: e1 08 sbc r14, r1 27b08: f1 08 sbc r15, r1 start += 1000; 27b0a: 88 ee ldi r24, 0xE8 ; 232 27b0c: 88 0e add r8, r24 27b0e: 83 e0 ldi r24, 0x03 ; 3 27b10: 98 1e adc r9, r24 27b12: a1 1c adc r10, r1 27b14: b1 1c adc r11, r1 27b16: e4 cf rjmp .-56 ; 0x27ae0 } } } 27b18: ff 90 pop r15 27b1a: ef 90 pop r14 27b1c: df 90 pop r13 27b1e: cf 90 pop r12 27b20: bf 90 pop r11 27b22: af 90 pop r10 27b24: 9f 90 pop r9 27b26: 8f 90 pop r8 27b28: 08 95 ret 00027b2a : * @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() { 27b2a: ef 92 push r14 27b2c: ff 92 push r15 27b2e: 0f 93 push r16 27b30: 1f 93 push r17 27b32: cf 93 push r28 27b34: df 93 push r29 27b36: cd b7 in r28, 0x3d ; 61 27b38: de b7 in r29, 0x3e ; 62 27b3a: 63 97 sbiw r28, 0x13 ; 19 27b3c: 0f b6 in r0, 0x3f ; 63 27b3e: f8 94 cli 27b40: de bf out 0x3e, r29 ; 62 27b42: 0f be out 0x3f, r0 ; 63 27b44: 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) 27b46: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 27b4a: 81 11 cpse r24, r1 27b4c: 3a c0 rjmp .+116 ; 0x27bc2 { // Menu was entered. // Initialize its status. _md->status = 1; 27b4e: 81 e0 ldi r24, 0x01 ; 1 27b50: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 check_babystep(); 27b54: 0e 94 1b 7b call 0xf636 ; 0xf636 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 27b58: 81 ea ldi r24, 0xA1 ; 161 27b5a: 9d e0 ldi r25, 0x0D ; 13 27b5c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 27b60: 18 2f mov r17, r24 27b62: 0e 94 dd 77 call 0xefba ; 0xefba 27b66: 81 11 cpse r24, r1 27b68: ee c0 rjmp .+476 ; 0x27d46 _md->babystepMemZ = 0; 27b6a: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 27b6e: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 _md->babystepMemZ = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); } // same logic as in babystep_load if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 27b72: 80 e1 ldi r24, 0x10 ; 16 27b74: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 27b78: 81 11 cpse r24, r1 27b7a: 04 c0 rjmp .+8 ; 0x27b84 _md->babystepMemZ = 0; 27b7c: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 27b80: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 27b84: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 27b88: 70 91 a7 03 lds r23, 0x03A7 ; 0x8003a7 27b8c: 07 2e mov r0, r23 27b8e: 00 0c add r0, r0 27b90: 88 0b sbc r24, r24 27b92: 99 0b sbc r25, r25 27b94: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 27b98: 20 91 77 06 lds r18, 0x0677 ; 0x800677 27b9c: 30 91 78 06 lds r19, 0x0678 ; 0x800678 27ba0: 40 91 79 06 lds r20, 0x0679 ; 0x800679 27ba4: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 27ba8: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 27bac: 60 93 a8 03 sts 0x03A8, r22 ; 0x8003a8 27bb0: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 27bb4: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 27bb8: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab lcd_draw_update = 1; 27bbc: 81 e0 ldi r24, 0x01 ; 1 27bbe: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 27bc2: 80 91 34 05 lds r24, 0x0534 ; 0x800534 27bc6: 90 91 35 05 lds r25, 0x0535 ; 0x800535 27bca: 00 97 sbiw r24, 0x00 ; 0 27bcc: f1 f1 breq .+124 ; 0x27c4a { _md->babystepMemZ += lcd_encoder; 27bce: 20 91 a6 03 lds r18, 0x03A6 ; 0x8003a6 27bd2: 30 91 a7 03 lds r19, 0x03A7 ; 0x8003a7 27bd6: 28 0f add r18, r24 27bd8: 39 1f adc r19, r25 27bda: 30 93 a7 03 sts 0x03A7, r19 ; 0x8003a7 27bde: 20 93 a6 03 sts 0x03A6, r18 ; 0x8003a6 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 27be2: 21 36 cpi r18, 0x61 ; 97 27be4: 40 ef ldi r20, 0xF0 ; 240 27be6: 34 07 cpc r19, r20 27be8: 0c f0 brlt .+2 ; 0x27bec 27bea: ba c0 rjmp .+372 ; 0x27d60 27bec: 81 e6 ldi r24, 0x61 ; 97 27bee: 90 ef ldi r25, 0xF0 ; 240 27bf0: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 27bf4: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 else if (_md->babystepMemZ > Z_BABYSTEP_MAX) _md->babystepMemZ = Z_BABYSTEP_MAX; //0 else babystepsTodoZadd(lcd_encoder); _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 27bf8: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 27bfc: 70 91 a7 03 lds r23, 0x03A7 ; 0x8003a7 27c00: 07 2e mov r0, r23 27c02: 00 0c add r0, r0 27c04: 88 0b sbc r24, r24 27c06: 99 0b sbc r25, r25 27c08: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 27c0c: 20 91 77 06 lds r18, 0x0677 ; 0x800677 27c10: 30 91 78 06 lds r19, 0x0678 ; 0x800678 27c14: 40 91 79 06 lds r20, 0x0679 ; 0x800679 27c18: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 27c1c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 27c20: 60 93 a8 03 sts 0x03A8, r22 ; 0x8003a8 27c24: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 27c28: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 27c2c: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab _delay(50); 27c30: 62 e3 ldi r22, 0x32 ; 50 27c32: 70 e0 ldi r23, 0x00 ; 0 27c34: 80 e0 ldi r24, 0x00 ; 0 27c36: 90 e0 ldi r25, 0x00 ; 0 27c38: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 lcd_encoder = 0; 27c3c: 10 92 35 05 sts 0x0535, r1 ; 0x800535 27c40: 10 92 34 05 sts 0x0534, r1 ; 0x800534 lcd_draw_update = 1; 27c44: 81 e0 ldi r24, 0x01 ; 1 27c46: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 27c4a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27c4e: 88 23 and r24, r24 27c50: c9 f1 breq .+114 ; 0x27cc4 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 27c52: 81 ea ldi r24, 0xA1 ; 161 27c54: 9d e0 ldi r25, 0x0D ; 13 27c56: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 27c5a: 2b e0 ldi r18, 0x0B ; 11 27c5c: 82 9f mul r24, r18 27c5e: c0 01 movw r24, r0 27c60: 11 24 eor r1, r1 27c62: be 01 movw r22, r28 27c64: 6f 5f subi r22, 0xFF ; 255 27c66: 7f 4f sbci r23, 0xFF ; 255 27c68: 87 5b subi r24, 0xB7 ; 183 27c6a: 92 4f sbci r25, 0xF2 ; 242 27c6c: 0f 94 5f cd call 0x39abe ; 0x39abe lcd_home(); 27c70: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_print(buffer.c); 27c74: ce 01 movw r24, r28 27c76: 01 96 adiw r24, 0x01 ; 1 27c78: 0e 94 ad 71 call 0xe35a ; 0xe35a lcd_set_cursor(0, 1); 27c7c: 61 e0 ldi r22, 0x01 ; 1 27c7e: 80 e0 ldi r24, 0x00 ; 0 27c80: 0e 94 a6 6f call 0xdf4c ; 0xdf4c menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 27c84: 10 91 a8 03 lds r17, 0x03A8 ; 0x8003a8 27c88: 00 91 a9 03 lds r16, 0x03A9 ; 0x8003a9 27c8c: f0 90 aa 03 lds r15, 0x03AA ; 0x8003aa 27c90: e0 90 ab 03 lds r14, 0x03AB ; 0x8003ab 27c94: 84 e3 ldi r24, 0x34 ; 52 27c96: 9d e4 ldi r25, 0x4D ; 77 27c98: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 //! (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); 27c9c: ef 92 push r14 27c9e: ff 92 push r15 27ca0: 0f 93 push r16 27ca2: 1f 93 push r17 27ca4: 9f 93 push r25 27ca6: 8f 93 push r24 27ca8: 1f 92 push r1 27caa: 80 e2 ldi r24, 0x20 ; 32 27cac: 8f 93 push r24 27cae: 88 ee ldi r24, 0xE8 ; 232 27cb0: 93 ea ldi r25, 0xA3 ; 163 27cb2: 9f 93 push r25 27cb4: 8f 93 push r24 27cb6: 0e 94 7f 6f call 0xdefe ; 0xdefe 27cba: 0f b6 in r0, 0x3f ; 63 27cbc: f8 94 cli 27cbe: de bf out 0x3e, r29 ; 62 27cc0: 0f be out 0x3f, r0 ; 63 27cc2: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 27cc4: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 27cc8: 81 11 cpse r24, r1 27cca: 04 c0 rjmp .+8 ; 0x27cd4 27ccc: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf 27cd0: 88 23 and r24, r24 27cd2: 51 f1 breq .+84 ; 0x27d28 { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 27cd4: 81 ea ldi r24, 0xA1 ; 161 27cd6: 9d e0 ldi r25, 0x0D ; 13 27cd8: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 27cdc: 9b e0 ldi r25, 0x0B ; 11 27cde: 89 9f mul r24, r25 27ce0: 80 01 movw r16, r0 27ce2: 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); 27ce4: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 27ce8: 70 91 a7 03 lds r23, 0x03A7 ; 0x8003a7 27cec: c8 01 movw r24, r16 27cee: 80 5b subi r24, 0xB0 ; 176 27cf0: 92 4f sbci r25, 0xF2 ; 242 27cf2: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 27cf6: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 27cfa: c8 01 movw r24, r16 27cfc: 8e 5a subi r24, 0xAE ; 174 27cfe: 92 4f sbci r25, 0xF2 ; 242 27d00: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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); 27d04: 60 91 95 03 lds r22, 0x0395 ; 0x800395 27d08: 70 91 96 03 lds r23, 0x0396 ; 0x800396 27d0c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 27d10: 90 91 98 03 lds r25, 0x0398 ; 0x800398 27d14: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 27d18: c8 01 movw r24, r16 27d1a: 8d 5a subi r24, 0xAD ; 173 27d1c: 92 4f sbci r25, 0xF2 ; 242 27d1e: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 27d22: 80 e1 ldi r24, 0x10 ; 16 27d24: 0e 94 3a e7 call 0x1ce74 ; 0x1ce74 } menu_back_if_clicked(); 27d28: 0f 94 2f d2 call 0x3a45e ; 0x3a45e } 27d2c: 63 96 adiw r28, 0x13 ; 19 27d2e: 0f b6 in r0, 0x3f ; 63 27d30: f8 94 cli 27d32: de bf out 0x3e, r29 ; 62 27d34: 0f be out 0x3f, r0 ; 63 27d36: cd bf out 0x3d, r28 ; 61 27d38: df 91 pop r29 27d3a: cf 91 pop r28 27d3c: 1f 91 pop r17 27d3e: 0f 91 pop r16 27d40: ff 90 pop r15 27d42: ef 90 pop r14 27d44: 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-> 27d46: 2b e0 ldi r18, 0x0B ; 11 27d48: 12 9f mul r17, r18 27d4a: c0 01 movw r24, r0 27d4c: 11 24 eor r1, r1 27d4e: 80 5b subi r24, 0xB0 ; 176 27d50: 92 4f sbci r25, 0xF2 ; 242 27d52: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 27d56: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 27d5a: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 27d5e: 09 cf rjmp .-494 ; 0x27b72 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 27d60: 12 16 cp r1, r18 27d62: 13 06 cpc r1, r19 27d64: 2c f4 brge .+10 ; 0x27d70 27d66: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 27d6a: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 27d6e: 44 cf rjmp .-376 ; 0x27bf8 extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 27d70: 2f b7 in r18, 0x3f ; 63 27d72: f8 94 cli babystepsTodo[Z_AXIS] += n; 27d74: 40 91 67 06 lds r20, 0x0667 ; 0x800667 27d78: 50 91 68 06 lds r21, 0x0668 ; 0x800668 27d7c: 84 0f add r24, r20 27d7e: 95 1f adc r25, r21 27d80: 90 93 68 06 sts 0x0668, r25 ; 0x800668 27d84: 80 93 67 06 sts 0x0667, r24 ; 0x800667 CRITICAL_SECTION_END 27d88: 2f bf out 0x3f, r18 ; 63 27d8a: 36 cf rjmp .-404 ; 0x27bf8 00027d8c : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 27d8c: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 27d90: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 27d94: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 27d98: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 27d9c: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 27da0: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 27da4: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 27da8: 26 17 cp r18, r22 27daa: 37 07 cpc r19, r23 27dac: 0c f0 brlt .+2 ; 0x27db0 27dae: 65 c0 rjmp .+202 ; 0x27e7a { if (lcd_encoder != 0) 27db0: 80 91 34 05 lds r24, 0x0534 ; 0x800534 27db4: 90 91 35 05 lds r25, 0x0535 ; 0x800535 27db8: 89 2b or r24, r25 27dba: b9 f1 breq .+110 ; 0x27e2a { refresh_cmd_timeout(); 27dbc: 0e 94 89 67 call 0xcf12 ; 0xcf12 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; 27dc0: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 if (++ next_block_index == BLOCK_BUFFER_SIZE) 27dc4: 8f 5f subi r24, 0xFF ; 255 27dc6: 80 31 cpi r24, 0x10 ; 16 27dc8: 09 f4 brne .+2 ; 0x27dcc next_block_index = 0; 27dca: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 27dcc: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 if (! planner_queue_full()) 27dd0: 98 17 cp r25, r24 27dd2: 59 f1 breq .+86 ; 0x27e2a { current_position[E_AXIS] += lcd_encoder; 27dd4: 60 91 34 05 lds r22, 0x0534 ; 0x800534 27dd8: 70 91 35 05 lds r23, 0x0535 ; 0x800535 27ddc: 07 2e mov r0, r23 27dde: 00 0c add r0, r0 27de0: 88 0b sbc r24, r24 27de2: 99 0b sbc r25, r25 27de4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 27de8: 9b 01 movw r18, r22 27dea: ac 01 movw r20, r24 27dec: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 27df0: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 27df4: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 27df8: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 27dfc: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 27e00: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 27e04: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 27e08: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 27e0c: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f lcd_encoder = 0; 27e10: 10 92 35 05 sts 0x0535, r1 ; 0x800535 27e14: 10 92 34 05 sts 0x0534, r1 ; 0x800534 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 27e18: 65 e5 ldi r22, 0x55 ; 85 27e1a: 75 e5 ldi r23, 0x55 ; 85 27e1c: 85 ed ldi r24, 0xD5 ; 213 27e1e: 9f e3 ldi r25, 0x3F ; 63 27e20: 0f 94 48 ba call 0x37490 ; 0x37490 lcd_draw_update = 1; 27e24: 81 e0 ldi r24, 0x01 ; 1 27e26: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 27e2a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27e2e: 88 23 and r24, r24 27e30: 11 f1 breq .+68 ; 0x27e76 { lcd_set_cursor(0, 1); 27e32: 61 e0 ldi r22, 0x01 ; 1 27e34: 80 e0 ldi r24, 0x00 ; 0 27e36: 0e 94 a6 6f call 0xdf4c ; 0xdf4c //! 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); 27e3a: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 27e3e: 8f 93 push r24 27e40: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 27e44: 8f 93 push r24 27e46: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 27e4a: 8f 93 push r24 27e4c: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 27e50: 8f 93 push r24 27e52: 8a ec ldi r24, 0xCA ; 202 27e54: 93 ea ldi r25, 0xA3 ; 163 27e56: 9f 93 push r25 27e58: 8f 93 push r24 27e5a: 8b eb ldi r24, 0xBB ; 187 27e5c: 93 ea ldi r25, 0xA3 ; 163 27e5e: 9f 93 push r25 27e60: 8f 93 push r24 27e62: 0e 94 7f 6f call 0xdefe ; 0xdefe 27e66: 8d b7 in r24, 0x3d ; 61 27e68: 9e b7 in r25, 0x3e ; 62 27e6a: 08 96 adiw r24, 0x08 ; 8 27e6c: 0f b6 in r0, 0x3f ; 63 27e6e: f8 94 cli 27e70: 9e bf out 0x3e, r25 ; 62 27e72: 0f be out 0x3f, r0 ; 63 27e74: 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(); 27e76: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e }; } void show_preheat_nozzle_warning() { lcd_clear(); 27e7a: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 27e7e: 85 ec ldi r24, 0xC5 ; 197 27e80: 9c e4 ldi r25, 0x4C ; 76 27e82: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 27e86: ac 01 movw r20, r24 27e88: 60 e0 ldi r22, 0x00 ; 0 27e8a: 80 e0 ldi r24, 0x00 ; 0 27e8c: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 27e90: 8f ea ldi r24, 0xAF ; 175 27e92: 9c e4 ldi r25, 0x4C ; 76 27e94: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 27e98: ac 01 movw r20, r24 27e9a: 62 e0 ldi r22, 0x02 ; 2 27e9c: 80 e0 ldi r24, 0x00 ; 0 27e9e: 0e 94 ba 6f call 0xdf74 ; 0xdf74 _delay(2000); 27ea2: 60 ed ldi r22, 0xD0 ; 208 27ea4: 77 e0 ldi r23, 0x07 ; 7 27ea6: 80 e0 ldi r24, 0x00 ; 0 27ea8: 90 e0 ldi r25, 0x00 ; 0 27eaa: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 lcd_clear(); 27eae: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 27eb2: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 00027eb6 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 27eb6: 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(); 27eb8: f8 94 cli m = timer2_millis; 27eba: 60 91 35 06 lds r22, 0x0635 ; 0x800635 27ebe: 70 91 36 06 lds r23, 0x0636 ; 0x800636 27ec2: 80 91 37 06 lds r24, 0x0637 ; 0x800637 27ec6: 90 91 38 06 lds r25, 0x0638 ; 0x800638 SREG = oldSREG; 27eca: 2f bf out 0x3f, r18 ; 63 return m; } 27ecc: 08 95 ret 00027ece : } //! @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); 27ece: 20 e0 ldi r18, 0x00 ; 0 27ed0: 30 e0 ldi r19, 0x00 ; 0 27ed2: 40 e8 ldi r20, 0x80 ; 128 27ed4: 5f eb ldi r21, 0xBF ; 191 27ed6: 60 e0 ldi r22, 0x00 ; 0 27ed8: 70 e0 ldi r23, 0x00 ; 0 27eda: cb 01 movw r24, r22 27edc: 0e 94 7b 8a call 0x114f6 ; 0x114f6 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 27ee0: 89 e6 ldi r24, 0x69 ; 105 27ee2: 9f e6 ldi r25, 0x6F ; 111 27ee4: 0e 94 17 7b call 0xf62e ; 0xf62e // Indicate that the printer is paused did_pause_print = true; 27ee8: 81 e0 ldi r24, 0x01 ; 1 27eea: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc } else return false; } bool Stopwatch::pause() { if (isRunning()) { 27eee: 80 91 99 03 lds r24, 0x0399 ; 0x800399 27ef2: 81 30 cpi r24, 0x01 ; 1 27ef4: 69 f4 brne .+26 ; 0x27f10 state = PAUSED; 27ef6: 82 e0 ldi r24, 0x02 ; 2 27ef8: 80 93 99 03 sts 0x0399, r24 ; 0x800399 stopTimestamp = _millis(); 27efc: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 27f00: 60 93 4c 06 sts 0x064C, r22 ; 0x80064c 27f04: 70 93 4d 06 sts 0x064D, r23 ; 0x80064d 27f08: 80 93 4e 06 sts 0x064E, r24 ; 0x80064e 27f0c: 90 93 4f 06 sts 0x064F, r25 ; 0x80064f print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 27f10: 82 e0 ldi r24, 0x02 ; 2 27f12: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 lcd_return_to_status(); 27f16: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 00027f1a ::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) 27f1a: ff 92 push r15 27f1c: 0f 93 push r16 27f1e: 1f 93 push r17 27f20: cf 93 push r28 27f22: df 93 push r29 { if (!m_isRunning) return false; 27f24: fc 01 movw r30, r24 27f26: f0 80 ld r15, Z 27f28: f1 10 cpse r15, r1 27f2a: 08 c0 rjmp .+16 ; 0x27f3c ::expired(unsigned short)+0x22> 27f2c: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 27f2e: 8f 2d mov r24, r15 27f30: df 91 pop r29 27f32: cf 91 pop r28 27f34: 1f 91 pop r17 27f36: 0f 91 pop r16 27f38: ff 90 pop r15 27f3a: 08 95 ret 27f3c: 8b 01 movw r16, r22 27f3e: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 27f40: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 if (m_started <= m_started + msPeriod) 27f44: 89 81 ldd r24, Y+1 ; 0x01 27f46: 9a 81 ldd r25, Y+2 ; 0x02 27f48: 08 0f add r16, r24 27f4a: 19 1f adc r17, r25 27f4c: 08 17 cp r16, r24 27f4e: 19 07 cpc r17, r25 27f50: 40 f0 brcs .+16 ; 0x27f62 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 27f52: 60 17 cp r22, r16 27f54: 71 07 cpc r23, r17 27f56: 18 f4 brcc .+6 ; 0x27f5e ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27f58: 68 17 cp r22, r24 27f5a: 79 07 cpc r23, r25 27f5c: 38 f7 brcc .-50 ; 0x27f2c ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 27f5e: 18 82 st Y, r1 27f60: e6 cf rjmp .-52 ; 0x27f2e ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27f62: 60 17 cp r22, r16 27f64: 71 07 cpc r23, r17 27f66: c0 f7 brcc .-16 ; 0x27f58 ::expired(unsigned short)+0x3e> 27f68: e1 cf rjmp .-62 ; 0x27f2c ::expired(unsigned short)+0x12> 00027f6a ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 27f6a: fc 01 movw r30, r24 27f6c: 20 81 ld r18, Z 27f6e: 21 11 cpse r18, r1 27f70: 0d 94 8d 3f jmp 0x27f1a ; 0x27f1a ::expired(unsigned short)> } 27f74: 81 e0 ldi r24, 0x01 ; 1 27f76: 08 95 ret 00027f78 ::start()>: /** * @brief Start timer */ template void Timer::start() 27f78: cf 93 push r28 27f7a: df 93 push r29 27f7c: ec 01 movw r28, r24 { m_started = _millis(); 27f7e: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 27f82: 7a 83 std Y+2, r23 ; 0x02 27f84: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 27f86: 81 e0 ldi r24, 0x01 ; 1 27f88: 88 83 st Y, r24 } 27f8a: df 91 pop r29 27f8c: cf 91 pop r28 27f8e: 08 95 ret 00027f90 : } static uint8_t twi_wait(uint8_t status) { 27f90: 1f 93 push r17 27f92: cf 93 push r28 27f94: df 93 push r29 27f96: 00 d0 rcall .+0 ; 0x27f98 27f98: cd b7 in r28, 0x3d ; 61 27f9a: de b7 in r29, 0x3e ; 62 27f9c: 18 2f mov r17, r24 ShortTimer timmy; 27f9e: 19 82 std Y+1, r1 ; 0x01 27fa0: 1b 82 std Y+3, r1 ; 0x03 27fa2: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 27fa4: ce 01 movw r24, r28 27fa6: 01 96 adiw r24, 0x01 ; 1 27fa8: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> while(!(TWCR & _BV(TWINT))) { 27fac: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 27fb0: 87 fd sbrc r24, 7 27fb2: 0a c0 rjmp .+20 ; 0x27fc8 if (timmy.expired(TWI_TIMEOUT_MS)) { 27fb4: 6a e0 ldi r22, 0x0A ; 10 27fb6: 70 e0 ldi r23, 0x00 ; 0 27fb8: ce 01 movw r24, r28 27fba: 01 96 adiw r24, 0x01 ; 1 27fbc: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 27fc0: 88 23 and r24, r24 27fc2: a1 f3 breq .-24 ; 0x27fac return 2; 27fc4: 82 e0 ldi r24, 0x02 ; 2 27fc6: 09 c0 rjmp .+18 ; 0x27fda } } if(TW_STATUS != status) 27fc8: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 27fcc: 88 7f andi r24, 0xF8 ; 248 27fce: 18 17 cp r17, r24 27fd0: 59 f0 breq .+22 ; 0x27fe8 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 27fd2: 84 e9 ldi r24, 0x94 ; 148 27fd4: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 27fd8: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 27fda: 0f 90 pop r0 27fdc: 0f 90 pop r0 27fde: 0f 90 pop r0 27fe0: df 91 pop r29 27fe2: cf 91 pop r28 27fe4: 1f 91 pop r17 27fe6: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 27fe8: 80 e0 ldi r24, 0x00 ; 0 27fea: f7 cf rjmp .-18 ; 0x27fda 00027fec : } return standstill; } void tmc2130_check_overtemp() { 27fec: 1f 93 push r17 27fee: cf 93 push r28 27ff0: df 93 push r29 27ff2: 00 d0 rcall .+0 ; 0x27ff4 27ff4: 1f 92 push r1 27ff6: cd b7 in r28, 0x3d ; 61 27ff8: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 27ffa: 68 ee ldi r22, 0xE8 ; 232 27ffc: 73 e0 ldi r23, 0x03 ; 3 27ffe: 8e e3 ldi r24, 0x3E ; 62 28000: 96 e0 ldi r25, 0x06 ; 6 28002: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired_cont(unsigned short)> 28006: 88 23 and r24, r24 28008: 91 f1 breq .+100 ; 0x2806e { for (uint_least8_t i = 0; i < 4; i++) 2800a: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 2800c: 19 82 std Y+1, r1 ; 0x01 2800e: 1a 82 std Y+2, r1 ; 0x02 28010: 1b 82 std Y+3, r1 ; 0x03 28012: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 28014: ae 01 movw r20, r28 28016: 4f 5f subi r20, 0xFF ; 255 28018: 5f 4f sbci r21, 0xFF ; 255 2801a: 6f e6 ldi r22, 0x6F ; 111 2801c: 81 2f mov r24, r17 2801e: 0f 94 7c 39 call 0x272f8 ; 0x272f8 if (drv_status & ((uint32_t)1 << 26)) 28022: 89 81 ldd r24, Y+1 ; 0x01 28024: 9a 81 ldd r25, Y+2 ; 0x02 28026: ab 81 ldd r26, Y+3 ; 0x03 28028: bc 81 ldd r27, Y+4 ; 0x04 2802a: b2 ff sbrs r27, 2 2802c: 19 c0 rjmp .+50 ; 0x28060 { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 2802e: 81 ed ldi r24, 0xD1 ; 209 28030: 9e e6 ldi r25, 0x6E ; 110 28032: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 28036: 81 2f mov r24, r17 28038: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 2803c: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 28040: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 28042: 20 e0 ldi r18, 0x00 ; 0 28044: 30 e0 ldi r19, 0x00 ; 0 28046: 41 e0 ldi r20, 0x01 ; 1 28048: 50 e0 ldi r21, 0x00 ; 0 2804a: 6c ee ldi r22, 0xEC ; 236 2804c: 81 2f mov r24, r17 2804e: 0f 94 d6 39 call 0x273ac ; 0x273ac 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++) 28052: 1f 5f subi r17, 0xFF ; 255 28054: 14 30 cpi r17, 0x04 ; 4 28056: a9 f7 brne .-22 ; 0x28042 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 28058: 81 ed ldi r24, 0xD1 ; 209 2805a: 9e e6 ldi r25, 0x6E ; 110 2805c: 0e 94 a6 7b call 0xf74c ; 0xf74c void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 28060: 1f 5f subi r17, 0xFF ; 255 28062: 14 30 cpi r17, 0x04 ; 4 28064: 99 f6 brne .-90 ; 0x2800c tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 28066: 8e e3 ldi r24, 0x3E ; 62 28068: 96 e0 ldi r25, 0x06 ; 6 2806a: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> } } 2806e: 0f 90 pop r0 28070: 0f 90 pop r0 28072: 0f 90 pop r0 28074: 0f 90 pop r0 28076: df 91 pop r29 28078: cf 91 pop r28 2807a: 1f 91 pop r17 2807c: 08 95 ret 0002807e ::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) 2807e: 8f 92 push r8 28080: 9f 92 push r9 28082: af 92 push r10 28084: bf 92 push r11 28086: cf 92 push r12 28088: df 92 push r13 2808a: ef 92 push r14 2808c: ff 92 push r15 2808e: 1f 93 push r17 28090: cf 93 push r28 28092: df 93 push r29 { if (!m_isRunning) return false; 28094: fc 01 movw r30, r24 28096: 10 81 ld r17, Z 28098: 11 11 cpse r17, r1 2809a: 0e c0 rjmp .+28 ; 0x280b8 ::expired(unsigned long)+0x3a> 2809c: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 2809e: 81 2f mov r24, r17 280a0: df 91 pop r29 280a2: cf 91 pop r28 280a4: 1f 91 pop r17 280a6: ff 90 pop r15 280a8: ef 90 pop r14 280aa: df 90 pop r13 280ac: cf 90 pop r12 280ae: bf 90 pop r11 280b0: af 90 pop r10 280b2: 9f 90 pop r9 280b4: 8f 90 pop r8 280b6: 08 95 ret 280b8: 6a 01 movw r12, r20 280ba: 7b 01 movw r14, r22 280bc: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 280be: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 280c2: 4b 01 movw r8, r22 280c4: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 280c6: 89 81 ldd r24, Y+1 ; 0x01 280c8: 9a 81 ldd r25, Y+2 ; 0x02 280ca: ab 81 ldd r26, Y+3 ; 0x03 280cc: bc 81 ldd r27, Y+4 ; 0x04 280ce: c8 0e add r12, r24 280d0: d9 1e adc r13, r25 280d2: ea 1e adc r14, r26 280d4: fb 1e adc r15, r27 280d6: c8 16 cp r12, r24 280d8: d9 06 cpc r13, r25 280da: ea 06 cpc r14, r26 280dc: fb 06 cpc r15, r27 280de: 60 f0 brcs .+24 ; 0x280f8 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 280e0: 8c 14 cp r8, r12 280e2: 9d 04 cpc r9, r13 280e4: ae 04 cpc r10, r14 280e6: bf 04 cpc r11, r15 280e8: 28 f4 brcc .+10 ; 0x280f4 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 280ea: 88 16 cp r8, r24 280ec: 99 06 cpc r9, r25 280ee: aa 06 cpc r10, r26 280f0: bb 06 cpc r11, r27 280f2: a0 f6 brcc .-88 ; 0x2809c ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 280f4: 18 82 st Y, r1 280f6: d3 cf rjmp .-90 ; 0x2809e ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 280f8: 8c 14 cp r8, r12 280fa: 9d 04 cpc r9, r13 280fc: ae 04 cpc r10, r14 280fe: bf 04 cpc r11, r15 28100: a0 f7 brcc .-24 ; 0x280ea ::expired(unsigned long)+0x6c> 28102: cc cf rjmp .-104 ; 0x2809c ::expired(unsigned long)+0x1e> 00028104 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 28104: 0f 93 push r16 28106: 1f 93 push r17 28108: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 2810a: 80 91 db 03 lds r24, 0x03DB ; 0x8003db 2810e: 88 23 and r24, r24 28110: 09 f4 brne .+2 ; 0x28114 28112: 4d c0 rjmp .+154 ; 0x281ae heating_status_counter++; 28114: 80 91 45 06 lds r24, 0x0645 ; 0x800645 28118: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 2811a: 8e 30 cpi r24, 0x0E ; 14 2811c: b0 f4 brcc .+44 ; 0x2814a //! @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++; 2811e: 80 93 45 06 sts 0x0645, r24 ; 0x800645 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 28122: 63 e0 ldi r22, 0x03 ; 3 28124: 87 e0 ldi r24, 0x07 ; 7 28126: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_space(13); 2812a: 8d e0 ldi r24, 0x0D ; 13 2812c: 0e 94 9c 6f call 0xdf38 ; 0xdf38 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 28130: c0 e0 ldi r28, 0x00 ; 0 28132: 80 91 45 06 lds r24, 0x0645 ; 0x800645 28136: c8 17 cp r28, r24 28138: 58 f4 brcc .+22 ; 0x28150 lcd_putc_at(7 + dots, 3, '.'); 2813a: 4e e2 ldi r20, 0x2E ; 46 2813c: 63 e0 ldi r22, 0x03 ; 3 2813e: 87 e0 ldi r24, 0x07 ; 7 28140: 8c 0f add r24, r28 28142: 0e 94 c6 6f call 0xdf8c ; 0xdf8c heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 28146: cf 5f subi r28, 0xFF ; 255 28148: f4 cf rjmp .-24 ; 0x28132 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; 2814a: 10 92 45 06 sts 0x0645, r1 ; 0x800645 2814e: e9 cf rjmp .-46 ; 0x28122 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 28150: 80 91 db 03 lds r24, 0x03DB ; 0x8003db 28154: 82 30 cpi r24, 0x02 ; 2 28156: d1 f0 breq .+52 ; 0x2818c 28158: 30 f4 brcc .+12 ; 0x28166 2815a: 81 30 cpi r24, 0x01 ; 1 2815c: 59 f0 breq .+22 ; 0x28174 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2815e: cf 91 pop r28 28160: 1f 91 pop r17 28162: 0f 91 pop r16 28164: 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) { 28166: 83 30 cpi r24, 0x03 ; 3 28168: f9 f0 breq .+62 ; 0x281a8 2816a: 84 30 cpi r24, 0x04 ; 4 2816c: c1 f7 brne .-16 ; 0x2815e 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)); 2816e: 83 ee ldi r24, 0xE3 ; 227 28170: 99 e4 ldi r25, 0x49 ; 73 28172: 0e c0 rjmp .+28 ; 0x28190 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)); 28174: 8c e0 ldi r24, 0x0C ; 12 28176: 9a e4 ldi r25, 0x4A ; 74 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 28178: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2817c: ac 01 movw r20, r24 2817e: 63 e0 ldi r22, 0x03 ; 3 28180: 80 e0 ldi r24, 0x00 ; 0 break; } } } 28182: cf 91 pop r28 28184: 1f 91 pop r17 28186: 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)); 28188: 0c 94 ba 6f jmp 0xdf74 ; 0xdf74 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)); 2818c: 8c ef ldi r24, 0xFC ; 252 2818e: 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)); 28190: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 28194: ac 01 movw r20, r24 28196: 63 e0 ldi r22, 0x03 ; 3 28198: 80 e0 ldi r24, 0x00 ; 0 2819a: 0e 94 ba 6f call 0xdf74 ; 0xdf74 heating_status = HeatingStatus::NO_HEATING; 2819e: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db heating_status_counter = 0; 281a2: 10 92 45 06 sts 0x0645, r1 ; 0x800645 281a6: db cf rjmp .-74 ; 0x2815e 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)); 281a8: 8e ee ldi r24, 0xEE ; 238 281aa: 99 e4 ldi r25, 0x49 ; 73 281ac: e5 cf rjmp .-54 ; 0x28178 #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) && 281ae: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 281b2: 88 23 and r24, r24 281b4: 61 f1 breq .+88 ; 0x2820e } else if (((IS_SD_PRINTING) #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && 281b6: 80 91 72 07 lds r24, 0x0772 ; 0x800772 281ba: 81 11 cpse r24, r1 281bc: 28 c0 rjmp .+80 ; 0x2820e (custom_message_type == CustomMsg::Status) && 281be: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> 281c2: 82 30 cpi r24, 0x02 ; 2 281c4: 20 f5 brcc .+72 ; 0x2820e } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 281c6: 80 91 4c 05 lds r24, 0x054C ; 0x80054c <_ZL26lcd_status_message_timeout.lto_priv.466> 281ca: 81 11 cpse r24, r1 281cc: 16 c0 rjmp .+44 ; 0x281fa (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); 281ce: 80 91 82 14 lds r24, 0x1482 ; 0x801482 281d2: 88 23 and r24, r24 281d4: 09 f4 brne .+2 ; 0x281d8 281d6: 35 c0 rjmp .+106 ; 0x28242 281d8: 82 e8 ldi r24, 0x82 ; 130 281da: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 281dc: 20 91 65 0e lds r18, 0x0E65 ; 0x800e65 281e0: 64 e1 ldi r22, 0x14 ; 20 281e2: 82 0f add r24, r18 281e4: 91 1d adc r25, r1 281e6: 0e 94 95 71 call 0xe32a ; 0xe32a 281ea: 81 11 cpse r24, r1 281ec: 2d c0 rjmp .+90 ; 0x28248 { scrollstuff++; 281ee: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 281f2: 8f 5f subi r24, 0xFF ; 255 281f4: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 281f8: b2 cf rjmp .-156 ; 0x2815e 281fa: 40 e2 ldi r20, 0x20 ; 32 281fc: 5e e4 ldi r21, 0x4E ; 78 281fe: 60 e0 ldi r22, 0x00 ; 0 28200: 70 e0 ldi r23, 0x00 ; 0 28202: 8c e4 ldi r24, 0x4C ; 76 28204: 95 e0 ldi r25, 0x05 ; 5 28206: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 2820a: 81 11 cpse r24, r1 2820c: e0 cf rjmp .-64 ; 0x281ce 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) 2820e: 80 91 72 07 lds r24, 0x0772 ; 0x800772 28212: 81 11 cpse r24, r1 28214: 1c c0 rjmp .+56 ; 0x2824e { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 28216: e0 91 72 07 lds r30, 0x0772 ; 0x800772 2821a: ea 30 cpi r30, 0x0A ; 10 2821c: 08 f0 brcs .+2 ; 0x28220 2821e: 9f cf rjmp .-194 ; 0x2815e 28220: f0 e0 ldi r31, 0x00 ; 0 28222: 88 27 eor r24, r24 28224: e9 5e subi r30, 0xE9 ; 233 28226: fe 4b sbci r31, 0xBE ; 190 28228: 8e 4f sbci r24, 0xFE ; 254 2822a: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 2822e: ca 3a cpi r28, 0xAA ; 170 28230: 6e 3b cpi r22, 0xBE ; 190 28232: ca 3a cpi r28, 0xAA ; 170 28234: a6 39 cpi r26, 0x96 ; 150 28236: 2a 3b cpi r18, 0xBA ; 186 28238: f2 39 cpi r31, 0x92 ; 146 2823a: ca 3a cpi r28, 0xAA ; 170 2823c: ca 3a cpi r28, 0xAA ; 170 2823e: 7a 3b cpi r23, 0xBA ; 186 28240: ca 3a cpi r28, 0xAA ; 170 (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); 28242: 8d e6 ldi r24, 0x6D ; 109 28244: 94 e1 ldi r25, 0x14 ; 20 28246: ca cf rjmp .-108 ; 0x281dc if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 28248: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 2824c: 88 cf rjmp .-240 ; 0x2815e } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 2824e: 80 91 4c 05 lds r24, 0x054C ; 0x80054c <_ZL26lcd_status_message_timeout.lto_priv.466> 28252: 88 23 and r24, r24 28254: 01 f3 breq .-64 ; 0x28216 * 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; 28256: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2825a: 00 91 4d 05 lds r16, 0x054D ; 0x80054d <_ZL26lcd_status_message_timeout.lto_priv.466+0x1> 2825e: 10 91 4e 05 lds r17, 0x054E ; 0x80054e <_ZL26lcd_status_message_timeout.lto_priv.466+0x2> 28262: 20 91 4f 05 lds r18, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.466+0x3> 28266: 30 91 50 05 lds r19, 0x0550 ; 0x800550 <_ZL26lcd_status_message_timeout.lto_priv.466+0x4> 2826a: 60 1b sub r22, r16 2826c: 71 0b sbc r23, r17 2826e: 82 0b sbc r24, r18 28270: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 28272: 60 3a cpi r22, 0xA0 ; 160 28274: 7f 40 sbci r23, 0x0F ; 15 28276: 81 05 cpc r24, r1 28278: 91 05 cpc r25, r1 2827a: 68 f6 brcc .-102 ; 0x28216 2827c: 70 cf rjmp .-288 ; 0x2815e 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); 2827e: 63 e0 ldi r22, 0x03 ; 3 28280: 80 91 36 05 lds r24, 0x0536 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.463> 28284: 0e 94 a6 6f call 0xdf4c ; 0xdf4c const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 28288: 80 91 36 05 lds r24, 0x0536 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.463> 2828c: c4 e1 ldi r28, 0x14 ; 20 2828e: 6c 2f mov r22, r28 28290: 68 1b sub r22, r24 28292: 90 e0 ldi r25, 0x00 ; 0 28294: 89 5c subi r24, 0xC9 ; 201 28296: 9a 4f sbci r25, 0xFA ; 250 28298: 0e 94 95 71 call 0xe32a ; 0xe32a lcd_status_message_idx = LCD_WIDTH - padding; 2829c: c8 1b sub r28, r24 2829e: c0 93 36 05 sts 0x0536, r28 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.463> 282a2: 5d cf rjmp .-326 ; 0x2815e } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 282a4: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 282a8: 8b 30 cpi r24, 0x0B ; 11 282aa: 08 f1 brcs .+66 ; 0x282ee lcd_set_cursor(0, 3); 282ac: 63 e0 ldi r22, 0x03 ; 3 282ae: 80 e0 ldi r24, 0x00 ; 0 282b0: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_space(LCD_WIDTH); 282b4: 84 e1 ldi r24, 0x14 ; 20 282b6: 0e 94 9c 6f call 0xdf38 ; 0xdf38 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 282ba: 83 ed ldi r24, 0xD3 ; 211 282bc: 99 e4 ldi r25, 0x49 ; 73 282be: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 282c2: ac 01 movw r20, r24 282c4: 63 e0 ldi r22, 0x03 ; 3 282c6: 80 e0 ldi r24, 0x00 ; 0 282c8: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_P(PSTR(" : ")); 282cc: 8d ef ldi r24, 0xFD ; 253 282ce: 90 ea ldi r25, 0xA0 ; 160 282d0: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_print(custom_message_state - 10); 282d4: 60 91 f0 03 lds r22, 0x03F0 ; 0x8003f0 282d8: 6a 50 subi r22, 0x0A ; 10 282da: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 282dc: 07 2e mov r0, r23 282de: 00 0c add r0, r0 282e0: 88 0b sbc r24, r24 282e2: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 282e4: cf 91 pop r28 282e6: 1f 91 pop r17 282e8: 0f 91 pop r16 282ea: 0c 94 5f 71 jmp 0xe2be ; 0xe2be 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) { 282ee: 83 30 cpi r24, 0x03 ; 3 282f0: 31 f4 brne .+12 ; 0x282fe lcd_setstatuspgm(MSG_WELCOME); 282f2: 8d ea ldi r24, 0xAD ; 173 282f4: 90 e7 ldi r25, 0x70 ; 112 282f6: 0f 94 be 0b call 0x2177c ; 0x2177c custom_message_type = CustomMsg::Status; 282fa: 10 92 72 07 sts 0x0772, r1 ; 0x800772 } if (custom_message_state > 3 && custom_message_state <= 10) { 282fe: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 28302: 84 50 subi r24, 0x04 ; 4 28304: 87 30 cpi r24, 0x07 ; 7 28306: 08 f0 brcs .+2 ; 0x2830a 28308: 2a cf rjmp .-428 ; 0x2815e lcd_set_cursor(0, 3); 2830a: 63 e0 ldi r22, 0x03 ; 3 2830c: 80 e0 ldi r24, 0x00 ; 0 2830e: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_space(19); 28312: 83 e1 ldi r24, 0x13 ; 19 28314: 0e 94 9c 6f call 0xdf38 ; 0xdf38 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 28318: 80 ec ldi r24, 0xC0 ; 192 2831a: 99 e4 ldi r25, 0x49 ; 73 2831c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 28320: ac 01 movw r20, r24 28322: 63 e0 ldi r22, 0x03 ; 3 28324: 80 e0 ldi r24, 0x00 ; 0 28326: 0e 94 ba 6f call 0xdf74 ; 0xdf74 custom_message_state--; 2832a: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 2832e: 81 50 subi r24, 0x01 ; 1 28330: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 28334: 14 cf rjmp .-472 ; 0x2815e } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 28336: 64 e1 ldi r22, 0x14 ; 20 28338: 87 e3 ldi r24, 0x37 ; 55 2833a: 95 e0 ldi r25, 0x05 ; 5 2833c: 0e 94 95 71 call 0xe32a ; 0xe32a if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 28340: 20 91 43 06 lds r18, 0x0643 ; 0x800643 28344: 30 91 44 06 lds r19, 0x0644 ; 0x800644 28348: 80 91 41 06 lds r24, 0x0641 ; 0x800641 2834c: 90 91 42 06 lds r25, 0x0642 ; 0x800642 28350: 82 17 cp r24, r18 28352: 93 07 cpc r25, r19 28354: 0c f4 brge .+2 ; 0x28358 28356: 03 cf rjmp .-506 ; 0x2815e 28358: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 2835c: 88 23 and r24, r24 2835e: 09 f4 brne .+2 ; 0x28362 28360: fe ce rjmp .-516 ; 0x2815e lcd_set_cursor(10, 3); 28362: 63 e0 ldi r22, 0x03 ; 3 28364: 8a e0 ldi r24, 0x0A ; 10 28366: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 2836a: 80 91 42 06 lds r24, 0x0642 ; 0x800642 2836e: 8f 93 push r24 28370: 80 91 41 06 lds r24, 0x0641 ; 0x800641 28374: 8f 93 push r24 28376: 80 91 44 06 lds r24, 0x0644 ; 0x800644 2837a: 8f 93 push r24 2837c: 80 91 43 06 lds r24, 0x0643 ; 0x800643 28380: 8f 93 push r24 28382: 84 ef ldi r24, 0xF4 ; 244 28384: 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); 28386: 9f 93 push r25 28388: 8f 93 push r24 2838a: 0e 94 7f 6f call 0xdefe ; 0xdefe 2838e: 0f 90 pop r0 28390: 0f 90 pop r0 28392: 0f 90 pop r0 28394: 0f 90 pop r0 28396: 0f 90 pop r0 28398: 0f 90 pop r0 2839a: e1 ce rjmp .-574 ; 0x2815e 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); 2839c: 63 e0 ldi r22, 0x03 ; 3 2839e: 80 e0 ldi r24, 0x00 ; 0 283a0: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 283a4: c0 91 f0 03 lds r28, 0x03F0 ; 0x8003f0 283a8: 82 e3 ldi r24, 0x32 ; 50 283aa: 9a e3 ldi r25, 0x3A ; 58 283ac: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 283b0: 1f 92 push r1 283b2: cf 93 push r28 283b4: 9f 93 push r25 283b6: 8f 93 push r24 283b8: 86 ee ldi r24, 0xE6 ; 230 283ba: 90 ea ldi r25, 0xA0 ; 160 283bc: e4 cf rjmp .-56 ; 0x28386 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 283be: 80 eb ldi r24, 0xB0 ; 176 283c0: 99 e4 ldi r25, 0x49 ; 73 283c2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 283c6: ac 01 movw r20, r24 283c8: 63 e0 ldi r22, 0x03 ; 3 283ca: 80 e0 ldi r24, 0x00 ; 0 283cc: 0e 94 ba 6f call 0xdf74 ; 0xdf74 if (custom_message_state <= PINDA_HEAT_T) { 283d0: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 283d4: 89 37 cpi r24, 0x79 ; 121 283d6: 08 f0 brcs .+2 ; 0x283da 283d8: c2 ce rjmp .-636 ; 0x2815e lcd_puts_P(PSTR(": ")); 283da: 83 ee ldi r24, 0xE3 ; 227 283dc: 90 ea ldi r25, 0xA0 ; 160 283de: 0e 94 91 6f call 0xdf22 ; 0xdf22 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 283e2: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 283e6: 0e 94 55 70 call 0xe0aa ; 0xe0aa } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 283ea: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 283ec: cf 91 pop r28 283ee: 1f 91 pop r17 283f0: 0f 91 pop r16 283f2: 0c 94 55 70 jmp 0xe0aa ; 0xe0aa lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 283f6: 8f e9 ldi r24, 0x9F ; 159 283f8: 99 e4 ldi r25, 0x49 ; 73 283fa: be ce rjmp .-644 ; 0x28178 000283fc ::start()>: /** * @brief Start timer */ template void Timer::start() 283fc: cf 93 push r28 283fe: df 93 push r29 28400: ec 01 movw r28, r24 { m_started = _millis(); 28402: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 28406: 69 83 std Y+1, r22 ; 0x01 28408: 7a 83 std Y+2, r23 ; 0x02 2840a: 8b 83 std Y+3, r24 ; 0x03 2840c: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 2840e: 81 e0 ldi r24, 0x01 ; 1 28410: 88 83 st Y, r24 } 28412: df 91 pop r29 28414: cf 91 pop r28 28416: 08 95 ret 00028418 : //! 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) { 28418: cf 92 push r12 2841a: df 92 push r13 2841c: ff 92 push r15 2841e: 0f 93 push r16 28420: 1f 93 push r17 28422: cf 93 push r28 28424: df 93 push r29 28426: cd b7 in r28, 0x3d ; 61 28428: de b7 in r29, 0x3e ; 62 2842a: 64 97 sbiw r28, 0x14 ; 20 2842c: 0f b6 in r0, 0x3f ; 63 2842e: f8 94 cli 28430: de bf out 0x3e, r29 ; 62 28432: 0f be out 0x3f, r0 ; 63 28434: cd bf out 0x3d, r28 ; 61 28436: 8c 01 movw r16, r24 28438: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 2843a: 67 ef ldi r22, 0xF7 ; 247 2843c: 7e e9 ldi r23, 0x9E ; 158 2843e: ce 01 movw r24, r28 28440: 01 96 adiw r24, 0x01 ; 1 28442: 0f 94 fd da call 0x3b5fa ; 0x3b5fa strcat_P(msg, type); 28446: b8 01 movw r22, r16 28448: ce 01 movw r24, r28 2844a: 01 96 adiw r24, 0x01 ; 1 2844c: 0f 94 e9 da call 0x3b5d2 ; 0x3b5d2 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 28450: 83 e0 ldi r24, 0x03 ; 3 28452: 0f 94 85 06 call 0x20d0a ; 0x20d0a 28456: 88 23 and r24, r24 28458: e1 f0 breq .+56 ; 0x28492 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 2845a: be 01 movw r22, r28 2845c: 6f 5f subi r22, 0xFF ; 255 2845e: 7f 4f sbci r23, 0xFF ; 255 28460: 87 e3 ldi r24, 0x37 ; 55 28462: 95 e0 ldi r25, 0x05 ; 5 28464: 0f 94 a8 e3 call 0x3c750 ; 0x3c750 28468: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 2846a: 8c e4 ldi r24, 0x4C ; 76 2846c: 95 e0 ldi r25, 0x05 ; 5 2846e: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> lcd_status_message_level = severity; 28472: 83 e0 ldi r24, 0x03 ; 3 28474: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> custom_message_type = CustomMsg::Status; 28478: 10 92 72 07 sts 0x0772, r1 ; 0x800772 custom_message_state = 0; 2847c: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 if (!same) { 28480: cd 28 or r12, r13 28482: 39 f0 breq .+14 ; 0x28492 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 28484: 60 e0 ldi r22, 0x00 ; 0 28486: ce 01 movw r24, r28 28488: 01 96 adiw r24, 0x01 ; 1 2848a: 0f 94 6a 06 call 0x20cd4 ; 0x20cd4 lcd_return_to_status(); 2848e: 0f 94 23 27 call 0x24e46 ; 0x24e46 lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 28492: 8c ee ldi r24, 0xEC ; 236 28494: 99 ea ldi r25, 0xA9 ; 169 28496: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if(e != EXTRUDERS) { 2849a: 81 e0 ldi r24, 0x01 ; 1 2849c: f8 16 cp r15, r24 2849e: 49 f0 breq .+18 ; 0x284b2 284a0: 60 e0 ldi r22, 0x00 ; 0 284a2: 70 e0 ldi r23, 0x00 ; 0 284a4: cb 01 movw r24, r22 284a6: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 284aa: 84 ef ldi r24, 0xF4 ; 244 284ac: 9e e9 ldi r25, 0x9E ; 158 284ae: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } SERIAL_ERRORPGM("Heaters switched off. "); 284b2: 8d ed ldi r24, 0xDD ; 221 284b4: 9e e9 ldi r25, 0x9E ; 158 284b6: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORRPGM(type); 284ba: c8 01 movw r24, r16 284bc: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORLNPGM(" triggered!"); 284c0: 81 ed ldi r24, 0xD1 ; 209 284c2: 9e e9 ldi r25, 0x9E ; 158 284c4: 0e 94 17 7b call 0xf62e ; 0xf62e } 284c8: 64 96 adiw r28, 0x14 ; 20 284ca: 0f b6 in r0, 0x3f ; 63 284cc: f8 94 cli 284ce: de bf out 0x3e, r29 ; 62 284d0: 0f be out 0x3f, r0 ; 63 284d2: cd bf out 0x3d, r28 ; 61 284d4: df 91 pop r29 284d6: cf 91 pop r28 284d8: 1f 91 pop r17 284da: 0f 91 pop r16 284dc: ff 90 pop r15 284de: df 90 pop r13 284e0: cf 90 pop r12 284e2: 08 95 ret 000284e4 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 284e4: 1f 92 push r1 284e6: 0f 92 push r0 284e8: 0f b6 in r0, 0x3f ; 63 284ea: 0f 92 push r0 284ec: 11 24 eor r1, r1 284ee: 2f 93 push r18 284f0: 3f 93 push r19 284f2: 8f 93 push r24 284f4: 9f 93 push r25 284f6: af 93 push r26 284f8: 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; 284fa: 80 91 35 06 lds r24, 0x0635 ; 0x800635 284fe: 90 91 36 06 lds r25, 0x0636 ; 0x800636 28502: a0 91 37 06 lds r26, 0x0637 ; 0x800637 28506: b0 91 38 06 lds r27, 0x0638 ; 0x800638 unsigned char f = timer2_fract; 2850a: 30 91 34 06 lds r19, 0x0634 ; 0x800634 m += MILLIS_INC; f += FRACT_INC; 2850e: 23 e0 ldi r18, 0x03 ; 3 28510: 23 0f add r18, r19 if (f >= FRACT_MAX) 28512: 2d 37 cpi r18, 0x7D ; 125 28514: 58 f5 brcc .+86 ; 0x2856c <__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; 28516: 01 96 adiw r24, 0x01 ; 1 28518: a1 1d adc r26, r1 2851a: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 2851c: 20 93 34 06 sts 0x0634, r18 ; 0x800634 timer2_millis = m; 28520: 80 93 35 06 sts 0x0635, r24 ; 0x800635 28524: 90 93 36 06 sts 0x0636, r25 ; 0x800636 28528: a0 93 37 06 sts 0x0637, r26 ; 0x800637 2852c: b0 93 38 06 sts 0x0638, r27 ; 0x800638 timer2_overflow_count++; 28530: 80 91 39 06 lds r24, 0x0639 ; 0x800639 28534: 90 91 3a 06 lds r25, 0x063A ; 0x80063a 28538: a0 91 3b 06 lds r26, 0x063B ; 0x80063b 2853c: b0 91 3c 06 lds r27, 0x063C ; 0x80063c 28540: 01 96 adiw r24, 0x01 ; 1 28542: a1 1d adc r26, r1 28544: b1 1d adc r27, r1 28546: 80 93 39 06 sts 0x0639, r24 ; 0x800639 2854a: 90 93 3a 06 sts 0x063A, r25 ; 0x80063a 2854e: a0 93 3b 06 sts 0x063B, r26 ; 0x80063b 28552: b0 93 3c 06 sts 0x063C, r27 ; 0x80063c } 28556: bf 91 pop r27 28558: af 91 pop r26 2855a: 9f 91 pop r25 2855c: 8f 91 pop r24 2855e: 3f 91 pop r19 28560: 2f 91 pop r18 28562: 0f 90 pop r0 28564: 0f be out 0x3f, r0 ; 63 28566: 0f 90 pop r0 28568: 1f 90 pop r1 2856a: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 2856c: 26 e8 ldi r18, 0x86 ; 134 2856e: 23 0f add r18, r19 m += 1; 28570: 02 96 adiw r24, 0x02 ; 2 28572: a1 1d adc r26, r1 28574: b1 1d adc r27, r1 28576: d2 cf rjmp .-92 ; 0x2851c <__vector_15+0x38> 00028578 : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 28578: 2f 92 push r2 2857a: 3f 92 push r3 2857c: 4f 92 push r4 2857e: 5f 92 push r5 28580: 6f 92 push r6 28582: 7f 92 push r7 28584: 8f 92 push r8 28586: 9f 92 push r9 28588: af 92 push r10 2858a: bf 92 push r11 2858c: cf 92 push r12 2858e: df 92 push r13 28590: ef 92 push r14 28592: ff 92 push r15 28594: 0f 93 push r16 28596: 1f 93 push r17 28598: cf 93 push r28 2859a: df 93 push r29 2859c: 00 d0 rcall .+0 ; 0x2859e 2859e: 00 d0 rcall .+0 ; 0x285a0 285a0: 1f 92 push r1 285a2: cd b7 in r28, 0x3d ; 61 285a4: de b7 in r29, 0x3e ; 62 285a6: 9c 83 std Y+4, r25 ; 0x04 285a8: 8b 83 std Y+3, r24 ; 0x03 285aa: 0d 83 std Y+5, r16 ; 0x05 285ac: 26 01 movw r4, r12 285ae: 37 01 movw r6, r14 *var = v; 285b0: fb 01 movw r30, r22 285b2: 20 83 st Z, r18 285b4: 31 83 std Z+1, r19 ; 0x01 285b6: 42 83 std Z+2, r20 ; 0x02 285b8: 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); 285ba: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 285be: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 285c2: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 285c6: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 285ca: 61 e7 ldi r22, 0x71 ; 113 285cc: 7d e3 ldi r23, 0x3D ; 61 285ce: 8a e8 ldi r24, 0x8A ; 138 285d0: 9e e3 ldi r25, 0x3E ; 62 285d2: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 285d6: 60 93 18 13 sts 0x1318, r22 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 285da: 70 93 19 13 sts 0x1319, r23 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 285de: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 285e2: 90 93 1b 13 sts 0x131B, r25 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> warn_s = warn * TEMP_MGR_INTV; 285e6: 21 e7 ldi r18, 0x71 ; 113 285e8: 3d e3 ldi r19, 0x3D ; 61 285ea: 4a e8 ldi r20, 0x8A ; 138 285ec: 5e e3 ldi r21, 0x3E ; 62 285ee: 60 91 0f 13 lds r22, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 285f2: 70 91 10 13 lds r23, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 285f6: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 285fa: 90 91 12 13 lds r25, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 285fe: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 28602: 60 93 1c 13 sts 0x131C, r22 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 28606: 70 93 1d 13 sts 0x131D, r23 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 2860a: 80 93 1e 13 sts 0x131E, r24 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 2860e: 90 93 1f 13 sts 0x131F, r25 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> err_s = err * TEMP_MGR_INTV; 28612: 21 e7 ldi r18, 0x71 ; 113 28614: 3d e3 ldi r19, 0x3D ; 61 28616: 4a e8 ldi r20, 0x8A ; 138 28618: 5e e3 ldi r21, 0x3E ; 62 2861a: 60 91 13 13 lds r22, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 2861e: 70 91 14 13 lds r23, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 28622: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 28626: 90 91 16 13 lds r25, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 2862a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2862e: 60 93 20 13 sts 0x1320, r22 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 28632: 70 93 21 13 sts 0x1321, r23 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 28636: 80 93 22 13 sts 0x1322, r24 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 2863a: 90 93 23 13 sts 0x1323, r25 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 2863e: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 28642: 90 91 ca 12 lds r25, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 28646: 6e e0 ldi r22, 0x0E ; 14 28648: 71 e0 ldi r23, 0x01 ; 1 2864a: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 2864e: 60 93 ab 12 sts 0x12AB, r22 ; 0x8012ab <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 28652: eb e8 ldi r30, 0x8B ; 139 28654: 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; 28656: 80 e0 ldi r24, 0x00 ; 0 28658: 90 e0 ldi r25, 0x00 ; 0 2865a: a0 ec ldi r26, 0xC0 ; 192 2865c: bf e7 ldi r27, 0x7F ; 127 2865e: 81 93 st Z+, r24 28660: 91 93 st Z+, r25 28662: a1 93 st Z+, r26 28664: 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) 28666: 22 e1 ldi r18, 0x12 ; 18 28668: eb 3a cpi r30, 0xAB ; 171 2866a: f2 07 cpc r31, r18 2866c: c1 f7 brne .-16 ; 0x2865e dT_lag_buf[i] = NAN; dT_lag_idx = 0; 2866e: 10 92 ac 12 sts 0x12AC, r1 ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> dT_err_prev = 0; 28672: 10 92 ad 12 sts 0x12AD, r1 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 28676: 10 92 ae 12 sts 0x12AE, r1 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 2867a: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 2867e: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> T_prev = NAN; 28682: 80 93 b1 12 sts 0x12B1, r24 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 28686: 90 93 b2 12 sts 0x12B2, r25 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 2868a: a0 93 b3 12 sts 0x12B3, r26 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 2868e: b0 93 b4 12 sts 0x12B4, r27 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> // clear the initialization flag flag_bits.uninitialized = false; 28692: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 28696: 8e 7f andi r24, 0xFE ; 254 28698: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 2869c: 83 e7 ldi r24, 0x73 ; 115 2869e: 97 e0 ldi r25, 0x07 ; 7 286a0: 9f 83 std Y+7, r25 ; 0x07 286a2: 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) { 286a4: e1 e0 ldi r30, 0x01 ; 1 286a6: f0 e0 ldi r31, 0x00 ; 0 286a8: fa 83 std Y+2, r31 ; 0x02 286aa: 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; 286ac: 31 2c mov r3, r1 286ae: 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; 286b0: 81 2c mov r8, r1 286b2: 91 2c mov r9, r1 286b4: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 286b6: 29 81 ldd r18, Y+1 ; 0x01 286b8: 3a 81 ldd r19, Y+2 ; 0x02 286ba: 8b 81 ldd r24, Y+3 ; 0x03 286bc: 9c 81 ldd r25, Y+4 ; 0x04 286be: 28 17 cp r18, r24 286c0: 39 07 cpc r19, r25 286c2: c8 f5 brcc .+114 ; 0x28736 thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 286c4: ee 81 ldd r30, Y+6 ; 0x06 286c6: ff 81 ldd r31, Y+7 ; 0x07 286c8: 25 81 ldd r18, Z+5 ; 0x05 286ca: 36 81 ldd r19, Z+6 ; 0x06 286cc: 47 81 ldd r20, Z+7 ; 0x07 286ce: 50 85 ldd r21, Z+8 ; 0x08 286d0: 83 01 movw r16, r6 286d2: 72 01 movw r14, r4 286d4: 6d 81 ldd r22, Y+5 ; 0x05 286d6: 81 85 ldd r24, Z+9 ; 0x09 286d8: 0e 94 c2 db call 0x1b784 ; 0x1b784 float err_v = thermal_model::data.dT_err_prev; 286dc: c0 90 ad 12 lds r12, 0x12AD ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 286e0: d0 90 ae 12 lds r13, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 286e4: e0 90 af 12 lds r14, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 286e8: f0 90 b0 12 lds r15, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> if(!isnan(err_v)) { 286ec: a7 01 movw r20, r14 286ee: 96 01 movw r18, r12 286f0: c7 01 movw r24, r14 286f2: b6 01 movw r22, r12 286f4: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 286f8: 81 11 cpse r24, r1 286fa: 11 c0 rjmp .+34 ; 0x2871e err += err_v * err_v; 286fc: a7 01 movw r20, r14 286fe: 96 01 movw r18, r12 28700: c7 01 movw r24, r14 28702: b6 01 movw r22, r12 28704: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 28708: 9b 01 movw r18, r22 2870a: ac 01 movw r20, r24 2870c: c5 01 movw r24, r10 2870e: b4 01 movw r22, r8 28710: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 28714: 4b 01 movw r8, r22 28716: 5c 01 movw r10, r24 ++cnt; 28718: ff ef ldi r31, 0xFF ; 255 2871a: 2f 1a sub r2, r31 2871c: 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) { 2871e: 29 81 ldd r18, Y+1 ; 0x01 28720: 3a 81 ldd r19, Y+2 ; 0x02 28722: 2f 5f subi r18, 0xFF ; 255 28724: 3f 4f sbci r19, 0xFF ; 255 28726: 3a 83 std Y+2, r19 ; 0x02 28728: 29 83 std Y+1, r18 ; 0x01 2872a: 8e 81 ldd r24, Y+6 ; 0x06 2872c: 9f 81 ldd r25, Y+7 ; 0x07 2872e: 05 96 adiw r24, 0x05 ; 5 28730: 9f 83 std Y+7, r25 ; 0x07 28732: 8e 83 std Y+6, r24 ; 0x06 28734: c0 cf rjmp .-128 ; 0x286b6 if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 28736: 60 e0 ldi r22, 0x00 ; 0 28738: 70 e0 ldi r23, 0x00 ; 0 2873a: 80 ec ldi r24, 0xC0 ; 192 2873c: 9f e7 ldi r25, 0x7F ; 127 2873e: 21 14 cp r2, r1 28740: 31 04 cpc r3, r1 28742: 59 f0 breq .+22 ; 0x2875a 28744: b1 01 movw r22, r2 28746: 90 e0 ldi r25, 0x00 ; 0 28748: 80 e0 ldi r24, 0x00 ; 0 2874a: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 2874e: 9b 01 movw r18, r22 28750: ac 01 movw r20, r24 28752: c5 01 movw r24, r10 28754: b4 01 movw r22, r8 28756: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> } 2875a: 27 96 adiw r28, 0x07 ; 7 2875c: 0f b6 in r0, 0x3f ; 63 2875e: f8 94 cli 28760: de bf out 0x3e, r29 ; 62 28762: 0f be out 0x3f, r0 ; 63 28764: cd bf out 0x3d, r28 ; 61 28766: df 91 pop r29 28768: cf 91 pop r28 2876a: 1f 91 pop r17 2876c: 0f 91 pop r16 2876e: ff 90 pop r15 28770: ef 90 pop r14 28772: df 90 pop r13 28774: cf 90 pop r12 28776: bf 90 pop r11 28778: af 90 pop r10 2877a: 9f 90 pop r9 2877c: 8f 90 pop r8 2877e: 7f 90 pop r7 28780: 6f 90 pop r6 28782: 5f 90 pop r5 28784: 4f 90 pop r4 28786: 3f 90 pop r3 28788: 2f 90 pop r2 2878a: 08 95 ret 0002878c : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 2878c: cf 93 push r28 2878e: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 28790: 0e 94 d4 75 call 0xeba8 ; 0xeba8 fanSpeed = fan_speed; 28794: c0 93 df 03 sts 0x03DF, r28 ; 0x8003df #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 28798: c0 93 9d 04 sts 0x049D, r28 ; 0x80049d #endif } 2879c: cf 91 pop r28 2879e: 08 95 ret 000287a0 : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 287a0: cf 92 push r12 287a2: df 92 push r13 287a4: ef 92 push r14 287a6: ff 92 push r15 287a8: 0f 93 push r16 287aa: 1f 93 push r17 287ac: cf 93 push r28 287ae: df 93 push r29 SERIAL_ECHO_START; 287b0: 84 e1 ldi r24, 0x14 ; 20 287b2: 9a ea ldi r25, 0xAA ; 170 287b4: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNPGM("Thermal Model settings:"); 287b8: 8c e9 ldi r24, 0x9C ; 156 287ba: 9f e9 ldi r25, 0x9F ; 159 287bc: 0e 94 17 7b call 0xf62e ; 0xf62e 287c0: cb ec ldi r28, 0xCB ; 203 287c2: d2 e1 ldi r29, 0x12 ; 18 287c4: 10 e0 ldi r17, 0x00 ; 0 287c6: 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]); 287c8: 84 e1 ldi r24, 0x14 ; 20 287ca: e8 2e mov r14, r24 287cc: 8a ea ldi r24, 0xAA ; 170 287ce: f8 2e mov r15, r24 287d0: 98 e8 ldi r25, 0x88 ; 136 287d2: c9 2e mov r12, r25 287d4: 9f e9 ldi r25, 0x9F ; 159 287d6: d9 2e mov r13, r25 287d8: 88 81 ld r24, Y 287da: 99 81 ldd r25, Y+1 ; 0x01 287dc: 2a 81 ldd r18, Y+2 ; 0x02 287de: 3b 81 ldd r19, Y+3 ; 0x03 287e0: 24 96 adiw r28, 0x04 ; 4 287e2: 3f 93 push r19 287e4: 2f 93 push r18 287e6: 9f 93 push r25 287e8: 8f 93 push r24 287ea: 1f 93 push r17 287ec: 0f 93 push r16 287ee: ff 92 push r15 287f0: ef 92 push r14 287f2: df 92 push r13 287f4: cf 92 push r12 287f6: 0f 94 08 dc call 0x3b810 ; 0x3b810 287fa: 0f 5f subi r16, 0xFF ; 255 287fc: 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) 287fe: 8d b7 in r24, 0x3d ; 61 28800: 9e b7 in r25, 0x3e ; 62 28802: 0a 96 adiw r24, 0x0a ; 10 28804: 0f b6 in r0, 0x3f ; 63 28806: f8 94 cli 28808: 9e bf out 0x3e, r25 ; 62 2880a: 0f be out 0x3f, r0 ; 63 2880c: 8d bf out 0x3d, r24 ; 61 2880e: 00 31 cpi r16, 0x10 ; 16 28810: 11 05 cpc r17, r1 28812: 11 f7 brne .-60 ; 0x287d8 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"), 28814: 80 91 0e 13 lds r24, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 28818: 8f 93 push r24 2881a: 80 91 0d 13 lds r24, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 2881e: 8f 93 push r24 28820: 80 91 0c 13 lds r24, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 28824: 8f 93 push r24 28826: 80 91 0b 13 lds r24, 0x130B ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 2882a: 8f 93 push r24 2882c: 80 91 12 13 lds r24, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 28830: 8f 93 push r24 28832: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 28836: 8f 93 push r24 28838: 80 91 10 13 lds r24, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 2883c: 8f 93 push r24 2883e: 80 91 0f 13 lds r24, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 28842: 8f 93 push r24 28844: 80 91 16 13 lds r24, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 28848: 8f 93 push r24 2884a: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 2884e: 8f 93 push r24 28850: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 28854: 8f 93 push r24 28856: 80 91 13 13 lds r24, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 2885a: 8f 93 push r24 2885c: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.469> 28860: 1f 92 push r1 28862: 8f 93 push r24 28864: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> 28868: 1f 92 push r1 2886a: 8f 93 push r24 2886c: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 28870: 8f 93 push r24 28872: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 28876: 8f 93 push r24 28878: 80 91 c8 12 lds r24, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> 2887c: 8f 93 push r24 2887e: 80 91 c7 12 lds r24, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 28882: 8f 93 push r24 28884: 80 91 c6 12 lds r24, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 28888: 8f 93 push r24 2888a: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 2888e: 8f 93 push r24 28890: 80 91 c4 12 lds r24, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 28894: 8f 93 push r24 28896: 80 91 c3 12 lds r24, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 2889a: 8f 93 push r24 2889c: 80 91 c2 12 lds r24, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 288a0: 8f 93 push r24 288a2: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 288a6: 8f 93 push r24 288a8: 80 91 c0 12 lds r24, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 288ac: 8f 93 push r24 288ae: 80 91 bf 12 lds r24, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 288b2: 8f 93 push r24 288b4: 80 91 be 12 lds r24, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 288b8: 8f 93 push r24 288ba: 80 91 bd 12 lds r24, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 288be: 8f 93 push r24 288c0: 80 91 bc 12 lds r24, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 288c4: 8f 93 push r24 288c6: 80 91 bb 12 lds r24, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 288ca: 8f 93 push r24 288cc: 80 91 ba 12 lds r24, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 288d0: 8f 93 push r24 288d2: 80 91 b9 12 lds r24, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 288d6: 8f 93 push r24 288d8: 80 91 b8 12 lds r24, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 288dc: 8f 93 push r24 288de: 80 91 b7 12 lds r24, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 288e2: 8f 93 push r24 288e4: 80 91 b6 12 lds r24, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 288e8: 8f 93 push r24 288ea: 80 91 b5 12 lds r24, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 288ee: 8f 93 push r24 288f0: ff 92 push r15 288f2: ef 92 push r14 288f4: 82 e4 ldi r24, 0x42 ; 66 288f6: 9f e9 ldi r25, 0x9F ; 159 288f8: 9f 93 push r25 288fa: 8f 93 push r24 288fc: 0f 94 08 dc call 0x3b810 ; 0x3b810 28900: 8d b7 in r24, 0x3d ; 61 28902: 9e b7 in r25, 0x3e ; 62 28904: 8a 96 adiw r24, 0x2a ; 42 28906: 0f b6 in r0, 0x3f ; 63 28908: f8 94 cli 2890a: 9e bf out 0x3e, r25 ; 62 2890c: 0f be out 0x3f, r0 ; 63 2890e: 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); } 28910: df 91 pop r29 28912: cf 91 pop r28 28914: 1f 91 pop r17 28916: 0f 91 pop r16 28918: ff 90 pop r15 2891a: ef 90 pop r14 2891c: df 90 pop r13 2891e: cf 90 pop r12 28920: 08 95 ret 00028922 : // 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); 28922: 89 57 subi r24, 0x79 ; 121 28924: 9f 4f sbci r25, 0xFF ; 255 28926: 6e e0 ldi r22, 0x0E ; 14 28928: 71 e0 ldi r23, 0x01 ; 1 2892a: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 2892e: 61 15 cp r22, r1 28930: 71 05 cpc r23, r1 28932: 99 f0 breq .+38 ; 0x2895a 28934: 69 30 cpi r22, 0x09 ; 9 28936: 71 05 cpc r23, r1 28938: 10 f0 brcs .+4 ; 0x2893e 2893a: 68 e0 ldi r22, 0x08 ; 8 2893c: 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; 2893e: 2e e0 ldi r18, 0x0E ; 14 28940: 31 e0 ldi r19, 0x01 ; 1 28942: 62 9f mul r22, r18 28944: c0 01 movw r24, r0 28946: 63 9f mul r22, r19 28948: 90 0d add r25, r0 2894a: 72 9f mul r23, r18 2894c: 90 0d add r25, r0 2894e: 11 24 eor r1, r1 28950: 90 93 ca 12 sts 0x12CA, r25 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 28954: 80 93 c9 12 sts 0x12C9, r24 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> } 28958: 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; 2895a: 61 e0 ldi r22, 0x01 ; 1 2895c: 70 e0 ldi r23, 0x00 ; 0 2895e: ef cf rjmp .-34 ; 0x2893e 00028960 : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 28960: cf 93 push r28 28962: df 93 push r29 if(!(data.P > 0)) return false; 28964: 20 e0 ldi r18, 0x00 ; 0 28966: 30 e0 ldi r19, 0x00 ; 0 28968: a9 01 movw r20, r18 2896a: 60 91 b5 12 lds r22, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 2896e: 70 91 b6 12 lds r23, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 28972: 80 91 b7 12 lds r24, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 28976: 90 91 b8 12 lds r25, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 2897a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 2897e: 18 16 cp r1, r24 28980: 0c f0 brlt .+2 ; 0x28984 28982: 54 c0 rjmp .+168 ; 0x28a2c if(isnan(data.U)) return false; 28984: 60 91 b9 12 lds r22, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 28988: 70 91 ba 12 lds r23, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 2898c: 80 91 bb 12 lds r24, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 28990: 90 91 bc 12 lds r25, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 28994: 9b 01 movw r18, r22 28996: ac 01 movw r20, r24 28998: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 2899c: 81 11 cpse r24, r1 2899e: 46 c0 rjmp .+140 ; 0x28a2c if(isnan(data.V)) return false; 289a0: 60 91 bd 12 lds r22, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 289a4: 70 91 be 12 lds r23, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 289a8: 80 91 bf 12 lds r24, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 289ac: 90 91 c0 12 lds r25, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 289b0: 9b 01 movw r18, r22 289b2: ac 01 movw r20, r24 289b4: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 289b8: 81 11 cpse r24, r1 289ba: 38 c0 rjmp .+112 ; 0x28a2c if(!(data.C > 0)) return false; 289bc: 20 e0 ldi r18, 0x00 ; 0 289be: 30 e0 ldi r19, 0x00 ; 0 289c0: a9 01 movw r20, r18 289c2: 60 91 c1 12 lds r22, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 289c6: 70 91 c2 12 lds r23, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 289ca: 80 91 c3 12 lds r24, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 289ce: 90 91 c4 12 lds r25, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 289d2: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 289d6: 18 16 cp r1, r24 289d8: 4c f5 brge .+82 ; 0x28a2c if(isnan(data.fS)) return false; 289da: 60 91 c5 12 lds r22, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 289de: 70 91 c6 12 lds r23, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 289e2: 80 91 c7 12 lds r24, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 289e6: 90 91 c8 12 lds r25, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> 289ea: 9b 01 movw r18, r22 289ec: ac 01 movw r20, r24 289ee: 0f 94 7c e2 call 0x3c4f8 ; 0x3c4f8 <__unordsf2> 289f2: 81 11 cpse r24, r1 289f4: 1b c0 rjmp .+54 ; 0x28a2c if(!(data.L > 0)) return false; 289f6: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 289fa: 90 91 ca 12 lds r25, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 289fe: 89 2b or r24, r25 28a00: a9 f0 breq .+42 ; 0x28a2c 28a02: cb ec ldi r28, 0xCB ; 203 28a04: 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)) 28a06: 69 91 ld r22, Y+ 28a08: 79 91 ld r23, Y+ 28a0a: 89 91 ld r24, Y+ 28a0c: 99 91 ld r25, Y+ 28a0e: 20 e0 ldi r18, 0x00 ; 0 28a10: 30 e0 ldi r19, 0x00 ; 0 28a12: a9 01 movw r20, r18 28a14: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 28a18: 87 fd sbrc r24, 7 28a1a: 08 c0 rjmp .+16 ; 0x28a2c 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) { 28a1c: 83 e1 ldi r24, 0x13 ; 19 28a1e: cb 30 cpi r28, 0x0B ; 11 28a20: d8 07 cpc r29, r24 28a22: 89 f7 brne .-30 ; 0x28a06 if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 28a24: 81 e0 ldi r24, 0x01 ; 1 } 28a26: df 91 pop r29 28a28: cf 91 pop r28 28a2a: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 28a2c: 80 e0 ldi r24, 0x00 ; 0 28a2e: fb cf rjmp .-10 ; 0x28a26 00028a30 : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 28a30: 0f 94 b0 44 call 0x28960 ; 0x28960 28a34: 81 11 cpse r24, r1 28a36: 02 c0 rjmp .+4 ; 0x28a3c 28a38: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28a3c: 81 e0 ldi r24, 0x01 ; 1 28a3e: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 28a42: 80 91 33 06 lds r24, 0x0633 ; 0x800633 28a46: 8d 7f andi r24, 0xFD ; 253 28a48: 80 93 33 06 sts 0x0633, r24 ; 0x800633 // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; reinitialize(); } 28a4c: 08 95 ret 00028a4e : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 28a4e: 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; 28a50: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 28a54: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 28a58: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 28a5c: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28a60: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28a62: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 28a64: 0f 94 ad 21 call 0x2435a ; 0x2435a temp_mgr_pid(); 28a68: 0f 94 ea 1e call 0x23dd4 ; 0x23dd4 // 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); 28a6c: 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; 28a6e: 10 92 6a 06 sts 0x066A, r1 ; 0x80066a (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28a72: cf bf out 0x3f, r28 ; 63 #endif } } 28a74: cf 91 pop r28 28a76: 08 95 ret 00028a78 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 28a78: 0f 94 27 45 call 0x28a4e ; 0x28a4e fanSpeed = 0; 28a7c: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df lcd_return_to_status(); 28a80: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 00028a84 : // 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) { 28a84: 1f 93 push r17 28a86: cf 93 push r28 28a88: df 93 push r29 28a8a: c8 2f mov r28, r24 28a8c: 16 2f mov r17, r22 28a8e: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 28a90: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 28a94: 80 fd sbrc r24, 0 28a96: 18 c0 rjmp .+48 ; 0x28ac8 28a98: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 28a9c: 81 11 cpse r24, r1 28a9e: 14 c0 rjmp .+40 ; 0x28ac8 saved_bed_temperature = target_temperature_bed; 28aa0: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 28aa4: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_temperature = target_temperature[index]; 28aa8: e6 2f mov r30, r22 28aaa: f0 e0 ldi r31, 0x00 ; 0 28aac: ee 0f add r30, r30 28aae: ff 1f adc r31, r31 28ab0: e6 59 subi r30, 0x96 ; 150 28ab2: f1 4f sbci r31, 0xF1 ; 241 28ab4: 80 81 ld r24, Z 28ab6: 91 81 ldd r25, Z+1 ; 0x01 28ab8: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab 28abc: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa saved_fan_speed = fanSpeed; 28ac0: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 28ac4: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 28ac8: 0f 94 27 45 call 0x28a4e ; 0x28a4e void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed 28acc: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> 28ad0: 82 60 ori r24, 0x02 ; 2 28ad2: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.487> #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 28ad6: 0e 94 d4 75 call 0xeba8 ; 0xeba8 setExtruderAutoFanState(3); 28ada: 83 e0 ldi r24, 0x03 ; 3 28adc: 0e 94 e2 76 call 0xedc4 ; 0xedc4 SET_OUTPUT(FAN_PIN); 28ae0: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 28ae4: 88 60 ori r24, 0x08 ; 8 28ae6: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 28aea: 8f ef ldi r24, 0xFF ; 255 28aec: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 28af0: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 28af4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 28af8: 80 ff sbrs r24, 0 28afa: 07 c0 rjmp .+14 ; 0x28b0a 28afc: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 28b00: 82 95 swap r24 28b02: 86 95 lsr r24 28b04: 87 70 andi r24, 0x07 ; 7 28b06: d8 17 cp r29, r24 28b08: c0 f4 brcc .+48 ; 0x28b3a temp_error_state.source = (uint8_t)source; 28b0a: c3 70 andi r28, 0x03 ; 3 28b0c: cc 0f add r28, r28 28b0e: cc 0f add r28, r28 28b10: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 28b14: 83 7f andi r24, 0xF3 ; 243 28b16: 8c 2b or r24, r28 28b18: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.468> temp_error_state.index = index; 28b1c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 28b20: 10 fb bst r17, 0 28b22: 84 f9 bld r24, 4 28b24: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.468> temp_error_state.type = (uint8_t)type; 28b28: d2 95 swap r29 28b2a: dd 0f add r29, r29 28b2c: d0 7e andi r29, 0xE0 ; 224 28b2e: 40 91 1b 05 lds r20, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 28b32: 4f 71 andi r20, 0x1F ; 31 28b34: 4d 2b or r20, r29 28b36: 40 93 1b 05 sts 0x051B, r20 ; 0x80051b <_ZL16temp_error_state.lto_priv.468> } // always set the error state temp_error_state.error = true; 28b3a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 28b3e: 81 60 ori r24, 0x01 ; 1 28b40: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.468> temp_error_state.assert = true; 28b44: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 28b48: 82 60 ori r24, 0x02 ; 2 28b4a: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.468> } 28b4e: df 91 pop r29 28b50: cf 91 pop r28 28b52: 1f 91 pop r17 28b54: 08 95 ret 00028b56 : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 28b56: 20 91 03 06 lds r18, 0x0603 ; 0x800603 28b5a: 30 91 04 06 lds r19, 0x0604 ; 0x800604 28b5e: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.485> 28b62: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.485+0x1> 28b66: 28 17 cp r18, r24 28b68: 39 07 cpc r19, r25 28b6a: 2c f0 brlt .+10 ; 0x28b76 #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 28b6c: 41 e0 ldi r20, 0x01 ; 1 28b6e: 60 e0 ldi r22, 0x00 ; 0 28b70: 81 e0 ldi r24, 0x01 ; 1 28b72: 0d 94 42 45 jmp 0x28a84 ; 0x28a84 } } 28b76: 08 95 ret 00028b78 : 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]) { 28b78: 20 91 05 06 lds r18, 0x0605 ; 0x800605 28b7c: 30 91 06 06 lds r19, 0x0606 ; 0x800606 28b80: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.486> 28b84: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.486+0x1> 28b88: 28 17 cp r18, r24 28b8a: 39 07 cpc r19, r25 28b8c: 2c f0 brlt .+10 ; 0x28b98 #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 28b8e: 41 e0 ldi r20, 0x01 ; 1 28b90: 60 e0 ldi r22, 0x00 ; 0 28b92: 80 e0 ldi r24, 0x00 ; 0 28b94: 0d 94 42 45 jmp 0x28a84 ; 0x28a84 } } 28b98: 08 95 ret 00028b9a : 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) { 28b9a: 2f 92 push r2 28b9c: 3f 92 push r3 28b9e: 4f 92 push r4 28ba0: 5f 92 push r5 28ba2: 6f 92 push r6 28ba4: 7f 92 push r7 28ba6: 8f 92 push r8 28ba8: 9f 92 push r9 28baa: af 92 push r10 28bac: bf 92 push r11 28bae: cf 92 push r12 28bb0: df 92 push r13 28bb2: ef 92 push r14 28bb4: ff 92 push r15 28bb6: 0f 93 push r16 28bb8: 1f 93 push r17 28bba: cf 93 push r28 28bbc: df 93 push r29 28bbe: cd b7 in r28, 0x3d ; 61 28bc0: de b7 in r29, 0x3e ; 62 28bc2: 2c 97 sbiw r28, 0x0c ; 12 28bc4: 0f b6 in r0, 0x3f ; 63 28bc6: f8 94 cli 28bc8: de bf out 0x3e, r29 ; 62 28bca: 0f be out 0x3f, r0 ; 63 28bcc: cd bf out 0x3d, r28 ; 61 28bce: 28 2e mov r2, r24 28bd0: 49 83 std Y+1, r20 ; 0x01 28bd2: 5a 83 std Y+2, r21 ; 0x02 28bd4: 6b 83 std Y+3, r22 ; 0x03 28bd6: 7c 83 std Y+4, r23 ; 0x04 28bd8: 28 01 movw r4, r16 28bda: 39 01 movw r6, r18 28bdc: 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) 28bde: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 28be2: 02 2d mov r16, r2 28be4: 10 e0 ldi r17, 0x00 ; 0 28be6: 98 01 movw r18, r16 28be8: 22 0f add r18, r18 28bea: 33 1f adc r19, r19 28bec: 22 0f add r18, r18 28bee: 33 1f adc r19, r19 28bf0: 3c 87 std Y+12, r19 ; 0x0c 28bf2: 2b 87 std Y+11, r18 ; 0x0b 28bf4: f9 01 movw r30, r18 28bf6: e9 53 subi r30, 0x39 ; 57 28bf8: fa 4f sbci r31, 0xFA ; 250 28bfa: 80 80 ld r8, Z 28bfc: 91 80 ldd r9, Z+1 ; 0x01 28bfe: a2 80 ldd r10, Z+2 ; 0x02 28c00: b3 80 ldd r11, Z+3 ; 0x03 28c02: 68 19 sub r22, r8 28c04: 79 09 sbc r23, r9 28c06: 8a 09 sbc r24, r10 28c08: 9b 09 sbc r25, r11 28c0a: 61 3d cpi r22, 0xD1 ; 209 28c0c: 77 40 sbci r23, 0x07 ; 7 28c0e: 81 05 cpc r24, r1 28c10: 91 05 cpc r25, r1 28c12: 08 f4 brcc .+2 ; 0x28c16 28c14: ea c0 rjmp .+468 ; 0x28dea { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 28c16: 33 20 and r3, r3 28c18: 09 f4 brne .+2 ; 0x28c1c 28c1a: 75 c0 rjmp .+234 ; 0x28d06 { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 28c1c: 88 e6 ldi r24, 0x68 ; 104 28c1e: 91 e0 ldi r25, 0x01 ; 1 28c20: 9a 87 std Y+10, r25 ; 0x0a 28c22: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 28c24: 80 e0 ldi r24, 0x00 ; 0 28c26: 90 e0 ldi r25, 0x00 ; 0 28c28: a0 ea ldi r26, 0xA0 ; 160 28c2a: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28c2c: 8d 83 std Y+5, r24 ; 0x05 28c2e: 9e 83 std Y+6, r25 ; 0x06 28c30: af 83 std Y+7, r26 ; 0x07 28c32: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 28c34: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 28c38: eb 85 ldd r30, Y+11 ; 0x0b 28c3a: fc 85 ldd r31, Y+12 ; 0x0c 28c3c: e9 53 subi r30, 0x39 ; 57 28c3e: fa 4f sbci r31, 0xFA ; 250 28c40: 60 83 st Z, r22 28c42: 71 83 std Z+1, r23 ; 0x01 28c44: 82 83 std Z+2, r24 ; 0x02 28c46: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 28c48: 20 e0 ldi r18, 0x00 ; 0 28c4a: 30 e0 ldi r19, 0x00 ; 0 28c4c: a9 01 movw r20, r18 28c4e: c7 01 movw r24, r14 28c50: b6 01 movw r22, r12 28c52: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 28c56: 81 11 cpse r24, r1 28c58: 07 c0 rjmp .+14 ; 0x28c68 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28c5a: f8 01 movw r30, r16 28c5c: ee 0f add r30, r30 28c5e: ff 1f adc r31, r31 28c60: ed 53 subi r30, 0x3D ; 61 28c62: fa 4f sbci r31, 0xFA ; 250 28c64: 11 82 std Z+1, r1 ; 0x01 28c66: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 28c68: ab 85 ldd r26, Y+11 ; 0x0b 28c6a: bc 85 ldd r27, Y+12 ; 0x0c 28c6c: a5 54 subi r26, 0x45 ; 69 28c6e: ba 4f sbci r27, 0xFA ; 250 28c70: 5d 01 movw r10, r26 28c72: 29 81 ldd r18, Y+1 ; 0x01 28c74: 3a 81 ldd r19, Y+2 ; 0x02 28c76: 4b 81 ldd r20, Y+3 ; 0x03 28c78: 5c 81 ldd r21, Y+4 ; 0x04 28c7a: 6d 91 ld r22, X+ 28c7c: 7d 91 ld r23, X+ 28c7e: 8d 91 ld r24, X+ 28c80: 9c 91 ld r25, X 28c82: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 28c86: 88 23 and r24, r24 28c88: 09 f4 brne .+2 ; 0x28c8c 28c8a: 91 c0 rjmp .+290 ; 0x28dae { if (_target_temperature > 0) 28c8c: 20 e0 ldi r18, 0x00 ; 0 28c8e: 30 e0 ldi r19, 0x00 ; 0 28c90: a9 01 movw r20, r18 28c92: 69 81 ldd r22, Y+1 ; 0x01 28c94: 7a 81 ldd r23, Y+2 ; 0x02 28c96: 8b 81 ldd r24, Y+3 ; 0x03 28c98: 9c 81 ldd r25, Y+4 ; 0x04 28c9a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 28c9e: f8 01 movw r30, r16 28ca0: e7 54 subi r30, 0x47 ; 71 28ca2: fa 4f sbci r31, 0xFA ; 250 28ca4: 18 16 cp r1, r24 28ca6: c4 f5 brge .+112 ; 0x28d18 { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 28ca8: 81 e0 ldi r24, 0x01 ; 1 28caa: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 28cac: 89 81 ldd r24, Y+1 ; 0x01 28cae: 9a 81 ldd r25, Y+2 ; 0x02 28cb0: ab 81 ldd r26, Y+3 ; 0x03 28cb2: bc 81 ldd r27, Y+4 ; 0x04 28cb4: f5 01 movw r30, r10 28cb6: 80 83 st Z, r24 28cb8: 91 83 std Z+1, r25 ; 0x01 28cba: a2 83 std Z+2, r26 ; 0x02 28cbc: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 28cbe: eb 85 ldd r30, Y+11 ; 0x0b 28cc0: fc 85 ldd r31, Y+12 ; 0x0c 28cc2: ef 54 subi r30, 0x4F ; 79 28cc4: fa 4f sbci r31, 0xFA ; 250 28cc6: 40 82 st Z, r4 28cc8: 51 82 std Z+1, r5 ; 0x01 28cca: 62 82 std Z+2, r6 ; 0x02 28ccc: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 28cce: f8 01 movw r30, r16 28cd0: e1 55 subi r30, 0x51 ; 81 28cd2: fa 4f sbci r31, 0xFA ; 250 28cd4: 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)) 28cd6: a3 01 movw r20, r6 28cd8: 92 01 movw r18, r4 28cda: bc 01 movw r22, r24 28cdc: cd 01 movw r24, r26 28cde: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 28ce2: 18 16 cp r1, r24 28ce4: 1c f5 brge .+70 ; 0x28d2c { __preheat_counter[_heater_id]++; 28ce6: f8 01 movw r30, r16 28ce8: e1 55 subi r30, 0x51 ; 81 28cea: fa 4f sbci r31, 0xFA ; 250 28cec: 80 81 ld r24, Z 28cee: 8f 5f subi r24, 0xFF ; 255 28cf0: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 28cf2: 31 10 cpse r3, r1 28cf4: c7 c0 rjmp .+398 ; 0x28e84 28cf6: 89 30 cpi r24, 0x09 ; 9 28cf8: c8 f0 brcs .+50 ; 0x28d2c { __delta=2.0; 28cfa: 81 2c mov r8, r1 28cfc: 91 2c mov r9, r1 28cfe: a1 2c mov r10, r1 28d00: 50 e4 ldi r21, 0x40 ; 64 28d02: b5 2e mov r11, r21 28d04: e8 c0 rjmp .+464 ; 0x28ed6 #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 28d06: ad e2 ldi r26, 0x2D ; 45 28d08: b0 e0 ldi r27, 0x00 ; 0 28d0a: ba 87 std Y+10, r27 ; 0x0a 28d0c: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28d0e: 80 e0 ldi r24, 0x00 ; 0 28d10: 90 e0 ldi r25, 0x00 ; 0 28d12: a0 e7 ldi r26, 0x70 ; 112 28d14: b1 e4 ldi r27, 0x41 ; 65 28d16: 8a cf rjmp .-236 ; 0x28c2c __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 28d18: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 28d1a: 89 81 ldd r24, Y+1 ; 0x01 28d1c: 9a 81 ldd r25, Y+2 ; 0x02 28d1e: ab 81 ldd r26, Y+3 ; 0x03 28d20: bc 81 ldd r27, Y+4 ; 0x04 28d22: f5 01 movw r30, r10 28d24: 80 83 st Z, r24 28d26: 91 83 std Z+1, r25 ; 0x01 28d28: a2 83 std Z+2, r26 ; 0x02 28d2a: 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) 28d2c: 2d 81 ldd r18, Y+5 ; 0x05 28d2e: 3e 81 ldd r19, Y+6 ; 0x06 28d30: 4f 81 ldd r20, Y+7 ; 0x07 28d32: 58 85 ldd r21, Y+8 ; 0x08 28d34: 69 81 ldd r22, Y+1 ; 0x01 28d36: 7a 81 ldd r23, Y+2 ; 0x02 28d38: 8b 81 ldd r24, Y+3 ; 0x03 28d3a: 9c 81 ldd r25, Y+4 ; 0x04 28d3c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 28d40: a3 01 movw r20, r6 28d42: 92 01 movw r18, r4 28d44: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 28d48: 87 ff sbrs r24, 7 28d4a: 46 c0 rjmp .+140 ; 0x28dd8 28d4c: f8 01 movw r30, r16 28d4e: e7 54 subi r30, 0x47 ; 71 28d50: fa 4f sbci r31, 0xFA ; 250 28d52: 80 81 ld r24, Z 28d54: 81 30 cpi r24, 0x01 ; 1 28d56: 49 f4 brne .+18 ; 0x28d6a { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 28d58: 82 e0 ldi r24, 0x02 ; 2 28d5a: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28d5c: f8 01 movw r30, r16 28d5e: ee 0f add r30, r30 28d60: ff 1f adc r31, r31 28d62: ed 53 subi r30, 0x3D ; 61 28d64: fa 4f sbci r31, 0xFA ; 250 28d66: 11 82 std Z+1, r1 ; 0x01 28d68: 10 82 st Z, r1 } if (_output > 0) 28d6a: 20 e0 ldi r18, 0x00 ; 0 28d6c: 30 e0 ldi r19, 0x00 ; 0 28d6e: a9 01 movw r20, r18 28d70: c7 01 movw r24, r14 28d72: b6 01 movw r22, r12 28d74: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 28d78: 18 16 cp r1, r24 28d7a: bc f5 brge .+110 ; 0x28dea if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 28d7c: 29 81 ldd r18, Y+1 ; 0x01 28d7e: 3a 81 ldd r19, Y+2 ; 0x02 28d80: 4b 81 ldd r20, Y+3 ; 0x03 28d82: 5c 81 ldd r21, Y+4 ; 0x04 28d84: 6d 81 ldd r22, Y+5 ; 0x05 28d86: 7e 81 ldd r23, Y+6 ; 0x06 28d88: 8f 81 ldd r24, Y+7 ; 0x07 28d8a: 98 85 ldd r25, Y+8 ; 0x08 28d8c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 28d90: a3 01 movw r20, r6 28d92: 92 01 movw r18, r4 28d94: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 28d98: 18 16 cp r1, r24 28d9a: 0c f0 brlt .+2 ; 0x28d9e 28d9c: 3f c0 rjmp .+126 ; 0x28e1c { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28d9e: 00 0f add r16, r16 28da0: 11 1f adc r17, r17 28da2: f8 01 movw r30, r16 28da4: ed 53 subi r30, 0x3D ; 61 28da6: fa 4f sbci r31, 0xFA ; 250 28da8: 11 82 std Z+1, r1 ; 0x01 28daa: 10 82 st Z, r1 28dac: 1e c0 rjmp .+60 ; 0x28dea 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)) 28dae: a3 01 movw r20, r6 28db0: 92 01 movw r18, r4 28db2: 69 81 ldd r22, Y+1 ; 0x01 28db4: 7a 81 ldd r23, Y+2 ; 0x02 28db6: 8b 81 ldd r24, Y+3 ; 0x03 28db8: 9c 81 ldd r25, Y+4 ; 0x04 28dba: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 28dbe: 18 16 cp r1, r24 28dc0: 0c f0 brlt .+2 ; 0x28dc4 28dc2: b4 cf rjmp .-152 ; 0x28d2c 28dc4: f8 01 movw r30, r16 28dc6: e7 54 subi r30, 0x47 ; 71 28dc8: fa 4f sbci r31, 0xFA ; 250 28dca: 80 81 ld r24, Z 28dcc: 81 30 cpi r24, 0x01 ; 1 28dce: 09 f0 breq .+2 ; 0x28dd2 28dd0: ad cf rjmp .-166 ; 0x28d2c 28dd2: 89 cf rjmp .-238 ; 0x28ce6 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; 28dd4: 10 82 st Z, r1 28dd6: 97 c0 rjmp .+302 ; 0x28f06 temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 28dd8: 20 e0 ldi r18, 0x00 ; 0 28dda: 30 e0 ldi r19, 0x00 ; 0 28ddc: a9 01 movw r20, r18 28dde: c7 01 movw r24, r14 28de0: b6 01 movw r22, r12 28de2: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 28de6: 18 16 cp r1, r24 28de8: cc f0 brlt .+50 ; 0x28e1c } } } } } 28dea: 2c 96 adiw r28, 0x0c ; 12 28dec: 0f b6 in r0, 0x3f ; 63 28dee: f8 94 cli 28df0: de bf out 0x3e, r29 ; 62 28df2: 0f be out 0x3f, r0 ; 63 28df4: cd bf out 0x3d, r28 ; 61 28df6: df 91 pop r29 28df8: cf 91 pop r28 28dfa: 1f 91 pop r17 28dfc: 0f 91 pop r16 28dfe: ff 90 pop r15 28e00: ef 90 pop r14 28e02: df 90 pop r13 28e04: cf 90 pop r12 28e06: bf 90 pop r11 28e08: af 90 pop r10 28e0a: 9f 90 pop r9 28e0c: 8f 90 pop r8 28e0e: 7f 90 pop r7 28e10: 6f 90 pop r6 28e12: 5f 90 pop r5 28e14: 4f 90 pop r4 28e16: 3f 90 pop r3 28e18: 2f 90 pop r2 28e1a: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 28e1c: f8 01 movw r30, r16 28e1e: e7 54 subi r30, 0x47 ; 71 28e20: fa 4f sbci r31, 0xFA ; 250 28e22: 80 81 ld r24, Z 28e24: 82 30 cpi r24, 0x02 ; 2 28e26: 08 f3 brcs .-62 ; 0x28dea { temp_runaway_error_counter[_heater_id]++; 28e28: 00 0f add r16, r16 28e2a: 11 1f adc r17, r17 28e2c: f8 01 movw r30, r16 28e2e: ed 53 subi r30, 0x3D ; 61 28e30: fa 4f sbci r31, 0xFA ; 250 28e32: 80 81 ld r24, Z 28e34: 91 81 ldd r25, Z+1 ; 0x01 28e36: 01 96 adiw r24, 0x01 ; 1 28e38: 91 83 std Z+1, r25 ; 0x01 28e3a: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 28e3c: 88 0f add r24, r24 28e3e: 99 1f adc r25, r25 28e40: e9 85 ldd r30, Y+9 ; 0x09 28e42: fa 85 ldd r31, Y+10 ; 0x0a 28e44: e8 17 cp r30, r24 28e46: f9 07 cpc r31, r25 28e48: 80 f6 brcc .-96 ; 0x28dea set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 28e4a: 43 e0 ldi r20, 0x03 ; 3 28e4c: 62 2d mov r22, r2 28e4e: 83 2d mov r24, r3 } } } } } 28e50: 2c 96 adiw r28, 0x0c ; 12 28e52: 0f b6 in r0, 0x3f ; 63 28e54: f8 94 cli 28e56: de bf out 0x3e, r29 ; 62 28e58: 0f be out 0x3f, r0 ; 63 28e5a: cd bf out 0x3d, r28 ; 61 28e5c: df 91 pop r29 28e5e: cf 91 pop r28 28e60: 1f 91 pop r17 28e62: 0f 91 pop r16 28e64: ff 90 pop r15 28e66: ef 90 pop r14 28e68: df 90 pop r13 28e6a: cf 90 pop r12 28e6c: bf 90 pop r11 28e6e: af 90 pop r10 28e70: 9f 90 pop r9 28e72: 8f 90 pop r8 28e74: 7f 90 pop r7 28e76: 6f 90 pop r6 28e78: 5f 90 pop r5 28e7a: 4f 90 pop r4 28e7c: 3f 90 pop r3 28e7e: 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); 28e80: 0d 94 42 45 jmp 0x28a84 ; 0x28a84 } 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 28e84: 81 31 cpi r24, 0x11 ; 17 28e86: 08 f4 brcc .+2 ; 0x28e8a 28e88: 51 cf rjmp .-350 ; 0x28d2c { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 28e8a: 20 e0 ldi r18, 0x00 ; 0 28e8c: 30 e0 ldi r19, 0x00 ; 0 28e8e: 44 eb ldi r20, 0xB4 ; 180 28e90: 52 e4 ldi r21, 0x42 ; 66 28e92: c3 01 movw r24, r6 28e94: b2 01 movw r22, r4 28e96: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 28e9a: 81 2c mov r8, r1 28e9c: 91 2c mov r9, r1 28e9e: e0 e4 ldi r30, 0x40 ; 64 28ea0: ae 2e mov r10, r30 28ea2: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 28ea4: 18 16 cp r1, r24 28ea6: 2c f4 brge .+10 ; 0x28eb2 28ea8: 81 2c mov r8, r1 28eaa: 91 2c mov r9, r1 28eac: a1 2c mov r10, r1 28eae: 70 e4 ldi r23, 0x40 ; 64 28eb0: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 28eb2: 20 e0 ldi r18, 0x00 ; 0 28eb4: 30 e0 ldi r19, 0x00 ; 0 28eb6: 42 ed ldi r20, 0xD2 ; 210 28eb8: 52 e4 ldi r21, 0x42 ; 66 28eba: c3 01 movw r24, r6 28ebc: b2 01 movw r22, r4 28ebe: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 28ec2: 18 16 cp r1, r24 28ec4: 44 f4 brge .+16 ; 0x28ed6 28ec6: 6a e9 ldi r22, 0x9A ; 154 28ec8: 86 2e mov r8, r22 28eca: 69 e9 ldi r22, 0x99 ; 153 28ecc: 96 2e mov r9, r22 28ece: 69 e1 ldi r22, 0x19 ; 25 28ed0: a6 2e mov r10, r22 28ed2: 6f e3 ldi r22, 0x3F ; 63 28ed4: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 28ed6: eb 85 ldd r30, Y+11 ; 0x0b 28ed8: fc 85 ldd r31, Y+12 ; 0x0c 28eda: ef 54 subi r30, 0x4F ; 79 28edc: fa 4f sbci r31, 0xFA ; 250 28ede: 20 81 ld r18, Z 28ee0: 31 81 ldd r19, Z+1 ; 0x01 28ee2: 42 81 ldd r20, Z+2 ; 0x02 28ee4: 53 81 ldd r21, Z+3 ; 0x03 28ee6: c3 01 movw r24, r6 28ee8: b2 01 movw r22, r4 28eea: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 28eee: a5 01 movw r20, r10 28ef0: 94 01 movw r18, r8 28ef2: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 28ef6: f8 01 movw r30, r16 28ef8: e3 55 subi r30, 0x53 ; 83 28efa: fa 4f sbci r31, 0xFA ; 250 28efc: 87 ff sbrs r24, 7 28efe: 6a cf rjmp .-300 ; 0x28dd4 __preheat_errors[_heater_id]++; 28f00: 80 81 ld r24, Z 28f02: 8f 5f subi r24, 0xFF ; 255 28f04: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28f06: 80 81 ld r24, Z 28f08: 90 e0 ldi r25, 0x00 ; 0 28f0a: 31 10 cpse r3, r1 28f0c: 04 c0 rjmp .+8 ; 0x28f16 28f0e: 06 97 sbiw r24, 0x06 ; 6 28f10: 4c f0 brlt .+18 ; 0x28f24 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28f12: 80 e0 ldi r24, 0x00 ; 0 28f14: 03 c0 rjmp .+6 ; 0x28f1c __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28f16: 04 97 sbiw r24, 0x04 ; 4 28f18: 2c f0 brlt .+10 ; 0x28f24 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28f1a: 81 e0 ldi r24, 0x01 ; 1 28f1c: 42 e0 ldi r20, 0x02 ; 2 28f1e: 62 2d mov r22, r2 28f20: 0f 94 42 45 call 0x28a84 ; 0x28a84 __preheat_start[_heater_id] = _current_temperature; 28f24: 2b 85 ldd r18, Y+11 ; 0x0b 28f26: 3c 85 ldd r19, Y+12 ; 0x0c 28f28: 2f 54 subi r18, 0x4F ; 79 28f2a: 3a 4f sbci r19, 0xFA ; 250 28f2c: d9 01 movw r26, r18 28f2e: 4d 92 st X+, r4 28f30: 5d 92 st X+, r5 28f32: 6d 92 st X+, r6 28f34: 7c 92 st X, r7 28f36: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 28f38: f8 01 movw r30, r16 28f3a: e1 55 subi r30, 0x51 ; 81 28f3c: fa 4f sbci r31, 0xFA ; 250 28f3e: 10 82 st Z, r1 28f40: f5 ce rjmp .-534 ; 0x28d2c 00028f42 : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 28f42: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28f44: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28f46: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 28f48: 80 81 ld r24, Z 28f4a: 88 23 and r24, r24 28f4c: 29 f0 breq .+10 ; 0x28f58 28f4e: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 28f52: 82 60 ori r24, 0x02 ; 2 28f54: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28f58: 9f bf out 0x3f, r25 ; 63 } } 28f5a: 08 95 ret 00028f5c : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 28f5c: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28f5e: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28f60: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 28f62: e3 e7 ldi r30, 0x73 ; 115 28f64: f0 e0 ldi r31, 0x00 ; 0 28f66: 90 81 ld r25, Z 28f68: 96 95 lsr r25 28f6a: 91 70 andi r25, 0x01 ; 1 28f6c: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 28f6e: 80 81 ld r24, Z 28f70: 8d 7f andi r24, 0xFD ; 253 28f72: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28f74: 2f bf out 0x3f, r18 ; 63 } } 28f76: 08 95 ret 00028f78 : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 28f78: cf 93 push r28 28f7a: df 93 push r29 28f7c: 1f 92 push r1 28f7e: cd b7 in r28, 0x3d ; 61 28f80: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 28f82: ce 01 movw r24, r28 28f84: 01 96 adiw r24, 0x01 ; 1 28f86: 0f 94 ae 47 call 0x28f5c ; 0x28f5c thermal_model::data.P = THERMAL_MODEL_DEF(P); 28f8a: 80 e0 ldi r24, 0x00 ; 0 28f8c: 90 e0 ldi r25, 0x00 ; 0 28f8e: a8 e1 ldi r26, 0x18 ; 24 28f90: b2 e4 ldi r27, 0x42 ; 66 28f92: 80 93 b5 12 sts 0x12B5, r24 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 28f96: 90 93 b6 12 sts 0x12B6, r25 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 28f9a: a0 93 b7 12 sts 0x12B7, r26 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 28f9e: b0 93 b8 12 sts 0x12B8, r27 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 28fa2: 10 92 b9 12 sts 0x12B9, r1 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 28fa6: 10 92 ba 12 sts 0x12BA, r1 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 28faa: 10 92 bb 12 sts 0x12BB, r1 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 28fae: 10 92 bc 12 sts 0x12BC, r1 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 28fb2: 80 e0 ldi r24, 0x00 ; 0 28fb4: 90 e0 ldi r25, 0x00 ; 0 28fb6: a0 e8 ldi r26, 0x80 ; 128 28fb8: bf e3 ldi r27, 0x3F ; 63 28fba: 80 93 bd 12 sts 0x12BD, r24 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 28fbe: 90 93 be 12 sts 0x12BE, r25 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 28fc2: a0 93 bf 12 sts 0x12BF, r26 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 28fc6: b0 93 c0 12 sts 0x12C0, r27 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 28fca: 8a e9 ldi r24, 0x9A ; 154 28fcc: 99 e9 ldi r25, 0x99 ; 153 28fce: a1 e4 ldi r26, 0x41 ; 65 28fd0: b1 e4 ldi r27, 0x41 ; 65 28fd2: 80 93 c1 12 sts 0x12C1, r24 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 28fd6: 90 93 c2 12 sts 0x12C2, r25 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 28fda: a0 93 c3 12 sts 0x12C3, r26 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 28fde: b0 93 c4 12 sts 0x12C4, r27 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 28fe2: 88 eb ldi r24, 0xB8 ; 184 28fe4: 9e e1 ldi r25, 0x1E ; 30 28fe6: a5 e8 ldi r26, 0x85 ; 133 28fe8: bd e3 ldi r27, 0x3D ; 61 28fea: 80 93 c5 12 sts 0x12C5, r24 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 28fee: 90 93 c6 12 sts 0x12C6, r25 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 28ff2: a0 93 c7 12 sts 0x12C7, r26 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 28ff6: b0 93 c8 12 sts 0x12C8, r27 ; 0x8012c8 <_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); 28ffa: 80 e7 ldi r24, 0x70 ; 112 28ffc: 98 e0 ldi r25, 0x08 ; 8 28ffe: 90 93 ca 12 sts 0x12CA, r25 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 29002: 80 93 c9 12 sts 0x12C9, r24 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 29006: 84 eb ldi r24, 0xB4 ; 180 29008: 9f e9 ldi r25, 0x9F ; 159 2900a: ab ec ldi r26, 0xCB ; 203 2900c: 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); 2900e: fc 01 movw r30, r24 29010: 45 91 lpm r20, Z+ 29012: 55 91 lpm r21, Z+ 29014: 65 91 lpm r22, Z+ 29016: 74 91 lpm r23, Z 29018: 4d 93 st X+, r20 2901a: 5d 93 st X+, r21 2901c: 6d 93 st X+, r22 2901e: 7d 93 st X+, r23 29020: 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) 29022: 23 e1 ldi r18, 0x13 ; 19 29024: ab 30 cpi r26, 0x0B ; 11 29026: b2 07 cpc r27, r18 29028: 91 f7 brne .-28 ; 0x2900e thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 2902a: 80 e0 ldi r24, 0x00 ; 0 2902c: 90 e0 ldi r25, 0x00 ; 0 2902e: a0 ee ldi r26, 0xE0 ; 224 29030: b0 ec ldi r27, 0xC0 ; 192 29032: 80 93 0b 13 sts 0x130B, r24 ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 29036: 90 93 0c 13 sts 0x130C, r25 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 2903a: a0 93 0d 13 sts 0x130D, r26 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 2903e: b0 93 0e 13 sts 0x130E, r27 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 29042: 8a e9 ldi r24, 0x9A ; 154 29044: 99 e9 ldi r25, 0x99 ; 153 29046: a9 e9 ldi r26, 0x99 ; 153 29048: bf e3 ldi r27, 0x3F ; 63 2904a: 80 93 0f 13 sts 0x130F, r24 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 2904e: 90 93 10 13 sts 0x1310, r25 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 29052: a0 93 11 13 sts 0x1311, r26 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 29056: b0 93 12 13 sts 0x1312, r27 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 2905a: 82 e5 ldi r24, 0x52 ; 82 2905c: 98 eb ldi r25, 0xB8 ; 184 2905e: ae ed ldi r26, 0xDE ; 222 29060: bf e3 ldi r27, 0x3F ; 63 29062: 80 93 13 13 sts 0x1313, r24 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 29066: 90 93 14 13 sts 0x1314, r25 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 2906a: a0 93 15 13 sts 0x1315, r26 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 2906e: b0 93 16 13 sts 0x1316, r27 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> thermal_model::warn_beep = true; 29072: 81 e0 ldi r24, 0x01 ; 1 29074: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.469> thermal_model::enabled = true; 29078: 80 93 1d 05 sts 0x051D, r24 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 2907c: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 29080: 80 91 33 06 lds r24, 0x0633 ; 0x800633 29084: 8d 7f andi r24, 0xFD ; 253 29086: 80 93 33 06 sts 0x0633, r24 ; 0x800633 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 2908a: ce 01 movw r24, r28 2908c: 01 96 adiw r24, 0x01 ; 1 2908e: 0f 94 a1 47 call 0x28f42 ; 0x28f42 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(); } 29092: 0f 90 pop r0 29094: df 91 pop r29 29096: cf 91 pop r28 29098: 08 95 ret 0002909a : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 2909a: 1f 93 push r17 2909c: cf 93 push r28 2909e: df 93 push r29 290a0: 1f 92 push r1 290a2: cd b7 in r28, 0x3d ; 61 290a4: de b7 in r29, 0x3e ; 62 290a6: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 290a8: ce 01 movw r24, r28 290aa: 01 96 adiw r24, 0x01 ; 1 290ac: 0f 94 ae 47 call 0x28f5c ; 0x28f5c thermal_model::enabled = enabled; 290b0: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> thermal_model::setup(); 290b4: 0f 94 18 45 call 0x28a30 ; 0x28a30 void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 290b8: ce 01 movw r24, r28 290ba: 01 96 adiw r24, 0x01 ; 1 290bc: 0f 94 a1 47 call 0x28f42 ; 0x28f42 thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 290c0: 11 23 and r17, r17 290c2: 41 f0 breq .+16 ; 0x290d4 290c4: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> 290c8: 81 11 cpse r24, r1 290ca: 04 c0 rjmp .+8 ; 0x290d4 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 290cc: 8c e1 ldi r24, 0x1C ; 28 290ce: 9f e9 ldi r25, 0x9F ; 159 290d0: 0e 94 17 7b call 0xf62e ; 0xf62e } 290d4: 0f 90 pop r0 290d6: df 91 pop r29 290d8: cf 91 pop r28 290da: 1f 91 pop r17 290dc: 08 95 ret 000290de : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 290de: 1f 93 push r17 290e0: cf 93 push r28 290e2: df 93 push r29 290e4: 1f 92 push r1 290e6: cd b7 in r28, 0x3d ; 61 290e8: de b7 in r29, 0x3e ; 62 290ea: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 290ec: ce 01 movw r24, r28 290ee: 01 96 adiw r24, 0x01 ; 1 290f0: 0f 94 ae 47 call 0x28f5c ; 0x28f5c thermal_model::enabled = enabled; 290f4: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 290f8: 81 e0 ldi r24, 0x01 ; 1 290fa: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 290fe: e3 e3 ldi r30, 0x33 ; 51 29100: f6 e0 ldi r31, 0x06 ; 6 29102: 80 81 ld r24, Z 29104: 8d 7f andi r24, 0xFD ; 253 29106: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 29108: ce 01 movw r24, r28 2910a: 01 96 adiw r24, 0x01 ; 1 2910c: 0f 94 a1 47 call 0x28f42 ; 0x28f42 thermal_model::enabled = enabled; thermal_model::reinitialize(); } 29110: 0f 90 pop r0 29112: df 91 pop r29 29114: cf 91 pop r28 29116: 1f 91 pop r17 29118: 08 95 ret 0002911a : /* 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() { 2911a: cf 93 push r28 2911c: df 93 push r29 2911e: 1f 92 push r1 29120: cd b7 in r28, 0x3d ; 61 29122: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 29124: ce 01 movw r24, r28 29126: 01 96 adiw r24, 0x01 ; 1 29128: 0f 94 ae 47 call 0x28f5c ; 0x28f5c } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 29130: 90 91 18 05 lds r25, 0x0518 ; 0x800518 29134: a0 91 19 05 lds r26, 0x0519 ; 0x800519 29138: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 2913c: 80 93 5e 0e sts 0x0E5E, r24 ; 0x800e5e 29140: 90 93 5f 0e sts 0x0E5F, r25 ; 0x800e5f 29144: a0 93 60 0e sts 0x0E60, r26 ; 0x800e60 29148: b0 93 61 0e sts 0x0E61, r27 ; 0x800e61 current_temperature_bed = current_temperature_bed_isr; 2914c: 80 91 13 06 lds r24, 0x0613 ; 0x800613 29150: 90 91 14 06 lds r25, 0x0614 ; 0x800614 29154: a0 91 15 06 lds r26, 0x0615 ; 0x800615 29158: b0 91 16 06 lds r27, 0x0616 ; 0x800616 2915c: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee 29160: 90 93 ef 04 sts 0x04EF, r25 ; 0x8004ef 29164: a0 93 f0 04 sts 0x04F0, r26 ; 0x8004f0 29168: b0 93 f1 04 sts 0x04F1, r27 ; 0x8004f1 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 2916c: 80 91 fd 05 lds r24, 0x05FD ; 0x8005fd 29170: 90 91 fe 05 lds r25, 0x05FE ; 0x8005fe 29174: a0 91 ff 05 lds r26, 0x05FF ; 0x8005ff 29178: b0 91 00 06 lds r27, 0x0600 ; 0x800600 2917c: 80 93 95 03 sts 0x0395, r24 ; 0x800395 29180: 90 93 96 03 sts 0x0396, r25 ; 0x800396 29184: a0 93 97 03 sts 0x0397, r26 ; 0x800397 29188: b0 93 98 03 sts 0x0398, r27 ; 0x800398 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 2918c: 80 91 1a 06 lds r24, 0x061A ; 0x80061a 29190: 90 91 1b 06 lds r25, 0x061B ; 0x80061b 29194: a0 91 1c 06 lds r26, 0x061C ; 0x80061c 29198: b0 91 1d 06 lds r27, 0x061D ; 0x80061d 2919c: 80 93 50 06 sts 0x0650, r24 ; 0x800650 291a0: 90 93 51 06 sts 0x0651, r25 ; 0x800651 291a4: a0 93 52 06 sts 0x0652, r26 ; 0x800652 291a8: b0 93 53 06 sts 0x0653, r27 ; 0x800653 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 291ac: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 291b0: 81 11 cpse r24, r1 291b2: 02 c0 rjmp .+4 ; 0x291b8 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 291b4: 0f 94 ad 21 call 0x2435a ; 0x2435a } temp_meas_ready = false; 291b8: 10 92 fc 05 sts 0x05FC, r1 ; 0x8005fc - fetch updated values from temp_mgr_isr to current values - update target temperatures for temp_mgr_isr regulation *if* no temperature error is set This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; 291bc: ce 01 movw r24, r28 291be: 01 96 adiw r24, 0x01 ; 1 291c0: 0f 94 a1 47 call 0x28f42 ; 0x28f42 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 291c4: 0f 90 pop r0 291c6: df 91 pop r29 291c8: cf 91 pop r28 291ca: 08 95 ret 000291cc <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 291cc: 1f 92 push r1 291ce: 0f 92 push r0 291d0: 0f b6 in r0, 0x3f ; 63 291d2: 0f 92 push r0 291d4: 11 24 eor r1, r1 291d6: 0b b6 in r0, 0x3b ; 59 291d8: 0f 92 push r0 291da: ff 92 push r15 291dc: 0f 93 push r16 291de: 1f 93 push r17 291e0: 2f 93 push r18 291e2: 3f 93 push r19 291e4: 4f 93 push r20 291e6: 5f 93 push r21 291e8: 6f 93 push r22 291ea: 7f 93 push r23 291ec: 8f 93 push r24 291ee: 9f 93 push r25 291f0: af 93 push r26 291f2: bf 93 push r27 291f4: cf 93 push r28 291f6: df 93 push r29 291f8: ef 93 push r30 291fa: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 291fc: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 29200: 8b 7f andi r24, 0xFB ; 251 29202: 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(); 29206: 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) 29208: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 2920c: 86 fd sbrc r24, 6 2920e: c8 c0 rjmp .+400 ; 0x293a0 <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 29210: 68 ec ldi r22, 0xC8 ; 200 29212: 70 e0 ldi r23, 0x00 ; 0 29214: 8d ed ldi r24, 0xDD ; 221 29216: 95 e0 ldi r25, 0x05 ; 5 29218: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired_cont(unsigned short)> 2921c: 88 23 and r24, r24 2921e: b9 f0 breq .+46 ; 0x2924e <__vector_14+0x82> buttonBlanking.start(); 29220: 8d ed ldi r24, 0xDD ; 221 29222: 95 e0 ldi r25, 0x05 ; 5 29224: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> safetyTimer.start(); 29228: 88 ed ldi r24, 0xD8 ; 216 2922a: 95 e0 ldi r25, 0x05 ; 5 2922c: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 29230: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 29234: 81 11 cpse r24, r1 29236: a5 c0 rjmp .+330 ; 0x29382 <__vector_14+0x1b6> 29238: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 2923c: 81 11 cpse r24, r1 2923e: a1 c0 rjmp .+322 ; 0x29382 <__vector_14+0x1b6> { longPressTimer.start(); 29240: 83 ed ldi r24, 0xD3 ; 211 29242: 95 e0 ldi r25, 0x05 ; 5 29244: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> lcd_button_pressed = 1; 29248: 81 e0 ldi r24, 0x01 ; 1 2924a: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 2924e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 29252: 82 fb bst r24, 2 29254: 88 27 eor r24, r24 29256: 80 f9 bld r24, 0 29258: 91 e0 ldi r25, 0x01 ; 1 2925a: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 2925c: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 29260: 91 ff sbrs r25, 1 29262: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 29264: e0 91 d0 05 lds r30, 0x05D0 ; 0x8005d0 29268: e8 17 cp r30, r24 2926a: e1 f0 breq .+56 ; 0x292a4 <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 2926c: 24 e0 ldi r18, 0x04 ; 4 2926e: e2 9f mul r30, r18 29270: f0 01 movw r30, r0 29272: 11 24 eor r1, r1 29274: e8 2b or r30, r24 29276: e3 50 subi r30, 0x03 ; 3 29278: f1 46 sbci r31, 0x61 ; 97 2927a: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 2927c: 90 91 cf 05 lds r25, 0x05CF ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.559> 29280: e9 0f add r30, r25 29282: e0 93 cf 05 sts 0x05CF, r30 ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.559> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 29286: 0e 2e mov r0, r30 29288: 00 0c add r0, r0 2928a: ff 0b sbc r31, r31 2928c: f7 ff sbrs r31, 7 2928e: 03 c0 rjmp .+6 ; 0x29296 <__vector_14+0xca> 29290: f1 95 neg r31 29292: e1 95 neg r30 29294: f1 09 sbc r31, r1 29296: 34 97 sbiw r30, 0x04 ; 4 29298: 1c f0 brlt .+6 ; 0x292a0 <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 2929a: 91 e0 ldi r25, 0x01 ; 1 2929c: 90 93 d1 05 sts 0x05D1, r25 ; 0x8005d1 <_ZL26lcd_backlight_wake_trigger.lto_priv.558> } enc_bits_old = enc_bits; 292a0: 80 93 d0 05 sts 0x05D0, r24 ; 0x8005d0 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 292a4: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 292a8: 81 11 cpse r24, r1 292aa: 08 c0 rjmp .+16 ; 0x292bc <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 292ac: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 292b0: 80 93 e2 05 sts 0x05E2, r24 ; 0x8005e2 if(soft_pwm_0 > 0) 292b4: 88 23 and r24, r24 292b6: 09 f4 brne .+2 ; 0x292ba <__vector_14+0xee> 292b8: 87 c0 rjmp .+270 ; 0x293c8 <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 292ba: 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) 292bc: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 292c0: 8f 70 andi r24, 0x0F ; 15 292c2: a9 f4 brne .+42 ; 0x292ee <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 292c4: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 292c8: 90 e0 ldi r25, 0x00 ; 0 292ca: 24 e0 ldi r18, 0x04 ; 4 292cc: 95 95 asr r25 292ce: 87 95 ror r24 292d0: 2a 95 dec r18 292d2: e1 f7 brne .-8 ; 0x292cc <__vector_14+0x100> 292d4: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c <_ZL12soft_pwm_fan.lto_priv.474> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 292d8: 89 2b or r24, r25 292da: 09 f4 brne .+2 ; 0x292de <__vector_14+0x112> 292dc: 77 c0 rjmp .+238 ; 0x293cc <__vector_14+0x200> 292de: 9f b7 in r25, 0x3f ; 63 292e0: f8 94 cli 292e2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 292e6: 88 60 ori r24, 0x08 ; 8 292e8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 292ec: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 292ee: 90 91 e2 05 lds r25, 0x05E2 ; 0x8005e2 292f2: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 292f6: 98 17 cp r25, r24 292f8: 08 f4 brcc .+2 ; 0x292fc <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 292fa: 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); 292fc: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29300: 8f 70 andi r24, 0x0F ; 15 29302: 90 91 9c 04 lds r25, 0x049C ; 0x80049c <_ZL12soft_pwm_fan.lto_priv.474> 29306: 98 17 cp r25, r24 29308: 40 f4 brcc .+16 ; 0x2931a <__vector_14+0x14e> 2930a: 9f b7 in r25, 0x3f ; 63 2930c: f8 94 cli 2930e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29312: 87 7f andi r24, 0xF7 ; 247 29314: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29318: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 2931a: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2931e: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 29320: 8f 77 andi r24, 0x7F ; 127 29322: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 29326: 10 e0 ldi r17, 0x00 ; 0 29328: 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 2932a: e8 01 movw r28, r16 2932c: cc 0f add r28, r28 2932e: dd 1f adc r29, r29 29330: cd 59 subi r28, 0x9D ; 157 29332: d9 4f sbci r29, 0xF9 ; 249 29334: 88 81 ld r24, Y 29336: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 29338: 18 16 cp r1, r24 2933a: 19 06 cpc r1, r25 2933c: 0c f0 brlt .+2 ; 0x29340 <__vector_14+0x174> 2933e: 4c c0 rjmp .+152 ; 0x293d8 <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 29340: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 29342: f8 94 cli babystep(axis,/*fwd*/true); 29344: 61 e0 ldi r22, 0x01 ; 1 29346: 80 2f mov r24, r16 29348: 0f 94 be 21 call 0x2437c ; 0x2437c babystepsTodo[axis]--; //less to do next time 2934c: 88 81 ld r24, Y 2934e: 99 81 ldd r25, Y+1 ; 0x01 29350: 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 29352: 99 83 std Y+1, r25 ; 0x01 29354: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 29356: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 29358: 0f 5f subi r16, 0xFF ; 255 2935a: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 2935c: 03 30 cpi r16, 0x03 ; 3 2935e: 11 05 cpc r17, r1 29360: 21 f7 brne .-56 ; 0x2932a <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 29362: 80 91 36 18 lds r24, 0x1836 ; 0x801836 <__bss_end+0x20> 29366: 90 91 37 18 lds r25, 0x1837 ; 0x801837 <__bss_end+0x21> 2936a: a0 91 38 18 lds r26, 0x1838 ; 0x801838 <__bss_end+0x22> 2936e: b0 91 39 18 lds r27, 0x1839 ; 0x801839 <__bss_end+0x23> 29372: 82 3a cpi r24, 0xA2 ; 162 29374: 92 4a sbci r25, 0xA2 ; 162 29376: a1 05 cpc r26, r1 29378: b1 05 cpc r27, r1 2937a: d9 f1 breq .+118 ; 0x293f2 <__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); 2937c: 81 e0 ldi r24, 0x01 ; 1 2937e: 0e 94 1e 68 call 0xd03c ; 0xd03c if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 29382: 68 ee ldi r22, 0xE8 ; 232 29384: 73 e0 ldi r23, 0x03 ; 3 29386: 83 ed ldi r24, 0xD3 ; 211 29388: 95 e0 ldi r25, 0x05 ; 5 2938a: 0f 94 8d 3f call 0x27f1a ; 0x27f1a ::expired(unsigned short)> 2938e: 88 23 and r24, r24 29390: 09 f4 brne .+2 ; 0x29394 <__vector_14+0x1c8> 29392: 5d cf rjmp .-326 ; 0x2924e <__vector_14+0x82> { lcd_long_press_active = 1; 29394: 81 e0 ldi r24, 0x01 ; 1 29396: 80 93 d6 05 sts 0x05D6, r24 ; 0x8005d6 lcd_longpress_trigger = 1; 2939a: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 2939e: 57 cf rjmp .-338 ; 0x2924e <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 293a0: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 293a4: 88 23 and r24, r24 293a6: 09 f4 brne .+2 ; 0x293aa <__vector_14+0x1de> 293a8: 52 cf rjmp .-348 ; 0x2924e <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 293aa: 10 92 d7 05 sts 0x05D7, r1 ; 0x8005d7 if (!lcd_long_press_active) 293ae: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 293b2: 81 11 cpse r24, r1 293b4: 03 c0 rjmp .+6 ; 0x293bc <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 293b6: 81 e0 ldi r24, 0x01 ; 1 293b8: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 293bc: 81 e0 ldi r24, 0x01 ; 1 293be: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 <_ZL26lcd_backlight_wake_trigger.lto_priv.558> lcd_long_press_active = 0; 293c2: 10 92 d6 05 sts 0x05D6, r1 ; 0x8005d6 293c6: 43 cf rjmp .-378 ; 0x2924e <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 293c8: 75 98 cbi 0x0e, 5 ; 14 293ca: 78 cf rjmp .-272 ; 0x292bc <__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); 293cc: 9f b7 in r25, 0x3f ; 63 293ce: f8 94 cli 293d0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 293d4: 87 7f andi r24, 0xF7 ; 247 293d6: 88 cf rjmp .-240 ; 0x292e8 <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 293d8: 89 2b or r24, r25 293da: 09 f4 brne .+2 ; 0x293de <__vector_14+0x212> 293dc: bd cf rjmp .-134 ; 0x29358 <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 293de: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 293e0: f8 94 cli babystep(axis,/*fwd*/false); 293e2: 60 e0 ldi r22, 0x00 ; 0 293e4: 80 2f mov r24, r16 293e6: 0f 94 be 21 call 0x2437c ; 0x2437c babystepsTodo[axis]++; //less to do next time 293ea: 88 81 ld r24, Y 293ec: 99 81 ldd r25, Y+1 ; 0x01 293ee: 01 96 adiw r24, 0x01 ; 1 293f0: b0 cf rjmp .-160 ; 0x29352 <__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]) { 293f2: 9c b1 in r25, 0x0c ; 12 293f4: 80 91 e0 05 lds r24, 0x05E0 ; 0x8005e0 293f8: 96 fb bst r25, 6 293fa: 99 27 eor r25, r25 293fc: 90 f9 bld r25, 0 293fe: 98 17 cp r25, r24 29400: 91 f0 breq .+36 ; 0x29426 <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 29402: 90 91 33 05 lds r25, 0x0533 ; 0x800533 29406: 99 23 and r25, r25 29408: 51 f0 breq .+20 ; 0x2941e <__vector_14+0x252> 2940a: 20 91 b2 04 lds r18, 0x04B2 ; 0x8004b2 2940e: 30 91 b3 04 lds r19, 0x04B3 ; 0x8004b3 29412: 2f 5f subi r18, 0xFF ; 255 29414: 3f 4f sbci r19, 0xFF ; 255 29416: 30 93 b3 04 sts 0x04B3, r19 ; 0x8004b3 2941a: 20 93 b2 04 sts 0x04B2, r18 ; 0x8004b2 fan_state[0] = !fan_state[0]; 2941e: 91 e0 ldi r25, 0x01 ; 1 29420: 89 27 eor r24, r25 29422: 80 93 e0 05 sts 0x05E0, r24 ; 0x8005e0 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 29426: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 29428: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 2942c: 84 60 ori r24, 0x04 ; 4 2942e: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 29432: ff 91 pop r31 29434: ef 91 pop r30 29436: df 91 pop r29 29438: cf 91 pop r28 2943a: bf 91 pop r27 2943c: af 91 pop r26 2943e: 9f 91 pop r25 29440: 8f 91 pop r24 29442: 7f 91 pop r23 29444: 6f 91 pop r22 29446: 5f 91 pop r21 29448: 4f 91 pop r20 2944a: 3f 91 pop r19 2944c: 2f 91 pop r18 2944e: 1f 91 pop r17 29450: 0f 91 pop r16 29452: ff 90 pop r15 29454: 0f 90 pop r0 29456: 0b be out 0x3b, r0 ; 59 29458: 0f 90 pop r0 2945a: 0f be out 0x3f, r0 ; 63 2945c: 0f 90 pop r0 2945e: 1f 90 pop r1 29460: 18 95 reti 00029462 : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 29462: 4f 92 push r4 29464: 5f 92 push r5 29466: 6f 92 push r6 29468: 7f 92 push r7 2946a: af 92 push r10 2946c: bf 92 push r11 2946e: cf 92 push r12 29470: df 92 push r13 29472: ef 92 push r14 29474: ff 92 push r15 29476: 0f 93 push r16 29478: 1f 93 push r17 2947a: cf 93 push r28 2947c: df 93 push r29 2947e: 24 e0 ldi r18, 0x04 ; 4 29480: 30 e0 ldi r19, 0x00 ; 0 29482: 41 e0 ldi r20, 0x01 ; 1 29484: 50 e0 ldi r21, 0x00 ; 0 29486: d9 01 movw r26, r18 29488: a1 57 subi r26, 0x71 ; 113 2948a: b2 46 sbci r27, 0x62 ; 98 float celsius = 0; byte i; for (i=1; i raw) 2948c: fd 01 movw r30, r26 2948e: 65 91 lpm r22, Z+ 29490: 74 91 lpm r23, Z 29492: 86 17 cp r24, r22 29494: 97 07 cpc r25, r23 29496: 0c f0 brlt .+2 ; 0x2949a 29498: 66 c0 rjmp .+204 ; 0x29566 { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 2949a: 41 50 subi r20, 0x01 ; 1 2949c: 51 09 sbc r21, r1 2949e: 44 0f add r20, r20 294a0: 55 1f adc r21, r21 294a2: 44 0f add r20, r20 294a4: 55 1f adc r21, r21 294a6: ea 01 movw r28, r20 294a8: cf 56 subi r28, 0x6F ; 111 294aa: d2 46 sbci r29, 0x62 ; 98 294ac: fe 01 movw r30, r28 294ae: 05 91 lpm r16, Z+ 294b0: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 294b2: 41 57 subi r20, 0x71 ; 113 294b4: 52 46 sbci r21, 0x62 ; 98 294b6: fa 01 movw r30, r20 294b8: 65 91 lpm r22, Z+ 294ba: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 294bc: f9 01 movw r30, r18 294be: ef 56 subi r30, 0x6F ; 111 294c0: f2 46 sbci r31, 0x62 ; 98 294c2: e5 90 lpm r14, Z+ 294c4: f4 90 lpm r15, Z 294c6: fe 01 movw r30, r28 294c8: c5 90 lpm r12, Z+ 294ca: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 294cc: fd 01 movw r30, r26 294ce: c5 91 lpm r28, Z+ 294d0: d4 91 lpm r29, Z 294d2: fa 01 movw r30, r20 294d4: a5 90 lpm r10, Z+ 294d6: 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])) * 294d8: 86 1b sub r24, r22 294da: 97 0b sbc r25, r23 294dc: bc 01 movw r22, r24 294de: 99 0f add r25, r25 294e0: 88 0b sbc r24, r24 294e2: 99 0b sbc r25, r25 294e4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 294e8: 2b 01 movw r4, r22 294ea: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 294ec: b7 01 movw r22, r14 294ee: 6c 19 sub r22, r12 294f0: 7d 09 sbc r23, r13 294f2: 07 2e mov r0, r23 294f4: 00 0c add r0, r0 294f6: 88 0b sbc r24, r24 294f8: 99 0b sbc r25, r25 294fa: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 294fe: 9b 01 movw r18, r22 29500: 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])) * 29502: c3 01 movw r24, r6 29504: b2 01 movw r22, r4 29506: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2950a: 6b 01 movw r12, r22 2950c: 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])); 2950e: be 01 movw r22, r28 29510: 6a 19 sub r22, r10 29512: 7b 09 sbc r23, r11 29514: 07 2e mov r0, r23 29516: 00 0c add r0, r0 29518: 88 0b sbc r24, r24 2951a: 99 0b sbc r25, r25 2951c: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 29520: 9b 01 movw r18, r22 29522: 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])) / 29524: c7 01 movw r24, r14 29526: b6 01 movw r22, r12 29528: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 2952c: 6b 01 movw r12, r22 2952e: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 29530: b8 01 movw r22, r16 29532: 11 0f add r17, r17 29534: 88 0b sbc r24, r24 29536: 99 0b sbc r25, r25 29538: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 2953c: 9b 01 movw r18, r22 2953e: ac 01 movw r20, r24 29540: c7 01 movw r24, r14 29542: b6 01 movw r22, r12 29544: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 29548: df 91 pop r29 2954a: cf 91 pop r28 2954c: 1f 91 pop r17 2954e: 0f 91 pop r16 29550: ff 90 pop r15 29552: ef 90 pop r14 29554: df 90 pop r13 29556: cf 90 pop r12 29558: bf 90 pop r11 2955a: af 90 pop r10 2955c: 7f 90 pop r7 2955e: 6f 90 pop r6 29560: 5f 90 pop r5 29562: 4f 90 pop r4 29564: 08 95 ret 29566: 4f 5f subi r20, 0xFF ; 255 29568: 5f 4f sbci r21, 0xFF ; 255 2956a: 2c 5f subi r18, 0xFC ; 252 2956c: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 29574: 88 cf rjmp .-240 ; 0x29486 (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]); 29576: e5 e1 ldi r30, 0x15 ; 21 29578: fe e9 ldi r31, 0x9E ; 158 2957a: 65 91 lpm r22, Z+ 2957c: 74 91 lpm r23, Z 2957e: 07 2e mov r0, r23 29580: 00 0c add r0, r0 29582: 88 0b sbc r24, r24 29584: 99 0b sbc r25, r25 29586: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 2958a: de cf rjmp .-68 ; 0x29548 0002958c : 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) { 2958c: 4f 92 push r4 2958e: 5f 92 push r5 29590: 6f 92 push r6 29592: 7f 92 push r7 29594: af 92 push r10 29596: bf 92 push r11 29598: cf 92 push r12 2959a: df 92 push r13 2959c: ef 92 push r14 2959e: ff 92 push r15 295a0: 0f 93 push r16 295a2: 1f 93 push r17 295a4: cf 93 push r28 295a6: df 93 push r29 295a8: 24 e0 ldi r18, 0x04 ; 4 295aa: 30 e0 ldi r19, 0x00 ; 0 295ac: 41 e0 ldi r20, 0x01 ; 1 295ae: 50 e0 ldi r21, 0x00 ; 0 295b0: d9 01 movw r26, r18 295b2: a5 56 subi r26, 0x65 ; 101 295b4: b3 46 sbci r27, 0x63 ; 99 float celsius = 0; byte i; for (i=1; i raw) 295b6: fd 01 movw r30, r26 295b8: 65 91 lpm r22, Z+ 295ba: 74 91 lpm r23, Z 295bc: 86 17 cp r24, r22 295be: 97 07 cpc r25, r23 295c0: 0c f0 brlt .+2 ; 0x295c4 295c2: 80 c0 rjmp .+256 ; 0x296c4 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 295c4: 41 50 subi r20, 0x01 ; 1 295c6: 51 09 sbc r21, r1 295c8: 44 0f add r20, r20 295ca: 55 1f adc r21, r21 295cc: 44 0f add r20, r20 295ce: 55 1f adc r21, r21 295d0: 8a 01 movw r16, r20 295d2: 03 56 subi r16, 0x63 ; 99 295d4: 13 46 sbci r17, 0x63 ; 99 295d6: f8 01 movw r30, r16 295d8: c5 90 lpm r12, Z+ 295da: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 295dc: 45 56 subi r20, 0x65 ; 101 295de: 53 46 sbci r21, 0x63 ; 99 295e0: fa 01 movw r30, r20 295e2: 65 91 lpm r22, Z+ 295e4: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 295e6: f9 01 movw r30, r18 295e8: e3 56 subi r30, 0x63 ; 99 295ea: f3 46 sbci r31, 0x63 ; 99 295ec: c5 91 lpm r28, Z+ 295ee: d4 91 lpm r29, Z 295f0: f8 01 movw r30, r16 295f2: 05 91 lpm r16, Z+ 295f4: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 295f6: fd 01 movw r30, r26 295f8: e5 90 lpm r14, Z+ 295fa: f4 90 lpm r15, Z 295fc: fa 01 movw r30, r20 295fe: a5 90 lpm r10, Z+ 29600: 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])) * 29602: 86 1b sub r24, r22 29604: 97 0b sbc r25, r23 29606: bc 01 movw r22, r24 29608: 99 0f add r25, r25 2960a: 88 0b sbc r24, r24 2960c: 99 0b sbc r25, r25 2960e: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 29612: 2b 01 movw r4, r22 29614: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 29616: be 01 movw r22, r28 29618: 60 1b sub r22, r16 2961a: 71 0b sbc r23, r17 2961c: 07 2e mov r0, r23 2961e: 00 0c add r0, r0 29620: 88 0b sbc r24, r24 29622: 99 0b sbc r25, r25 29624: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 29628: 9b 01 movw r18, r22 2962a: 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])) * 2962c: c3 01 movw r24, r6 2962e: b2 01 movw r22, r4 29630: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 29634: 2b 01 movw r4, r22 29636: 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])); 29638: b7 01 movw r22, r14 2963a: 6a 19 sub r22, r10 2963c: 7b 09 sbc r23, r11 2963e: 07 2e mov r0, r23 29640: 00 0c add r0, r0 29642: 88 0b sbc r24, r24 29644: 99 0b sbc r25, r25 29646: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 2964a: 9b 01 movw r18, r22 2964c: 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])) / 2964e: c3 01 movw r24, r6 29650: b2 01 movw r22, r4 29652: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 29656: 2b 01 movw r4, r22 29658: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 2965a: b6 01 movw r22, r12 2965c: dd 0c add r13, r13 2965e: 88 0b sbc r24, r24 29660: 99 0b sbc r25, r25 29662: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 29666: 9b 01 movw r18, r22 29668: ac 01 movw r20, r24 2966a: c3 01 movw r24, r6 2966c: b2 01 movw r22, r4 2966e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 29672: 6b 01 movw r12, r22 29674: 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) 29676: 20 e0 ldi r18, 0x00 ; 0 29678: 30 e0 ldi r19, 0x00 ; 0 2967a: 40 e2 ldi r20, 0x20 ; 32 2967c: 52 e4 ldi r21, 0x42 ; 66 2967e: c7 01 movw r24, r14 29680: b6 01 movw r22, r12 29682: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 29686: 87 fd sbrc r24, 7 29688: 30 c0 rjmp .+96 ; 0x296ea 2968a: 20 e0 ldi r18, 0x00 ; 0 2968c: 30 e0 ldi r19, 0x00 ; 0 2968e: 48 e4 ldi r20, 0x48 ; 72 29690: 52 e4 ldi r21, 0x42 ; 66 29692: c7 01 movw r24, r14 29694: b6 01 movw r22, r12 29696: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2969a: 18 16 cp r1, r24 2969c: 34 f1 brlt .+76 ; 0x296ea { celsius = celsius + (_first_koef * (celsius - _offset_start)); 2969e: 20 e0 ldi r18, 0x00 ; 0 296a0: 30 e0 ldi r19, 0x00 ; 0 296a2: 40 e2 ldi r20, 0x20 ; 32 296a4: 52 e4 ldi r21, 0x42 ; 66 296a6: c7 01 movw r24, r14 296a8: b6 01 movw r22, r12 296aa: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 296ae: 20 e0 ldi r18, 0x00 ; 0 296b0: 30 e0 ldi r19, 0x00 ; 0 296b2: 40 e0 ldi r20, 0x00 ; 0 296b4: 5f e3 ldi r21, 0x3F ; 63 296b6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 296ba: 9b 01 movw r18, r22 296bc: 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; 296be: c7 01 movw r24, r14 296c0: b6 01 movw r22, r12 296c2: 43 c0 rjmp .+134 ; 0x2974a 296c4: 4f 5f subi r20, 0xFF ; 255 296c6: 5f 4f sbci r21, 0xFF ; 255 296c8: 2c 5f subi r18, 0xFC ; 252 296ca: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 296d2: 6e cf rjmp .-292 ; 0x295b0 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 296d4: ed e8 ldi r30, 0x8D ; 141 296d6: fd e9 ldi r31, 0x9D ; 157 296d8: 65 91 lpm r22, Z+ 296da: 74 91 lpm r23, Z 296dc: 07 2e mov r0, r23 296de: 00 0c add r0, r0 296e0: 88 0b sbc r24, r24 296e2: 99 0b sbc r25, r25 296e4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 296e8: c4 cf rjmp .-120 ; 0x29672 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 296ea: 20 e0 ldi r18, 0x00 ; 0 296ec: 30 e0 ldi r19, 0x00 ; 0 296ee: 48 e4 ldi r20, 0x48 ; 72 296f0: 52 e4 ldi r21, 0x42 ; 66 296f2: c7 01 movw r24, r14 296f4: b6 01 movw r22, r12 296f6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 296fa: 18 16 cp r1, r24 296fc: dc f5 brge .+118 ; 0x29774 296fe: 20 e0 ldi r18, 0x00 ; 0 29700: 30 e0 ldi r19, 0x00 ; 0 29702: 48 ec ldi r20, 0xC8 ; 200 29704: 52 e4 ldi r21, 0x42 ; 66 29706: c7 01 movw r24, r14 29708: b6 01 movw r22, r12 2970a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2970e: 18 16 cp r1, r24 29710: 8c f1 brlt .+98 ; 0x29774 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 29712: 20 e0 ldi r18, 0x00 ; 0 29714: 30 e0 ldi r19, 0x00 ; 0 29716: 40 ea ldi r20, 0xA0 ; 160 29718: 50 e4 ldi r21, 0x40 ; 64 2971a: c7 01 movw r24, r14 2971c: b6 01 movw r22, r12 2971e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 29722: 2b 01 movw r4, r22 29724: 3c 01 movw r6, r24 29726: 20 e0 ldi r18, 0x00 ; 0 29728: 30 e0 ldi r19, 0x00 ; 0 2972a: 48 e4 ldi r20, 0x48 ; 72 2972c: 52 e4 ldi r21, 0x42 ; 66 2972e: c7 01 movw r24, r14 29730: b6 01 movw r22, r12 29732: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 29736: 2d ec ldi r18, 0xCD ; 205 29738: 3c ec ldi r19, 0xCC ; 204 2973a: 4c ec ldi r20, 0xCC ; 204 2973c: 5d e3 ldi r21, 0x3D ; 61 2973e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 29742: 9b 01 movw r18, r22 29744: ac 01 movw r20, r24 29746: c3 01 movw r24, r6 29748: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 2974a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2974e: 6b 01 movw r12, r22 29750: 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 } 29752: c7 01 movw r24, r14 29754: b6 01 movw r22, r12 29756: df 91 pop r29 29758: cf 91 pop r28 2975a: 1f 91 pop r17 2975c: 0f 91 pop r16 2975e: ff 90 pop r15 29760: ef 90 pop r14 29762: df 90 pop r13 29764: cf 90 pop r12 29766: bf 90 pop r11 29768: af 90 pop r10 2976a: 7f 90 pop r7 2976c: 6f 90 pop r6 2976e: 5f 90 pop r5 29770: 4f 90 pop r4 29772: 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) 29774: 20 e0 ldi r18, 0x00 ; 0 29776: 30 e0 ldi r19, 0x00 ; 0 29778: 48 ec ldi r20, 0xC8 ; 200 2977a: 52 e4 ldi r21, 0x42 ; 66 2977c: c7 01 movw r24, r14 2977e: b6 01 movw r22, r12 29780: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 29784: 18 16 cp r1, r24 29786: 2c f7 brge .-54 ; 0x29752 { celsius = celsius + _offset; 29788: 20 e0 ldi r18, 0x00 ; 0 2978a: 30 e0 ldi r19, 0x00 ; 0 2978c: 40 e2 ldi r20, 0x20 ; 32 2978e: 51 e4 ldi r21, 0x41 ; 65 29790: 96 cf rjmp .-212 ; 0x296be 00029792 : } static void check_temp_raw(); static void temp_mgr_isr() { 29792: 4f 92 push r4 29794: 5f 92 push r5 29796: 6f 92 push r6 29798: 7f 92 push r7 2979a: af 92 push r10 2979c: cf 92 push r12 2979e: df 92 push r13 297a0: ef 92 push r14 297a2: ff 92 push r15 297a4: 0f 93 push r16 297a6: 1f 93 push r17 297a8: cf 93 push r28 297aa: 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 297b0: 90 91 06 06 lds r25, 0x0606 ; 0x800606 297b4: 0e 94 9e da call 0x1b53c ; 0x1b53c 297b8: 60 93 17 05 sts 0x0517, r22 ; 0x800517 297bc: 70 93 18 05 sts 0x0518, r23 ; 0x800518 297c0: 80 93 19 05 sts 0x0519, r24 ; 0x800519 297c4: 90 93 1a 05 sts 0x051A, r25 ; 0x80051a current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 297c8: 60 90 03 06 lds r6, 0x0603 ; 0x800603 297cc: 70 90 04 06 lds r7, 0x0604 ; 0x800604 297d0: c3 01 movw r24, r6 297d2: 0f 94 c6 4a call 0x2958c ; 0x2958c 297d6: 6b 01 movw r12, r22 297d8: 7c 01 movw r14, r24 297da: c0 92 13 06 sts 0x0613, r12 ; 0x800613 297de: d0 92 14 06 sts 0x0614, r13 ; 0x800614 297e2: e0 92 15 06 sts 0x0615, r14 ; 0x800615 297e6: f0 92 16 06 sts 0x0616, r15 ; 0x800616 #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 297ea: 80 91 01 06 lds r24, 0x0601 ; 0x800601 297ee: 90 91 02 06 lds r25, 0x0602 ; 0x800602 297f2: 0f 94 c6 4a call 0x2958c ; 0x2958c 297f6: 60 93 fd 05 sts 0x05FD, r22 ; 0x8005fd 297fa: 70 93 fe 05 sts 0x05FE, r23 ; 0x8005fe 297fe: 80 93 ff 05 sts 0x05FF, r24 ; 0x8005ff 29802: 90 93 00 06 sts 0x0600, r25 ; 0x800600 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) 29806: c0 91 0f 06 lds r28, 0x060F ; 0x80060f 2980a: d0 91 10 06 lds r29, 0x0610 ; 0x800610 2980e: ce 01 movw r24, r28 29810: 0f 94 31 4a call 0x29462 ; 0x29462 29814: 60 93 1a 06 sts 0x061A, r22 ; 0x80061a 29818: 70 93 1b 06 sts 0x061B, r23 ; 0x80061b 2981c: 80 93 1c 06 sts 0x061C, r24 ; 0x80061c 29820: 90 93 1d 06 sts 0x061D, r25 ; 0x80061d #endif temp_meas_ready = true; 29824: 81 e0 ldi r24, 0x01 ; 1 29826: 80 93 fc 05 sts 0x05FC, r24 ; 0x8005fc { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 2982a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 2982e: 8d 7f andi r24, 0xFD ; 253 29830: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 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]) { 29834: 20 91 05 06 lds r18, 0x0605 ; 0x800605 29838: 30 91 06 06 lds r19, 0x0606 ; 0x800606 2983c: 80 91 98 04 lds r24, 0x0498 ; 0x800498 <_ZL12maxttemp_raw.lto_priv.477> 29840: 90 91 99 04 lds r25, 0x0499 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.477+0x1> 29844: 82 17 cp r24, r18 29846: 93 07 cpc r25, r19 29848: 2c f0 brlt .+10 ; 0x29854 #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 2984a: 40 e0 ldi r20, 0x00 ; 0 2984c: 60 e0 ldi r22, 0x00 ; 0 2984e: 80 e0 ldi r24, 0x00 ; 0 29850: 0f 94 42 45 call 0x28a84 ; 0x28a84 } //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) { 29854: 80 91 96 04 lds r24, 0x0496 ; 0x800496 <_ZL16bed_maxttemp_raw.lto_priv.478> 29858: 90 91 97 04 lds r25, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.478+0x1> 2985c: 86 15 cp r24, r6 2985e: 97 05 cpc r25, r7 29860: 2c f0 brlt .+10 ; 0x2986c #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 29862: 40 e0 ldi r20, 0x00 ; 0 29864: 60 e0 ldi r22, 0x00 ; 0 29866: 81 e0 ldi r24, 0x01 ; 1 29868: 0f 94 42 45 call 0x28a84 ; 0x28a84 } #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) { 2986c: 80 91 94 04 lds r24, 0x0494 ; 0x800494 <_ZL20ambient_maxttemp_raw.lto_priv.479> 29870: 90 91 95 04 lds r25, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.479+0x1> 29874: 8c 17 cp r24, r28 29876: 9d 07 cpc r25, r29 29878: 2c f0 brlt .+10 ; 0x29884 #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 2987a: 40 e0 ldi r20, 0x00 ; 0 2987c: 60 e0 ldi r22, 0x00 ; 0 2987e: 82 e0 ldi r24, 0x02 ; 2 29880: 0f 94 42 45 call 0x28a84 ; 0x28a84 #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) { 29884: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.476> 29888: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.476+0x1> 2988c: c8 17 cp r28, r24 2988e: d9 07 cpc r29, r25 29890: 2c f0 brlt .+10 ; 0x2989c #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 29892: 41 e0 ldi r20, 0x01 ; 1 29894: 60 e0 ldi r22, 0x00 ; 0 29896: 82 e0 ldi r24, 0x02 ; 2 29898: 0f 94 42 45 call 0x28a84 ; 0x28a84 #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 2989c: c1 3a cpi r28, 0xA1 ; 161 2989e: de 43 sbci r29, 0x3E ; 62 298a0: 0c f4 brge .+2 ; 0x298a4 298a2: cd c1 rjmp .+922 ; 0x29c3e { // 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]) { 298a4: 60 91 9a 04 lds r22, 0x049A ; 0x80049a <_ZL8minttemp.lto_priv.475> 298a8: 70 91 9b 04 lds r23, 0x049B ; 0x80049b <_ZL8minttemp.lto_priv.475+0x1> 298ac: 80 91 18 06 lds r24, 0x0618 ; 0x800618 298b0: 90 91 19 06 lds r25, 0x0619 ; 0x800619 298b4: 68 17 cp r22, r24 298b6: 79 07 cpc r23, r25 298b8: 0c f0 brlt .+2 ; 0x298bc 298ba: 55 c0 rjmp .+170 ; 0x29966 // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 298bc: c0 91 0e 06 lds r28, 0x060E ; 0x80060e 298c0: c1 11 cpse r28, r1 298c2: 18 c0 rjmp .+48 ; 0x298f4 298c4: 6b 5f subi r22, 0xFB ; 251 298c6: 7f 4f sbci r23, 0xFF ; 255 298c8: 07 2e mov r0, r23 298ca: 00 0c add r0, r0 298cc: 88 0b sbc r24, r24 298ce: 99 0b sbc r25, r25 298d0: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 298d4: 9b 01 movw r18, r22 298d6: ac 01 movw r20, r24 298d8: c1 e0 ldi r28, 0x01 ; 1 298da: 60 91 17 05 lds r22, 0x0517 ; 0x800517 298de: 70 91 18 05 lds r23, 0x0518 ; 0x800518 298e2: 80 91 19 05 lds r24, 0x0519 ; 0x800519 298e6: 90 91 1a 05 lds r25, 0x051A ; 0x80051a 298ea: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 298ee: 18 16 cp r1, r24 298f0: 0c f0 brlt .+2 ; 0x298f4 298f2: c0 e0 ldi r28, 0x00 ; 0 298f4: c0 93 0e 06 sts 0x060E, r28 ; 0x80060e if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 298f8: 68 e9 ldi r22, 0x98 ; 152 298fa: 7a e3 ldi r23, 0x3A ; 58 298fc: 8b e0 ldi r24, 0x0B ; 11 298fe: 96 e0 ldi r25, 0x06 ; 6 29900: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired_cont(unsigned short)> 29904: 81 11 cpse r24, r1 29906: 02 c0 rjmp .+4 ; 0x2990c 29908: cc 23 and r28, r28 2990a: 29 f0 breq .+10 ; 0x29916 bCheckingOnHeater=true; // not necessary 2990c: 81 e0 ldi r24, 0x01 ; 1 2990e: 80 93 0e 06 sts 0x060E, r24 ; 0x80060e check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active 29912: 0f 94 bc 45 call 0x28b78 ; 0x28b78 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 29916: 80 91 11 06 lds r24, 0x0611 ; 0x800611 2991a: 90 91 12 06 lds r25, 0x0612 ; 0x800612 2991e: 0b 97 sbiw r24, 0x0b ; 11 29920: 4c f1 brlt .+82 ; 0x29974 // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 29922: c0 91 0a 06 lds r28, 0x060A ; 0x80060a 29926: c1 11 cpse r28, r1 29928: 0c c0 rjmp .+24 ; 0x29942 2992a: c1 e0 ldi r28, 0x01 ; 1 2992c: 20 e0 ldi r18, 0x00 ; 0 2992e: 30 e0 ldi r19, 0x00 ; 0 29930: 40 e7 ldi r20, 0x70 ; 112 29932: 51 e4 ldi r21, 0x41 ; 65 29934: c7 01 movw r24, r14 29936: b6 01 movw r22, r12 29938: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 2993c: 18 16 cp r1, r24 2993e: 0c f0 brlt .+2 ; 0x29942 29940: c0 e0 ldi r28, 0x00 ; 0 29942: c0 93 0a 06 sts 0x060A, r28 ; 0x80060a if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 29946: 60 e5 ldi r22, 0x50 ; 80 29948: 73 ec ldi r23, 0xC3 ; 195 2994a: 87 e0 ldi r24, 0x07 ; 7 2994c: 96 e0 ldi r25, 0x06 ; 6 2994e: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired_cont(unsigned short)> 29952: 81 11 cpse r24, r1 29954: 02 c0 rjmp .+4 ; 0x2995a 29956: cc 23 and r28, r28 29958: 99 f0 breq .+38 ; 0x29980 bCheckingOnBed=true; // not necessary 2995a: 81 e0 ldi r24, 0x01 ; 1 2995c: 80 93 0a 06 sts 0x060A, r24 ; 0x80060a #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 29960: 0f 94 ab 45 call 0x28b56 ; 0x28b56 29964: 0d c0 rjmp .+26 ; 0x29980 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 29966: 8b e0 ldi r24, 0x0B ; 11 29968: 96 e0 ldi r25, 0x06 ; 6 2996a: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> bCheckingOnHeater=false; 2996e: 10 92 0e 06 sts 0x060E, r1 ; 0x80060e 29972: d1 cf rjmp .-94 ; 0x29916 check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 29974: 87 e0 ldi r24, 0x07 ; 7 29976: 96 e0 ldi r25, 0x06 ; 6 29978: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> bCheckingOnBed=false; 2997c: 10 92 0a 06 sts 0x060A, r1 ; 0x80060a static void check_temp_runaway() { #ifdef TEMP_RUNAWAY_EXTRUDER_HYSTERESIS for(uint8_t e = 0; e < EXTRUDERS; e++) temp_runaway_check(e+1, target_temperature_isr[e], current_temperature_isr[e], soft_pwm[e], false); 29980: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 29984: 70 e0 ldi r23, 0x00 ; 0 29986: 90 e0 ldi r25, 0x00 ; 0 29988: 80 e0 ldi r24, 0x00 ; 0 2998a: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 2998e: 6b 01 movw r12, r22 29990: 7c 01 movw r14, r24 29992: 40 90 17 05 lds r4, 0x0517 ; 0x800517 29996: 50 90 18 05 lds r5, 0x0518 ; 0x800518 2999a: 60 90 19 05 lds r6, 0x0519 ; 0x800519 2999e: 70 90 1a 05 lds r7, 0x051A ; 0x80051a 299a2: 60 91 18 06 lds r22, 0x0618 ; 0x800618 299a6: 70 91 19 06 lds r23, 0x0619 ; 0x800619 299aa: 07 2e mov r0, r23 299ac: 00 0c add r0, r0 299ae: 88 0b sbc r24, r24 299b0: 99 0b sbc r25, r25 299b2: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 299b6: ab 01 movw r20, r22 299b8: bc 01 movw r22, r24 299ba: a1 2c mov r10, r1 299bc: 93 01 movw r18, r6 299be: 82 01 movw r16, r4 299c0: 81 e0 ldi r24, 0x01 ; 1 299c2: 0f 94 cd 45 call 0x28b9a ; 0x28b9a #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 299c6: 60 91 17 06 lds r22, 0x0617 ; 0x800617 299ca: 70 e0 ldi r23, 0x00 ; 0 299cc: 90 e0 ldi r25, 0x00 ; 0 299ce: 80 e0 ldi r24, 0x00 ; 0 299d0: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 299d4: 6b 01 movw r12, r22 299d6: 7c 01 movw r14, r24 299d8: 40 90 13 06 lds r4, 0x0613 ; 0x800613 299dc: 50 90 14 06 lds r5, 0x0614 ; 0x800614 299e0: 60 90 15 06 lds r6, 0x0615 ; 0x800615 299e4: 70 90 16 06 lds r7, 0x0616 ; 0x800616 299e8: 60 91 11 06 lds r22, 0x0611 ; 0x800611 299ec: 70 91 12 06 lds r23, 0x0612 ; 0x800612 299f0: 07 2e mov r0, r23 299f2: 00 0c add r0, r0 299f4: 88 0b sbc r24, r24 299f6: 99 0b sbc r25, r25 299f8: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 299fc: ab 01 movw r20, r22 299fe: bc 01 movw r22, r24 29a00: aa 24 eor r10, r10 29a02: a3 94 inc r10 29a04: 93 01 movw r18, r6 29a06: 82 01 movw r16, r4 29a08: 80 e0 ldi r24, 0x00 ; 0 29a0a: 0f 94 cd 45 call 0x28b9a ; 0x28b9a return true; } static void check() { if(!enabled) return; 29a0e: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.470> 29a12: 88 23 and r24, r24 29a14: 09 f4 brne .+2 ; 0x29a18 29a16: bc c0 rjmp .+376 ; 0x29b90 uint8_t heater_pwm = soft_pwm[0]; 29a18: c0 91 16 05 lds r28, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> uint8_t fan_pwm = soft_pwm_fan; 29a1c: d0 91 9c 04 lds r29, 0x049C ; 0x80049c <_ZL12soft_pwm_fan.lto_priv.474> float heater_temp = current_temperature_isr[0]; 29a20: 40 90 17 05 lds r4, 0x0517 ; 0x800517 29a24: 50 90 18 05 lds r5, 0x0518 ; 0x800518 29a28: 60 90 19 05 lds r6, 0x0519 ; 0x800519 29a2c: 70 90 1a 05 lds r7, 0x051A ; 0x80051a float ambient_temp = current_temperature_ambient_isr; 29a30: c0 90 1a 06 lds r12, 0x061A ; 0x80061a 29a34: d0 90 1b 06 lds r13, 0x061B ; 0x80061b 29a38: e0 90 1c 06 lds r14, 0x061C ; 0x80061c 29a3c: f0 90 1d 06 lds r15, 0x061D ; 0x80061d // check if a reset is required to seed the model: this needs to be done with valid // ADC values, so we can't do that directly in init() if(data.flag_bits.uninitialized) 29a40: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29a44: 80 ff sbrs r24, 0 29a46: 72 c0 rjmp .+228 ; 0x29b2c 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); 29a48: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 29a4c: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 29a50: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 29a54: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 29a58: 61 e7 ldi r22, 0x71 ; 113 29a5a: 7d e3 ldi r23, 0x3D ; 61 29a5c: 8a e8 ldi r24, 0x8A ; 138 29a5e: 9e e3 ldi r25, 0x3E ; 62 29a60: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 29a64: 60 93 18 13 sts 0x1318, r22 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 29a68: 70 93 19 13 sts 0x1319, r23 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 29a6c: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 29a70: 90 93 1b 13 sts 0x131B, r25 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> warn_s = warn * TEMP_MGR_INTV; 29a74: 21 e7 ldi r18, 0x71 ; 113 29a76: 3d e3 ldi r19, 0x3D ; 61 29a78: 4a e8 ldi r20, 0x8A ; 138 29a7a: 5e e3 ldi r21, 0x3E ; 62 29a7c: 60 91 0f 13 lds r22, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 29a80: 70 91 10 13 lds r23, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 29a84: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 29a88: 90 91 12 13 lds r25, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 29a8c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 29a90: 60 93 1c 13 sts 0x131C, r22 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 29a94: 70 93 1d 13 sts 0x131D, r23 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 29a98: 80 93 1e 13 sts 0x131E, r24 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 29a9c: 90 93 1f 13 sts 0x131F, r25 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> err_s = err * TEMP_MGR_INTV; 29aa0: 21 e7 ldi r18, 0x71 ; 113 29aa2: 3d e3 ldi r19, 0x3D ; 61 29aa4: 4a e8 ldi r20, 0x8A ; 138 29aa6: 5e e3 ldi r21, 0x3E ; 62 29aa8: 60 91 13 13 lds r22, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 29aac: 70 91 14 13 lds r23, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 29ab0: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 29ab4: 90 91 16 13 lds r25, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 29ab8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 29abc: 60 93 20 13 sts 0x1320, r22 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 29ac0: 70 93 21 13 sts 0x1321, r23 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 29ac4: 80 93 22 13 sts 0x1322, r24 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 29ac8: 90 93 23 13 sts 0x1323, r25 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 29acc: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 29ad0: 90 91 ca 12 lds r25, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 29ad4: 6e e0 ldi r22, 0x0E ; 14 29ad6: 71 e0 ldi r23, 0x01 ; 1 29ad8: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 29adc: 60 93 ab 12 sts 0x12AB, r22 ; 0x8012ab <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 29ae0: eb e8 ldi r30, 0x8B ; 139 29ae2: f2 e1 ldi r31, 0x12 ; 18 29ae4: 8b ea ldi r24, 0xAB ; 171 29ae6: 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; 29ae8: 40 e0 ldi r20, 0x00 ; 0 29aea: 50 e0 ldi r21, 0x00 ; 0 29aec: 60 ec ldi r22, 0xC0 ; 192 29aee: 7f e7 ldi r23, 0x7F ; 127 29af0: 41 93 st Z+, r20 29af2: 51 93 st Z+, r21 29af4: 61 93 st Z+, r22 29af6: 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) 29af8: 8e 17 cp r24, r30 29afa: 9f 07 cpc r25, r31 29afc: c9 f7 brne .-14 ; 0x29af0 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 29afe: 10 92 ac 12 sts 0x12AC, r1 ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> dT_err_prev = 0; 29b02: 10 92 ad 12 sts 0x12AD, r1 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 29b06: 10 92 ae 12 sts 0x12AE, r1 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 29b0a: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 29b0e: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> T_prev = NAN; 29b12: 40 93 b1 12 sts 0x12B1, r20 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 29b16: 50 93 b2 12 sts 0x12B2, r21 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 29b1a: 60 93 b3 12 sts 0x12B3, r22 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 29b1e: 70 93 b4 12 sts 0x12B4, r23 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> // clear the initialization flag flag_bits.uninitialized = false; 29b22: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29b26: 8e 7f andi r24, 0xFE ; 254 29b28: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_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); 29b2c: 87 01 movw r16, r14 29b2e: 76 01 movw r14, r12 29b30: a3 01 movw r20, r6 29b32: 92 01 movw r18, r4 29b34: 6d 2f mov r22, r29 29b36: 8c 2f mov r24, r28 29b38: 0e 94 c2 db call 0x1b784 ; 0x1b784 // handle errors if(data.flag_bits.error) 29b3c: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29b40: 81 ff sbrs r24, 1 29b42: 05 c0 rjmp .+10 ; 0x29b4e set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 29b44: 44 e0 ldi r20, 0x04 ; 4 29b46: 60 e0 ldi r22, 0x00 ; 0 29b48: 80 e0 ldi r24, 0x00 ; 0 29b4a: 0f 94 42 45 call 0x28a84 ; 0x28a84 // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 29b4e: 90 91 17 13 lds r25, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29b52: 80 91 33 06 lds r24, 0x0633 ; 0x800633 29b56: 92 fb bst r25, 2 29b58: 81 f9 bld r24, 1 29b5a: 80 93 33 06 sts 0x0633, r24 ; 0x800633 if(warning_state.assert) { 29b5e: 80 91 33 06 lds r24, 0x0633 ; 0x800633 29b62: 81 ff sbrs r24, 1 29b64: 15 c0 rjmp .+42 ; 0x29b90 warning_state.warning = true; 29b66: 80 91 33 06 lds r24, 0x0633 ; 0x800633 29b6a: 81 60 ori r24, 0x01 ; 1 29b6c: 80 93 33 06 sts 0x0633, r24 ; 0x800633 warning_state.dT_err = thermal_model::data.dT_err_prev; 29b70: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 29b74: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 29b78: a0 91 af 12 lds r26, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 29b7c: b0 91 b0 12 lds r27, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> 29b80: 80 93 2f 06 sts 0x062F, r24 ; 0x80062f 29b84: 90 93 30 06 sts 0x0630, r25 ; 0x800630 29b88: a0 93 31 06 sts 0x0631, r26 ; 0x800631 29b8c: b0 93 32 06 sts 0x0632, r27 ; 0x800632 (int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b); } static void log_isr() { if(!log_buf.enabled) return; 29b90: 80 91 2e 06 lds r24, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x10> 29b94: 88 23 and r24, r24 29b96: 09 f4 brne .+2 ; 0x29b9a 29b98: 3f c0 rjmp .+126 ; 0x29c18 uint32_t stamp = _millis(); 29b9a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 29b9e: c0 90 1e 06 lds r12, 0x061E ; 0x80061e <_ZN13thermal_modelL7log_bufE.lto_priv.557> 29ba2: d0 90 1f 06 lds r13, 0x061F ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x1> 29ba6: e0 90 20 06 lds r14, 0x0620 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x2> 29baa: f0 90 21 06 lds r15, 0x0621 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x3> log_buf.entry.stamp = stamp; 29bae: 60 93 1e 06 sts 0x061E, r22 ; 0x80061e <_ZN13thermal_modelL7log_bufE.lto_priv.557> 29bb2: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x1> 29bb6: 80 93 20 06 sts 0x0620, r24 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x2> 29bba: 90 93 21 06 sts 0x0621, r25 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x3> ++log_buf.entry.counter; 29bbe: 20 91 23 06 lds r18, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x5> 29bc2: 2f 5f subi r18, 0xFF ; 255 29bc4: 20 93 23 06 sts 0x0623, r18 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.557+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); 29bc8: 6c 19 sub r22, r12 29bca: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 29bcc: 60 93 22 06 sts 0x0622, r22 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 29bd0: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 29bd4: 80 93 24 06 sts 0x0624, r24 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 29bd8: 80 91 17 05 lds r24, 0x0517 ; 0x800517 29bdc: 90 91 18 05 lds r25, 0x0518 ; 0x800518 29be0: a0 91 19 05 lds r26, 0x0519 ; 0x800519 29be4: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 29be8: 80 93 25 06 sts 0x0625, r24 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x7> 29bec: 90 93 26 06 sts 0x0626, r25 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x8> 29bf0: a0 93 27 06 sts 0x0627, r26 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x9> 29bf4: b0 93 28 06 sts 0x0628, r27 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 29bf8: 80 91 1a 06 lds r24, 0x061A ; 0x80061a 29bfc: 90 91 1b 06 lds r25, 0x061B ; 0x80061b 29c00: a0 91 1c 06 lds r26, 0x061C ; 0x80061c 29c04: b0 91 1d 06 lds r27, 0x061D ; 0x80061d 29c08: 80 93 29 06 sts 0x0629, r24 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xb> 29c0c: 90 93 2a 06 sts 0x062A, r25 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xc> 29c10: a0 93 2b 06 sts 0x062B, r26 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xd> 29c14: b0 93 2c 06 sts 0x062C, r27 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xe> thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 29c18: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.472> 29c1c: 88 23 and r24, r24 29c1e: 91 f0 breq .+36 ; 0x29c44 temp_mgr_pid(); } 29c20: df 91 pop r29 29c22: cf 91 pop r28 29c24: 1f 91 pop r17 29c26: 0f 91 pop r16 29c28: ff 90 pop r15 29c2a: ef 90 pop r14 29c2c: df 90 pop r13 29c2e: cf 90 pop r12 29c30: af 90 pop r10 29c32: 7f 90 pop r7 29c34: 6f 90 pop r6 29c36: 5f 90 pop r5 29c38: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 29c3a: 0d 94 ea 1e jmp 0x23dd4 ; 0x23dd4 // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 29c3e: 0f 94 bc 45 call 0x28b78 ; 0x28b78 29c42: 8e ce rjmp .-740 ; 0x29960 #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 29c44: df 91 pop r29 29c46: cf 91 pop r28 29c48: 1f 91 pop r17 29c4a: 0f 91 pop r16 29c4c: ff 90 pop r15 29c4e: ef 90 pop r14 29c50: df 90 pop r13 29c52: cf 90 pop r12 29c54: af 90 pop r10 29c56: 7f 90 pop r7 29c58: 6f 90 pop r6 29c5a: 5f 90 pop r5 29c5c: 4f 90 pop r4 29c5e: 08 95 ret 00029c60 <__vector_47>: ISR(TIMERx_COMPA_vect) { 29c60: 1f 92 push r1 29c62: 0f 92 push r0 29c64: 0f b6 in r0, 0x3f ; 63 29c66: 0f 92 push r0 29c68: 11 24 eor r1, r1 29c6a: 0b b6 in r0, 0x3b ; 59 29c6c: 0f 92 push r0 29c6e: 2f 93 push r18 29c70: 3f 93 push r19 29c72: 4f 93 push r20 29c74: 5f 93 push r21 29c76: 6f 93 push r22 29c78: 7f 93 push r23 29c7a: 8f 93 push r24 29c7c: 9f 93 push r25 29c7e: af 93 push r26 29c80: bf 93 push r27 29c82: ef 93 push r30 29c84: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 29c86: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.471> 29c8a: 88 23 and r24, r24 29c8c: 91 f0 breq .+36 ; 0x29cb2 <__vector_47+0x52> adc_values_ready = false; 29c8e: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.471> adc_start_cycle(); 29c92: 0e 94 95 8f call 0x11f2a ; 0x11f2a // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 29c96: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29c9a: 8d 7f andi r24, 0xFD ; 253 29c9c: 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(); 29ca0: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 29ca2: 0f 94 c9 4b call 0x29792 ; 0x29792 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 29ca6: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 29ca8: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29cac: 82 60 ori r24, 0x02 ; 2 29cae: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 29cb2: ff 91 pop r31 29cb4: ef 91 pop r30 29cb6: bf 91 pop r27 29cb8: af 91 pop r26 29cba: 9f 91 pop r25 29cbc: 8f 91 pop r24 29cbe: 7f 91 pop r23 29cc0: 6f 91 pop r22 29cc2: 5f 91 pop r21 29cc4: 4f 91 pop r20 29cc6: 3f 91 pop r19 29cc8: 2f 91 pop r18 29cca: 0f 90 pop r0 29ccc: 0b be out 0x3b, r0 ; 59 29cce: 0f 90 pop r0 29cd0: 0f be out 0x3f, r0 ; 63 29cd2: 0f 90 pop r0 29cd4: 1f 90 pop r1 29cd6: 18 95 reti 00029cd8 : } void handle_temp_error(); void manage_heater() { 29cd8: 6f 92 push r6 29cda: 7f 92 push r7 29cdc: 8f 92 push r8 29cde: 9f 92 push r9 29ce0: af 92 push r10 29ce2: bf 92 push r11 29ce4: cf 92 push r12 29ce6: df 92 push r13 29ce8: ef 92 push r14 29cea: ff 92 push r15 29cec: 0f 93 push r16 29cee: 1f 93 push r17 29cf0: cf 93 push r28 29cf2: df 93 push r29 29cf4: 1f 92 push r1 29cf6: cd b7 in r28, 0x3d ; 61 29cf8: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 29cfa: 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) 29cfc: 80 91 fc 05 lds r24, 0x05FC ; 0x8005fc 29d00: 88 23 and r24, r24 29d02: 09 f4 brne .+2 ; 0x29d06 29d04: bb c0 rjmp .+374 ; 0x29e7c return; // syncronize temperatures with isr updateTemperatures(); 29d06: 0f 94 8d 48 call 0x2911a ; 0x2911a #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 29d0a: 80 91 33 06 lds r24, 0x0633 ; 0x800633 29d0e: 80 ff sbrs r24, 0 29d10: 51 c0 rjmp .+162 ; 0x29db4 } static void handle_warning() { // update values float warn = data.warn; 29d12: 10 91 0f 13 lds r17, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 29d16: 00 91 10 13 lds r16, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 29d1a: b0 90 11 13 lds r11, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 29d1e: a0 90 12 13 lds r10, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 29d22: ce 01 movw r24, r28 29d24: 01 96 adiw r24, 0x01 ; 1 29d26: 0f 94 ae 47 call 0x28f5c ; 0x28f5c dT_err = warning_state.dT_err; 29d2a: c0 90 2f 06 lds r12, 0x062F ; 0x80062f 29d2e: d0 90 30 06 lds r13, 0x0630 ; 0x800630 29d32: e0 90 31 06 lds r14, 0x0631 ; 0x800631 29d36: f0 90 32 06 lds r15, 0x0632 ; 0x800632 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 29d3a: ce 01 movw r24, r28 29d3c: 01 96 adiw r24, 0x01 ; 1 29d3e: 0f 94 a1 47 call 0x28f42 ; 0x28f42 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); 29d42: af 92 push r10 29d44: bf 92 push r11 29d46: 0f 93 push r16 29d48: 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 29d4a: 21 e7 ldi r18, 0x71 ; 113 29d4c: 3d e3 ldi r19, 0x3D ; 61 29d4e: 4a e8 ldi r20, 0x8A ; 138 29d50: 5e e3 ldi r21, 0x3E ; 62 29d52: c7 01 movw r24, r14 29d54: b6 01 movw r22, r12 29d56: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 29d5a: 9f 93 push r25 29d5c: 8f 93 push r24 29d5e: 7f 93 push r23 29d60: 6f 93 push r22 29d62: 88 e8 ldi r24, 0x88 ; 136 29d64: 9c e9 ldi r25, 0x9C ; 156 29d66: 9f 93 push r25 29d68: 8f 93 push r24 29d6a: 0f 94 08 dc call 0x3b810 ; 0x3b810 static bool first = true; if(warning_state.assert) { 29d6e: 90 91 33 06 lds r25, 0x0633 ; 0x800633 29d72: 0f b6 in r0, 0x3f ; 63 29d74: f8 94 cli 29d76: de bf out 0x3e, r29 ; 62 29d78: 0f be out 0x3f, r0 ; 63 29d7a: cd bf out 0x3d, r28 ; 61 29d7c: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.469> 29d80: 91 ff sbrs r25, 1 29d82: 93 c0 rjmp .+294 ; 0x29eaa if (first) { 29d84: 90 91 7b 02 lds r25, 0x027B ; 0x80027b 29d88: 99 23 and r25, r25 29d8a: 09 f4 brne .+2 ; 0x29d8e 29d8c: 87 c0 rjmp .+270 ; 0x29e9c if(warn_beep) { 29d8e: 88 23 and r24, r24 29d90: 79 f0 breq .+30 ; 0x29db0 lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 29d92: 8d e8 ldi r24, 0x8D ; 141 29d94: 99 e4 ldi r25, 0x49 ; 73 29d96: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 29d9a: 61 e0 ldi r22, 0x01 ; 1 29d9c: 0f 94 9b 06 call 0x20d36 ; 0x20d36 WRITE(BEEPER, HIGH); 29da0: 9f b7 in r25, 0x3f ; 63 29da2: f8 94 cli 29da4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29da8: 84 60 ori r24, 0x04 ; 4 29daa: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29dae: 9f bf out 0x3f, r25 ; 63 } first = false; 29db0: 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) 29db4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29db8: 88 23 and r24, r24 29dba: 89 f0 breq .+34 ; 0x29dde #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29dbc: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29dc0: 82 95 swap r24 29dc2: 86 95 lsr r24 29dc4: 87 70 andi r24, 0x07 ; 7 29dc6: 84 30 cpi r24, 0x04 ; 4 29dc8: 08 f0 brcs .+2 ; 0x29dcc 29dca: 82 c0 rjmp .+260 ; 0x29ed0 29dcc: 82 30 cpi r24, 0x02 ; 2 29dce: 08 f0 brcs .+2 ; 0x29dd2 29dd0: 1d c1 rjmp .+570 ; 0x2a00c 29dd2: 88 23 and r24, r24 29dd4: 09 f4 brne .+2 ; 0x29dd8 29dd6: f4 c0 rjmp .+488 ; 0x29fc0 29dd8: 81 30 cpi r24, 0x01 ; 1 29dda: 09 f4 brne .+2 ; 0x29dde 29ddc: 94 c0 rjmp .+296 ; 0x29f06 // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 29dde: 0e 94 9e 81 call 0x1033c ; 0x1033c } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 29de2: 80 91 2e 06 lds r24, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x10> 29de6: 88 23 and r24, r24 29de8: 09 f4 brne .+2 ; 0x29dec 29dea: 48 c0 rjmp .+144 ; 0x29e7c uint8_t counter = log_buf.entry.counter; 29dec: 80 91 23 06 lds r24, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x5> if (counter == log_buf.serial) return; 29df0: 70 90 2d 06 lds r7, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xf> 29df4: 87 15 cp r24, r7 29df6: 09 f4 brne .+2 ; 0x29dfa 29df8: 41 c0 rjmp .+130 ; 0x29e7c // 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; 29dfa: ce 01 movw r24, r28 29dfc: 01 96 adiw r24, 0x01 ; 1 29dfe: 0f 94 ae 47 call 0x28f5c ; 0x28f5c delta_ms = log_buf.entry.delta_ms; 29e02: 00 91 22 06 lds r16, 0x0622 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x4> counter = log_buf.entry.counter; 29e06: 10 91 23 06 lds r17, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x5> cur_pwm = log_buf.entry.cur_pwm; 29e0a: 60 90 24 06 lds r6, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x6> cur_temp = log_buf.entry.cur_temp; 29e0e: c0 90 25 06 lds r12, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x7> 29e12: d0 90 26 06 lds r13, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x8> 29e16: e0 90 27 06 lds r14, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0x9> 29e1a: f0 90 28 06 lds r15, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xa> cur_amb = log_buf.entry.cur_amb; 29e1e: 80 90 29 06 lds r8, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xb> 29e22: 90 90 2a 06 lds r9, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xc> 29e26: a0 90 2b 06 lds r10, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xd> 29e2a: b0 90 2c 06 lds r11, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.557+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; 29e2e: ce 01 movw r24, r28 29e30: 01 96 adiw r24, 0x01 ; 1 29e32: 0f 94 a1 47 call 0x28f42 ; 0x28f42 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; 29e36: 10 93 2d 06 sts 0x062D, r17 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.557+0xf> printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 29e3a: bf 92 push r11 29e3c: af 92 push r10 29e3e: 9f 92 push r9 29e40: 8f 92 push r8 29e42: ff 92 push r15 29e44: ef 92 push r14 29e46: df 92 push r13 29e48: cf 92 push r12 29e4a: 1f 92 push r1 29e4c: 6f 92 push r6 29e4e: 80 2f mov r24, r16 29e50: 00 0f add r16, r16 29e52: 99 0b sbc r25, r25 29e54: 01 96 adiw r24, 0x01 ; 1 29e56: 9f 93 push r25 29e58: 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; 29e5a: 81 2f mov r24, r17 29e5c: 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, 29e5e: 81 50 subi r24, 0x01 ; 1 29e60: 99 0b sbc r25, r25 29e62: 9f 93 push r25 29e64: 8f 93 push r24 29e66: 8b e0 ldi r24, 0x0B ; 11 29e68: 9c e9 ldi r25, 0x9C ; 156 29e6a: 9f 93 push r25 29e6c: 8f 93 push r24 29e6e: 0f 94 08 dc call 0x3b810 ; 0x3b810 29e72: 0f b6 in r0, 0x3f ; 63 29e74: f8 94 cli 29e76: de bf out 0x3e, r29 ; 62 29e78: 0f be out 0x3f, r0 ; 63 29e7a: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 29e7c: 0f 90 pop r0 29e7e: df 91 pop r29 29e80: cf 91 pop r28 29e82: 1f 91 pop r17 29e84: 0f 91 pop r16 29e86: ff 90 pop r15 29e88: ef 90 pop r14 29e8a: df 90 pop r13 29e8c: cf 90 pop r12 29e8e: bf 90 pop r11 29e90: af 90 pop r10 29e92: 9f 90 pop r9 29e94: 8f 90 pop r8 29e96: 7f 90 pop r7 29e98: 6f 90 pop r6 29e9a: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 29e9c: 88 23 and r24, r24 29e9e: 09 f4 brne .+2 ; 0x29ea2 29ea0: 89 cf rjmp .-238 ; 0x29db4 29ea2: 84 e0 ldi r24, 0x04 ; 4 29ea4: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 29ea8: 85 cf rjmp .-246 ; 0x29db4 } } else { // warning cleared, reset state warning_state.warning = false; 29eaa: 90 91 33 06 lds r25, 0x0633 ; 0x800633 29eae: 9e 7f andi r25, 0xFE ; 254 29eb0: 90 93 33 06 sts 0x0633, r25 ; 0x800633 if(warn_beep) WRITE(BEEPER, LOW); 29eb4: 88 23 and r24, r24 29eb6: 41 f0 breq .+16 ; 0x29ec8 29eb8: 9f b7 in r25, 0x3f ; 63 29eba: f8 94 cli 29ebc: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29ec0: 8b 7f andi r24, 0xFB ; 251 29ec2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29ec6: 9f bf out 0x3f, r25 ; 63 first = true; 29ec8: 81 e0 ldi r24, 0x01 ; 1 29eca: 80 93 7b 02 sts 0x027B, r24 ; 0x80027b 29ece: 72 cf rjmp .-284 ; 0x29db4 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29ed0: 84 30 cpi r24, 0x04 ; 4 29ed2: 09 f0 breq .+2 ; 0x29ed6 29ed4: 84 cf rjmp .-248 ; 0x29dde #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 29ed6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29eda: 81 ff sbrs r24, 1 29edc: b4 c0 rjmp .+360 ; 0x2a046 if(IsStopped() == false) { 29ede: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29ee2: 81 11 cpse r24, r1 29ee4: 04 c0 rjmp .+8 ; 0x29eee SERIAL_ECHOLNPGM("TM: error triggered!"); 29ee6: 83 e7 ldi r24, 0x73 ; 115 29ee8: 9c e9 ldi r25, 0x9C ; 156 29eea: 0e 94 17 7b call 0xf62e ; 0xf62e } ThermalStop(true); 29eee: 81 e0 ldi r24, 0x01 ; 1 29ef0: 0e 94 48 7b call 0xf690 ; 0xf690 WRITE(BEEPER, HIGH); 29ef4: 9f b7 in r25, 0x3f ; 63 29ef6: f8 94 cli 29ef8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29efc: 84 60 ori r24, 0x04 ; 4 29efe: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f02: 9f bf out 0x3f, r25 ; 63 29f04: 6c cf rjmp .-296 ; 0x29dde void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 29f06: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29f0a: 86 95 lsr r24 29f0c: 86 95 lsr r24 29f0e: 83 70 andi r24, 0x03 ; 3 29f10: 81 30 cpi r24, 0x01 ; 1 29f12: d9 f1 breq .+118 ; 0x29f8a 29f14: 58 f0 brcs .+22 ; 0x29f2c 29f16: 82 30 cpi r24, 0x02 ; 2 29f18: 09 f0 breq .+2 ; 0x29f1c 29f1a: 61 cf rjmp .-318 ; 0x29dde } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 29f1c: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29f20: 81 11 cpse r24, r1 29f22: 14 c0 rjmp .+40 ; 0x29f4c temp_error_messagepgm(PSTR("MINTEMP AMB")); 29f24: 61 e0 ldi r22, 0x01 ; 1 29f26: 85 e3 ldi r24, 0x35 ; 53 29f28: 9c e9 ldi r25, 0x9C ; 156 29f2a: 0e c0 rjmp .+28 ; 0x29f48 // 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) { 29f2c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29f30: 81 ff sbrs r24, 1 29f32: 10 c0 rjmp .+32 ; 0x29f54 min_temp_error(temp_error_state.index); 29f34: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29f38: 62 95 swap r22 29f3a: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 29f3c: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29f40: 81 11 cpse r24, r1 29f42: 04 c0 rjmp .+8 ; 0x29f4c temp_error_messagepgm(err, e); 29f44: 81 e2 ldi r24, 0x21 ; 33 29f46: 9c e9 ldi r25, 0x9C ; 156 29f48: 0f 94 0c 42 call 0x28418 ; 0x28418 prusa_statistics(92); } ThermalStop(); 29f4c: 80 e0 ldi r24, 0x00 ; 0 29f4e: 0e 94 48 7b call 0xf690 ; 0xf690 29f52: 45 cf rjmp .-374 ; 0x29dde // 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); 29f54: 60 91 9a 04 lds r22, 0x049A ; 0x80049a <_ZL8minttemp.lto_priv.475> 29f58: 70 91 9b 04 lds r23, 0x049B ; 0x80049b <_ZL8minttemp.lto_priv.475+0x1> 29f5c: 6b 5f subi r22, 0xFB ; 251 29f5e: 7f 4f sbci r23, 0xFF ; 255 29f60: 07 2e mov r0, r23 29f62: 00 0c add r0, r0 29f64: 88 0b sbc r24, r24 29f66: 99 0b sbc r25, r25 29f68: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 29f6c: 8b 01 movw r16, r22 29f6e: 9c 01 movw r18, r24 29f70: 40 91 5e 0e lds r20, 0x0E5E ; 0x800e5e 29f74: 50 91 5f 0e lds r21, 0x0E5F ; 0x800e5f 29f78: 60 91 60 0e lds r22, 0x0E60 ; 0x800e60 29f7c: 70 91 61 0e lds r23, 0x0E61 ; 0x800e61 29f80: 87 e7 ldi r24, 0x77 ; 119 29f82: 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); 29f84: 0f 94 08 32 call 0x26410 ; 0x26410 29f88: 2a cf rjmp .-428 ; 0x29dde // 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) { 29f8a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29f8e: 81 ff sbrs r24, 1 29f90: 08 c0 rjmp .+16 ; 0x29fa2 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 29f92: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29f96: 81 11 cpse r24, r1 29f98: d9 cf rjmp .-78 ; 0x29f4c temp_error_messagepgm(err); 29f9a: 61 e0 ldi r22, 0x01 ; 1 29f9c: 89 e2 ldi r24, 0x29 ; 41 29f9e: 9c e9 ldi r25, 0x9C ; 156 29fa0: d3 cf rjmp .-90 ; 0x29f48 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); 29fa2: 40 91 ee 04 lds r20, 0x04EE ; 0x8004ee 29fa6: 50 91 ef 04 lds r21, 0x04EF ; 0x8004ef 29faa: 60 91 f0 04 lds r22, 0x04F0 ; 0x8004f0 29fae: 70 91 f1 04 lds r23, 0x04F1 ; 0x8004f1 29fb2: 00 e0 ldi r16, 0x00 ; 0 29fb4: 10 e0 ldi r17, 0x00 ; 0 29fb6: 20 e7 ldi r18, 0x70 ; 112 29fb8: 31 e4 ldi r19, 0x41 ; 65 29fba: 83 e7 ldi r24, 0x73 ; 115 29fbc: 92 e0 ldi r25, 0x02 ; 2 29fbe: e2 cf rjmp .-60 ; 0x29f84 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 29fc0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29fc4: 86 95 lsr r24 29fc6: 86 95 lsr r24 29fc8: 83 70 andi r24, 0x03 ; 3 29fca: 81 30 cpi r24, 0x01 ; 1 29fcc: b9 f0 breq .+46 ; 0x29ffc 29fce: 58 f0 brcs .+22 ; 0x29fe6 29fd0: 82 30 cpi r24, 0x02 ; 2 29fd2: 09 f0 breq .+2 ; 0x29fd6 29fd4: 04 cf rjmp .-504 ; 0x29dde } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 29fd6: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29fda: 81 11 cpse r24, r1 29fdc: b7 cf rjmp .-146 ; 0x29f4c temp_error_messagepgm(PSTR("MAXTEMP AMB")); 29fde: 61 e0 ldi r22, 0x01 ; 1 29fe0: 85 e5 ldi r24, 0x55 ; 85 29fe2: 9c e9 ldi r25, 0x9C ; 156 29fe4: b1 cf rjmp .-158 ; 0x29f48 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 29fe6: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 29fea: 62 95 swap r22 29fec: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 29fee: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29ff2: 81 11 cpse r24, r1 29ff4: ab cf rjmp .-170 ; 0x29f4c temp_error_messagepgm(PSTR("MAXTEMP"), e); 29ff6: 81 e4 ldi r24, 0x41 ; 65 29ff8: 9c e9 ldi r25, 0x9C ; 156 29ffa: a6 cf rjmp .-180 ; 0x29f48 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 29ffc: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2a000: 81 11 cpse r24, r1 2a002: a4 cf rjmp .-184 ; 0x29f4c temp_error_messagepgm(PSTR("MAXTEMP BED")); 2a004: 61 e0 ldi r22, 0x01 ; 1 2a006: 89 e4 ldi r24, 0x49 ; 73 2a008: 9c e9 ldi r25, 0x9C ; 156 2a00a: 9e cf rjmp .-196 ; 0x29f48 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 2a00c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 2a010: 86 95 lsr r24 2a012: 86 95 lsr r24 2a014: 83 70 andi r24, 0x03 ; 3 2a016: 82 30 cpi r24, 0x02 ; 2 2a018: 08 f0 brcs .+2 ; 0x2a01c 2a01a: e1 ce rjmp .-574 ; 0x29dde case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 2a01c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 2a020: 86 95 lsr r24 2a022: 86 95 lsr r24 2a024: 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), 2a026: 90 91 1b 05 lds r25, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 2a02a: 92 95 swap r25 2a02c: 96 95 lsr r25 2a02e: 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( 2a030: 61 e0 ldi r22, 0x01 ; 1 2a032: 81 30 cpi r24, 0x01 ; 1 2a034: 09 f0 breq .+2 ; 0x2a038 2a036: 60 e0 ldi r22, 0x00 ; 0 2a038: 81 e0 ldi r24, 0x01 ; 1 2a03a: 92 30 cpi r25, 0x02 ; 2 2a03c: 09 f0 breq .+2 ; 0x2a040 2a03e: 80 e0 ldi r24, 0x00 ; 0 2a040: 0f 94 41 32 call 0x26482 ; 0x26482 2a044: cc ce rjmp .-616 ; 0x29dde SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 2a046: 10 92 1b 05 sts 0x051B, r1 ; 0x80051b <_ZL16temp_error_state.lto_priv.468> WRITE(BEEPER, LOW); 2a04a: 9f b7 in r25, 0x3f ; 63 2a04c: f8 94 cli 2a04e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a052: 8b 7f andi r24, 0xFB ; 251 2a054: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a058: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 2a05a: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 2a05e: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 2a062: 89 2b or r24, r25 2a064: 39 f4 brne .+14 ; 0x2a074 target_temperature_bed = saved_bed_temperature; 2a066: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 2a06a: 90 e0 ldi r25, 0x00 ; 0 2a06c: 90 93 69 0e sts 0x0E69, r25 ; 0x800e69 2a070: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 SERIAL_ECHOLNPGM("TM: error cleared"); 2a074: 81 e6 ldi r24, 0x61 ; 97 2a076: 9c e9 ldi r25, 0x9C ; 156 2a078: 0e 94 17 7b call 0xf62e ; 0xf62e 2a07c: b0 ce rjmp .-672 ; 0x29dde 0002a07e : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 2a07e: 4f 92 push r4 2a080: 5f 92 push r5 2a082: 6f 92 push r6 2a084: 7f 92 push r7 2a086: 8f 92 push r8 2a088: 9f 92 push r9 2a08a: af 92 push r10 2a08c: bf 92 push r11 2a08e: cf 92 push r12 2a090: df 92 push r13 2a092: ef 92 push r14 2a094: ff 92 push r15 2a096: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 2a098: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a09c: 28 ee ldi r18, 0xE8 ; 232 2a09e: 33 e0 ldi r19, 0x03 ; 3 2a0a0: 40 e0 ldi r20, 0x00 ; 0 2a0a2: 50 e0 ldi r21, 0x00 ; 0 2a0a4: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 2a0a8: 29 01 movw r4, r18 2a0aa: 3a 01 movw r6, r20 lcd_consume_click(); 2a0ac: 0e 94 be 71 call 0xe37c ; 0xe37c KEEPALIVE_STATE(PAUSED_FOR_USER); 2a0b0: 84 e0 ldi r24, 0x04 ; 4 2a0b2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 2a0b6: f1 2c mov r15, r1 2a0b8: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 2a0ba: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 manage_inactivity(true); 2a0be: 81 e0 ldi r24, 0x01 ; 1 2a0c0: 0e 94 f3 8b call 0x117e6 ; 0x117e6 bDelayed = ((_millis()/1000-nTime0) > nDelay); 2a0c4: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a0c8: 28 ee ldi r18, 0xE8 ; 232 2a0ca: 33 e0 ldi r19, 0x03 ; 3 2a0cc: 40 e0 ldi r20, 0x00 ; 0 2a0ce: 50 e0 ldi r21, 0x00 ; 0 2a0d0: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 2a0d4: 49 01 movw r8, r18 2a0d6: 5a 01 movw r10, r20 2a0d8: 84 18 sub r8, r4 2a0da: 95 08 sbc r9, r5 2a0dc: a6 08 sbc r10, r6 2a0de: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 2a0e0: 0e 94 c3 71 call 0xe386 ; 0xe386 2a0e4: 81 11 cpse r24, r1 2a0e6: 07 c0 rjmp .+14 ; 0x2a0f6 2a0e8: c8 14 cp r12, r8 2a0ea: d9 04 cpc r13, r9 2a0ec: ea 04 cpc r14, r10 2a0ee: fb 04 cpc r15, r11 2a0f0: 20 f7 brcc .-56 ; 0x2a0ba 2a0f2: 81 e0 ldi r24, 0x01 ; 1 2a0f4: 07 c0 rjmp .+14 ; 0x2a104 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 2a0f6: 81 e0 ldi r24, 0x01 ; 1 2a0f8: c8 14 cp r12, r8 2a0fa: d9 04 cpc r13, r9 2a0fc: ea 04 cpc r14, r10 2a0fe: fb 04 cpc r15, r11 2a100: 08 f0 brcs .+2 ; 0x2a104 2a102: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 2a104: 92 e0 ldi r25, 0x02 ; 2 2a106: 90 93 96 02 sts 0x0296, r25 ; 0x800296 return(!bDelayed); } } } 2a10a: 91 e0 ldi r25, 0x01 ; 1 2a10c: 89 27 eor r24, r25 2a10e: ff 90 pop r15 2a110: ef 90 pop r14 2a112: df 90 pop r13 2a114: cf 90 pop r12 2a116: bf 90 pop r11 2a118: af 90 pop r10 2a11a: 9f 90 pop r9 2a11c: 8f 90 pop r8 2a11e: 7f 90 pop r7 2a120: 6f 90 pop r6 2a122: 5f 90 pop r5 2a124: 4f 90 pop r4 2a126: 08 95 ret 0002a128 : #endif } static void waiting_handler() { manage_heater(); 2a128: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 host_keepalive(); 2a12c: 0e 94 43 81 call 0x10286 ; 0x10286 host_autoreport(); 2a130: 0e 94 f4 7a call 0xf5e8 ; 0xf5e8 checkFans(); 2a134: 0e 94 9e 81 call 0x1033c ; 0x1033c lcd_update(0); 2a138: 80 e0 ldi r24, 0x00 ; 0 2a13a: 0c 94 6d 6f jmp 0xdeda ; 0xdeda 0002a13e : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 2a13e: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 2a142: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 2a146: 65 50 subi r22, 0x05 ; 5 2a148: 71 09 sbc r23, r1 2a14a: 07 2e mov r0, r23 2a14c: 00 0c add r0, r0 2a14e: 88 0b sbc r24, r24 2a150: 99 0b sbc r25, r25 2a152: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 2a156: 9b 01 movw r18, r22 2a158: ac 01 movw r20, r24 2a15a: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2a15e: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 2a162: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 2a166: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 2a16a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2a16e: 87 ff sbrs r24, 7 2a170: 07 c0 rjmp .+14 ; 0x2a180 if(temp_error_state.v) break; 2a172: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 2a176: 81 11 cpse r24, r1 2a178: 03 c0 rjmp .+6 ; 0x2a180 waiting_handler(); 2a17a: 0f 94 94 50 call 0x2a128 ; 0x2a128 2a17e: df cf rjmp .-66 ; 0x2a13e } } 2a180: 08 95 ret 0002a182 : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 2a182: cf 92 push r12 2a184: df 92 push r13 2a186: ef 92 push r14 2a188: ff 92 push r15 2a18a: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 2a18c: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a190: 9b 01 movw r18, r22 2a192: ac 01 movw r20, r24 2a194: 2e 0d add r18, r14 2a196: 3f 1d adc r19, r15 2a198: 41 1d adc r20, r1 2a19a: 51 1d adc r21, r1 2a19c: 69 01 movw r12, r18 2a19e: 7a 01 movw r14, r20 while(_millis() < mark) { 2a1a0: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a1a4: 6c 15 cp r22, r12 2a1a6: 7d 05 cpc r23, r13 2a1a8: 8e 05 cpc r24, r14 2a1aa: 9f 05 cpc r25, r15 2a1ac: 38 f4 brcc .+14 ; 0x2a1bc if(temp_error_state.v) break; 2a1ae: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.468> 2a1b2: 81 11 cpse r24, r1 2a1b4: 03 c0 rjmp .+6 ; 0x2a1bc waiting_handler(); 2a1b6: 0f 94 94 50 call 0x2a128 ; 0x2a128 2a1ba: f2 cf rjmp .-28 ; 0x2a1a0 } } 2a1bc: ff 90 pop r15 2a1be: ef 90 pop r14 2a1c0: df 90 pop r13 2a1c2: cf 90 pop r12 2a1c4: 08 95 ret 0002a1c6 : 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; 2a1c6: 20 91 d7 06 lds r18, 0x06D7 ; 0x8006d7 2a1ca: 30 91 d8 06 lds r19, 0x06D8 ; 0x8006d8 2a1ce: 40 91 d9 06 lds r20, 0x06D9 ; 0x8006d9 2a1d2: 50 91 da 06 lds r21, 0x06DA ; 0x8006da 2a1d6: 60 e0 ldi r22, 0x00 ; 0 2a1d8: 70 e0 ldi r23, 0x00 ; 0 2a1da: 8f e7 ldi r24, 0x7F ; 127 2a1dc: 93 e4 ldi r25, 0x43 ; 67 2a1de: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 2a1e2: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 <_ZL14iState_sum_max.lto_priv.483> 2a1e6: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.483+0x1> 2a1ea: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.483+0x2> 2a1ee: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.483+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 2a1f2: 20 91 e3 06 lds r18, 0x06E3 ; 0x8006e3 2a1f6: 30 91 e4 06 lds r19, 0x06E4 ; 0x8006e4 2a1fa: 40 91 e5 06 lds r20, 0x06E5 ; 0x8006e5 2a1fe: 50 91 e6 06 lds r21, 0x06E6 ; 0x8006e6 2a202: 60 e0 ldi r22, 0x00 ; 0 2a204: 70 e0 ldi r23, 0x00 ; 0 2a206: 8f e7 ldi r24, 0x7F ; 127 2a208: 93 e4 ldi r25, 0x43 ; 67 2a20a: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 2a20e: 60 93 9e 04 sts 0x049E, r22 ; 0x80049e <_ZL19temp_iState_max_bed.lto_priv.481> 2a212: 70 93 9f 04 sts 0x049F, r23 ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.481+0x1> 2a216: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.481+0x2> 2a21a: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.481+0x3> #endif } 2a21e: 08 95 ret 0002a220 : #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) { 2a220: 2f 92 push r2 2a222: 3f 92 push r3 2a224: 4f 92 push r4 2a226: 5f 92 push r5 2a228: 6f 92 push r6 2a22a: 7f 92 push r7 2a22c: 8f 92 push r8 2a22e: 9f 92 push r9 2a230: af 92 push r10 2a232: bf 92 push r11 2a234: cf 92 push r12 2a236: df 92 push r13 2a238: ef 92 push r14 2a23a: ff 92 push r15 2a23c: 0f 93 push r16 2a23e: 1f 93 push r17 2a240: cf 93 push r28 2a242: df 93 push r29 2a244: cd b7 in r28, 0x3d ; 61 2a246: de b7 in r29, 0x3e ; 62 2a248: e0 97 sbiw r28, 0x30 ; 48 2a24a: 0f b6 in r0, 0x3f ; 63 2a24c: f8 94 cli 2a24e: de bf out 0x3e, r29 ; 62 2a250: 0f be out 0x3f, r0 ; 63 2a252: cd bf out 0x3d, r28 ; 61 2a254: 6a 87 std Y+10, r22 ; 0x0a 2a256: 7b 87 std Y+11, r23 ; 0x0b 2a258: 8c 87 std Y+12, r24 ; 0x0c 2a25a: 9d 87 std Y+13, r25 ; 0x0d 2a25c: 1a 01 movw r2, r20 2a25e: 3a a7 std Y+42, r19 ; 0x2a 2a260: 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(); 2a262: 0f 94 27 45 call 0x28a4e ; 0x28a4e pid_tuning_finished = false; 2a266: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.472> // 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; 2a26a: 29 a5 ldd r18, Y+41 ; 0x29 2a26c: 3a a5 ldd r19, Y+42 ; 0x2a 2a26e: 30 93 42 06 sts 0x0642, r19 ; 0x800642 2a272: 20 93 41 06 sts 0x0641, r18 ; 0x800641 float input = 0.0; pid_cycle=0; 2a276: 10 92 44 06 sts 0x0644, r1 ; 0x800644 2a27a: 10 92 43 06 sts 0x0643, r1 ; 0x800643 bool heating = true; unsigned long temp_millis = _millis(); 2a27e: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a282: 6e 83 std Y+6, r22 ; 0x06 2a284: 7f 83 std Y+7, r23 ; 0x07 2a286: 88 87 std Y+8, r24 ; 0x08 2a288: 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 2a28a: 37 fe sbrs r3, 7 2a28c: ff c0 rjmp .+510 ; 0x2a48c 2a28e: 3d e2 ldi r19, 0x2D ; 45 2a290: 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(); 2a292: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a296: 6c a3 std Y+36, r22 ; 0x24 2a298: 7d a3 std Y+37, r23 ; 0x25 2a29a: 8e a3 std Y+38, r24 ; 0x26 2a29c: 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."); 2a29e: 81 ee ldi r24, 0xE1 ; 225 2a2a0: 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) 2a2a2: 12 14 cp r1, r2 2a2a4: 13 04 cpc r1, r3 2a2a6: 0c f4 brge .+2 ; 0x2a2aa 2a2a8: 8a c2 rjmp .+1300 ; 0x2a7be pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 2a2aa: 8e ec ldi r24, 0xCE ; 206 2a2ac: 9b e9 ldi r25, 0x9B ; 155 2a2ae: 0e 94 17 7b call 0xf62e ; 0xf62e 2a2b2: 6a 85 ldd r22, Y+10 ; 0x0a 2a2b4: 7b 85 ldd r23, Y+11 ; 0x0b 2a2b6: 8c 85 ldd r24, Y+12 ; 0x0c 2a2b8: 9d 85 ldd r25, Y+13 ; 0x0d 2a2ba: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 2a2be: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 2a2c0: 21 14 cp r2, r1 2a2c2: 31 04 cpc r3, r1 2a2c4: 09 f4 brne .+2 ; 0x2a2c8 2a2c6: e5 c0 rjmp .+458 ; 0x2a492 { soft_pwm_bed = (MAX_BED_POWER)/2; 2a2c8: 20 93 17 06 sts 0x0617, r18 ; 0x800617 bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 2a2cc: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 2a2d0: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 long bias, d; float Ku, Tu; float max = 0, min = 10000; uint8_t safety_check_cycles = 0; const uint8_t safety_check_cycles_count = (extruder < 0) ? 45 : 10; //10 cycles / 20s delay for extruder and 45 cycles / 90s for heatbed 2a2d4: 8e 81 ldd r24, Y+6 ; 0x06 2a2d6: 9f 81 ldd r25, Y+7 ; 0x07 2a2d8: a8 85 ldd r26, Y+8 ; 0x08 2a2da: b9 85 ldd r27, Y+9 ; 0x09 2a2dc: 8e 87 std Y+14, r24 ; 0x0e 2a2de: 9f 87 std Y+15, r25 ; 0x0f 2a2e0: a8 8b std Y+16, r26 ; 0x10 2a2e2: b9 8b std Y+17, r27 ; 0x11 2a2e4: 88 a3 std Y+32, r24 ; 0x20 2a2e6: 99 a3 std Y+33, r25 ; 0x21 2a2e8: aa a3 std Y+34, r26 ; 0x22 2a2ea: bb a3 std Y+35, r27 ; 0x23 2a2ec: 1a 8a std Y+18, r1 ; 0x12 2a2ee: 90 e4 ldi r25, 0x40 ; 64 2a2f0: 9b 8b std Y+19, r25 ; 0x13 2a2f2: ac e1 ldi r26, 0x1C ; 28 2a2f4: ac 8b std Y+20, r26 ; 0x14 2a2f6: b6 e4 ldi r27, 0x46 ; 70 2a2f8: bd 8b std Y+21, r27 ; 0x15 2a2fa: 1e 8a std Y+22, r1 ; 0x16 2a2fc: 1f 8a std Y+23, r1 ; 0x17 2a2fe: 18 8e std Y+24, r1 ; 0x18 2a300: 19 8e std Y+25, r1 ; 0x19 2a302: 6f e7 ldi r22, 0x7F ; 127 2a304: c6 2e mov r12, r22 2a306: d1 2c mov r13, r1 2a308: e1 2c mov r14, r1 2a30a: f1 2c mov r15, r1 2a30c: 00 e0 ldi r16, 0x00 ; 0 2a30e: 10 e0 ldi r17, 0x00 ; 0 2a310: 18 aa std Y+48, r1 ; 0x30 2a312: 1f a6 std Y+47, r1 ; 0x2f 2a314: 1d 82 std Y+5, r1 ; 0x05 2a316: 2f e7 ldi r18, 0x7F ; 127 2a318: 30 e0 ldi r19, 0x00 ; 0 2a31a: 40 e0 ldi r20, 0x00 ; 0 2a31c: 50 e0 ldi r21, 0x00 ; 0 2a31e: 29 83 std Y+1, r18 ; 0x01 2a320: 3a 83 std Y+2, r19 ; 0x02 2a322: 4b 83 std Y+3, r20 ; 0x03 2a324: 5c 83 std Y+4, r21 ; 0x04 2a326: 1b 8e std Y+27, r1 ; 0x1b 2a328: 1c 8e std Y+28, r1 ; 0x1c 2a32a: 1d 8e std Y+29, r1 ; 0x1d 2a32c: 1e 8e std Y+30, r1 ; 0x1e 2a32e: 31 e0 ldi r19, 0x01 ; 1 2a330: 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(); 2a332: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2a334: 40 91 fc 05 lds r20, 0x05FC ; 0x8005fc 2a338: 48 a7 std Y+40, r20 ; 0x28 2a33a: 44 23 and r20, r20 2a33c: 09 f4 brne .+2 ; 0x2a340 2a33e: 2c c2 rjmp .+1112 ; 0x2a798 updateTemperatures(); 2a340: 0f 94 8d 48 call 0x2911a ; 0x2911a input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a344: 21 14 cp r2, r1 2a346: 31 04 cpc r3, r1 2a348: 09 f0 breq .+2 ; 0x2a34c 2a34a: aa c0 rjmp .+340 ; 0x2a4a0 2a34c: 00 91 5e 0e lds r16, 0x0E5E ; 0x800e5e 2a350: 10 91 5f 0e lds r17, 0x0E5F ; 0x800e5f 2a354: 50 91 60 0e lds r21, 0x0E60 ; 0x800e60 2a358: 58 ab std Y+48, r21 ; 0x30 2a35a: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 2a35e: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2a360: 2e 89 ldd r18, Y+22 ; 0x16 2a362: 3f 89 ldd r19, Y+23 ; 0x17 2a364: 48 8d ldd r20, Y+24 ; 0x18 2a366: 59 8d ldd r21, Y+25 ; 0x19 2a368: b8 01 movw r22, r16 2a36a: 88 a9 ldd r24, Y+48 ; 0x30 2a36c: 9f a5 ldd r25, Y+47 ; 0x2f 2a36e: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2a372: 87 fd sbrc r24, 7 2a374: 06 c0 rjmp .+12 ; 0x2a382 2a376: 0e 8b std Y+22, r16 ; 0x16 2a378: 1f 8b std Y+23, r17 ; 0x17 2a37a: b8 a9 ldd r27, Y+48 ; 0x30 2a37c: b8 8f std Y+24, r27 ; 0x18 2a37e: 2f a5 ldd r18, Y+47 ; 0x2f 2a380: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 2a382: 2a 89 ldd r18, Y+18 ; 0x12 2a384: 3b 89 ldd r19, Y+19 ; 0x13 2a386: 4c 89 ldd r20, Y+20 ; 0x14 2a388: 5d 89 ldd r21, Y+21 ; 0x15 2a38a: b8 01 movw r22, r16 2a38c: 88 a9 ldd r24, Y+48 ; 0x30 2a38e: 9f a5 ldd r25, Y+47 ; 0x2f 2a390: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 2a394: 18 16 cp r1, r24 2a396: 34 f0 brlt .+12 ; 0x2a3a4 2a398: 0a 8b std Y+18, r16 ; 0x12 2a39a: 1b 8b std Y+19, r17 ; 0x13 2a39c: 38 a9 ldd r19, Y+48 ; 0x30 2a39e: 3c 8b std Y+20, r19 ; 0x14 2a3a0: 4f a5 ldd r20, Y+47 ; 0x2f 2a3a2: 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) { 2a3a4: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a3a8: 2c a1 ldd r18, Y+36 ; 0x24 2a3aa: 3d a1 ldd r19, Y+37 ; 0x25 2a3ac: 4e a1 ldd r20, Y+38 ; 0x26 2a3ae: 5f a1 ldd r21, Y+39 ; 0x27 2a3b0: 62 1b sub r22, r18 2a3b2: 73 0b sbc r23, r19 2a3b4: 84 0b sbc r24, r20 2a3b6: 95 0b sbc r25, r21 2a3b8: 65 3c cpi r22, 0xC5 ; 197 2a3ba: 79 40 sbci r23, 0x09 ; 9 2a3bc: 81 05 cpc r24, r1 2a3be: 91 05 cpc r25, r1 2a3c0: 40 f0 brcs .+16 ; 0x2a3d2 checkExtruderAutoFans(); 2a3c2: 0e 94 43 77 call 0xee86 ; 0xee86 extruder_autofan_last_check = _millis(); 2a3c6: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a3ca: 6c a3 std Y+36, r22 ; 0x24 2a3cc: 7d a3 std Y+37, r23 ; 0x25 2a3ce: 8e a3 std Y+38, r24 ; 0x26 2a3d0: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 2a3d2: 4a 8d ldd r20, Y+26 ; 0x1a 2a3d4: 44 23 and r20, r20 2a3d6: 09 f4 brne .+2 ; 0x2a3da 2a3d8: 4c c0 rjmp .+152 ; 0x2a472 2a3da: 2a 85 ldd r18, Y+10 ; 0x0a 2a3dc: 3b 85 ldd r19, Y+11 ; 0x0b 2a3de: 4c 85 ldd r20, Y+12 ; 0x0c 2a3e0: 5d 85 ldd r21, Y+13 ; 0x0d 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 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 2a3ec: 18 16 cp r1, r24 2a3ee: 0c f0 brlt .+2 ; 0x2a3f2 2a3f0: d3 c1 rjmp .+934 ; 0x2a798 if(_millis() - t2 > 5000) { 2a3f2: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a3f6: 2e 85 ldd r18, Y+14 ; 0x0e 2a3f8: 3f 85 ldd r19, Y+15 ; 0x0f 2a3fa: 48 89 ldd r20, Y+16 ; 0x10 2a3fc: 59 89 ldd r21, Y+17 ; 0x11 2a3fe: 62 1b sub r22, r18 2a400: 73 0b sbc r23, r19 2a402: 84 0b sbc r24, r20 2a404: 95 0b sbc r25, r21 2a406: 69 38 cpi r22, 0x89 ; 137 2a408: 73 41 sbci r23, 0x13 ; 19 2a40a: 81 05 cpc r24, r1 2a40c: 91 05 cpc r25, r1 2a40e: 08 f4 brcc .+2 ; 0x2a412 2a410: c3 c1 rjmp .+902 ; 0x2a798 2a412: d7 01 movw r26, r14 2a414: c6 01 movw r24, r12 2a416: 29 81 ldd r18, Y+1 ; 0x01 2a418: 3a 81 ldd r19, Y+2 ; 0x02 2a41a: 4b 81 ldd r20, Y+3 ; 0x03 2a41c: 5c 81 ldd r21, Y+4 ; 0x04 2a41e: 82 1b sub r24, r18 2a420: 93 0b sbc r25, r19 2a422: a4 0b sbc r26, r20 2a424: b5 0b sbc r27, r21 2a426: b5 95 asr r27 2a428: a7 95 ror r26 2a42a: 97 95 ror r25 2a42c: 87 95 ror r24 heating=false; if (extruder<0) { 2a42e: 21 14 cp r2, r1 2a430: 31 04 cpc r3, r1 2a432: 09 f4 brne .+2 ; 0x2a436 2a434: 40 c0 rjmp .+128 ; 0x2a4b6 soft_pwm_bed = (bias - d) >> 1; 2a436: 80 93 17 06 sts 0x0617, r24 ; 0x800617 } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 2a43a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a43e: 6e 83 std Y+6, r22 ; 0x06 2a440: 7f 83 std Y+7, r23 ; 0x07 2a442: 88 87 std Y+8, r24 ; 0x08 2a444: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 2a446: dc 01 movw r26, r24 2a448: cb 01 movw r24, r22 2a44a: 2e 85 ldd r18, Y+14 ; 0x0e 2a44c: 3f 85 ldd r19, Y+15 ; 0x0f 2a44e: 48 89 ldd r20, Y+16 ; 0x10 2a450: 59 89 ldd r21, Y+17 ; 0x11 2a452: 82 1b sub r24, r18 2a454: 93 0b sbc r25, r19 2a456: a4 0b sbc r26, r20 2a458: b5 0b sbc r27, r21 2a45a: 8b 8f std Y+27, r24 ; 0x1b 2a45c: 9c 8f std Y+28, r25 ; 0x1c 2a45e: ad 8f std Y+29, r26 ; 0x1d 2a460: be 8f std Y+30, r27 ; 0x1e max=temp; 2a462: 3a 85 ldd r19, Y+10 ; 0x0a 2a464: 3e 8b std Y+22, r19 ; 0x16 2a466: 4b 85 ldd r20, Y+11 ; 0x0b 2a468: 4f 8b std Y+23, r20 ; 0x17 2a46a: 5c 85 ldd r21, Y+12 ; 0x0c 2a46c: 58 8f std Y+24, r21 ; 0x18 2a46e: 8d 85 ldd r24, Y+13 ; 0x0d 2a470: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 2a472: 2a 85 ldd r18, Y+10 ; 0x0a 2a474: 3b 85 ldd r19, Y+11 ; 0x0b 2a476: 4c 85 ldd r20, Y+12 ; 0x0c 2a478: 5d 85 ldd r21, Y+13 ; 0x0d 2a47a: b8 01 movw r22, r16 2a47c: 88 a9 ldd r24, Y+48 ; 0x30 2a47e: 9f a5 ldd r25, Y+47 ; 0x2f 2a480: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2a484: 87 fd sbrc r24, 7 2a486: 1a c0 rjmp .+52 ; 0x2a4bc if(_millis() - t1 > 5000) { 2a488: 1a 8e std Y+26, r1 ; 0x1a 2a48a: 86 c1 rjmp .+780 ; 0x2a798 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 2a48c: 4a e0 ldi r20, 0x0A ; 10 2a48e: 4f 8f std Y+31, r20 ; 0x1f 2a490: 00 cf rjmp .-512 ; 0x2a292 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; 2a492: 20 93 16 05 sts 0x0516, r18 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 2a496: 70 93 6b 0e sts 0x0E6B, r23 ; 0x800e6b 2a49a: 60 93 6a 0e sts 0x0E6A, r22 ; 0x800e6a 2a49e: 1a cf rjmp .-460 ; 0x2a2d4 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a4a0: 00 91 ee 04 lds r16, 0x04EE ; 0x8004ee 2a4a4: 10 91 ef 04 lds r17, 0x04EF ; 0x8004ef 2a4a8: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 2a4ac: 98 ab std Y+48, r25 ; 0x30 2a4ae: a0 91 f1 04 lds r26, 0x04F1 ; 0x8004f1 2a4b2: af a7 std Y+47, r26 ; 0x2f 2a4b4: 55 cf rjmp .-342 ; 0x2a360 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 2a4b6: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 2a4ba: bf cf rjmp .-130 ; 0x2a43a t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 2a4bc: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a4c0: 2e 81 ldd r18, Y+6 ; 0x06 2a4c2: 3f 81 ldd r19, Y+7 ; 0x07 2a4c4: 48 85 ldd r20, Y+8 ; 0x08 2a4c6: 59 85 ldd r21, Y+9 ; 0x09 2a4c8: 62 1b sub r22, r18 2a4ca: 73 0b sbc r23, r19 2a4cc: 84 0b sbc r24, r20 2a4ce: 95 0b sbc r25, r21 2a4d0: 69 38 cpi r22, 0x89 ; 137 2a4d2: 73 41 sbci r23, 0x13 ; 19 2a4d4: 81 05 cpc r24, r1 2a4d6: 91 05 cpc r25, r1 2a4d8: b8 f2 brcs .-82 ; 0x2a488 heating=true; t2=_millis(); 2a4da: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a4de: 6e 87 std Y+14, r22 ; 0x0e 2a4e0: 7f 87 std Y+15, r23 ; 0x0f 2a4e2: 88 8b std Y+16, r24 ; 0x10 2a4e4: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 2a4e6: 80 91 43 06 lds r24, 0x0643 ; 0x800643 2a4ea: 90 91 44 06 lds r25, 0x0644 ; 0x800644 2a4ee: 18 16 cp r1, r24 2a4f0: 19 06 cpc r1, r25 2a4f2: 0c f0 brlt .+2 ; 0x2a4f6 2a4f4: 2c c1 rjmp .+600 ; 0x2a74e } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 2a4f6: 8e 85 ldd r24, Y+14 ; 0x0e 2a4f8: 9f 85 ldd r25, Y+15 ; 0x0f 2a4fa: a8 89 ldd r26, Y+16 ; 0x10 2a4fc: b9 89 ldd r27, Y+17 ; 0x11 2a4fe: 2e 81 ldd r18, Y+6 ; 0x06 2a500: 3f 81 ldd r19, Y+7 ; 0x07 2a502: 48 85 ldd r20, Y+8 ; 0x08 2a504: 59 85 ldd r21, Y+9 ; 0x09 2a506: 82 1b sub r24, r18 2a508: 93 0b sbc r25, r19 2a50a: a4 0b sbc r26, r20 2a50c: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 2a50e: 4b 8c ldd r4, Y+27 ; 0x1b 2a510: 5c 8c ldd r5, Y+28 ; 0x1c 2a512: 6d 8c ldd r6, Y+29 ; 0x1d 2a514: 7e 8c ldd r7, Y+30 ; 0x1e 2a516: 48 0e add r4, r24 2a518: 59 1e adc r5, r25 2a51a: 6a 1e adc r6, r26 2a51c: 7b 1e adc r7, r27 2a51e: 2b 8d ldd r18, Y+27 ; 0x1b 2a520: 3c 8d ldd r19, Y+28 ; 0x1c 2a522: 4d 8d ldd r20, Y+29 ; 0x1d 2a524: 5e 8d ldd r21, Y+30 ; 0x1e 2a526: 28 1b sub r18, r24 2a528: 39 0b sbc r19, r25 2a52a: 4a 0b sbc r20, r26 2a52c: 5b 0b sbc r21, r27 2a52e: 69 81 ldd r22, Y+1 ; 0x01 2a530: 7a 81 ldd r23, Y+2 ; 0x02 2a532: 8b 81 ldd r24, Y+3 ; 0x03 2a534: 9c 81 ldd r25, Y+4 ; 0x04 2a536: 0f 94 a9 dd call 0x3bb52 ; 0x3bb52 <__mulsi3> 2a53a: a3 01 movw r20, r6 2a53c: 92 01 movw r18, r4 2a53e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__divmodsi4> 2a542: da 01 movw r26, r20 2a544: c9 01 movw r24, r18 2a546: 8c 0d add r24, r12 2a548: 9d 1d adc r25, r13 2a54a: ae 1d adc r26, r14 2a54c: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 2a54e: 84 31 cpi r24, 0x14 ; 20 2a550: 91 05 cpc r25, r1 2a552: a1 05 cpc r26, r1 2a554: b1 05 cpc r27, r1 2a556: 0c f4 brge .+2 ; 0x2a55a 2a558: 3c c1 rjmp .+632 ; 0x2a7d2 2a55a: 6c 01 movw r12, r24 2a55c: 7d 01 movw r14, r26 2a55e: 3c ee ldi r19, 0xEC ; 236 2a560: c3 16 cp r12, r19 2a562: d1 04 cpc r13, r1 2a564: e1 04 cpc r14, r1 2a566: f1 04 cpc r15, r1 2a568: 2c f0 brlt .+10 ; 0x2a574 2a56a: 4b ee ldi r20, 0xEB ; 235 2a56c: c4 2e mov r12, r20 2a56e: d1 2c mov r13, r1 2a570: e1 2c mov r14, r1 2a572: 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; 2a574: 80 38 cpi r24, 0x80 ; 128 2a576: 91 05 cpc r25, r1 2a578: a1 05 cpc r26, r1 2a57a: b1 05 cpc r27, r1 2a57c: 0c f4 brge .+2 ; 0x2a580 2a57e: 37 c1 rjmp .+622 ; 0x2a7ee 2a580: 8e ef ldi r24, 0xFE ; 254 2a582: 90 e0 ldi r25, 0x00 ; 0 2a584: a0 e0 ldi r26, 0x00 ; 0 2a586: b0 e0 ldi r27, 0x00 ; 0 2a588: 8c 19 sub r24, r12 2a58a: 9d 09 sbc r25, r13 2a58c: ae 09 sbc r26, r14 2a58e: bf 09 sbc r27, r15 2a590: 89 83 std Y+1, r24 ; 0x01 2a592: 9a 83 std Y+2, r25 ; 0x02 2a594: ab 83 std Y+3, r26 ; 0x03 2a596: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 2a598: 86 ec ldi r24, 0xC6 ; 198 2a59a: 9b e9 ldi r25, 0x9B ; 155 2a59c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a5a0: c7 01 movw r24, r14 2a5a2: b6 01 movw r22, r12 2a5a4: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 2a5a8: 81 ec ldi r24, 0xC1 ; 193 2a5aa: 9b e9 ldi r25, 0x9B ; 155 2a5ac: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a5b0: 69 81 ldd r22, Y+1 ; 0x01 2a5b2: 7a 81 ldd r23, Y+2 ; 0x02 2a5b4: 8b 81 ldd r24, Y+3 ; 0x03 2a5b6: 9c 81 ldd r25, Y+4 ; 0x04 2a5b8: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 2a5bc: 8a eb ldi r24, 0xBA ; 186 2a5be: 9b e9 ldi r25, 0x9B ; 155 2a5c0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2a5c4: 42 e0 ldi r20, 0x02 ; 2 2a5c6: 6a 89 ldd r22, Y+18 ; 0x12 2a5c8: 7b 89 ldd r23, Y+19 ; 0x13 2a5ca: 8c 89 ldd r24, Y+20 ; 0x14 2a5cc: 9d 89 ldd r25, Y+21 ; 0x15 2a5ce: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 2a5d2: 83 eb ldi r24, 0xB3 ; 179 2a5d4: 9b e9 ldi r25, 0x9B ; 155 2a5d6: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a5da: 6e 89 ldd r22, Y+22 ; 0x16 2a5dc: 7f 89 ldd r23, Y+23 ; 0x17 2a5de: 88 8d ldd r24, Y+24 ; 0x18 2a5e0: 99 8d ldd r25, Y+25 ; 0x19 2a5e2: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a if(pid_cycle > 2) { 2a5e6: 80 91 43 06 lds r24, 0x0643 ; 0x800643 2a5ea: 90 91 44 06 lds r25, 0x0644 ; 0x800644 2a5ee: 03 97 sbiw r24, 0x03 ; 3 2a5f0: 0c f4 brge .+2 ; 0x2a5f4 2a5f2: ad c0 rjmp .+346 ; 0x2a74e Ku = (4.0*d)/(3.14159*(max-min)/2.0); 2a5f4: 69 81 ldd r22, Y+1 ; 0x01 2a5f6: 7a 81 ldd r23, Y+2 ; 0x02 2a5f8: 8b 81 ldd r24, Y+3 ; 0x03 2a5fa: 9c 81 ldd r25, Y+4 ; 0x04 2a5fc: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 2a600: 20 e0 ldi r18, 0x00 ; 0 2a602: 30 e0 ldi r19, 0x00 ; 0 2a604: 40 e8 ldi r20, 0x80 ; 128 2a606: 50 e4 ldi r21, 0x40 ; 64 2a608: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2a60c: 4b 01 movw r8, r22 2a60e: 5c 01 movw r10, r24 2a610: 2a 89 ldd r18, Y+18 ; 0x12 2a612: 3b 89 ldd r19, Y+19 ; 0x13 2a614: 4c 89 ldd r20, Y+20 ; 0x14 2a616: 5d 89 ldd r21, Y+21 ; 0x15 2a618: 6e 89 ldd r22, Y+22 ; 0x16 2a61a: 7f 89 ldd r23, Y+23 ; 0x17 2a61c: 88 8d ldd r24, Y+24 ; 0x18 2a61e: 99 8d ldd r25, Y+25 ; 0x19 2a620: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 2a624: 20 ed ldi r18, 0xD0 ; 208 2a626: 3f e0 ldi r19, 0x0F ; 15 2a628: 49 e4 ldi r20, 0x49 ; 73 2a62a: 50 e4 ldi r21, 0x40 ; 64 2a62c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2a630: 20 e0 ldi r18, 0x00 ; 0 2a632: 30 e0 ldi r19, 0x00 ; 0 2a634: 40 e0 ldi r20, 0x00 ; 0 2a636: 5f e3 ldi r21, 0x3F ; 63 2a638: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2a63c: 9b 01 movw r18, r22 2a63e: ac 01 movw r20, r24 2a640: c5 01 movw r24, r10 2a642: b4 01 movw r22, r8 2a644: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 2a648: 4b 01 movw r8, r22 2a64a: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 2a64c: c3 01 movw r24, r6 2a64e: b2 01 movw r22, r4 2a650: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 2a654: 20 e0 ldi r18, 0x00 ; 0 2a656: 30 e0 ldi r19, 0x00 ; 0 2a658: 4a e7 ldi r20, 0x7A ; 122 2a65a: 54 e4 ldi r21, 0x44 ; 68 2a65c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 2a660: 2b 01 movw r4, r22 2a662: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 2a664: 8d ea ldi r24, 0xAD ; 173 2a666: 9b e9 ldi r25, 0x9B ; 155 2a668: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a66c: 42 e0 ldi r20, 0x02 ; 2 2a66e: c5 01 movw r24, r10 2a670: b4 01 movw r22, r8 2a672: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 2a676: 87 ea ldi r24, 0xA7 ; 167 2a678: 9b e9 ldi r25, 0x9B ; 155 2a67a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a67e: c3 01 movw r24, r6 2a680: b2 01 movw r22, r4 2a682: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a _Kp = 0.6*Ku; 2a686: 2a e9 ldi r18, 0x9A ; 154 2a688: 39 e9 ldi r19, 0x99 ; 153 2a68a: 49 e1 ldi r20, 0x19 ; 25 2a68c: 5f e3 ldi r21, 0x3F ; 63 2a68e: c5 01 movw r24, r10 2a690: b4 01 movw r22, r8 2a692: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2a696: 4b 01 movw r8, r22 2a698: 5c 01 movw r10, r24 2a69a: 80 92 ec 03 sts 0x03EC, r8 ; 0x8003ec <_Kp> 2a69e: 90 92 ed 03 sts 0x03ED, r9 ; 0x8003ed <_Kp+0x1> 2a6a2: a0 92 ee 03 sts 0x03EE, r10 ; 0x8003ee <_Kp+0x2> 2a6a6: b0 92 ef 03 sts 0x03EF, r11 ; 0x8003ef <_Kp+0x3> _Ki = 2*_Kp/Tu; 2a6aa: ac 01 movw r20, r24 2a6ac: 9b 01 movw r18, r22 2a6ae: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2a6b2: a3 01 movw r20, r6 2a6b4: 92 01 movw r18, r4 2a6b6: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 2a6ba: 60 93 e8 03 sts 0x03E8, r22 ; 0x8003e8 <_Ki> 2a6be: 70 93 e9 03 sts 0x03E9, r23 ; 0x8003e9 <_Ki+0x1> 2a6c2: 80 93 ea 03 sts 0x03EA, r24 ; 0x8003ea <_Ki+0x2> 2a6c6: 90 93 eb 03 sts 0x03EB, r25 ; 0x8003eb <_Ki+0x3> _Kd = _Kp*Tu/8; 2a6ca: a3 01 movw r20, r6 2a6cc: 92 01 movw r18, r4 2a6ce: c5 01 movw r24, r10 2a6d0: b4 01 movw r22, r8 2a6d2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2a6d6: 20 e0 ldi r18, 0x00 ; 0 2a6d8: 30 e0 ldi r19, 0x00 ; 0 2a6da: 40 e0 ldi r20, 0x00 ; 0 2a6dc: 5e e3 ldi r21, 0x3E ; 62 2a6de: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2a6e2: 60 93 e4 03 sts 0x03E4, r22 ; 0x8003e4 <_Kd> 2a6e6: 70 93 e5 03 sts 0x03E5, r23 ; 0x8003e5 <_Kd+0x1> 2a6ea: 80 93 e6 03 sts 0x03E6, r24 ; 0x8003e6 <_Kd+0x2> 2a6ee: 90 93 e7 03 sts 0x03E7, r25 ; 0x8003e7 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 2a6f2: 89 e9 ldi r24, 0x99 ; 153 2a6f4: 9b e9 ldi r25, 0x9B ; 155 2a6f6: 0e 94 17 7b call 0xf62e ; 0xf62e SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 2a6fa: 83 e9 ldi r24, 0x93 ; 147 2a6fc: 9b e9 ldi r25, 0x9B ; 155 2a6fe: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a702: 60 91 ec 03 lds r22, 0x03EC ; 0x8003ec <_Kp> 2a706: 70 91 ed 03 lds r23, 0x03ED ; 0x8003ed <_Kp+0x1> 2a70a: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_Kp+0x2> 2a70e: 90 91 ef 03 lds r25, 0x03EF ; 0x8003ef <_Kp+0x3> 2a712: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 2a716: 8d e8 ldi r24, 0x8D ; 141 2a718: 9b e9 ldi r25, 0x9B ; 155 2a71a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a71e: 60 91 e8 03 lds r22, 0x03E8 ; 0x8003e8 <_Ki> 2a722: 70 91 e9 03 lds r23, 0x03E9 ; 0x8003e9 <_Ki+0x1> 2a726: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Ki+0x2> 2a72a: 90 91 eb 03 lds r25, 0x03EB ; 0x8003eb <_Ki+0x3> 2a72e: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 2a732: 87 e8 ldi r24, 0x87 ; 135 2a734: 9b e9 ldi r25, 0x9B ; 155 2a736: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a73a: 60 91 e4 03 lds r22, 0x03E4 ; 0x8003e4 <_Kd> 2a73e: 70 91 e5 03 lds r23, 0x03E5 ; 0x8003e5 <_Kd+0x1> 2a742: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_Kd+0x2> 2a746: 90 91 e7 03 lds r25, 0x03E7 ; 0x8003e7 <_Kd+0x3> 2a74a: 0f 94 8d 76 call 0x2ed1a ; 0x2ed1a 2a74e: 89 81 ldd r24, Y+1 ; 0x01 2a750: 9a 81 ldd r25, Y+2 ; 0x02 2a752: ab 81 ldd r26, Y+3 ; 0x03 2a754: bc 81 ldd r27, Y+4 ; 0x04 2a756: 8c 0d add r24, r12 2a758: 9d 1d adc r25, r13 2a75a: ae 1d adc r26, r14 2a75c: bf 1d adc r27, r15 2a75e: b5 95 asr r27 2a760: a7 95 ror r26 2a762: 97 95 ror r25 2a764: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 2a766: 21 14 cp r2, r1 2a768: 31 04 cpc r3, r1 2a76a: 09 f4 brne .+2 ; 0x2a76e 2a76c: 45 c0 rjmp .+138 ; 0x2a7f8 { soft_pwm_bed = (bias + d) >> 1; 2a76e: 80 93 17 06 sts 0x0617, r24 ; 0x800617 } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 2a772: 80 91 43 06 lds r24, 0x0643 ; 0x800643 2a776: 90 91 44 06 lds r25, 0x0644 ; 0x800644 2a77a: 01 96 adiw r24, 0x01 ; 1 2a77c: 90 93 44 06 sts 0x0644, r25 ; 0x800644 2a780: 80 93 43 06 sts 0x0643, r24 ; 0x800643 min=temp; 2a784: 3a 85 ldd r19, Y+10 ; 0x0a 2a786: 3a 8b std Y+18, r19 ; 0x12 2a788: 4b 85 ldd r20, Y+11 ; 0x0b 2a78a: 4b 8b std Y+19, r20 ; 0x13 2a78c: 5c 85 ldd r21, Y+12 ; 0x0c 2a78e: 5c 8b std Y+20, r21 ; 0x14 2a790: 8d 85 ldd r24, Y+13 ; 0x0d 2a792: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 2a794: 98 a5 ldd r25, Y+40 ; 0x28 2a796: 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)) { 2a798: 20 e0 ldi r18, 0x00 ; 0 2a79a: 30 e0 ldi r19, 0x00 ; 0 2a79c: 40 ea ldi r20, 0xA0 ; 160 2a79e: 51 e4 ldi r21, 0x41 ; 65 2a7a0: 6a 85 ldd r22, Y+10 ; 0x0a 2a7a2: 7b 85 ldd r23, Y+11 ; 0x0b 2a7a4: 8c 85 ldd r24, Y+12 ; 0x0c 2a7a6: 9d 85 ldd r25, Y+13 ; 0x0d 2a7a8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2a7ac: 98 01 movw r18, r16 2a7ae: 48 a9 ldd r20, Y+48 ; 0x30 2a7b0: 5f a5 ldd r21, Y+47 ; 0x2f 2a7b2: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2a7b6: 87 ff sbrs r24, 7 2a7b8: 22 c0 rjmp .+68 ; 0x2a7fe SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 2a7ba: 8d e5 ldi r24, 0x5D ; 93 2a7bc: 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"); 2a7be: 0e 94 17 7b call 0xf62e ; 0xf62e pid_tuning_finished = true; 2a7c2: 81 e0 ldi r24, 0x01 ; 1 2a7c4: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.472> pid_cycle = 0; 2a7c8: 10 92 44 06 sts 0x0644, r1 ; 0x800644 2a7cc: 10 92 43 06 sts 0x0643, r1 ; 0x800643 2a7d0: 98 c0 rjmp .+304 ; 0x2a902 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); 2a7d2: 34 e1 ldi r19, 0x14 ; 20 2a7d4: c3 2e mov r12, r19 2a7d6: d1 2c mov r13, r1 2a7d8: e1 2c mov r14, r1 2a7da: f1 2c mov r15, r1 2a7dc: 24 e1 ldi r18, 0x14 ; 20 2a7de: 30 e0 ldi r19, 0x00 ; 0 2a7e0: 40 e0 ldi r20, 0x00 ; 0 2a7e2: 50 e0 ldi r21, 0x00 ; 0 2a7e4: 29 83 std Y+1, r18 ; 0x01 2a7e6: 3a 83 std Y+2, r19 ; 0x02 2a7e8: 4b 83 std Y+3, r20 ; 0x03 2a7ea: 5c 83 std Y+4, r21 ; 0x04 2a7ec: d5 ce rjmp .-598 ; 0x2a598 2a7ee: c9 82 std Y+1, r12 ; 0x01 2a7f0: da 82 std Y+2, r13 ; 0x02 2a7f2: eb 82 std Y+3, r14 ; 0x03 2a7f4: fc 82 std Y+4, r15 ; 0x04 2a7f6: d0 ce rjmp .-608 ; 0x2a598 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 2a7f8: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 2a7fc: ba cf rjmp .-140 ; 0x2a772 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 2a7fe: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a802: 28 a1 ldd r18, Y+32 ; 0x20 2a804: 39 a1 ldd r19, Y+33 ; 0x21 2a806: 4a a1 ldd r20, Y+34 ; 0x22 2a808: 5b a1 ldd r21, Y+35 ; 0x23 2a80a: 62 1b sub r22, r18 2a80c: 73 0b sbc r23, r19 2a80e: 84 0b sbc r24, r20 2a810: 95 0b sbc r25, r21 2a812: 61 3d cpi r22, 0xD1 ; 209 2a814: 77 40 sbci r23, 0x07 ; 7 2a816: 81 05 cpc r24, r1 2a818: 91 05 cpc r25, r1 2a81a: 58 f1 brcs .+86 ; 0x2a872 int p; if (extruder<0){ p=soft_pwm_bed; 2a81c: a0 90 17 06 lds r10, 0x0617 ; 0x800617 2a820: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 2a822: 8a e5 ldi r24, 0x5A ; 90 2a824: 9b e9 ldi r25, 0x9B ; 155 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 2a826: 21 14 cp r2, r1 2a828: 31 04 cpc r3, r1 2a82a: 29 f4 brne .+10 ; 0x2a836 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 2a82c: a0 90 16 05 lds r10, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.473> 2a830: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 2a832: 87 e5 ldi r24, 0x57 ; 87 2a834: 9b e9 ldi r25, 0x9B ; 155 2a836: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2a83a: 42 e0 ldi r20, 0x02 ; 2 2a83c: b8 01 movw r22, r16 2a83e: 88 a9 ldd r24, Y+48 ; 0x30 2a840: 9f a5 ldd r25, Y+47 ; 0x2f 2a842: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 2a846: 83 e5 ldi r24, 0x53 ; 83 2a848: 9b e9 ldi r25, 0x9B ; 155 2a84a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_PROTOCOLLN(p); 2a84e: c5 01 movw r24, r10 2a850: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c if (safety_check_cycles == 0) { //save ambient temp 2a854: 4d 81 ldd r20, Y+5 ; 0x05 2a856: 44 23 and r20, r20 2a858: 09 f4 brne .+2 ; 0x2a85c 2a85a: 6c c0 rjmp .+216 ; 0x2a934 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 2a85c: 5f 8d ldd r21, Y+31 ; 0x1f 2a85e: 45 17 cp r20, r21 2a860: 70 f5 brcc .+92 ; 0x2a8be safety_check_cycles++; 2a862: 4f 5f subi r20, 0xFF ; 255 2a864: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 2a866: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a86a: 68 a3 std Y+32, r22 ; 0x20 2a86c: 79 a3 std Y+33, r23 ; 0x21 2a86e: 8a a3 std Y+34, r24 ; 0x22 2a870: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 2a872: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a876: 4b 01 movw r8, r22 2a878: 5c 01 movw r10, r24 2a87a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a87e: 4e 80 ldd r4, Y+6 ; 0x06 2a880: 5f 80 ldd r5, Y+7 ; 0x07 2a882: 68 84 ldd r6, Y+8 ; 0x08 2a884: 79 84 ldd r7, Y+9 ; 0x09 2a886: 2e 85 ldd r18, Y+14 ; 0x0e 2a888: 3f 85 ldd r19, Y+15 ; 0x0f 2a88a: 48 89 ldd r20, Y+16 ; 0x10 2a88c: 59 89 ldd r21, Y+17 ; 0x11 2a88e: 42 0e add r4, r18 2a890: 53 1e adc r5, r19 2a892: 64 1e adc r6, r20 2a894: 75 1e adc r7, r21 2a896: 84 18 sub r8, r4 2a898: 95 08 sbc r9, r5 2a89a: a6 08 sbc r10, r6 2a89c: b7 08 sbc r11, r7 2a89e: 86 0e add r8, r22 2a8a0: 97 1e adc r9, r23 2a8a2: a8 1e adc r10, r24 2a8a4: b9 1e adc r11, r25 2a8a6: 31 e8 ldi r19, 0x81 ; 129 2a8a8: 83 16 cp r8, r19 2a8aa: 3f e4 ldi r19, 0x4F ; 79 2a8ac: 93 06 cpc r9, r19 2a8ae: 32 e1 ldi r19, 0x12 ; 18 2a8b0: a3 06 cpc r10, r19 2a8b2: b1 04 cpc r11, r1 2a8b4: 08 f4 brcc .+2 ; 0x2a8b8 2a8b6: 47 c0 rjmp .+142 ; 0x2a946 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 2a8b8: 86 e3 ldi r24, 0x36 ; 54 2a8ba: 9b e9 ldi r25, 0x9B ; 155 2a8bc: 80 cf rjmp .-256 ; 0x2a7be 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 2a8be: 8d 81 ldd r24, Y+5 ; 0x05 2a8c0: 9f 8d ldd r25, Y+31 ; 0x1f 2a8c2: 89 13 cpse r24, r25 2a8c4: d0 cf rjmp .-96 ; 0x2a866 safety_check_cycles++; 2a8c6: 8f 5f subi r24, 0xFF ; 255 2a8c8: 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) { 2a8ca: 2b a5 ldd r18, Y+43 ; 0x2b 2a8cc: 3c a5 ldd r19, Y+44 ; 0x2c 2a8ce: 4d a5 ldd r20, Y+45 ; 0x2d 2a8d0: 5e a5 ldd r21, Y+46 ; 0x2e 2a8d2: b8 01 movw r22, r16 2a8d4: 88 a9 ldd r24, Y+48 ; 0x30 2a8d6: 9f a5 ldd r25, Y+47 ; 0x2f 2a8d8: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 2a8dc: 9f 77 andi r25, 0x7F ; 127 2a8de: 20 e0 ldi r18, 0x00 ; 0 2a8e0: 30 e0 ldi r19, 0x00 ; 0 2a8e2: 40 ea ldi r20, 0xA0 ; 160 2a8e4: 50 e4 ldi r21, 0x40 ; 64 2a8e6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2a8ea: 87 ff sbrs r24, 7 2a8ec: bc cf rjmp .-136 ; 0x2a866 temp_runaway_stop(false, (extruder<0)); 2a8ee: 63 2d mov r22, r3 2a8f0: 66 1f adc r22, r22 2a8f2: 66 27 eor r22, r22 2a8f4: 66 1f adc r22, r22 2a8f6: 80 e0 ldi r24, 0x00 ; 0 2a8f8: 0f 94 41 32 call 0x26482 ; 0x26482 pid_tuning_finished = true; 2a8fc: 81 e0 ldi r24, 0x01 ; 1 2a8fe: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.472> pid_cycle = 0; return; } lcd_update(0); } } 2a902: e0 96 adiw r28, 0x30 ; 48 2a904: 0f b6 in r0, 0x3f ; 63 2a906: f8 94 cli 2a908: de bf out 0x3e, r29 ; 62 2a90a: 0f be out 0x3f, r0 ; 63 2a90c: cd bf out 0x3d, r28 ; 61 2a90e: df 91 pop r29 2a910: cf 91 pop r28 2a912: 1f 91 pop r17 2a914: 0f 91 pop r16 2a916: ff 90 pop r15 2a918: ef 90 pop r14 2a91a: df 90 pop r13 2a91c: cf 90 pop r12 2a91e: bf 90 pop r11 2a920: af 90 pop r10 2a922: 9f 90 pop r9 2a924: 8f 90 pop r8 2a926: 7f 90 pop r7 2a928: 6f 90 pop r6 2a92a: 5f 90 pop r5 2a92c: 4f 90 pop r4 2a92e: 3f 90 pop r3 2a930: 2f 90 pop r2 2a932: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 2a934: 0b a7 std Y+43, r16 ; 0x2b 2a936: 1c a7 std Y+44, r17 ; 0x2c 2a938: a8 a9 ldd r26, Y+48 ; 0x30 2a93a: ad a7 std Y+45, r26 ; 0x2d 2a93c: bf a5 ldd r27, Y+47 ; 0x2f 2a93e: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 2a940: 21 e0 ldi r18, 0x01 ; 1 2a942: 2d 83 std Y+5, r18 ; 0x05 2a944: 90 cf rjmp .-224 ; 0x2a866 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 2a946: 80 91 43 06 lds r24, 0x0643 ; 0x800643 2a94a: 90 91 44 06 lds r25, 0x0644 ; 0x800644 2a94e: 49 a5 ldd r20, Y+41 ; 0x29 2a950: 5a a5 ldd r21, Y+42 ; 0x2a 2a952: 48 17 cp r20, r24 2a954: 59 07 cpc r21, r25 2a956: 1c f4 brge .+6 ; 0x2a95e SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 2a958: 8a ed ldi r24, 0xDA ; 218 2a95a: 9a e9 ldi r25, 0x9A ; 154 2a95c: 30 cf rjmp .-416 ; 0x2a7be pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 2a95e: 80 e0 ldi r24, 0x00 ; 0 2a960: 0e 94 6d 6f call 0xdeda ; 0xdeda 2a964: e6 cc rjmp .-1588 ; 0x2a332 0002a966 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 2a966: 0f 93 push r16 2a968: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2a96a: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2a96e: 81 30 cpi r24, 0x01 ; 1 2a970: 19 f5 brne .+70 ; 0x2a9b8 2a972: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2a976: 00 91 a5 05 lds r16, 0x05A5 ; 0x8005a5 2a97a: 10 91 a6 05 lds r17, 0x05A6 ; 0x8005a6 2a97e: 20 91 a7 05 lds r18, 0x05A7 ; 0x8005a7 2a982: 30 91 a8 05 lds r19, 0x05A8 ; 0x8005a8 2a986: 60 1b sub r22, r16 2a988: 71 0b sbc r23, r17 2a98a: 82 0b sbc r24, r18 2a98c: 93 0b sbc r25, r19 2a98e: 28 ee ldi r18, 0xE8 ; 232 2a990: 33 e0 ldi r19, 0x03 ; 3 2a992: 40 e0 ldi r20, 0x00 ; 0 2a994: 50 e0 ldi r21, 0x00 ; 0 2a996: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 2a99a: 60 91 a1 05 lds r22, 0x05A1 ; 0x8005a1 2a99e: 70 91 a2 05 lds r23, 0x05A2 ; 0x8005a2 2a9a2: 80 91 a3 05 lds r24, 0x05A3 ; 0x8005a3 2a9a6: 90 91 a4 05 lds r25, 0x05A4 ; 0x8005a4 2a9aa: 62 0f add r22, r18 2a9ac: 73 1f adc r23, r19 2a9ae: 84 1f adc r24, r20 2a9b0: 95 1f adc r25, r21 } 2a9b2: 1f 91 pop r17 2a9b4: 0f 91 pop r16 2a9b6: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2a9b8: 60 91 4c 06 lds r22, 0x064C ; 0x80064c 2a9bc: 70 91 4d 06 lds r23, 0x064D ; 0x80064d 2a9c0: 80 91 4e 06 lds r24, 0x064E ; 0x80064e 2a9c4: 90 91 4f 06 lds r25, 0x064F ; 0x80064f 2a9c8: d6 cf rjmp .-84 ; 0x2a976 0002a9ca : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 2a9ca: 4f 92 push r4 2a9cc: 5f 92 push r5 2a9ce: 6f 92 push r6 2a9d0: 7f 92 push r7 2a9d2: 8f 92 push r8 2a9d4: 9f 92 push r9 2a9d6: af 92 push r10 2a9d8: bf 92 push r11 2a9da: cf 92 push r12 2a9dc: df 92 push r13 2a9de: ef 92 push r14 2a9e0: ff 92 push r15 2a9e2: 0f 93 push r16 2a9e4: 1f 93 push r17 2a9e6: cf 93 push r28 2a9e8: df 93 push r29 2a9ea: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 2a9ee: 0e 94 56 68 call 0xd0ac ; 0xd0ac 2a9f2: 88 23 and r24, r24 2a9f4: 09 f4 brne .+2 ; 0x2a9f8 2a9f6: 6e c0 rjmp .+220 ; 0x2aad4 { const float _met = ((float)total_filament_used) / (100000.f); 2a9f8: 60 91 5f 06 lds r22, 0x065F ; 0x80065f 2a9fc: 70 91 60 06 lds r23, 0x0660 ; 0x800660 2aa00: 80 91 61 06 lds r24, 0x0661 ; 0x800661 2aa04: 90 91 62 06 lds r25, 0x0662 ; 0x800662 2aa08: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 2aa0c: 20 e0 ldi r18, 0x00 ; 0 2aa0e: 30 e5 ldi r19, 0x50 ; 80 2aa10: 43 ec ldi r20, 0xC3 ; 195 2aa12: 57 e4 ldi r21, 0x47 ; 71 2aa14: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 2aa18: 56 2e mov r5, r22 2aa1a: 47 2e mov r4, r23 2aa1c: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 2aa1e: 0f 94 b3 54 call 0x2a966 ; 0x2a966 2aa22: 6b 01 movw r12, r22 2aa24: 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(); 2aa26: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_printf_P(_N( 2aa2a: 82 ea ldi r24, 0xA2 ; 162 2aa2c: 9c e4 ldi r25, 0x4C ; 76 2aa2e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2aa32: 18 2f mov r17, r24 2aa34: 09 2f mov r16, r25 2aa36: 82 e9 ldi r24, 0x92 ; 146 2aa38: 9c e4 ldi r25, 0x4C ; 76 2aa3a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2aa3e: 78 2e mov r7, r24 2aa40: 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; 2aa42: 8c e3 ldi r24, 0x3C ; 60 2aa44: 88 2e mov r8, r24 2aa46: 91 2c mov r9, r1 2aa48: a1 2c mov r10, r1 2aa4a: b1 2c mov r11, r1 2aa4c: c7 01 movw r24, r14 2aa4e: b6 01 movw r22, r12 2aa50: a5 01 movw r20, r10 2aa52: 94 01 movw r18, r8 2aa54: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2aa58: 7f 93 push r23 2aa5a: 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; 2aa5c: ca 01 movw r24, r20 2aa5e: b9 01 movw r22, r18 2aa60: a5 01 movw r20, r10 2aa62: 94 01 movw r18, r8 2aa64: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2aa68: 7f 93 push r23 2aa6a: 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; 2aa6c: c7 01 movw r24, r14 2aa6e: b6 01 movw r22, r12 2aa70: 20 e1 ldi r18, 0x10 ; 16 2aa72: 3e e0 ldi r19, 0x0E ; 14 2aa74: 40 e0 ldi r20, 0x00 ; 0 2aa76: 50 e0 ldi r21, 0x00 ; 0 2aa78: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2aa7c: 5f 93 push r21 2aa7e: 4f 93 push r20 2aa80: 3f 93 push r19 2aa82: 2f 93 push r18 2aa84: 0f 93 push r16 2aa86: 1f 93 push r17 2aa88: df 93 push r29 2aa8a: cf 93 push r28 2aa8c: 4f 92 push r4 2aa8e: 5f 92 push r5 2aa90: 6f 92 push r6 2aa92: 7f 92 push r7 2aa94: 8c ee ldi r24, 0xEC ; 236 2aa96: 9f e6 ldi r25, 0x6F ; 111 2aa98: 9f 93 push r25 2aa9a: 8f 93 push r24 2aa9c: 0e 94 7f 6f call 0xdefe ; 0xdefe "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 2aaa0: 8d b7 in r24, 0x3d ; 61 2aaa2: 9e b7 in r25, 0x3e ; 62 2aaa4: 42 96 adiw r24, 0x12 ; 18 2aaa6: 0f b6 in r0, 0x3f ; 63 2aaa8: f8 94 cli 2aaaa: 9e bf out 0x3e, r25 ; 62 2aaac: 0f be out 0x3f, r0 ; 63 2aaae: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 2aab0: df 91 pop r29 2aab2: cf 91 pop r28 2aab4: 1f 91 pop r17 2aab6: 0f 91 pop r16 2aab8: ff 90 pop r15 2aaba: ef 90 pop r14 2aabc: df 90 pop r13 2aabe: cf 90 pop r12 2aac0: bf 90 pop r11 2aac2: af 90 pop r10 2aac4: 9f 90 pop r9 2aac6: 8f 90 pop r8 2aac8: 7f 90 pop r7 2aaca: 6f 90 pop r6 2aacc: 5f 90 pop r5 2aace: 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(); 2aad0: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 2aad4: 81 ef ldi r24, 0xF1 ; 241 2aad6: 9f e0 ldi r25, 0x0F ; 15 2aad8: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 2aadc: 2b 01 movw r4, r22 2aade: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 2aae0: 8d ee ldi r24, 0xED ; 237 2aae2: 9f e0 ldi r25, 0x0F ; 15 2aae4: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 2aae8: 6b 01 movw r12, r22 2aaea: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 2aaec: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_printf_P(_N( 2aaf0: 8f e7 ldi r24, 0x7F ; 127 2aaf2: 9c e4 ldi r25, 0x4C ; 76 2aaf4: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2aaf8: 98 2e mov r9, r24 2aafa: 89 2e mov r8, r25 2aafc: 8e e6 ldi r24, 0x6E ; 110 2aafe: 9c e4 ldi r25, 0x4C ; 76 2ab00: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2ab04: b8 2e mov r11, r24 2ab06: 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; 2ab08: c7 01 movw r24, r14 2ab0a: b6 01 movw r22, r12 2ab0c: 2c e3 ldi r18, 0x3C ; 60 2ab0e: 30 e0 ldi r19, 0x00 ; 0 2ab10: 40 e0 ldi r20, 0x00 ; 0 2ab12: 50 e0 ldi r21, 0x00 ; 0 2ab14: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2ab18: 7f 93 push r23 2ab1a: 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; 2ab1c: ca 01 movw r24, r20 2ab1e: b9 01 movw r22, r18 2ab20: 28 e1 ldi r18, 0x18 ; 24 2ab22: 30 e0 ldi r19, 0x00 ; 0 2ab24: 40 e0 ldi r20, 0x00 ; 0 2ab26: 50 e0 ldi r21, 0x00 ; 0 2ab28: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2ab2c: 7f 93 push r23 2ab2e: 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; 2ab30: c7 01 movw r24, r14 2ab32: b6 01 movw r22, r12 2ab34: 20 ea ldi r18, 0xA0 ; 160 2ab36: 35 e0 ldi r19, 0x05 ; 5 2ab38: 40 e0 ldi r20, 0x00 ; 0 2ab3a: 50 e0 ldi r21, 0x00 ; 0 2ab3c: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2ab40: 5f 93 push r21 2ab42: 4f 93 push r20 2ab44: 3f 93 push r19 2ab46: 2f 93 push r18 2ab48: 8f 92 push r8 2ab4a: 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; 2ab4c: c3 01 movw r24, r6 2ab4e: b2 01 movw r22, r4 2ab50: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 2ab54: 20 e0 ldi r18, 0x00 ; 0 2ab56: 30 e0 ldi r19, 0x00 ; 0 2ab58: 48 ec ldi r20, 0xC8 ; 200 2ab5a: 52 e4 ldi r21, 0x42 ; 66 2ab5c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2ab60: 9f 93 push r25 2ab62: 8f 93 push r24 2ab64: 7f 93 push r23 2ab66: 6f 93 push r22 2ab68: af 92 push r10 2ab6a: bf 92 push r11 2ab6c: 88 ec ldi r24, 0xC8 ; 200 2ab6e: 9f e6 ldi r25, 0x6F ; 111 2ab70: 9f 93 push r25 2ab72: 8f 93 push r24 2ab74: 0e 94 7f 6f call 0xdefe ; 0xdefe "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 2ab78: 8d b7 in r24, 0x3d ; 61 2ab7a: 9e b7 in r25, 0x3e ; 62 2ab7c: 42 96 adiw r24, 0x12 ; 18 2ab7e: 0f b6 in r0, 0x3f ; 63 2ab80: f8 94 cli 2ab82: 9e bf out 0x3e, r25 ; 62 2ab84: 0f be out 0x3f, r0 ; 63 2ab86: 8d bf out 0x3d, r24 ; 61 2ab88: 93 cf rjmp .-218 ; 0x2aab0 0002ab8a : 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()") { 2ab8a: cf 92 push r12 2ab8c: df 92 push r13 2ab8e: ef 92 push r14 2ab90: ff 92 push r15 2ab92: 0f 93 push r16 2ab94: 1f 93 push r17 2ab96: cf 93 push r28 2ab98: df 93 push r29 2ab9a: 00 d0 rcall .+0 ; 0x2ab9c 2ab9c: 00 d0 rcall .+0 ; 0x2ab9e 2ab9e: 1f 92 push r1 2aba0: 1f 92 push r1 2aba2: cd b7 in r28, 0x3d ; 61 2aba4: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 2aba6: 80 91 34 05 lds r24, 0x0534 ; 0x800534 2abaa: 90 91 35 05 lds r25, 0x0535 ; 0x800535 2abae: 00 97 sbiw r24, 0x00 ; 0 2abb0: e1 f1 breq .+120 ; 0x2ac2a { const int16_t initial_feedmultiply = feedmultiply; 2abb2: 20 91 39 02 lds r18, 0x0239 ; 0x800239 2abb6: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2abba: 24 36 cpi r18, 0x64 ; 100 2abbc: 31 05 cpc r19, r1 2abbe: 4c f4 brge .+18 ; 0x2abd2 2abc0: ac 01 movw r20, r24 2abc2: 42 0f add r20, r18 2abc4: 53 1f adc r21, r19 2abc6: 45 36 cpi r20, 0x65 ; 101 2abc8: 51 05 cpc r21, r1 2abca: 6c f4 brge .+26 ; 0x2abe6 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; 2abcc: 82 0f add r24, r18 2abce: 93 1f adc r25, r19 2abd0: 0c c0 rjmp .+24 ; 0x2abea #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2abd2: 24 36 cpi r18, 0x64 ; 100 2abd4: 31 05 cpc r19, r1 2abd6: 09 f4 brne .+2 ; 0x2abda 2abd8: 55 c0 rjmp .+170 ; 0x2ac84 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 2abda: ac 01 movw r20, r24 2abdc: 42 0f add r20, r18 2abde: 53 1f adc r21, r19 2abe0: 44 36 cpi r20, 0x64 ; 100 2abe2: 51 05 cpc r21, r1 2abe4: 9c f7 brge .-26 ; 0x2abcc { feedmultiply = 100; 2abe6: 84 e6 ldi r24, 0x64 ; 100 2abe8: 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; 2abea: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2abee: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 2abf2: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2abf6: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 2abfa: 82 17 cp r24, r18 2abfc: 93 07 cpc r25, r19 2abfe: a9 f0 breq .+42 ; 0x2ac2a feedmultiply = constrain(feedmultiply, 10, 999); 2ac00: 88 3e cpi r24, 0xE8 ; 232 2ac02: 53 e0 ldi r21, 0x03 ; 3 2ac04: 95 07 cpc r25, r21 2ac06: 14 f0 brlt .+4 ; 0x2ac0c 2ac08: 87 ee ldi r24, 0xE7 ; 231 2ac0a: 93 e0 ldi r25, 0x03 ; 3 2ac0c: 8a 30 cpi r24, 0x0A ; 10 2ac0e: 91 05 cpc r25, r1 2ac10: 14 f4 brge .+4 ; 0x2ac16 2ac12: 8a e0 ldi r24, 0x0A ; 10 2ac14: 90 e0 ldi r25, 0x00 ; 0 2ac16: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2ac1a: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 2ac1e: 10 92 35 05 sts 0x0535, r1 ; 0x800535 2ac22: 10 92 34 05 sts 0x0534, r1 ; 0x800534 refresh_saved_feedrate_multiplier_in_ram(); 2ac26: 0e 94 a9 65 call 0xcb52 ; 0xcb52 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 2ac2a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2ac2e: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 2ac30: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b } if (lcd_status_update_delay) 2ac34: 10 91 4b 06 lds r17, 0x064B ; 0x80064b 2ac38: 11 23 and r17, r17 2ac3a: 91 f1 breq .+100 ; 0x2aca0 lcd_status_update_delay--; 2ac3c: 2f ef ldi r18, 0xFF ; 255 2ac3e: 21 0f add r18, r17 2ac40: 20 93 4b 06 sts 0x064B, r18 ; 0x80064b if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 2ac44: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 2ac48: 81 11 cpse r24, r1 2ac4a: 0d c0 rjmp .+26 ; 0x2ac66 2ac4c: 0e 94 c3 71 call 0xe386 ; 0xe386 2ac50: 88 23 and r24, r24 2ac52: 49 f0 breq .+18 ; 0x2ac66 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 2ac54: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 menu_submenu(lcd_main_menu); 2ac58: 60 e0 ldi r22, 0x00 ; 0 2ac5a: 81 ed ldi r24, 0xD1 ; 209 2ac5c: 94 ee ldi r25, 0xE4 ; 228 2ac5e: 0f 94 32 d0 call 0x3a064 ; 0x3a064 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2ac62: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 } } 2ac66: 28 96 adiw r28, 0x08 ; 8 2ac68: 0f b6 in r0, 0x3f ; 63 2ac6a: f8 94 cli 2ac6c: de bf out 0x3e, r29 ; 62 2ac6e: 0f be out 0x3f, r0 ; 63 2ac70: cd bf out 0x3d, r28 ; 61 2ac72: df 91 pop r29 2ac74: cf 91 pop r28 2ac76: 1f 91 pop r17 2ac78: 0f 91 pop r16 2ac7a: ff 90 pop r15 2ac7c: ef 90 pop r14 2ac7e: df 90 pop r13 2ac80: cf 90 pop r12 2ac82: 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) { 2ac84: 8b 30 cpi r24, 0x0B ; 11 2ac86: 91 05 cpc r25, r1 2ac88: 1c f0 brlt .+6 ; 0x2ac90 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 2ac8a: 86 5a subi r24, 0xA6 ; 166 2ac8c: 9f 4f sbci r25, 0xFF ; 255 2ac8e: ad cf rjmp .-166 ; 0x2abea } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 2ac90: 86 3f cpi r24, 0xF6 ; 246 2ac92: 4f ef ldi r20, 0xFF ; 255 2ac94: 94 07 cpc r25, r20 2ac96: 0c f0 brlt .+2 ; 0x2ac9a 2ac98: ac cf rjmp .-168 ; 0x2abf2 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 2ac9a: 82 59 subi r24, 0x92 ; 146 2ac9c: 9f 4f sbci r25, 0xFF ; 255 2ac9e: a5 cf rjmp .-182 ; 0x2abea 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; 2aca0: 6a e0 ldi r22, 0x0A ; 10 2aca2: 60 93 4b 06 sts 0x064B, r22 ; 0x80064b ReInitLCD++; 2aca6: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 2acaa: 8f 5f subi r24, 0xFF ; 255 2acac: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a if (ReInitLCD == 30) 2acb0: 8e 31 cpi r24, 0x1E ; 30 2acb2: 09 f0 breq .+2 ; 0x2acb6 2acb4: 9f c0 rjmp .+318 ; 0x2adf4 { ReInitLCD = 0 ; 2acb6: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2acba: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_status_message_idx = 0; // Re-draw message from beginning 2acbe: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.463> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 2acc2: 0e 94 5a 6f call 0xdeb4 ; 0xdeb4 lcd_home(); //line 0 2acc6: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2acca: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 2acce: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 2acd2: 07 2e mov r0, r23 2acd4: 00 0c add r0, r0 2acd6: 88 0b sbc r24, r24 2acd8: 99 0b sbc r25, r25 2acda: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__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)); 2acde: 20 e0 ldi r18, 0x00 ; 0 2ace0: 30 e0 ldi r19, 0x00 ; 0 2ace2: 40 e0 ldi r20, 0x00 ; 0 2ace4: 5f e3 ldi r21, 0x3F ; 63 2ace6: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2acea: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2acee: 6b 01 movw r12, r22 2acf0: 20 e0 ldi r18, 0x00 ; 0 2acf2: 30 e0 ldi r19, 0x00 ; 0 2acf4: 40 e0 ldi r20, 0x00 ; 0 2acf6: 5f e3 ldi r21, 0x3F ; 63 2acf8: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2acfc: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 2ad00: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 2ad04: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 2ad08: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2ad0c: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2ad10: a6 01 movw r20, r12 2ad12: 82 e8 ldi r24, 0x82 ; 130 2ad14: 0f 94 f2 2e call 0x25de4 ; 0x25de4 lcd_space(3); //3 spaces 2ad18: 83 e0 ldi r24, 0x03 ; 3 2ad1a: 0e 94 9c 6f call 0xdf38 ; 0xdf38 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 2ad1e: 80 91 72 07 lds r24, 0x0772 ; 0x800772 2ad22: 81 30 cpi r24, 0x01 ; 1 2ad24: 09 f0 breq .+2 ; 0x2ad28 2ad26: 6e c0 rjmp .+220 ; 0x2ae04 lcd_puts_P(_N("Z --- ")); 2ad28: 8e e1 ldi r24, 0x1E ; 30 2ad2a: 9f e6 ldi r25, 0x6F ; 111 2ad2c: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 2ad30: 61 e0 ldi r22, 0x01 ; 1 2ad32: 80 e0 ldi r24, 0x00 ; 0 2ad34: 0e 94 a6 6f call 0xdf4c ; 0xdf4c }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 2ad38: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 2ad3c: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 2ad40: 07 2e mov r0, r23 2ad42: 00 0c add r0, r0 2ad44: 88 0b sbc r24, r24 2ad46: 99 0b sbc r25, r25 2ad48: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 2ad4c: 20 e0 ldi r18, 0x00 ; 0 2ad4e: 30 e0 ldi r19, 0x00 ; 0 2ad50: 40 e0 ldi r20, 0x00 ; 0 2ad52: 5f e3 ldi r21, 0x3F ; 63 2ad54: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2ad58: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2ad5c: 6b 01 movw r12, r22 2ad5e: 20 e0 ldi r18, 0x00 ; 0 2ad60: 30 e0 ldi r19, 0x00 ; 0 2ad62: 40 e0 ldi r20, 0x00 ; 0 2ad64: 5f e3 ldi r21, 0x3F ; 63 2ad66: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 2ad6a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 2ad6e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 2ad72: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 2ad76: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 2ad7a: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2ad7e: a6 01 movw r20, r12 2ad80: 80 e8 ldi r24, 0x80 ; 128 2ad82: 0f 94 f2 2e call 0x25de4 ; 0x25de4 lcd_space(3); //3 spaces 2ad86: 83 e0 ldi r24, 0x03 ; 3 2ad88: 0e 94 9c 6f call 0xdf38 ; 0xdf38 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 2ad8c: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 2ad90: 8f 93 push r24 2ad92: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2ad96: 8f 93 push r24 2ad98: 87 e2 ldi r24, 0x27 ; 39 2ad9a: 9f e6 ldi r25, 0x6F ; 111 2ad9c: 9f 93 push r25 2ad9e: 8f 93 push r24 2ada0: 0e 94 7f 6f call 0xdefe ; 0xdefe lcd_space(8 - chars); 2ada4: 98 e0 ldi r25, 0x08 ; 8 2ada6: 98 1b sub r25, r24 2ada8: 89 2f mov r24, r25 2adaa: 0e 94 9c 6f call 0xdf38 ; 0xdf38 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 2adae: 62 e0 ldi r22, 0x02 ; 2 2adb0: 80 e0 ldi r24, 0x00 ; 0 2adb2: 0e 94 a6 6f call 0xdf4c ; 0xdf4c } // 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(" ")); 2adb6: 0f 90 pop r0 2adb8: 0f 90 pop r0 2adba: 0f 90 pop r0 2adbc: 0f 90 pop r0 2adbe: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 2adc2: e0 90 6b 14 lds r14, 0x146B ; 0x80146b 2adc6: 81 11 cpse r24, r1 2adc8: 3e c0 rjmp .+124 ; 0x2ae46 2adca: 2a e3 ldi r18, 0x3A ; 58 2adcc: c2 2e mov r12, r18 2adce: 2f e6 ldi r18, 0x6F ; 111 2add0: d2 2e mov r13, r18 2add2: e1 10 cpse r14, r1 2add4: 3c c0 rjmp .+120 ; 0x2ae4e 2add6: 8e e3 ldi r24, 0x3E ; 62 2add8: c8 2e mov r12, r24 2adda: 8f e6 ldi r24, 0x6F ; 111 2addc: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2adde: 0e 94 a7 68 call 0xd14e ; 0xd14e 2ade2: f8 2e mov r15, r24 2ade4: 88 23 and r24, r24 2ade6: e1 f1 breq .+120 ; 0x2ae60 2ade8: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2adec: 8f 3f cpi r24, 0xFF ; 255 2adee: 89 f5 brne .+98 ; 0x2ae52 2adf0: f1 2c mov r15, r1 2adf2: 36 c0 rjmp .+108 ; 0x2ae60 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 2adf4: 0f 94 01 de call 0x3bc02 ; 0x3bc02 <__divmodqi4> 2adf8: 91 11 cpse r25, r1 2adfa: 63 cf rjmp .-314 ; 0x2acc2 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 2adfc: 80 e0 ldi r24, 0x00 ; 0 2adfe: 0e 94 11 70 call 0xe022 ; 0xe022 2ae02: 5d cf rjmp .-326 ; 0x2acbe 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]?' ':'?'); 2ae04: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 2ae08: 88 23 and r24, r24 2ae0a: d9 f0 breq .+54 ; 0x2ae42 2ae0c: 80 e2 ldi r24, 0x20 ; 32 2ae0e: 1f 92 push r1 2ae10: 8f 93 push r24 2ae12: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 2ae16: 8f 93 push r24 2ae18: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 2ae1c: 8f 93 push r24 2ae1e: 80 91 49 07 lds r24, 0x0749 ; 0x800749 2ae22: 8f 93 push r24 2ae24: 80 91 48 07 lds r24, 0x0748 ; 0x800748 2ae28: 8f 93 push r24 2ae2a: 85 e1 ldi r24, 0x15 ; 21 2ae2c: 9f e6 ldi r25, 0x6F ; 111 2ae2e: 9f 93 push r25 2ae30: 8f 93 push r24 2ae32: 0e 94 7f 6f call 0xdefe ; 0xdefe 2ae36: 0f b6 in r0, 0x3f ; 63 2ae38: f8 94 cli 2ae3a: de bf out 0x3e, r29 ; 62 2ae3c: 0f be out 0x3f, r0 ; 63 2ae3e: cd bf out 0x3d, r28 ; 61 2ae40: 77 cf rjmp .-274 ; 0x2ad30 2ae42: 8f e3 ldi r24, 0x3F ; 63 2ae44: e4 cf rjmp .-56 ; 0x2ae0e } // 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(" ")); 2ae46: 92 e4 ldi r25, 0x42 ; 66 2ae48: c9 2e mov r12, r25 2ae4a: 9f e6 ldi r25, 0x6F ; 111 2ae4c: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2ae4e: ee 20 and r14, r14 2ae50: 31 f2 breq .-116 ; 0x2adde if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2ae52: 80 91 db 03 lds r24, 0x03DB ; 0x8003db // Print percent done in form "USB---%", " SD---%", " ---%" (7 chars total) void lcdui_print_percent_done(void) { const char* src = usb_timer.running()?_N(" HO"):(IS_SD_PRINTING?_N(" SD"):_N(" ")); bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2ae56: ff 24 eor r15, r15 2ae58: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2ae5a: 88 23 and r24, r24 2ae5c: 09 f4 brne .+2 ; 0x2ae60 2ae5e: bb c0 rjmp .+374 ; 0x2afd6 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 2ae60: 81 ea ldi r24, 0xA1 ; 161 2ae62: 9d e0 ldi r25, 0x0D ; 13 2ae64: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2ae68: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 2ae6a: 0e 94 eb 77 call 0xefd6 ; 0xefd6 if ((nextSheet >= 0) && (sheetNR != nextSheet)) 2ae6e: 87 fd sbrc r24, 7 2ae70: b2 c0 rjmp .+356 ; 0x2afd6 2ae72: 08 17 cp r16, r24 2ae74: 09 f4 brne .+2 ; 0x2ae78 2ae76: af c0 rjmp .+350 ; 0x2afd6 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 2ae78: 9b e0 ldi r25, 0x0B ; 11 2ae7a: 09 02 muls r16, r25 2ae7c: b0 01 movw r22, r0 2ae7e: 11 24 eor r1, r1 2ae80: 67 5b subi r22, 0xB7 ; 183 2ae82: 72 4f sbci r23, 0xF2 ; 242 2ae84: 47 e0 ldi r20, 0x07 ; 7 2ae86: 50 e0 ldi r21, 0x00 ; 0 2ae88: 8e 01 movw r16, r28 2ae8a: 0f 5f subi r16, 0xFF ; 255 2ae8c: 1f 4f sbci r17, 0xFF ; 255 2ae8e: c8 01 movw r24, r16 2ae90: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c sheet[7] = '\0'; 2ae94: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 2ae96: 1f 93 push r17 2ae98: 0f 93 push r16 2ae9a: 85 e0 ldi r24, 0x05 ; 5 2ae9c: 91 ea ldi r25, 0xA1 ; 161 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2ae9e: 9f 93 push r25 2aea0: 8f 93 push r24 2aea2: 0e 94 7f 6f call 0xdefe ; 0xdefe 2aea6: 0f 90 pop r0 2aea8: 0f 90 pop r0 2aeaa: 0f 90 pop r0 2aeac: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 2aeae: 80 91 95 13 lds r24, 0x1395 ; 0x801395 2aeb2: 81 30 cpi r24, 0x01 ; 1 2aeb4: 09 f0 breq .+2 ; 0x2aeb8 2aeb6: e9 c0 rjmp .+466 ; 0x2b08a // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 2aeb8: 0f 94 79 37 call 0x26ef2 ; 0x26ef2 2aebc: 95 e0 ldi r25, 0x05 ; 5 2aebe: 98 1b sub r25, r24 2aec0: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2aec2: 0e 94 9c 6f call 0xdf38 ; 0xdf38 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()) { 2aec6: 0e 94 a7 68 call 0xd14e ; 0xd14e 2aeca: 88 23 and r24, r24 2aecc: 09 f4 brne .+2 ; 0x2aed0 2aece: fa c0 rjmp .+500 ; 0x2b0c4 uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 2aed0: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 2aed4: 88 23 and r24, r24 2aed6: 09 f4 brne .+2 ; 0x2aeda 2aed8: da c0 rjmp .+436 ; 0x2b08e if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 2aeda: c0 90 8d 02 lds r12, 0x028D ; 0x80028d 2aede: 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) 2aee2: e0 90 8b 02 lds r14, 0x028B ; 0x80028b 2aee6: f0 90 8c 02 lds r15, 0x028C ; 0x80028c #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 2aeea: 80 91 49 06 lds r24, 0x0649 ; 0x800649 2aeee: 8a 30 cpi r24, 0x0A ; 10 2aef0: 11 f4 brne .+4 ; 0x2aef6 clock_interval = 0; 2aef2: 10 92 49 06 sts 0x0649, r1 ; 0x800649 clock_interval++; 2aef6: 80 91 49 06 lds r24, 0x0649 ; 0x800649 2aefa: 8f 5f subi r24, 0xFF ; 255 2aefc: 80 93 49 06 sts 0x0649, r24 ; 0x800649 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 2af00: 2f ef ldi r18, 0xFF ; 255 2af02: e2 16 cp r14, r18 2af04: f2 06 cpc r15, r18 2af06: 21 f0 breq .+8 ; 0x2af10 2af08: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 2af0a: 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) { 2af0c: 86 30 cpi r24, 0x06 ; 6 2af0e: 70 f4 brcc .+28 ; 0x2af2c print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 2af10: 3f ef ldi r19, 0xFF ; 255 2af12: c3 16 cp r12, r19 2af14: d3 06 cpc r13, r19 2af16: 09 f0 breq .+2 ; 0x2af1a 2af18: c3 c0 rjmp .+390 ; 0x2b0a0 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 2af1a: 0f 94 b3 54 call 0x2a966 ; 0x2a966 2af1e: 2c e3 ldi r18, 0x3C ; 60 2af20: 30 e0 ldi r19, 0x00 ; 0 2af22: 40 e0 ldi r20, 0x00 ; 0 2af24: 50 e0 ldi r21, 0x00 ; 0 2af26: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__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 = ' '; 2af2a: 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)) { 2af2c: 40 91 39 02 lds r20, 0x0239 ; 0x800239 2af30: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 2af34: 44 36 cpi r20, 0x64 ; 100 2af36: 51 05 cpc r21, r1 2af38: 09 f4 brne .+2 ; 0x2af3c 2af3a: b5 c0 rjmp .+362 ; 0x2b0a6 2af3c: c2 16 cp r12, r18 2af3e: d3 06 cpc r13, r19 2af40: 21 f0 breq .+8 ; 0x2af4a 2af42: e2 16 cp r14, r18 2af44: f3 06 cpc r15, r19 2af46: 09 f0 breq .+2 ; 0x2af4a 2af48: ae c0 rjmp .+348 ; 0x2b0a6 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); 2af4a: a4 e6 ldi r26, 0x64 ; 100 2af4c: b0 e0 ldi r27, 0x00 ; 0 2af4e: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 2af52: 9a 01 movw r18, r20 2af54: 55 0f add r21, r21 2af56: 44 0b sbc r20, r20 2af58: 55 0b sbc r21, r21 2af5a: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2af5e: 4f e3 ldi r20, 0x3F ; 63 2af60: e4 2e mov r14, r20 2af62: 04 2e mov r0, r20 2af64: 00 0c add r0, r0 2af66: ff 08 sbc r15, r15 2af68: e1 2f mov r30, r17 2af6a: 01 2e mov r0, r17 2af6c: 00 0c add r0, r0 2af6e: ff 0b sbc r31, r31 2af70: c9 01 movw r24, r18 2af72: 6c e3 ldi r22, 0x3C ; 60 2af74: 70 e0 ldi r23, 0x00 ; 0 2af76: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__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 2af7a: 20 37 cpi r18, 0x70 ; 112 2af7c: 37 41 sbci r19, 0x17 ; 23 2af7e: 08 f0 brcs .+2 ; 0x2af82 2af80: 94 c0 rjmp .+296 ; 0x2b0aa chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 2af82: ff 92 push r15 2af84: 4f 93 push r20 2af86: ff 93 push r31 2af88: 1f 93 push r17 2af8a: 9f 93 push r25 2af8c: 8f 93 push r24 2af8e: 7f 93 push r23 2af90: 6f 93 push r22 2af92: 8a e5 ldi r24, 0x5A ; 90 2af94: 9f e6 ldi r25, 0x6F ; 111 2af96: 9f 93 push r25 2af98: 8f 93 push r24 2af9a: 0e 94 7f 6f call 0xdefe ; 0xdefe else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 2af9e: 0f b6 in r0, 0x3f ; 63 2afa0: f8 94 cli 2afa2: de bf out 0x3e, r29 ; 62 2afa4: 0f be out 0x3f, r0 ; 63 2afa6: 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); 2afa8: 98 e0 ldi r25, 0x08 ; 8 2afaa: 98 1b sub r25, r24 2afac: 89 2f mov r24, r25 2afae: 0e 94 9c 6f call 0xdf38 ; 0xdf38 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 2afb2: 63 e0 ldi r22, 0x03 ; 3 2afb4: 80 e0 ldi r24, 0x00 ; 0 2afb6: 0e 94 a6 6f call 0xdf4c ; 0xdf4c #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2afba: 0f 94 82 40 call 0x28104 ; 0x28104 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 2afbe: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 2afc2: 88 23 and r24, r24 2afc4: 09 f4 brne .+2 ; 0x2afc8 2afc6: 3e ce rjmp .-900 ; 0x2ac44 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) { 2afc8: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 2afcc: 81 11 cpse r24, r1 2afce: 3a ce rjmp .-908 ; 0x2ac44 2afd0: 0f 94 cf 0b call 0x2179e ; 0x2179e 2afd4: 37 ce rjmp .-914 ; 0x2ac44 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 2afd6: e1 10 cpse r14, r1 2afd8: 04 c0 rjmp .+8 ; 0x2afe2 2afda: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL9M79_timer.lto_priv.465> 2afde: 81 11 cpse r24, r1 2afe0: 4a c0 rjmp .+148 ; 0x2b076 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 2afe2: df 92 push r13 2afe4: cf 92 push r12 2afe6: 81 e0 ldi r24, 0x01 ; 1 2afe8: 91 ea ldi r25, 0xA1 ; 161 2afea: 9f 93 push r25 2afec: 8f 93 push r24 2afee: 0e 94 7f 6f call 0xdefe ; 0xdefe 2aff2: 0f 90 pop r0 2aff4: 0f 90 pop r0 2aff6: 0f 90 pop r0 2aff8: 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) 2affa: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 2affe: 81 11 cpse r24, r1 2b000: 04 c0 rjmp .+8 ; 0x2b00a 2b002: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2b006: 85 36 cpi r24, 0x65 ; 101 2b008: f0 f1 brcs .+124 ; 0x2b086 { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 2b00a: 80 91 85 02 lds r24, 0x0285 ; 0x800285 2b00e: 85 36 cpi r24, 0x65 ; 101 2b010: d0 f1 brcs .+116 ; 0x2b086 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;}; 2b012: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 2b016: 88 23 and r24, r24 2b018: 19 f1 breq .+70 ; 0x2b060 2b01a: 80 91 78 17 lds r24, 0x1778 ; 0x801778 2b01e: 90 91 79 17 lds r25, 0x1779 ; 0x801779 2b022: a0 91 7a 17 lds r26, 0x177A ; 0x80177a 2b026: b0 91 7b 17 lds r27, 0x177B ; 0x80177b 2b02a: 00 97 sbiw r24, 0x00 ; 0 2b02c: a1 05 cpc r26, r1 2b02e: b1 05 cpc r27, r1 2b030: b9 f0 breq .+46 ; 0x2b060 2b032: bc 01 movw r22, r24 2b034: cd 01 movw r24, r26 2b036: 6d 59 subi r22, 0x9D ; 157 2b038: 7f 4f sbci r23, 0xFF ; 255 2b03a: 8f 4f sbci r24, 0xFF ; 255 2b03c: 9f 4f sbci r25, 0xFF ; 255 2b03e: 24 e6 ldi r18, 0x64 ; 100 2b040: 30 e0 ldi r19, 0x00 ; 0 2b042: 40 e0 ldi r20, 0x00 ; 0 2b044: 50 e0 ldi r21, 0x00 ; 0 2b046: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 2b04a: 60 91 7f 17 lds r22, 0x177F ; 0x80177f 2b04e: 70 91 80 17 lds r23, 0x1780 ; 0x801780 2b052: 80 91 81 17 lds r24, 0x1781 ; 0x801781 2b056: 90 91 82 17 lds r25, 0x1782 ; 0x801782 2b05a: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 2b05e: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2b060: 21 2f mov r18, r17 2b062: 30 e0 ldi r19, 0x00 ; 0 2b064: 84 e3 ldi r24, 0x34 ; 52 2b066: 9f e6 ldi r25, 0x6F ; 111 2b068: f1 10 cpse r15, r1 2b06a: 02 c0 rjmp .+4 ; 0x2b070 2b06c: 8e e2 ldi r24, 0x2E ; 46 2b06e: 9f e6 ldi r25, 0x6F ; 111 2b070: 3f 93 push r19 2b072: 2f 93 push r18 2b074: 14 cf rjmp .-472 ; 0x2ae9e if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 2b076: 81 e0 ldi r24, 0x01 ; 1 2b078: 0e 94 9c 6f call 0xdf38 ; 0xdf38 lcd_print(hostName); // Two characters 2b07c: 86 e4 ldi r24, 0x46 ; 70 2b07e: 96 e0 ldi r25, 0x06 ; 6 2b080: 0e 94 ad 71 call 0xe35a ; 0xe35a 2b084: ba cf rjmp .-140 ; 0x2affa 2b086: 18 2f mov r17, r24 2b088: eb cf rjmp .-42 ; 0x2b060 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2b08a: 85 e0 ldi r24, 0x05 ; 5 2b08c: 1a cf rjmp .-460 ; 0x2aec2 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) 2b08e: c0 90 89 02 lds r12, 0x0289 ; 0x800289 2b092: 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) 2b096: e0 90 87 02 lds r14, 0x0287 ; 0x800287 2b09a: f0 90 88 02 lds r15, 0x0288 ; 0x800288 2b09e: 25 cf rjmp .-438 ; 0x2aeea 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) { 2b0a0: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 2b0a2: 12 e5 ldi r17, 0x52 ; 82 2b0a4: 43 cf rjmp .-378 ; 0x2af2c 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 = ' '; 2b0a6: 40 e2 ldi r20, 0x20 ; 32 2b0a8: 5b cf rjmp .-330 ; 0x2af60 } 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); 2b0aa: ff 92 push r15 2b0ac: 4f 93 push r20 2b0ae: ff 93 push r31 2b0b0: 1f 93 push r17 2b0b2: 7f 93 push r23 2b0b4: 6f 93 push r22 2b0b6: 8f e4 ldi r24, 0x4F ; 79 2b0b8: 9f e6 ldi r25, 0x6F ; 111 2b0ba: 9f 93 push r25 2b0bc: 8f 93 push r24 2b0be: 0e 94 7f 6f call 0xdefe ; 0xdefe 2b0c2: 6d cf rjmp .-294 ; 0x2af9e } else { #ifdef QUICK_NOZZLE_CHANGE chars = lcd_printf_P(PSTR("Nd %4.2f "),(float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); #else chars = lcd_printf_P(_N(LCD_STR_CLOCK "--:-- ")); 2b0c4: 86 e4 ldi r24, 0x46 ; 70 2b0c6: 9f e6 ldi r25, 0x6F ; 111 2b0c8: 9f 93 push r25 2b0ca: 8f 93 push r24 2b0cc: 0e 94 7f 6f call 0xdefe ; 0xdefe 2b0d0: 0f 90 pop r0 2b0d2: 0f 90 pop r0 2b0d4: 69 cf rjmp .-302 ; 0x2afa8 0002b0d6 : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 2b0d6: 10 92 99 03 sts 0x0399, r1 ; 0x800399 startTimestamp = 0; 2b0da: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 2b0de: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 2b0e2: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 2b0e6: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 stopTimestamp = 0; 2b0ea: 10 92 4c 06 sts 0x064C, r1 ; 0x80064c 2b0ee: 10 92 4d 06 sts 0x064D, r1 ; 0x80064d 2b0f2: 10 92 4e 06 sts 0x064E, r1 ; 0x80064e 2b0f6: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f accumulator = 0; 2b0fa: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 2b0fe: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 2b102: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 2b106: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 } 2b10a: 08 95 ret 0002b10c : /** * @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; } 2b10c: 80 91 99 03 lds r24, 0x0399 ; 0x800399 } else return false; } bool Stopwatch::start() { if (!isRunning()) { 2b110: 81 30 cpi r24, 0x01 ; 1 2b112: f1 f0 breq .+60 ; 0x2b150 if (isPaused()) accumulator = duration(); 2b114: 82 30 cpi r24, 0x02 ; 2 2b116: c9 f4 brne .+50 ; 0x2b14a 2b118: 0f 94 b3 54 call 0x2a966 ; 0x2a966 2b11c: 60 93 a1 05 sts 0x05A1, r22 ; 0x8005a1 2b120: 70 93 a2 05 sts 0x05A2, r23 ; 0x8005a2 2b124: 80 93 a3 05 sts 0x05A3, r24 ; 0x8005a3 2b128: 90 93 a4 05 sts 0x05A4, r25 ; 0x8005a4 else reset(); state = RUNNING; 2b12c: 81 e0 ldi r24, 0x01 ; 1 2b12e: 80 93 99 03 sts 0x0399, r24 ; 0x800399 startTimestamp = _millis(); 2b132: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2b136: 60 93 a5 05 sts 0x05A5, r22 ; 0x8005a5 2b13a: 70 93 a6 05 sts 0x05A6, r23 ; 0x8005a6 2b13e: 80 93 a7 05 sts 0x05A7, r24 ; 0x8005a7 2b142: 90 93 a8 05 sts 0x05A8, r25 ; 0x8005a8 2b146: 81 e0 ldi r24, 0x01 ; 1 2b148: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 2b14a: 0f 94 6b 58 call 0x2b0d6 ; 0x2b0d6 2b14e: ee cf rjmp .-36 ; 0x2b12c state = RUNNING; startTimestamp = _millis(); return true; } else return false; 2b150: 80 e0 ldi r24, 0x00 ; 0 } 2b152: 08 95 ret 0002b154 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 2b154: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2b158: 81 50 subi r24, 0x01 ; 1 2b15a: 82 30 cpi r24, 0x02 ; 2 2b15c: 70 f4 brcc .+28 ; 0x2b17a state = STOPPED; 2b15e: 10 92 99 03 sts 0x0399, r1 ; 0x800399 stopTimestamp = _millis(); 2b162: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2b166: 60 93 4c 06 sts 0x064C, r22 ; 0x80064c 2b16a: 70 93 4d 06 sts 0x064D, r23 ; 0x80064d 2b16e: 80 93 4e 06 sts 0x064E, r24 ; 0x80064e 2b172: 90 93 4f 06 sts 0x064F, r25 ; 0x80064f 2b176: 81 e0 ldi r24, 0x01 ; 1 2b178: 08 95 ret return true; } else return false; 2b17a: 80 e0 ldi r24, 0x00 ; 0 } 2b17c: 08 95 ret 0002b17e : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 2b17e: 2f b7 in r18, 0x3f ; 63 2b180: f8 94 cli count_pos = count_position[axis]; 2b182: 94 e0 ldi r25, 0x04 ; 4 2b184: 89 9f mul r24, r25 2b186: f0 01 movw r30, r0 2b188: 11 24 eor r1, r1 2b18a: ef 59 subi r30, 0x9F ; 159 2b18c: f8 4f sbci r31, 0xF8 ; 248 2b18e: 60 81 ld r22, Z 2b190: 71 81 ldd r23, Z+1 ; 0x01 2b192: 82 81 ldd r24, Z+2 ; 0x02 2b194: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 2b196: 2f bf out 0x3f, r18 ; 63 return count_pos; } 2b198: 08 95 ret 0002b19a : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 2b19a: cf 93 push r28 2b19c: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 2b19e: 0f 94 bf 58 call 0x2b17e ; 0x2b17e 2b1a2: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2b1a6: 24 e0 ldi r18, 0x04 ; 4 2b1a8: c2 9f mul r28, r18 2b1aa: f0 01 movw r30, r0 2b1ac: 11 24 eor r1, r1 2b1ae: e1 59 subi r30, 0x91 ; 145 2b1b0: f9 4f sbci r31, 0xF9 ; 249 2b1b2: 20 81 ld r18, Z 2b1b4: 31 81 ldd r19, Z+1 ; 0x01 2b1b6: 42 81 ldd r20, Z+2 ; 0x02 2b1b8: 53 81 ldd r21, Z+3 ; 0x03 2b1ba: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> } 2b1be: cf 91 pop r28 2b1c0: 08 95 ret 0002b1c2 : } // Block until all buffered steps are executed void st_synchronize() { 2b1c2: cf 93 push r28 2b1c4: df 93 push r29 2b1c6: 00 d0 rcall .+0 ; 0x2b1c8 2b1c8: 1f 92 push r1 2b1ca: cd b7 in r28, 0x3d ; 61 2b1cc: 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); 2b1ce: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2b1d2: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 while(blocks_queued()) 2b1d6: 98 17 cp r25, r24 2b1d8: 09 f4 brne .+2 ; 0x2b1dc 2b1da: 46 c0 rjmp .+140 ; 0x2b268 { #ifdef TMC2130 manage_heater(); 2b1dc: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 2b1e0: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.488> 2b1e4: 84 30 cpi r24, 0x04 ; 4 2b1e6: 38 f0 brcs .+14 ; 0x2b1f6 // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 2b1e8: 81 e0 ldi r24, 0x01 ; 1 2b1ea: 0e 94 f3 8b call 0x117e6 ; 0x117e6 lcd_update(0); 2b1ee: 80 e0 ldi r24, 0x00 ; 0 2b1f0: 0e 94 6d 6f call 0xdeda ; 0xdeda 2b1f4: ec cf rjmp .-40 ; 0x2b1ce { uint32_t val32 = 0; 2b1f6: 19 82 std Y+1, r1 ; 0x01 2b1f8: 1a 82 std Y+2, r1 ; 0x02 2b1fa: 1b 82 std Y+3, r1 ; 0x03 2b1fc: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 2b1fe: ae 01 movw r20, r28 2b200: 4f 5f subi r20, 0xFF ; 255 2b202: 5f 4f sbci r21, 0xFF ; 255 2b204: 6f e6 ldi r22, 0x6F ; 111 2b206: 0f 94 7c 39 call 0x272f8 ; 0x272f8 tmc2130_sg_measure_val += (val32 & 0x3ff); 2b20a: 89 81 ldd r24, Y+1 ; 0x01 2b20c: 9a 81 ldd r25, Y+2 ; 0x02 2b20e: ab 81 ldd r26, Y+3 ; 0x03 2b210: bc 81 ldd r27, Y+4 ; 0x04 2b212: 93 70 andi r25, 0x03 ; 3 2b214: aa 27 eor r26, r26 2b216: bb 27 eor r27, r27 2b218: 40 91 c9 03 lds r20, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_val.lto_priv.489> 2b21c: 50 91 ca 03 lds r21, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x1> 2b220: 60 91 cb 03 lds r22, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x2> 2b224: 70 91 cc 03 lds r23, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x3> 2b228: 84 0f add r24, r20 2b22a: 95 1f adc r25, r21 2b22c: a6 1f adc r26, r22 2b22e: b7 1f adc r27, r23 2b230: 80 93 c9 03 sts 0x03C9, r24 ; 0x8003c9 <_ZL22tmc2130_sg_measure_val.lto_priv.489> 2b234: 90 93 ca 03 sts 0x03CA, r25 ; 0x8003ca <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x1> 2b238: a0 93 cb 03 sts 0x03CB, r26 ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x2> 2b23c: b0 93 cc 03 sts 0x03CC, r27 ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.489+0x3> tmc2130_sg_measure_cnt++; 2b240: 80 91 c5 03 lds r24, 0x03C5 ; 0x8003c5 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490> 2b244: 90 91 c6 03 lds r25, 0x03C6 ; 0x8003c6 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x1> 2b248: a0 91 c7 03 lds r26, 0x03C7 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x2> 2b24c: b0 91 c8 03 lds r27, 0x03C8 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x3> 2b250: 01 96 adiw r24, 0x01 ; 1 2b252: a1 1d adc r26, r1 2b254: b1 1d adc r27, r1 2b256: 80 93 c5 03 sts 0x03C5, r24 ; 0x8003c5 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490> 2b25a: 90 93 c6 03 sts 0x03C6, r25 ; 0x8003c6 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x1> 2b25e: a0 93 c7 03 sts 0x03C7, r26 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x2> 2b262: b0 93 c8 03 sts 0x03C8, r27 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.490+0x3> 2b266: b3 cf rjmp .-154 ; 0x2b1ce #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 2b268: 0f 90 pop r0 2b26a: 0f 90 pop r0 2b26c: 0f 90 pop r0 2b26e: 0f 90 pop r0 2b270: df 91 pop r29 2b272: cf 91 pop r28 2b274: 08 95 ret 0002b276 : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 2b276: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 2b278: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2b27c: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2b280: 80 ed ldi r24, 0xD0 ; 208 2b282: 97 e0 ldi r25, 0x07 ; 7 2b284: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b288: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 2b28c: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2b290: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b294: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> 2b298: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2b29c: 01 97 sbiw r24, 0x01 ; 1 2b29e: 8e 3f cpi r24, 0xFE ; 254 2b2a0: 9f 4f sbci r25, 0xFF ; 255 2b2a2: 20 f4 brcc .+8 ; 0x2b2ac nextAdvanceISR = 0; 2b2a4: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2b2a8: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> #endif } 2b2ac: 08 95 ret 0002b2ae : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 2b2ae: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 2b2b2: 81 11 cpse r24, r1 2b2b4: 3c c0 rjmp .+120 ; 0x2b32e #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 2b2b6: 81 e0 ldi r24, 0x01 ; 1 2b2b8: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 2b2bc: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 2b2c0: 8f ef ldi r24, 0xFF ; 255 2b2c2: 9f e0 ldi r25, 0x0F ; 15 2b2c4: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 2b2c8: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2b2cc: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 default: SilentModeMenu = SILENT_MODE_POWER; break; // (probably) not needed #endif //TMC2130 } eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, SilentModeMenu); #ifdef TMC2130 if (blocks_queued()) 2b2d0: 98 17 cp r25, r24 2b2d2: 41 f0 breq .+16 ; 0x2b2e4 { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 2b2d4: 81 ea ldi r24, 0xA1 ; 161 2b2d6: 9e e4 ldi r25, 0x4E ; 78 2b2d8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2b2dc: 0f 94 55 35 call 0x26aaa ; 0x26aaa // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 2b2e0: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } tmc2130_wait_standstill_xy(1000); 2b2e4: 0f 94 9f 87 call 0x30f3e ; 0x30f3e cli(); 2b2e8: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 2b2ea: 81 e0 ldi r24, 0x01 ; 1 2b2ec: 90 91 a0 03 lds r25, 0x03A0 ; 0x8003a0 2b2f0: 91 11 cpse r25, r1 2b2f2: 01 c0 rjmp .+2 ; 0x2b2f6 2b2f4: 80 e0 ldi r24, 0x00 ; 0 2b2f6: 80 93 69 06 sts 0x0669, r24 ; 0x800669 update_mode_profile(); 2b2fa: 0f 94 7c aa call 0x354f8 ; 0x354f8 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(); 2b2fe: 0e 94 aa f9 call 0x1f354 ; 0x1f354 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) { } 2b302: 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())); 2b304: 82 70 andi r24, 0x02 ; 2 2b306: 0f 94 f1 3b call 0x277e2 ; 0x277e2 // 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(); 2b30a: 0f 94 3b 59 call 0x2b276 ; 0x2b276 sei(); 2b30e: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 2b310: 89 e6 ldi r24, 0x69 ; 105 2b312: 9f e0 ldi r25, 0x0F ; 15 2b314: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2b318: 88 23 and r24, r24 2b31a: 61 f0 breq .+24 ; 0x2b334 2b31c: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 2b320: 88 23 and r24, r24 2b322: 41 f0 breq .+16 ; 0x2b334 menu_submenu(lcd_crash_mode_info2); 2b324: 60 e0 ldi r22, 0x00 ; 0 2b326: 88 e8 ldi r24, 0x88 ; 136 2b328: 9b e3 ldi r25, 0x3B ; 59 2b32a: 0d 94 32 d0 jmp 0x3a064 ; 0x3a064 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; 2b32e: 10 92 a0 03 sts 0x03A0, r1 ; 0x8003a0 2b332: c4 cf rjmp .-120 ; 0x2b2bc #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 2b334: 08 95 ret 0002b336 <__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) { 2b336: 1f 92 push r1 2b338: 0f 92 push r0 2b33a: 0f b6 in r0, 0x3f ; 63 2b33c: 0f 92 push r0 2b33e: 11 24 eor r1, r1 2b340: 0b b6 in r0, 0x3b ; 59 2b342: 0f 92 push r0 2b344: 6f 92 push r6 2b346: 7f 92 push r7 2b348: 8f 92 push r8 2b34a: cf 92 push r12 2b34c: df 92 push r13 2b34e: ef 92 push r14 2b350: ff 92 push r15 2b352: 0f 93 push r16 2b354: 1f 93 push r17 2b356: 2f 93 push r18 2b358: 3f 93 push r19 2b35a: 4f 93 push r20 2b35c: 5f 93 push r21 2b35e: 6f 93 push r22 2b360: 7f 93 push r23 2b362: 8f 93 push r24 2b364: 9f 93 push r25 2b366: af 93 push r26 2b368: bf 93 push r27 2b36a: cf 93 push r28 2b36c: df 93 push r29 2b36e: ef 93 push r30 2b370: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b372: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> 2b376: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2b37a: 9c 01 movw r18, r24 2b37c: 21 50 subi r18, 0x01 ; 1 2b37e: 31 09 sbc r19, r1 2b380: 2e 3f cpi r18, 0xFE ; 254 2b382: 3f 4f sbci r19, 0xFF ; 255 2b384: 90 f4 brcc .+36 ; 0x2b3aa <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 2b386: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b38a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b38e: 28 17 cp r18, r24 2b390: 39 07 cpc r19, r25 2b392: 08 f0 brcs .+2 ; 0x2b396 <__vector_17+0x60> 2b394: f9 c0 rjmp .+498 ; 0x2b588 <__vector_17+0x252> nextAdvanceISR -= OCR1A; 2b396: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b39a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b39e: 82 1b sub r24, r18 2b3a0: 93 0b sbc r25, r19 2b3a2: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2b3a6: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2b3aa: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b3ae: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b3b2: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> 2b3b6: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2b3ba: 28 17 cp r18, r24 2b3bc: 39 07 cpc r19, r25 2b3be: 08 f0 brcs .+2 ; 0x2b3c2 <__vector_17+0x8c> 2b3c0: e8 c0 rjmp .+464 ; 0x2b592 <__vector_17+0x25c> nextMainISR -= OCR1A; 2b3c2: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b3c6: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b3ca: 82 1b sub r24, r18 2b3cc: 93 0b sbc r25, r19 2b3ce: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2b3d2: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2b3d6: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> 2b3da: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2b3de: 89 2b or r24, r25 2b3e0: 11 f0 breq .+4 ; 0x2b3e6 <__vector_17+0xb0> 2b3e2: 0d 94 eb 62 jmp 0x2c5d6 ; 0x2c5d6 <__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) 2b3e6: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b3ea: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b3ee: 30 97 sbiw r30, 0x00 ; 0 2b3f0: 09 f0 breq .+2 ; 0x2b3f4 <__vector_17+0xbe> 2b3f2: 87 c1 rjmp .+782 ; 0x2b702 <__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) { 2b3f4: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2b3f8: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 2b3fc: 98 17 cp r25, r24 2b3fe: 09 f4 brne .+2 ; 0x2b402 <__vector_17+0xcc> 2b400: f9 c1 rjmp .+1010 ; 0x2b7f4 <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 2b402: c0 91 54 0e lds r28, 0x0E54 ; 0x800e54 2b406: 2c 2f mov r18, r28 2b408: 30 e0 ldi r19, 0x00 ; 0 2b40a: 5e e6 ldi r21, 0x6E ; 110 2b40c: c5 9f mul r28, r21 2b40e: e0 01 movw r28, r0 2b410: 11 24 eor r1, r1 2b412: cd 58 subi r28, 0x8D ; 141 2b414: d8 4f sbci r29, 0xF8 ; 248 block->busy = true; 2b416: fe 01 movw r30, r28 2b418: e9 5b subi r30, 0xB9 ; 185 2b41a: ff 4f sbci r31, 0xFF ; 255 2b41c: 41 e0 ldi r20, 0x01 ; 1 2b41e: 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(); 2b420: d0 93 a0 05 sts 0x05A0, r29 ; 0x8005a0 2b424: c0 93 9f 05 sts 0x059F, r28 ; 0x80059f if (current_block != NULL) { 2b428: 20 97 sbiw r28, 0x00 ; 0 2b42a: 09 f4 brne .+2 ; 0x2b42e <__vector_17+0xf8> 2b42c: e3 c1 rjmp .+966 ; 0x2b7f4 <__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; 2b42e: 10 92 9b 05 sts 0x059B, r1 ; 0x80059b 2b432: 10 92 9c 05 sts 0x059C, r1 ; 0x80059c 2b436: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d 2b43a: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e // Set the nominal step loops to zero to indicate, that the timer value is not known yet. // That means, delay the initialization of nominal step rate and step loops until the steady // state is reached. step_loops_nominal = 0; 2b43e: 10 92 9a 05 sts 0x059A, r1 ; 0x80059a acc_step_rate = uint16_t(current_block->initial_rate); 2b442: 8a ad ldd r24, Y+58 ; 0x3a 2b444: 9b ad ldd r25, Y+59 ; 0x3b 2b446: 90 93 99 05 sts 0x0599, r25 ; 0x800599 2b44a: 80 93 98 05 sts 0x0598, r24 ; 0x800598 #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2b44e: 81 34 cpi r24, 0x41 ; 65 2b450: ec e9 ldi r30, 0x9C ; 156 2b452: 9e 07 cpc r25, r30 2b454: 08 f0 brcs .+2 ; 0x2b458 <__vector_17+0x122> 2b456: a2 c0 rjmp .+324 ; 0x2b59c <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2b458: 81 32 cpi r24, 0x21 ; 33 2b45a: fe e4 ldi r31, 0x4E ; 78 2b45c: 9f 07 cpc r25, r31 2b45e: 08 f4 brcc .+2 ; 0x2b462 <__vector_17+0x12c> 2b460: a0 c0 rjmp .+320 ; 0x2b5a2 <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 2b462: 96 95 lsr r25 2b464: 87 95 ror r24 2b466: 96 95 lsr r25 2b468: 87 95 ror r24 step_loops = 4; 2b46a: 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; 2b46c: 40 93 97 05 sts 0x0597, r20 ; 0x800597 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2b470: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2b472: 81 15 cp r24, r1 2b474: e8 e0 ldi r30, 0x08 ; 8 2b476: 9e 07 cpc r25, r30 2b478: 08 f4 brcc .+2 ; 0x2b47c <__vector_17+0x146> 2b47a: a4 c0 rjmp .+328 ; 0x2b5c4 <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2b47c: e9 2f mov r30, r25 2b47e: ff 27 eor r31, r31 2b480: ee 0f add r30, r30 2b482: ff 1f adc r31, r31 2b484: ee 0f add r30, r30 2b486: ff 1f adc r31, r31 2b488: af 01 movw r20, r30 2b48a: 46 52 subi r20, 0x26 ; 38 2b48c: 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); 2b48e: fa 01 movw r30, r20 2b490: 32 96 adiw r30, 0x02 ; 2 2b492: a5 91 lpm r26, Z+ 2b494: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2b496: fa 01 movw r30, r20 2b498: 45 91 lpm r20, Z+ 2b49a: 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. ); 2b49c: b8 9f mul r27, r24 2b49e: b0 01 movw r22, r0 2b4a0: a8 9f mul r26, r24 2b4a2: 00 0c add r0, r0 2b4a4: 61 1d adc r22, r1 2b4a6: 11 24 eor r1, r1 2b4a8: 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); 2b4aa: ca 01 movw r24, r20 2b4ac: 86 1b sub r24, r22 2b4ae: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 2b4b0: 84 36 cpi r24, 0x64 ; 100 2b4b2: 91 05 cpc r25, r1 2b4b4: 10 f4 brcc .+4 ; 0x2b4ba <__vector_17+0x184> 2b4b6: 84 e6 ldi r24, 0x64 ; 100 2b4b8: 90 e0 ldi r25, 0x00 ; 0 2b4ba: b0 e0 ldi r27, 0x00 ; 0 2b4bc: a0 e0 ldi r26, 0x00 ; 0 2b4be: 80 93 93 05 sts 0x0593, r24 ; 0x800593 2b4c2: 90 93 94 05 sts 0x0594, r25 ; 0x800594 2b4c6: a0 93 95 05 sts 0x0595, r26 ; 0x800595 2b4ca: b0 93 96 05 sts 0x0596, r27 ; 0x800596 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2b4ce: 4e e6 ldi r20, 0x6E ; 110 2b4d0: 42 9f mul r20, r18 2b4d2: c0 01 movw r24, r0 2b4d4: 43 9f mul r20, r19 2b4d6: 90 0d add r25, r0 2b4d8: 11 24 eor r1, r1 2b4da: 8d 58 subi r24, 0x8D ; 141 2b4dc: 98 4f sbci r25, 0xF8 ; 248 2b4de: fc 01 movw r30, r24 2b4e0: e4 5b subi r30, 0xB4 ; 180 2b4e2: ff 4f sbci r31, 0xFF ; 255 2b4e4: 40 81 ld r20, Z 2b4e6: 44 23 and r20, r20 2b4e8: 49 f0 breq .+18 ; 0x2b4fc <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 2b4ea: 81 5b subi r24, 0xB1 ; 177 2b4ec: 9f 4f sbci r25, 0xFF ; 255 2b4ee: fc 01 movw r30, r24 2b4f0: 80 81 ld r24, Z 2b4f2: 91 81 ldd r25, Z+1 ; 0x01 2b4f4: 90 93 92 05 sts 0x0592, r25 ; 0x800592 2b4f8: 80 93 91 05 sts 0x0591, r24 ; 0x800591 } e_steps = 0; 2b4fc: 10 92 90 05 sts 0x0590, r1 ; 0x800590 nextAdvanceISR = ADV_NEVER; 2b500: 8f ef ldi r24, 0xFF ; 255 2b502: 9f ef ldi r25, 0xFF ; 255 2b504: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2b508: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> LA_phase = -1; 2b50c: 80 93 8f 05 sts 0x058F, r24 ; 0x80058f #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 2b510: 8e e6 ldi r24, 0x6E ; 110 2b512: 82 9f mul r24, r18 2b514: f0 01 movw r30, r0 2b516: 83 9f mul r24, r19 2b518: f0 0d add r31, r0 2b51a: 11 24 eor r1, r1 2b51c: ed 58 subi r30, 0x8D ; 141 2b51e: f8 4f sbci r31, 0xF8 ; 248 2b520: 85 a9 ldd r24, Z+53 ; 0x35 2b522: 84 ff sbrs r24, 4 2b524: 08 c0 rjmp .+16 ; 0x2b536 <__vector_17+0x200> count_position[E_AXIS] = 0; 2b526: 10 92 6d 07 sts 0x076D, r1 ; 0x80076d 2b52a: 10 92 6e 07 sts 0x076E, r1 ; 0x80076e 2b52e: 10 92 6f 07 sts 0x076F, r1 ; 0x80076f 2b532: 10 92 70 07 sts 0x0770, r1 ; 0x800770 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 2b536: 83 ff sbrs r24, 3 2b538: 66 c0 rjmp .+204 ; 0x2b606 <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 2b53a: 8e e6 ldi r24, 0x6E ; 110 2b53c: 82 9f mul r24, r18 2b53e: f0 01 movw r30, r0 2b540: 83 9f mul r24, r19 2b542: f0 0d add r31, r0 2b544: 11 24 eor r1, r1 2b546: ed 58 subi r30, 0x8D ; 141 2b548: f8 4f sbci r31, 0xF8 ; 248 2b54a: 80 89 ldd r24, Z+16 ; 0x10 2b54c: 91 89 ldd r25, Z+17 ; 0x11 2b54e: 96 95 lsr r25 2b550: 87 95 ror r24 2b552: 91 95 neg r25 2b554: 81 95 neg r24 2b556: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 2b558: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b55c: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f 2b560: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2b564: 80 93 83 05 sts 0x0583, r24 ; 0x800583 2b568: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2b56c: 80 93 87 05 sts 0x0587, r24 ; 0x800587 2b570: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2b574: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 2b578: 81 e0 ldi r24, 0x01 ; 1 2b57a: 24 85 ldd r18, Z+12 ; 0x0c 2b57c: 35 85 ldd r19, Z+13 ; 0x0d 2b57e: 23 2b or r18, r19 2b580: 09 f0 breq .+2 ; 0x2b584 <__vector_17+0x24e> 2b582: 82 c0 rjmp .+260 ; 0x2b688 <__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; 2b584: 80 e0 ldi r24, 0x00 ; 0 2b586: 80 c0 rjmp .+256 ; 0x2b688 <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 2b588: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2b58c: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> 2b590: 0c cf rjmp .-488 ; 0x2b3aa <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 2b592: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2b596: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> 2b59a: 1d cf rjmp .-454 ; 0x2b3d6 <__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; 2b59c: 80 e4 ldi r24, 0x40 ; 64 2b59e: 9c e9 ldi r25, 0x9C ; 156 2b5a0: 60 cf rjmp .-320 ; 0x2b462 <__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 2b5a2: 81 31 cpi r24, 0x11 ; 17 2b5a4: 57 e2 ldi r21, 0x27 ; 39 2b5a6: 95 07 cpc r25, r21 2b5a8: 20 f0 brcs .+8 ; 0x2b5b2 <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 2b5aa: 96 95 lsr r25 2b5ac: 87 95 ror r24 step_loops = 2; 2b5ae: 42 e0 ldi r20, 0x02 ; 2 2b5b0: 5d cf rjmp .-326 ; 0x2b46c <__vector_17+0x136> } else { step_loops = 1; 2b5b2: 40 93 97 05 sts 0x0597, r20 ; 0x800597 2b5b6: 80 32 cpi r24, 0x20 ; 32 2b5b8: 91 05 cpc r25, r1 2b5ba: 08 f0 brcs .+2 ; 0x2b5be <__vector_17+0x288> 2b5bc: 59 cf rjmp .-334 ; 0x2b470 <__vector_17+0x13a> 2b5be: 80 e2 ldi r24, 0x20 ; 32 2b5c0: 90 e0 ldi r25, 0x00 ; 0 2b5c2: 56 cf rjmp .-340 ; 0x2b470 <__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; 2b5c4: ac 01 movw r20, r24 2b5c6: 56 95 lsr r21 2b5c8: 47 95 ror r20 2b5ca: 4c 7f andi r20, 0xFC ; 252 2b5cc: 46 52 subi r20, 0x26 ; 38 2b5ce: 5d 46 sbci r21, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2b5d0: fa 01 movw r30, r20 2b5d2: 65 91 lpm r22, Z+ 2b5d4: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2b5d6: fa 01 movw r30, r20 2b5d8: 32 96 adiw r30, 0x02 ; 2 2b5da: a5 91 lpm r26, Z+ 2b5dc: b4 91 lpm r27, Z 2b5de: ac 01 movw r20, r24 2b5e0: 47 70 andi r20, 0x07 ; 7 2b5e2: 55 27 eor r21, r21 2b5e4: 4a 9f mul r20, r26 2b5e6: c0 01 movw r24, r0 2b5e8: 4b 9f mul r20, r27 2b5ea: 90 0d add r25, r0 2b5ec: 5a 9f mul r21, r26 2b5ee: 90 0d add r25, r0 2b5f0: 11 24 eor r1, r1 2b5f2: e3 e0 ldi r30, 0x03 ; 3 2b5f4: 96 95 lsr r25 2b5f6: 87 95 ror r24 2b5f8: ea 95 dec r30 2b5fa: e1 f7 brne .-8 ; 0x2b5f4 <__vector_17+0x2be> 2b5fc: ab 01 movw r20, r22 2b5fe: 48 1b sub r20, r24 2b600: 59 0b sbc r21, r25 2b602: ca 01 movw r24, r20 2b604: 55 cf rjmp .-342 ; 0x2b4b0 <__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); 2b606: 8e e6 ldi r24, 0x6E ; 110 2b608: 82 9f mul r24, r18 2b60a: f0 01 movw r30, r0 2b60c: 83 9f mul r24, r19 2b60e: f0 0d add r31, r0 2b610: 11 24 eor r1, r1 2b612: ed 58 subi r30, 0x8D ; 141 2b614: f8 4f sbci r31, 0xF8 ; 248 2b616: 80 89 ldd r24, Z+16 ; 0x10 2b618: 91 89 ldd r25, Z+17 ; 0x11 2b61a: a2 89 ldd r26, Z+18 ; 0x12 2b61c: b3 89 ldd r27, Z+19 ; 0x13 2b61e: b6 95 lsr r27 2b620: a7 95 ror r26 2b622: 97 95 ror r25 2b624: 87 95 ror r24 2b626: b0 95 com r27 2b628: a0 95 com r26 2b62a: 90 95 com r25 2b62c: 81 95 neg r24 2b62e: 9f 4f sbci r25, 0xFF ; 255 2b630: af 4f sbci r26, 0xFF ; 255 2b632: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 2b634: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f 2b638: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b63c: a0 93 81 05 sts 0x0581, r26 ; 0x800581 2b640: b0 93 82 05 sts 0x0582, r27 ; 0x800582 2b644: 80 93 83 05 sts 0x0583, r24 ; 0x800583 2b648: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2b64c: a0 93 85 05 sts 0x0585, r26 ; 0x800585 2b650: b0 93 86 05 sts 0x0586, r27 ; 0x800586 2b654: 80 93 87 05 sts 0x0587, r24 ; 0x800587 2b658: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2b65c: a0 93 89 05 sts 0x0589, r26 ; 0x800589 2b660: b0 93 8a 05 sts 0x058A, r27 ; 0x80058a 2b664: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b 2b668: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2b66c: a0 93 8d 05 sts 0x058D, r26 ; 0x80058d 2b670: b0 93 8e 05 sts 0x058E, r27 ; 0x80058e } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 2b674: 81 e0 ldi r24, 0x01 ; 1 2b676: 44 85 ldd r20, Z+12 ; 0x0c 2b678: 55 85 ldd r21, Z+13 ; 0x0d 2b67a: 66 85 ldd r22, Z+14 ; 0x0e 2b67c: 77 85 ldd r23, Z+15 ; 0x0f 2b67e: 45 2b or r20, r21 2b680: 46 2b or r20, r22 2b682: 47 2b or r20, r23 2b684: 09 f4 brne .+2 ; 0x2b688 <__vector_17+0x352> 2b686: 7e cf rjmp .-260 ; 0x2b584 <__vector_17+0x24e> 2b688: 80 93 7e 05 sts 0x057E, r24 ; 0x80057e #endif } step_events_completed.wide = 0; 2b68c: 10 92 7a 05 sts 0x057A, r1 ; 0x80057a 2b690: 10 92 7b 05 sts 0x057B, r1 ; 0x80057b 2b694: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 2b698: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d // Set directions. out_bits = current_block->direction_bits; 2b69c: 88 8d ldd r24, Y+24 ; 0x18 2b69e: 80 93 79 05 sts 0x0579, r24 ; 0x800579 // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< WRITE_NC(X_DIR_PIN, INVERT_X_DIR); 2b6a6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b6aa: 81 60 ori r24, 0x01 ; 1 2b6ac: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 2b6b0: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 2b6b2: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } if((out_bits & (1< 2b6ba: 81 ff sbrs r24, 1 2b6bc: 8b c0 rjmp .+278 ; 0x2b7d4 <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 2b6be: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b6c2: 8d 7f andi r24, 0xFD ; 253 2b6c4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2b6c8: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 2b6ca: 80 93 70 02 sts 0x0270, r24 ; 0x800270 } if ((out_bits & (1< 2b6d2: 82 ff sbrs r24, 2 2b6d4: 86 c0 rjmp .+268 ; 0x2b7e2 <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 2b6d6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b6da: 84 60 ori r24, 0x04 ; 4 2b6dc: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 2b6e0: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 2b6e2: 80 93 71 02 sts 0x0271, r24 ; 0x800271 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 2b6e6: 80 91 79 05 lds r24, 0x0579 ; 0x800579 2b6ea: 83 ff sbrs r24, 3 2b6ec: 81 c0 rjmp .+258 ; 0x2b7f0 <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 2b6ee: 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; 2b6f0: 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) 2b6f4: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b6f8: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b6fc: 30 97 sbiw r30, 0x00 ; 0 2b6fe: 09 f4 brne .+2 ; 0x2b702 <__vector_17+0x3cc> 2b700: 3d c7 rjmp .+3706 ; 0x2c57c <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 2b702: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 2b706: 50 91 76 05 lds r21, 0x0576 ; 0x800576 2b70a: 88 23 and r24, r24 2b70c: 09 f4 brne .+2 ; 0x2b710 <__vector_17+0x3da> 2b70e: cb c0 rjmp .+406 ; 0x2b8a6 <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 2b710: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.495> uint8_t _endstop = endstop; 2b714: 80 91 78 05 lds r24, 0x0578 ; 0x800578 uint8_t _old_endstop = old_endstop; 2b718: 90 91 77 05 lds r25, 0x0577 ; 0x800577 #ifndef COREXY if ((out_bits & (1< #endif { #if ( (defined(X_MIN_PIN) && (X_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_XMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); 2b720: 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))); 2b728: 42 fd sbrc r20, 2 2b72a: 83 c0 rjmp .+262 ; 0x2b832 <__vector_17+0x4fc> 2b72c: 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)) { 2b72e: 49 2f mov r20, r25 2b730: 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)){ 2b732: 48 23 and r20, r24 2b734: b1 f0 breq .+44 ; 0x2b762 <__vector_17+0x42c> 2b736: c0 80 ld r12, Z 2b738: d1 80 ldd r13, Z+1 ; 0x01 2b73a: e2 80 ldd r14, Z+2 ; 0x02 2b73c: f3 80 ldd r15, Z+3 ; 0x03 2b73e: 1c 14 cp r1, r12 2b740: 1d 04 cpc r1, r13 2b742: 1e 04 cpc r1, r14 2b744: 1f 04 cpc r1, r15 2b746: 6c f4 brge .+26 ; 0x2b762 <__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); 2b748: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 2b74a: c0 88 ldd r12, Z+16 ; 0x10 2b74c: d1 88 ldd r13, Z+17 ; 0x11 2b74e: e2 88 ldd r14, Z+18 ; 0x12 2b750: f3 88 ldd r15, Z+19 ; 0x13 2b752: c0 92 7a 05 sts 0x057A, r12 ; 0x80057a 2b756: d0 92 7b 05 sts 0x057B, r13 ; 0x80057b 2b75a: e0 92 7c 05 sts 0x057C, r14 ; 0x80057c 2b75e: f0 92 7d 05 sts 0x057D, r15 ; 0x80057d #endif { #if ( (defined(Y_MIN_PIN) && (Y_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_YMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); 2b762: 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))); 2b76a: 47 fd sbrc r20, 7 2b76c: 6c c0 rjmp .+216 ; 0x2b846 <__vector_17+0x510> 2b76e: 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)) { 2b770: 49 2f mov r20, r25 2b772: 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)){ 2b774: 48 23 and r20, r24 2b776: b1 f0 breq .+44 ; 0x2b7a4 <__vector_17+0x46e> 2b778: c4 80 ldd r12, Z+4 ; 0x04 2b77a: d5 80 ldd r13, Z+5 ; 0x05 2b77c: e6 80 ldd r14, Z+6 ; 0x06 2b77e: f7 80 ldd r15, Z+7 ; 0x07 2b780: 1c 14 cp r1, r12 2b782: 1d 04 cpc r1, r13 2b784: 1e 04 cpc r1, r14 2b786: 1f 04 cpc r1, r15 2b788: 6c f4 brge .+26 ; 0x2b7a4 <__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); 2b78a: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 2b78c: c0 88 ldd r12, Z+16 ; 0x10 2b78e: d1 88 ldd r13, Z+17 ; 0x11 2b790: e2 88 ldd r14, Z+18 ; 0x12 2b792: f3 88 ldd r15, Z+19 ; 0x13 2b794: c0 92 7a 05 sts 0x057A, r12 ; 0x80057a 2b798: d0 92 7b 05 sts 0x057B, r13 ; 0x80057b 2b79c: e0 92 7c 05 sts 0x057C, r14 ; 0x80057c 2b7a0: f0 92 7d 05 sts 0x057D, r15 ; 0x80057d } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 2b7a8: 51 11 cpse r21, r1 2b7aa: 77 c0 rjmp .+238 ; 0x2b89a <__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)) 2b7ac: 30 91 69 06 lds r19, 0x0669 ; 0x800669 2b7b0: 31 30 cpi r19, 0x01 ; 1 2b7b2: 09 f0 breq .+2 ; 0x2b7b6 <__vector_17+0x480> 2b7b4: 52 c0 rjmp .+164 ; 0x2b85a <__vector_17+0x524> 2b7b6: 30 91 3d 06 lds r19, 0x063D ; 0x80063d 2b7ba: 32 fd sbrc r19, 2 2b7bc: 4e c0 rjmp .+156 ; 0x2b85a <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b7be: 1c 9b sbis 0x03, 4 ; 3 2b7c0: 52 c0 rjmp .+164 ; 0x2b866 <__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))); 2b7c2: 84 60 ori r24, 0x04 ; 4 2b7c4: 51 c0 rjmp .+162 ; 0x2b868 <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 2b7ca: 8e 7f andi r24, 0xFE ; 254 2b7cc: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 2b7d0: 81 e0 ldi r24, 0x01 ; 1 2b7d2: 6f cf rjmp .-290 ; 0x2b6b2 <__vector_17+0x37c> } if((out_bits & (1< 2b7d8: 82 60 ori r24, 0x02 ; 2 2b7da: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 2b7de: 81 e0 ldi r24, 0x01 ; 1 2b7e0: 74 cf rjmp .-280 ; 0x2b6ca <__vector_17+0x394> } if ((out_bits & (1< 2b7e6: 8b 7f andi r24, 0xFB ; 251 2b7e8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 2b7ec: 81 e0 ldi r24, 0x01 ; 1 2b7ee: 79 cf rjmp .-270 ; 0x2b6e2 <__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; 2b7f0: 81 e0 ldi r24, 0x01 ; 1 2b7f2: 7e cf rjmp .-260 ; 0x2b6f0 <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 2b7f4: 80 ed ldi r24, 0xD0 ; 208 2b7f6: 97 e0 ldi r25, 0x07 ; 7 2b7f8: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2b7fc: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> 2b800: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.493+0x1> 2b804: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.493> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 2b808: 8f ef ldi r24, 0xFF ; 255 2b80a: 9f ef ldi r25, 0xFF ; 255 2b80c: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2b810: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> e_steps = 0; 2b814: 10 92 90 05 sts 0x0590, r1 ; 0x800590 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 2b818: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2b81c: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2b820: 00 97 sbiw r24, 0x00 ; 0 2b822: 09 f4 brne .+2 ; 0x2b826 <__vector_17+0x4f0> 2b824: 67 cf rjmp .-306 ; 0x2b6f4 <__vector_17+0x3be> --current_adv_steps; 2b826: 01 97 sbiw r24, 0x01 ; 1 2b828: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2b82c: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2b830: 61 cf rjmp .-318 ; 0x2b6f4 <__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))); 2b832: 8e 7f andi r24, 0xFE ; 254 2b834: 7c cf rjmp .-264 ; 0x2b72e <__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))); 2b836: 42 fd sbrc r20, 2 2b838: 04 c0 rjmp .+8 ; 0x2b842 <__vector_17+0x50c> 2b83a: 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)){ 2b83c: 49 2f mov r20, r25 2b83e: 40 71 andi r20, 0x10 ; 16 2b840: 78 cf rjmp .-272 ; 0x2b732 <__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))); 2b842: 8f 7e andi r24, 0xEF ; 239 2b844: fb cf rjmp .-10 ; 0x2b83c <__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))); 2b846: 8d 7f andi r24, 0xFD ; 253 2b848: 93 cf rjmp .-218 ; 0x2b770 <__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))); 2b84a: 47 fd sbrc r20, 7 2b84c: 04 c0 rjmp .+8 ; 0x2b856 <__vector_17+0x520> 2b84e: 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)){ 2b850: 49 2f mov r20, r25 2b852: 40 72 andi r20, 0x20 ; 32 2b854: 8f cf rjmp .-226 ; 0x2b774 <__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))); 2b856: 8f 7d andi r24, 0xDF ; 223 2b858: fb cf rjmp .-10 ; 0x2b850 <__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))); 2b85a: 1c 99 sbic 0x03, 4 ; 3 2b85c: b2 cf rjmp .-156 ; 0x2b7c2 <__vector_17+0x48c> 2b85e: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b862: 36 ff sbrs r19, 6 2b864: ae cf rjmp .-164 ; 0x2b7c2 <__vector_17+0x48c> 2b866: 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)) { 2b868: 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)) { 2b86a: 98 23 and r25, r24 2b86c: b1 f0 breq .+44 ; 0x2b89a <__vector_17+0x564> 2b86e: c0 84 ldd r12, Z+8 ; 0x08 2b870: d1 84 ldd r13, Z+9 ; 0x09 2b872: e2 84 ldd r14, Z+10 ; 0x0a 2b874: f3 84 ldd r15, Z+11 ; 0x0b 2b876: 1c 14 cp r1, r12 2b878: 1d 04 cpc r1, r13 2b87a: 1e 04 cpc r1, r14 2b87c: 1f 04 cpc r1, r15 2b87e: 6c f4 brge .+26 ; 0x2b89a <__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); 2b880: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b882: c0 88 ldd r12, Z+16 ; 0x10 2b884: d1 88 ldd r13, Z+17 ; 0x11 2b886: e2 88 ldd r14, Z+18 ; 0x12 2b888: f3 88 ldd r15, Z+19 ; 0x13 2b88a: c0 92 7a 05 sts 0x057A, r12 ; 0x80057a 2b88e: d0 92 7b 05 sts 0x057B, r13 ; 0x80057b 2b892: e0 92 7c 05 sts 0x057C, r14 ; 0x80057c 2b896: f0 92 7d 05 sts 0x057D, r15 ; 0x80057d } #endif } endstop = _endstop; 2b89a: 80 93 78 05 sts 0x0578, r24 ; 0x800578 old_endstop = _endstop; //apply current endstop state to the old endstop 2b89e: 80 93 77 05 sts 0x0577, r24 ; 0x800577 endstop_hit = _endstop_hit; 2b8a2: 20 93 0b 05 sts 0x050B, r18 ; 0x80050b <_ZL11endstop_hit.lto_priv.495> } // 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) { 2b8a6: 55 23 and r21, r21 2b8a8: 09 f4 brne .+2 ; 0x2b8ac <__vector_17+0x576> 2b8aa: 40 c0 rjmp .+128 ; 0x2b92c <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 2b8ac: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.495> uint8_t _endstop = endstop; 2b8b0: 80 91 78 05 lds r24, 0x0578 ; 0x800578 uint8_t _old_endstop = old_endstop; 2b8b4: 90 91 77 05 lds r25, 0x0577 ; 0x800577 // Check the Z min end-stop no matter what. // Good for searching for the center of an induction target. #ifdef TMC2130_SG_HOMING // Stall guard homing turned on #ifdef TMC2130_STEALTH_Z if ((tmc2130_mode == TMC2130_MODE_SILENT) && !(tmc2130_sg_homing_axes_mask & 0x04)) 2b8b8: 30 91 69 06 lds r19, 0x0669 ; 0x800669 2b8bc: 31 30 cpi r19, 0x01 ; 1 2b8be: c9 f4 brne .+50 ; 0x2b8f2 <__vector_17+0x5bc> 2b8c0: 30 91 3d 06 lds r19, 0x063D ; 0x80063d 2b8c4: 32 fd sbrc r19, 2 2b8c6: 15 c0 rjmp .+42 ; 0x2b8f2 <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b8c8: 1c 9b sbis 0x03, 4 ; 3 2b8ca: 19 c0 rjmp .+50 ; 0x2b8fe <__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))); 2b8cc: 84 60 ori r24, 0x04 ; 4 2b8ce: 18 c0 rjmp .+48 ; 0x2b900 <__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)) 2b8d0: 30 91 69 06 lds r19, 0x0669 ; 0x800669 2b8d4: 31 30 cpi r19, 0x01 ; 1 2b8d6: 31 f4 brne .+12 ; 0x2b8e4 <__vector_17+0x5ae> 2b8d8: 30 91 3d 06 lds r19, 0x063D ; 0x80063d 2b8dc: 32 fd sbrc r19, 2 2b8de: 02 c0 rjmp .+4 ; 0x2b8e4 <__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))); 2b8e0: 8f 7b andi r24, 0xBF ; 191 2b8e2: 05 c0 rjmp .+10 ; 0x2b8ee <__vector_17+0x5b8> 2b8e4: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b8e8: 36 fd sbrc r19, 6 2b8ea: fa cf rjmp .-12 ; 0x2b8e0 <__vector_17+0x5aa> 2b8ec: 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)) { 2b8ee: 90 74 andi r25, 0x40 ; 64 2b8f0: bc cf rjmp .-136 ; 0x2b86a <__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))); 2b8f2: 1c 99 sbic 0x03, 4 ; 3 2b8f4: eb cf rjmp .-42 ; 0x2b8cc <__vector_17+0x596> 2b8f6: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b8fa: 36 ff sbrs r19, 6 2b8fc: e7 cf rjmp .-50 ; 0x2b8cc <__vector_17+0x596> 2b8fe: 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)) { 2b900: 94 70 andi r25, 0x04 ; 4 2b902: 98 23 and r25, r24 2b904: 69 f0 breq .+26 ; 0x2b920 <__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); 2b906: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b908: 40 89 ldd r20, Z+16 ; 0x10 2b90a: 51 89 ldd r21, Z+17 ; 0x11 2b90c: 62 89 ldd r22, Z+18 ; 0x12 2b90e: 73 89 ldd r23, Z+19 ; 0x13 2b910: 40 93 7a 05 sts 0x057A, r20 ; 0x80057a 2b914: 50 93 7b 05 sts 0x057B, r21 ; 0x80057b 2b918: 60 93 7c 05 sts 0x057C, r22 ; 0x80057c 2b91c: 70 93 7d 05 sts 0x057D, r23 ; 0x80057d } endstop = _endstop; 2b920: 80 93 78 05 sts 0x0578, r24 ; 0x800578 old_endstop = _endstop; //apply current endstop state to the old endstop 2b924: 80 93 77 05 sts 0x0577, r24 ; 0x800577 endstop_hit = _endstop_hit; 2b928: 20 93 0b 05 sts 0x050B, r18 ; 0x80050b <_ZL11endstop_hit.lto_priv.495> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b92c: 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) 2b92e: 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); 2b930: 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); 2b932: 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); 2b934: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b936: 83 ff sbrs r24, 3 2b938: 08 c1 rjmp .+528 ; 0x2bb4a <__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) 2b93a: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2b93e: c8 17 cp r28, r24 2b940: 08 f0 brcs .+2 ; 0x2b944 <__vector_17+0x60e> 2b942: 72 c2 rjmp .+1252 ; 0x2be28 <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2b944: 0f 94 2f 22 call 0x2445e ; 0x2445e // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 2b948: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b94c: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b950: 80 81 ld r24, Z 2b952: 91 81 ldd r25, Z+1 ; 0x01 2b954: 20 91 7f 05 lds r18, 0x057F ; 0x80057f 2b958: 30 91 80 05 lds r19, 0x0580 ; 0x800580 2b95c: 82 0f add r24, r18 2b95e: 93 1f adc r25, r19 2b960: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b964: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f if (counter[X_AXIS].lo > 0) { 2b968: 18 16 cp r1, r24 2b96a: 19 06 cpc r1, r25 2b96c: 64 f5 brge .+88 ; 0x2b9c6 <__vector_17+0x690> STEP_NC_HI(X_AXIS); 2b96e: 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; 2b970: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b974: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b978: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2b97c: 90 91 80 05 lds r25, 0x0580 ; 0x800580 2b980: 20 89 ldd r18, Z+16 ; 0x10 2b982: 31 89 ldd r19, Z+17 ; 0x11 2b984: 82 1b sub r24, r18 2b986: 93 0b sbc r25, r19 2b988: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b98c: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f count_position[X_AXIS]+=count_direction[X_AXIS]; 2b990: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2b994: 40 91 61 07 lds r20, 0x0761 ; 0x800761 2b998: 50 91 62 07 lds r21, 0x0762 ; 0x800762 2b99c: 60 91 63 07 lds r22, 0x0763 ; 0x800763 2b9a0: 70 91 64 07 lds r23, 0x0764 ; 0x800764 2b9a4: 89 2f mov r24, r25 2b9a6: 99 0f add r25, r25 2b9a8: 99 0b sbc r25, r25 2b9aa: aa 0b sbc r26, r26 2b9ac: bb 0b sbc r27, r27 2b9ae: 84 0f add r24, r20 2b9b0: 95 1f adc r25, r21 2b9b2: a6 1f adc r26, r22 2b9b4: b7 1f adc r27, r23 2b9b6: 80 93 61 07 sts 0x0761, r24 ; 0x800761 2b9ba: 90 93 62 07 sts 0x0762, r25 ; 0x800762 2b9be: a0 93 63 07 sts 0x0763, r26 ; 0x800763 2b9c2: b0 93 64 07 sts 0x0764, r27 ; 0x800764 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_LO(X_DUP_AXIS); #endif //DEBUG_XSTEP_DUP_PIN } // Step in Y axis counter[Y_AXIS].lo += current_block->steps[Y_AXIS].lo; 2b9c6: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b9ca: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b9ce: 84 81 ldd r24, Z+4 ; 0x04 2b9d0: 95 81 ldd r25, Z+5 ; 0x05 2b9d2: 20 91 83 05 lds r18, 0x0583 ; 0x800583 2b9d6: 30 91 84 05 lds r19, 0x0584 ; 0x800584 2b9da: 82 0f add r24, r18 2b9dc: 93 1f adc r25, r19 2b9de: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2b9e2: 80 93 83 05 sts 0x0583, r24 ; 0x800583 if (counter[Y_AXIS].lo > 0) { 2b9e6: 18 16 cp r1, r24 2b9e8: 19 06 cpc r1, r25 2b9ea: 44 f5 brge .+80 ; 0x2ba3c <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 2b9ec: 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; 2b9ee: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b9f2: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b9f6: 20 89 ldd r18, Z+16 ; 0x10 2b9f8: 31 89 ldd r19, Z+17 ; 0x11 2b9fa: 82 1b sub r24, r18 2b9fc: 93 0b sbc r25, r19 2b9fe: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2ba02: 80 93 83 05 sts 0x0583, r24 ; 0x800583 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2ba06: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2ba0a: 40 91 65 07 lds r20, 0x0765 ; 0x800765 2ba0e: 50 91 66 07 lds r21, 0x0766 ; 0x800766 2ba12: 60 91 67 07 lds r22, 0x0767 ; 0x800767 2ba16: 70 91 68 07 lds r23, 0x0768 ; 0x800768 2ba1a: 89 2f mov r24, r25 2ba1c: 99 0f add r25, r25 2ba1e: 99 0b sbc r25, r25 2ba20: aa 0b sbc r26, r26 2ba22: bb 0b sbc r27, r27 2ba24: 84 0f add r24, r20 2ba26: 95 1f adc r25, r21 2ba28: a6 1f adc r26, r22 2ba2a: b7 1f adc r27, r23 2ba2c: 80 93 65 07 sts 0x0765, r24 ; 0x800765 2ba30: 90 93 66 07 sts 0x0766, r25 ; 0x800766 2ba34: a0 93 67 07 sts 0x0767, r26 ; 0x800767 2ba38: b0 93 68 07 sts 0x0768, r27 ; 0x800768 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_LO(Y_DUP_AXIS); #endif //DEBUG_YSTEP_DUP_PIN } // Step in Z axis counter[Z_AXIS].lo += current_block->steps[Z_AXIS].lo; 2ba3c: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2ba40: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2ba44: 80 85 ldd r24, Z+8 ; 0x08 2ba46: 91 85 ldd r25, Z+9 ; 0x09 2ba48: 20 91 87 05 lds r18, 0x0587 ; 0x800587 2ba4c: 30 91 88 05 lds r19, 0x0588 ; 0x800588 2ba50: 82 0f add r24, r18 2ba52: 93 1f adc r25, r19 2ba54: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2ba58: 80 93 87 05 sts 0x0587, r24 ; 0x800587 if (counter[Z_AXIS].lo > 0) { 2ba5c: 18 16 cp r1, r24 2ba5e: 19 06 cpc r1, r25 2ba60: 44 f5 brge .+80 ; 0x2bab2 <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 2ba62: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 2ba64: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2ba68: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2ba6c: 20 89 ldd r18, Z+16 ; 0x10 2ba6e: 31 89 ldd r19, Z+17 ; 0x11 2ba70: 82 1b sub r24, r18 2ba72: 93 0b sbc r25, r19 2ba74: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2ba78: 80 93 87 05 sts 0x0587, r24 ; 0x800587 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2ba7c: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2ba80: 40 91 69 07 lds r20, 0x0769 ; 0x800769 2ba84: 50 91 6a 07 lds r21, 0x076A ; 0x80076a 2ba88: 60 91 6b 07 lds r22, 0x076B ; 0x80076b 2ba8c: 70 91 6c 07 lds r23, 0x076C ; 0x80076c 2ba90: 89 2f mov r24, r25 2ba92: 99 0f add r25, r25 2ba94: 99 0b sbc r25, r25 2ba96: aa 0b sbc r26, r26 2ba98: bb 0b sbc r27, r27 2ba9a: 84 0f add r24, r20 2ba9c: 95 1f adc r25, r21 2ba9e: a6 1f adc r26, r22 2baa0: b7 1f adc r27, r23 2baa2: 80 93 69 07 sts 0x0769, r24 ; 0x800769 2baa6: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 2baaa: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 2baae: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 2bab2: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bab6: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2baba: 80 91 8b 05 lds r24, 0x058B ; 0x80058b 2babe: 90 91 8c 05 lds r25, 0x058C ; 0x80058c 2bac2: 24 85 ldd r18, Z+12 ; 0x0c 2bac4: 35 85 ldd r19, Z+13 ; 0x0d 2bac6: 82 0f add r24, r18 2bac8: 93 1f adc r25, r19 2baca: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2bace: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b 2bad2: 20 89 ldd r18, Z+16 ; 0x10 2bad4: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 2bad6: 18 16 cp r1, r24 2bad8: 19 06 cpc r1, r25 2bada: 44 f5 brge .+80 ; 0x2bb2c <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 2badc: 82 1b sub r24, r18 2bade: 93 0b sbc r25, r19 2bae0: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2bae4: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b count_position[E_AXIS] += count_direction[E_AXIS]; 2bae8: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2baec: 40 91 6d 07 lds r20, 0x076D ; 0x80076d 2baf0: 50 91 6e 07 lds r21, 0x076E ; 0x80076e 2baf4: 60 91 6f 07 lds r22, 0x076F ; 0x80076f 2baf8: 70 91 70 07 lds r23, 0x0770 ; 0x800770 2bafc: 89 2f mov r24, r25 2bafe: 99 0f add r25, r25 2bb00: 99 0b sbc r25, r25 2bb02: aa 0b sbc r26, r26 2bb04: bb 0b sbc r27, r27 2bb06: 84 0f add r24, r20 2bb08: 95 1f adc r25, r21 2bb0a: a6 1f adc r26, r22 2bb0c: b7 1f adc r27, r23 2bb0e: 80 93 6d 07 sts 0x076D, r24 ; 0x80076d 2bb12: 90 93 6e 07 sts 0x076E, r25 ; 0x80076e 2bb16: a0 93 6f 07 sts 0x076F, r26 ; 0x80076f 2bb1a: b0 93 70 07 sts 0x0770, r27 ; 0x800770 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2bb1e: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bb22: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2bb26: 89 0f add r24, r25 2bb28: 80 93 90 05 sts 0x0590, r24 ; 0x800590 fsensor.stStep(count_direction[E_AXIS] < 0); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) STEP_NC_LO(E_AXIS); #endif } if(++ step_events_completed.lo >= current_block->step_event_count.lo) 2bb2c: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2bb30: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 2bb34: 01 96 adiw r24, 0x01 ; 1 2bb36: 90 93 7b 05 sts 0x057B, r25 ; 0x80057b 2bb3a: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a 2bb3e: 82 17 cp r24, r18 2bb40: 93 07 cpc r25, r19 2bb42: 08 f0 brcs .+2 ; 0x2bb46 <__vector_17+0x810> 2bb44: 71 c1 rjmp .+738 ; 0x2be28 <__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) 2bb46: cf 5f subi r28, 0xFF ; 255 2bb48: f8 ce rjmp .-528 ; 0x2b93a <__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) 2bb4a: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2bb4e: c8 17 cp r28, r24 2bb50: 08 f0 brcs .+2 ; 0x2bb54 <__vector_17+0x81e> 2bb52: 6a c1 rjmp .+724 ; 0x2be28 <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2bb54: 0f 94 2f 22 call 0x2445e ; 0x2445e // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 2bb58: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bb5c: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2bb60: 80 81 ld r24, Z 2bb62: 91 81 ldd r25, Z+1 ; 0x01 2bb64: a2 81 ldd r26, Z+2 ; 0x02 2bb66: b3 81 ldd r27, Z+3 ; 0x03 2bb68: 40 91 7f 05 lds r20, 0x057F ; 0x80057f 2bb6c: 50 91 80 05 lds r21, 0x0580 ; 0x800580 2bb70: 60 91 81 05 lds r22, 0x0581 ; 0x800581 2bb74: 70 91 82 05 lds r23, 0x0582 ; 0x800582 2bb78: 84 0f add r24, r20 2bb7a: 95 1f adc r25, r21 2bb7c: a6 1f adc r26, r22 2bb7e: b7 1f adc r27, r23 2bb80: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f 2bb84: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2bb88: a0 93 81 05 sts 0x0581, r26 ; 0x800581 2bb8c: b0 93 82 05 sts 0x0582, r27 ; 0x800582 if (counter[X_AXIS].wide > 0) { 2bb90: 18 16 cp r1, r24 2bb92: 19 06 cpc r1, r25 2bb94: 1a 06 cpc r1, r26 2bb96: 1b 06 cpc r1, r27 2bb98: c4 f5 brge .+112 ; 0x2bc0a <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 2bb9a: 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; 2bb9c: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bba0: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2bba4: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2bba8: 90 91 80 05 lds r25, 0x0580 ; 0x800580 2bbac: a0 91 81 05 lds r26, 0x0581 ; 0x800581 2bbb0: b0 91 82 05 lds r27, 0x0582 ; 0x800582 2bbb4: 40 89 ldd r20, Z+16 ; 0x10 2bbb6: 51 89 ldd r21, Z+17 ; 0x11 2bbb8: 62 89 ldd r22, Z+18 ; 0x12 2bbba: 73 89 ldd r23, Z+19 ; 0x13 2bbbc: 84 1b sub r24, r20 2bbbe: 95 0b sbc r25, r21 2bbc0: a6 0b sbc r26, r22 2bbc2: b7 0b sbc r27, r23 2bbc4: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f 2bbc8: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2bbcc: a0 93 81 05 sts 0x0581, r26 ; 0x800581 2bbd0: b0 93 82 05 sts 0x0582, r27 ; 0x800582 count_position[X_AXIS]+=count_direction[X_AXIS]; 2bbd4: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2bbd8: 40 91 61 07 lds r20, 0x0761 ; 0x800761 2bbdc: 50 91 62 07 lds r21, 0x0762 ; 0x800762 2bbe0: 60 91 63 07 lds r22, 0x0763 ; 0x800763 2bbe4: 70 91 64 07 lds r23, 0x0764 ; 0x800764 2bbe8: 89 2f mov r24, r25 2bbea: 99 0f add r25, r25 2bbec: 99 0b sbc r25, r25 2bbee: aa 0b sbc r26, r26 2bbf0: bb 0b sbc r27, r27 2bbf2: 84 0f add r24, r20 2bbf4: 95 1f adc r25, r21 2bbf6: a6 1f adc r26, r22 2bbf8: b7 1f adc r27, r23 2bbfa: 80 93 61 07 sts 0x0761, r24 ; 0x800761 2bbfe: 90 93 62 07 sts 0x0762, r25 ; 0x800762 2bc02: a0 93 63 07 sts 0x0763, r26 ; 0x800763 2bc06: b0 93 64 07 sts 0x0764, r27 ; 0x800764 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_LO(X_DUP_AXIS); #endif //DEBUG_XSTEP_DUP_PIN } // Step in Y axis counter[Y_AXIS].wide += current_block->steps[Y_AXIS].wide; 2bc0a: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bc0e: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2bc12: 84 81 ldd r24, Z+4 ; 0x04 2bc14: 95 81 ldd r25, Z+5 ; 0x05 2bc16: a6 81 ldd r26, Z+6 ; 0x06 2bc18: b7 81 ldd r27, Z+7 ; 0x07 2bc1a: 40 91 83 05 lds r20, 0x0583 ; 0x800583 2bc1e: 50 91 84 05 lds r21, 0x0584 ; 0x800584 2bc22: 60 91 85 05 lds r22, 0x0585 ; 0x800585 2bc26: 70 91 86 05 lds r23, 0x0586 ; 0x800586 2bc2a: 84 0f add r24, r20 2bc2c: 95 1f adc r25, r21 2bc2e: a6 1f adc r26, r22 2bc30: b7 1f adc r27, r23 2bc32: 80 93 83 05 sts 0x0583, r24 ; 0x800583 2bc36: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2bc3a: a0 93 85 05 sts 0x0585, r26 ; 0x800585 2bc3e: b0 93 86 05 sts 0x0586, r27 ; 0x800586 if (counter[Y_AXIS].wide > 0) { 2bc42: 18 16 cp r1, r24 2bc44: 19 06 cpc r1, r25 2bc46: 1a 06 cpc r1, r26 2bc48: 1b 06 cpc r1, r27 2bc4a: 84 f5 brge .+96 ; 0x2bcac <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 2bc4c: 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; 2bc4e: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bc52: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2bc56: 40 89 ldd r20, Z+16 ; 0x10 2bc58: 51 89 ldd r21, Z+17 ; 0x11 2bc5a: 62 89 ldd r22, Z+18 ; 0x12 2bc5c: 73 89 ldd r23, Z+19 ; 0x13 2bc5e: 84 1b sub r24, r20 2bc60: 95 0b sbc r25, r21 2bc62: a6 0b sbc r26, r22 2bc64: b7 0b sbc r27, r23 2bc66: 80 93 83 05 sts 0x0583, r24 ; 0x800583 2bc6a: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2bc6e: a0 93 85 05 sts 0x0585, r26 ; 0x800585 2bc72: b0 93 86 05 sts 0x0586, r27 ; 0x800586 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2bc76: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2bc7a: 40 91 65 07 lds r20, 0x0765 ; 0x800765 2bc7e: 50 91 66 07 lds r21, 0x0766 ; 0x800766 2bc82: 60 91 67 07 lds r22, 0x0767 ; 0x800767 2bc86: 70 91 68 07 lds r23, 0x0768 ; 0x800768 2bc8a: 89 2f mov r24, r25 2bc8c: 99 0f add r25, r25 2bc8e: 99 0b sbc r25, r25 2bc90: aa 0b sbc r26, r26 2bc92: bb 0b sbc r27, r27 2bc94: 84 0f add r24, r20 2bc96: 95 1f adc r25, r21 2bc98: a6 1f adc r26, r22 2bc9a: b7 1f adc r27, r23 2bc9c: 80 93 65 07 sts 0x0765, r24 ; 0x800765 2bca0: 90 93 66 07 sts 0x0766, r25 ; 0x800766 2bca4: a0 93 67 07 sts 0x0767, r26 ; 0x800767 2bca8: b0 93 68 07 sts 0x0768, r27 ; 0x800768 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_LO(Y_DUP_AXIS); #endif //DEBUG_YSTEP_DUP_PIN } // Step in Z axis counter[Z_AXIS].wide += current_block->steps[Z_AXIS].wide; 2bcac: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bcb0: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2bcb4: 80 85 ldd r24, Z+8 ; 0x08 2bcb6: 91 85 ldd r25, Z+9 ; 0x09 2bcb8: a2 85 ldd r26, Z+10 ; 0x0a 2bcba: b3 85 ldd r27, Z+11 ; 0x0b 2bcbc: 40 91 87 05 lds r20, 0x0587 ; 0x800587 2bcc0: 50 91 88 05 lds r21, 0x0588 ; 0x800588 2bcc4: 60 91 89 05 lds r22, 0x0589 ; 0x800589 2bcc8: 70 91 8a 05 lds r23, 0x058A ; 0x80058a 2bccc: 84 0f add r24, r20 2bcce: 95 1f adc r25, r21 2bcd0: a6 1f adc r26, r22 2bcd2: b7 1f adc r27, r23 2bcd4: 80 93 87 05 sts 0x0587, r24 ; 0x800587 2bcd8: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2bcdc: a0 93 89 05 sts 0x0589, r26 ; 0x800589 2bce0: b0 93 8a 05 sts 0x058A, r27 ; 0x80058a if (counter[Z_AXIS].wide > 0) { 2bce4: 18 16 cp r1, r24 2bce6: 19 06 cpc r1, r25 2bce8: 1a 06 cpc r1, r26 2bcea: 1b 06 cpc r1, r27 2bcec: 84 f5 brge .+96 ; 0x2bd4e <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 2bcee: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 2bcf0: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bcf4: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2bcf8: 40 89 ldd r20, Z+16 ; 0x10 2bcfa: 51 89 ldd r21, Z+17 ; 0x11 2bcfc: 62 89 ldd r22, Z+18 ; 0x12 2bcfe: 73 89 ldd r23, Z+19 ; 0x13 2bd00: 84 1b sub r24, r20 2bd02: 95 0b sbc r25, r21 2bd04: a6 0b sbc r26, r22 2bd06: b7 0b sbc r27, r23 2bd08: 80 93 87 05 sts 0x0587, r24 ; 0x800587 2bd0c: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2bd10: a0 93 89 05 sts 0x0589, r26 ; 0x800589 2bd14: b0 93 8a 05 sts 0x058A, r27 ; 0x80058a count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2bd18: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2bd1c: 40 91 69 07 lds r20, 0x0769 ; 0x800769 2bd20: 50 91 6a 07 lds r21, 0x076A ; 0x80076a 2bd24: 60 91 6b 07 lds r22, 0x076B ; 0x80076b 2bd28: 70 91 6c 07 lds r23, 0x076C ; 0x80076c 2bd2c: 89 2f mov r24, r25 2bd2e: 99 0f add r25, r25 2bd30: 99 0b sbc r25, r25 2bd32: aa 0b sbc r26, r26 2bd34: bb 0b sbc r27, r27 2bd36: 84 0f add r24, r20 2bd38: 95 1f adc r25, r21 2bd3a: a6 1f adc r26, r22 2bd3c: b7 1f adc r27, r23 2bd3e: 80 93 69 07 sts 0x0769, r24 ; 0x800769 2bd42: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 2bd46: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 2bd4a: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 2bd4e: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bd52: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2bd56: 80 91 8b 05 lds r24, 0x058B ; 0x80058b 2bd5a: 90 91 8c 05 lds r25, 0x058C ; 0x80058c 2bd5e: a0 91 8d 05 lds r26, 0x058D ; 0x80058d 2bd62: b0 91 8e 05 lds r27, 0x058E ; 0x80058e 2bd66: 44 85 ldd r20, Z+12 ; 0x0c 2bd68: 55 85 ldd r21, Z+13 ; 0x0d 2bd6a: 66 85 ldd r22, Z+14 ; 0x0e 2bd6c: 77 85 ldd r23, Z+15 ; 0x0f 2bd6e: 84 0f add r24, r20 2bd70: 95 1f adc r25, r21 2bd72: a6 1f adc r26, r22 2bd74: b7 1f adc r27, r23 2bd76: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b 2bd7a: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2bd7e: a0 93 8d 05 sts 0x058D, r26 ; 0x80058d 2bd82: b0 93 8e 05 sts 0x058E, r27 ; 0x80058e 2bd86: 40 89 ldd r20, Z+16 ; 0x10 2bd88: 51 89 ldd r21, Z+17 ; 0x11 2bd8a: 62 89 ldd r22, Z+18 ; 0x12 2bd8c: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 2bd8e: 18 16 cp r1, r24 2bd90: 19 06 cpc r1, r25 2bd92: 1a 06 cpc r1, r26 2bd94: 1b 06 cpc r1, r27 2bd96: 74 f5 brge .+92 ; 0x2bdf4 <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 2bd98: 84 1b sub r24, r20 2bd9a: 95 0b sbc r25, r21 2bd9c: a6 0b sbc r26, r22 2bd9e: b7 0b sbc r27, r23 2bda0: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b 2bda4: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2bda8: a0 93 8d 05 sts 0x058D, r26 ; 0x80058d 2bdac: b0 93 8e 05 sts 0x058E, r27 ; 0x80058e count_position[E_AXIS] += count_direction[E_AXIS]; 2bdb0: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bdb4: c0 90 6d 07 lds r12, 0x076D ; 0x80076d 2bdb8: d0 90 6e 07 lds r13, 0x076E ; 0x80076e 2bdbc: e0 90 6f 07 lds r14, 0x076F ; 0x80076f 2bdc0: f0 90 70 07 lds r15, 0x0770 ; 0x800770 2bdc4: 89 2f mov r24, r25 2bdc6: 99 0f add r25, r25 2bdc8: 99 0b sbc r25, r25 2bdca: aa 0b sbc r26, r26 2bdcc: bb 0b sbc r27, r27 2bdce: 8c 0d add r24, r12 2bdd0: 9d 1d adc r25, r13 2bdd2: ae 1d adc r26, r14 2bdd4: bf 1d adc r27, r15 2bdd6: 80 93 6d 07 sts 0x076D, r24 ; 0x80076d 2bdda: 90 93 6e 07 sts 0x076E, r25 ; 0x80076e 2bdde: a0 93 6f 07 sts 0x076F, r26 ; 0x80076f 2bde2: b0 93 70 07 sts 0x0770, r27 ; 0x800770 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2bde6: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bdea: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2bdee: 89 0f add r24, r25 2bdf0: 80 93 90 05 sts 0x0590, r24 ; 0x800590 fsensor.stStep(count_direction[E_AXIS] < 0); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) STEP_NC_LO(E_AXIS); #endif } if(++ step_events_completed.wide >= current_block->step_event_count.wide) 2bdf4: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2bdf8: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 2bdfc: a0 91 7c 05 lds r26, 0x057C ; 0x80057c 2be00: b0 91 7d 05 lds r27, 0x057D ; 0x80057d 2be04: 01 96 adiw r24, 0x01 ; 1 2be06: a1 1d adc r26, r1 2be08: b1 1d adc r27, r1 2be0a: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a 2be0e: 90 93 7b 05 sts 0x057B, r25 ; 0x80057b 2be12: a0 93 7c 05 sts 0x057C, r26 ; 0x80057c 2be16: b0 93 7d 05 sts 0x057D, r27 ; 0x80057d 2be1a: 84 17 cp r24, r20 2be1c: 95 07 cpc r25, r21 2be1e: a6 07 cpc r26, r22 2be20: b7 07 cpc r27, r23 2be22: 10 f4 brcc .+4 ; 0x2be28 <__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) 2be24: cf 5f subi r28, 0xFF ; 255 2be26: 91 ce rjmp .-734 ; 0x2bb4a <__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); 2be28: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2be2c: 88 23 and r24, r24 2be2e: 39 f0 breq .+14 ; 0x2be3e <__vector_17+0xb08> 2be30: 87 fd sbrc r24, 7 2be32: ee c0 rjmp .+476 ; 0x2c010 <__vector_17+0xcda> 2be34: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2be38: 80 64 ori r24, 0x40 ; 64 2be3a: 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) { 2be3e: 40 91 7a 05 lds r20, 0x057A ; 0x80057a 2be42: 50 91 7b 05 lds r21, 0x057B ; 0x80057b 2be46: 60 91 7c 05 lds r22, 0x057C ; 0x80057c 2be4a: 70 91 7d 05 lds r23, 0x057D ; 0x80057d 2be4e: c0 91 9f 05 lds r28, 0x059F ; 0x80059f 2be52: d0 91 a0 05 lds r29, 0x05A0 ; 0x8005a0 2be56: 89 8d ldd r24, Y+25 ; 0x19 2be58: 9a 8d ldd r25, Y+26 ; 0x1a 2be5a: ab 8d ldd r26, Y+27 ; 0x1b 2be5c: bc 8d ldd r27, Y+28 ; 0x1c 2be5e: 84 17 cp r24, r20 2be60: 95 07 cpc r25, r21 2be62: a6 07 cpc r26, r22 2be64: b7 07 cpc r27, r23 2be66: 08 f4 brcc .+2 ; 0x2be6a <__vector_17+0xb34> 2be68: 34 c1 rjmp .+616 ; 0x2c0d2 <__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); 2be6a: 40 91 93 05 lds r20, 0x0593 ; 0x800593 2be6e: 50 91 94 05 lds r21, 0x0594 ; 0x800594 2be72: 60 91 95 05 lds r22, 0x0595 ; 0x800595 2be76: 70 91 96 05 lds r23, 0x0596 ; 0x800596 "adc %B0, r26 \n\t" "clr r1 \n\t" : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1", "r26" , "r27" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. R26 is __zero_reg__, R27 is a temporary register. ); 2be7a: cc 88 ldd r12, Y+20 ; 0x14 2be7c: dd 88 ldd r13, Y+21 ; 0x15 2be7e: ee 88 ldd r14, Y+22 ; 0x16 2be80: aa 27 eor r26, r26 2be82: 4d 9d mul r20, r13 2be84: b1 2d mov r27, r1 2be86: 5e 9d mul r21, r14 2be88: c0 01 movw r24, r0 2be8a: 6e 9d mul r22, r14 2be8c: 90 0d add r25, r0 2be8e: 6d 9d mul r22, r13 2be90: 80 0d add r24, r0 2be92: 91 1d adc r25, r1 2be94: 4e 9d mul r20, r14 2be96: b0 0d add r27, r0 2be98: 81 1d adc r24, r1 2be9a: 9a 1f adc r25, r26 2be9c: 5d 9d mul r21, r13 2be9e: b0 0d add r27, r0 2bea0: 81 1d adc r24, r1 2bea2: 9a 1f adc r25, r26 2bea4: 6c 9d mul r22, r12 2bea6: b0 0d add r27, r0 2bea8: 81 1d adc r24, r1 2beaa: 9a 1f adc r25, r26 2beac: 5c 9d mul r21, r12 2beae: b1 0d add r27, r1 2beb0: 8a 1f adc r24, r26 2beb2: 9a 1f adc r25, r26 2beb4: bb 0f add r27, r27 2beb6: 8a 1f adc r24, r26 2beb8: 9a 1f adc r25, r26 2beba: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 2bebc: 2a ad ldd r18, Y+58 ; 0x3a 2bebe: 3b ad ldd r19, Y+59 ; 0x3b 2bec0: 82 0f add r24, r18 2bec2: 93 1f adc r25, r19 2bec4: 90 93 99 05 sts 0x0599, r25 ; 0x800599 2bec8: 80 93 98 05 sts 0x0598, r24 ; 0x800598 // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 2becc: 2e a9 ldd r18, Y+54 ; 0x36 2bece: 3f a9 ldd r19, Y+55 ; 0x37 2bed0: 28 17 cp r18, r24 2bed2: 39 07 cpc r19, r25 2bed4: 20 f4 brcc .+8 ; 0x2bede <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 2bed6: 30 93 99 05 sts 0x0599, r19 ; 0x800599 2beda: 20 93 98 05 sts 0x0598, r18 ; 0x800598 // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 2bede: 80 91 98 05 lds r24, 0x0598 ; 0x800598 2bee2: 90 91 99 05 lds r25, 0x0599 ; 0x800599 #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2bee6: 81 34 cpi r24, 0x41 ; 65 2bee8: fc e9 ldi r31, 0x9C ; 156 2beea: 9f 07 cpc r25, r31 2beec: 08 f0 brcs .+2 ; 0x2bef0 <__vector_17+0xbba> 2beee: 94 c0 rjmp .+296 ; 0x2c018 <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2bef0: 81 32 cpi r24, 0x21 ; 33 2bef2: 2e e4 ldi r18, 0x4E ; 78 2bef4: 92 07 cpc r25, r18 2bef6: 08 f4 brcc .+2 ; 0x2befa <__vector_17+0xbc4> 2bef8: 92 c0 rjmp .+292 ; 0x2c01e <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 2befa: 96 95 lsr r25 2befc: 87 95 ror r24 2befe: 96 95 lsr r25 2bf00: 87 95 ror r24 step_loops = 4; 2bf02: 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; 2bf04: 20 93 97 05 sts 0x0597, r18 ; 0x800597 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2bf08: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2bf0a: 81 15 cp r24, r1 2bf0c: f8 e0 ldi r31, 0x08 ; 8 2bf0e: 9f 07 cpc r25, r31 2bf10: 08 f4 brcc .+2 ; 0x2bf14 <__vector_17+0xbde> 2bf12: 97 c0 rjmp .+302 ; 0x2c042 <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2bf14: e9 2f mov r30, r25 2bf16: ff 27 eor r31, r31 2bf18: ee 0f add r30, r30 2bf1a: ff 1f adc r31, r31 2bf1c: ee 0f add r30, r30 2bf1e: ff 1f adc r31, r31 2bf20: 9f 01 movw r18, r30 2bf22: 26 52 subi r18, 0x26 ; 38 2bf24: 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); 2bf26: f9 01 movw r30, r18 2bf28: 32 96 adiw r30, 0x02 ; 2 2bf2a: a5 91 lpm r26, Z+ 2bf2c: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2bf2e: f9 01 movw r30, r18 2bf30: 25 91 lpm r18, Z+ 2bf32: 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. ); 2bf34: b8 9f mul r27, r24 2bf36: f0 01 movw r30, r0 2bf38: a8 9f mul r26, r24 2bf3a: 00 0c add r0, r0 2bf3c: e1 1d adc r30, r1 2bf3e: 11 24 eor r1, r1 2bf40: 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); 2bf42: c9 01 movw r24, r18 2bf44: 8e 1b sub r24, r30 2bf46: 9f 0b sbc r25, r31 2bf48: 84 36 cpi r24, 0x64 ; 100 2bf4a: 91 05 cpc r25, r1 2bf4c: 10 f4 brcc .+4 ; 0x2bf52 <__vector_17+0xc1c> 2bf4e: 84 e6 ldi r24, 0x64 ; 100 2bf50: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 2bf52: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2bf56: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> 2bf5a: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.493+0x1> 2bf5e: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.493> acceleration_time += timer; 2bf62: 48 0f add r20, r24 2bf64: 59 1f adc r21, r25 2bf66: 61 1d adc r22, r1 2bf68: 71 1d adc r23, r1 2bf6a: 40 93 93 05 sts 0x0593, r20 ; 0x800593 2bf6e: 50 93 94 05 sts 0x0594, r21 ; 0x800594 2bf72: 60 93 95 05 sts 0x0595, r22 ; 0x800595 2bf76: 70 93 96 05 sts 0x0596, r23 ; 0x800596 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2bf7a: fe 01 movw r30, r28 2bf7c: e4 5b subi r30, 0xB4 ; 180 2bf7e: ff 4f sbci r31, 0xFF ; 255 2bf80: 80 81 ld r24, Z 2bf82: 81 11 cpse r24, r1 2bf84: 7d c0 rjmp .+250 ; 0x2c080 <__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; 2bf86: 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) { 2bf88: 80 ff sbrs r24, 0 2bf8a: 16 c0 rjmp .+44 ; 0x2bfb8 <__vector_17+0xc82> LA_phase = -1; 2bf8c: 9f ef ldi r25, 0xFF ; 255 2bf8e: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f if (current_adv_steps == target_adv_steps) { 2bf92: e0 91 df 04 lds r30, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2bf96: f0 91 e0 04 lds r31, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2bf9a: 20 91 91 05 lds r18, 0x0591 ; 0x800591 2bf9e: 30 91 92 05 lds r19, 0x0592 ; 0x800592 2bfa2: e2 17 cp r30, r18 2bfa4: f3 07 cpc r31, r19 2bfa6: 09 f0 breq .+2 ; 0x2bfaa <__vector_17+0xc74> 2bfa8: 24 c2 rjmp .+1096 ; 0x2c3f2 <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 2bfaa: 8f ef ldi r24, 0xFF ; 255 2bfac: 9f ef ldi r25, 0xFF ; 255 2bfae: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2bfb2: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> 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; 2bfb6: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 2bfb8: 80 fd sbrc r24, 0 2bfba: 07 c0 rjmp .+14 ; 0x2bfca <__vector_17+0xc94> 2bfbc: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> 2bfc0: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2bfc4: 01 96 adiw r24, 0x01 ; 1 2bfc6: 09 f4 brne .+2 ; 0x2bfca <__vector_17+0xc94> 2bfc8: b2 c2 rjmp .+1380 ; 0x2c52e <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 2bfca: e0 91 e1 04 lds r30, 0x04E1 ; 0x8004e1 <_ZL9main_Rate.lto_priv.493> 2bfce: f0 91 e2 04 lds r31, 0x04E2 ; 0x8004e2 <_ZL9main_Rate.lto_priv.493+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 2bfd2: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2bfd6: 90 91 71 05 lds r25, 0x0571 ; 0x800571 2bfda: a0 91 72 05 lds r26, 0x0572 ; 0x800572 2bfde: b0 91 73 05 lds r27, 0x0573 ; 0x800573 2bfe2: 8e 0f add r24, r30 2bfe4: 9f 1f adc r25, r31 2bfe6: a1 1d adc r26, r1 2bfe8: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 2bfea: c3 5b subi r28, 0xB3 ; 179 2bfec: df 4f sbci r29, 0xFF ; 255 2bfee: 08 81 ld r16, Y 2bff0: 19 81 ldd r17, Y+1 ; 0x01 2bff2: 30 e0 ldi r19, 0x00 ; 0 2bff4: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 2bff6: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 2bff8: 80 17 cp r24, r16 2bffa: 91 07 cpc r25, r17 2bffc: a2 07 cpc r26, r18 2bffe: b3 07 cpc r27, r19 2c000: 08 f4 brcc .+2 ; 0x2c004 <__vector_17+0xcce> 2c002: 27 c2 rjmp .+1102 ; 0x2c452 <__vector_17+0x111c> { ++ticks; 2c004: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 2c006: 80 1b sub r24, r16 2c008: 91 0b sbc r25, r17 2c00a: a2 0b sbc r26, r18 2c00c: b3 0b sbc r27, r19 2c00e: f4 cf rjmp .-24 ; 0x2bff8 <__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); 2c010: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c014: 8f 7b andi r24, 0xBF ; 191 2c016: 11 cf rjmp .-478 ; 0x2be3a <__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; 2c018: 80 e4 ldi r24, 0x40 ; 64 2c01a: 9c e9 ldi r25, 0x9C ; 156 2c01c: 6e cf rjmp .-292 ; 0x2befa <__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 2c01e: 81 31 cpi r24, 0x11 ; 17 2c020: e7 e2 ldi r30, 0x27 ; 39 2c022: 9e 07 cpc r25, r30 2c024: 20 f0 brcs .+8 ; 0x2c02e <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 2c026: 96 95 lsr r25 2c028: 87 95 ror r24 step_loops = 2; 2c02a: 22 e0 ldi r18, 0x02 ; 2 2c02c: 6b cf rjmp .-298 ; 0x2bf04 <__vector_17+0xbce> } else { step_loops = 1; 2c02e: 21 e0 ldi r18, 0x01 ; 1 2c030: 20 93 97 05 sts 0x0597, r18 ; 0x800597 2c034: 80 32 cpi r24, 0x20 ; 32 2c036: 91 05 cpc r25, r1 2c038: 08 f0 brcs .+2 ; 0x2c03c <__vector_17+0xd06> 2c03a: 66 cf rjmp .-308 ; 0x2bf08 <__vector_17+0xbd2> 2c03c: 80 e2 ldi r24, 0x20 ; 32 2c03e: 90 e0 ldi r25, 0x00 ; 0 2c040: 63 cf rjmp .-314 ; 0x2bf08 <__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; 2c042: 9c 01 movw r18, r24 2c044: 36 95 lsr r19 2c046: 27 95 ror r18 2c048: 2c 7f andi r18, 0xFC ; 252 2c04a: 26 52 subi r18, 0x26 ; 38 2c04c: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c04e: f9 01 movw r30, r18 2c050: a5 91 lpm r26, Z+ 2c052: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c054: f9 01 movw r30, r18 2c056: 32 96 adiw r30, 0x02 ; 2 2c058: 05 91 lpm r16, Z+ 2c05a: 14 91 lpm r17, Z 2c05c: 87 70 andi r24, 0x07 ; 7 2c05e: 99 27 eor r25, r25 2c060: 80 9f mul r24, r16 2c062: 90 01 movw r18, r0 2c064: 81 9f mul r24, r17 2c066: 30 0d add r19, r0 2c068: 90 9f mul r25, r16 2c06a: 30 0d add r19, r0 2c06c: 11 24 eor r1, r1 2c06e: f3 e0 ldi r31, 0x03 ; 3 2c070: 36 95 lsr r19 2c072: 27 95 ror r18 2c074: fa 95 dec r31 2c076: e1 f7 brne .-8 ; 0x2c070 <__vector_17+0xd3a> 2c078: cd 01 movw r24, r26 2c07a: 82 1b sub r24, r18 2c07c: 93 0b sbc r25, r19 2c07e: 64 cf rjmp .-312 ; 0x2bf48 <__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) { 2c080: 40 91 7a 05 lds r20, 0x057A ; 0x80057a 2c084: 50 91 7b 05 lds r21, 0x057B ; 0x80057b 2c088: 60 91 7c 05 lds r22, 0x057C ; 0x80057c 2c08c: 70 91 7d 05 lds r23, 0x057D ; 0x80057d 2c090: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2c094: 90 e0 ldi r25, 0x00 ; 0 2c096: b0 e0 ldi r27, 0x00 ; 0 2c098: a0 e0 ldi r26, 0x00 ; 0 2c09a: 84 17 cp r24, r20 2c09c: 95 07 cpc r25, r21 2c09e: a6 07 cpc r26, r22 2c0a0: b7 07 cpc r27, r23 2c0a2: 08 f4 brcc .+2 ; 0x2c0a6 <__vector_17+0xd70> 2c0a4: 70 cf rjmp .-288 ; 0x2bf86 <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 2c0a6: 80 91 7e 05 lds r24, 0x057E ; 0x80057e 2c0aa: 81 11 cpse r24, r1 2c0ac: 02 c0 rjmp .+4 ; 0x2c0b2 <__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; 2c0ae: 83 e0 ldi r24, 0x03 ; 3 2c0b0: 6b cf rjmp .-298 ; 0x2bf88 <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 2c0b2: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2c0b6: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2c0ba: 20 91 91 05 lds r18, 0x0591 ; 0x800591 2c0be: 30 91 92 05 lds r19, 0x0592 ; 0x800592 2c0c2: 28 17 cp r18, r24 2c0c4: 39 07 cpc r19, r25 2c0c6: 98 f7 brcc .-26 ; 0x2c0ae <__vector_17+0xd78> target_adv_steps = current_adv_steps; 2c0c8: 90 93 92 05 sts 0x0592, r25 ; 0x800592 2c0cc: 80 93 91 05 sts 0x0591, r24 ; 0x800591 2c0d0: ee cf rjmp .-36 ; 0x2c0ae <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 2c0d2: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2c0d6: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 2c0da: a0 91 7c 05 lds r26, 0x057C ; 0x80057c 2c0de: b0 91 7d 05 lds r27, 0x057D ; 0x80057d 2c0e2: 4d 8d ldd r20, Y+29 ; 0x1d 2c0e4: 5e 8d ldd r21, Y+30 ; 0x1e 2c0e6: 6f 8d ldd r22, Y+31 ; 0x1f 2c0e8: 78 a1 ldd r23, Y+32 ; 0x20 2c0ea: 48 17 cp r20, r24 2c0ec: 59 07 cpc r21, r25 2c0ee: 6a 07 cpc r22, r26 2c0f0: 7b 07 cpc r23, r27 2c0f2: 08 f0 brcs .+2 ; 0x2c0f6 <__vector_17+0xdc0> 2c0f4: e3 c0 rjmp .+454 ; 0x2c2bc <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 2c0f6: c0 90 9b 05 lds r12, 0x059B ; 0x80059b 2c0fa: d0 90 9c 05 lds r13, 0x059C ; 0x80059c 2c0fe: e0 90 9d 05 lds r14, 0x059D ; 0x80059d 2c102: f0 90 9e 05 lds r15, 0x059E ; 0x80059e "adc %B0, r26 \n\t" "clr r1 \n\t" : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1", "r26" , "r27" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. R26 is __zero_reg__, R27 is a temporary register. ); 2c106: 6c 88 ldd r6, Y+20 ; 0x14 2c108: 7d 88 ldd r7, Y+21 ; 0x15 2c10a: 8e 88 ldd r8, Y+22 ; 0x16 2c10c: aa 27 eor r26, r26 2c10e: c7 9c mul r12, r7 2c110: b1 2d mov r27, r1 2c112: d8 9c mul r13, r8 2c114: f0 01 movw r30, r0 2c116: e8 9c mul r14, r8 2c118: f0 0d add r31, r0 2c11a: e7 9c mul r14, r7 2c11c: e0 0d add r30, r0 2c11e: f1 1d adc r31, r1 2c120: c8 9c mul r12, r8 2c122: b0 0d add r27, r0 2c124: e1 1d adc r30, r1 2c126: fa 1f adc r31, r26 2c128: d7 9c mul r13, r7 2c12a: b0 0d add r27, r0 2c12c: e1 1d adc r30, r1 2c12e: fa 1f adc r31, r26 2c130: e6 9c mul r14, r6 2c132: b0 0d add r27, r0 2c134: e1 1d adc r30, r1 2c136: fa 1f adc r31, r26 2c138: d6 9c mul r13, r6 2c13a: b1 0d add r27, r1 2c13c: ea 1f adc r30, r26 2c13e: fa 1f adc r31, r26 2c140: bb 0f add r27, r27 2c142: ea 1f adc r30, r26 2c144: fa 1f adc r31, r26 2c146: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 2c148: 20 91 98 05 lds r18, 0x0598 ; 0x800598 2c14c: 30 91 99 05 lds r19, 0x0599 ; 0x800599 2c150: 8e ad ldd r24, Y+62 ; 0x3e 2c152: 9f ad ldd r25, Y+63 ; 0x3f 2c154: 2e 17 cp r18, r30 2c156: 3f 07 cpc r19, r31 2c158: 30 f0 brcs .+12 ; 0x2c166 <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 2c15a: 2e 1b sub r18, r30 2c15c: 3f 0b sbc r19, r31 2c15e: 82 17 cp r24, r18 2c160: 93 07 cpc r25, r19 2c162: 08 f4 brcc .+2 ; 0x2c166 <__vector_17+0xe30> 2c164: 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; 2c166: 81 34 cpi r24, 0x41 ; 65 2c168: 2c e9 ldi r18, 0x9C ; 156 2c16a: 92 07 cpc r25, r18 2c16c: 08 f0 brcs .+2 ; 0x2c170 <__vector_17+0xe3a> 2c16e: 75 c0 rjmp .+234 ; 0x2c25a <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2c170: 81 32 cpi r24, 0x21 ; 33 2c172: ee e4 ldi r30, 0x4E ; 78 2c174: 9e 07 cpc r25, r30 2c176: 08 f4 brcc .+2 ; 0x2c17a <__vector_17+0xe44> 2c178: 73 c0 rjmp .+230 ; 0x2c260 <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 2c17a: 96 95 lsr r25 2c17c: 87 95 ror r24 2c17e: 96 95 lsr r25 2c180: 87 95 ror r24 step_loops = 4; 2c182: 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; 2c184: 20 93 97 05 sts 0x0597, r18 ; 0x800597 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c188: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c18a: 81 15 cp r24, r1 2c18c: 28 e0 ldi r18, 0x08 ; 8 2c18e: 92 07 cpc r25, r18 2c190: 08 f4 brcc .+2 ; 0x2c194 <__vector_17+0xe5e> 2c192: 78 c0 rjmp .+240 ; 0x2c284 <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c194: e9 2f mov r30, r25 2c196: ff 27 eor r31, r31 2c198: ee 0f add r30, r30 2c19a: ff 1f adc r31, r31 2c19c: ee 0f add r30, r30 2c19e: ff 1f adc r31, r31 2c1a0: 9f 01 movw r18, r30 2c1a2: 26 52 subi r18, 0x26 ; 38 2c1a4: 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); 2c1a6: f9 01 movw r30, r18 2c1a8: 32 96 adiw r30, 0x02 ; 2 2c1aa: a5 91 lpm r26, Z+ 2c1ac: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c1ae: f9 01 movw r30, r18 2c1b0: 25 91 lpm r18, Z+ 2c1b2: 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. ); 2c1b4: b8 9f mul r27, r24 2c1b6: f0 01 movw r30, r0 2c1b8: a8 9f mul r26, r24 2c1ba: 00 0c add r0, r0 2c1bc: e1 1d adc r30, r1 2c1be: 11 24 eor r1, r1 2c1c0: 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); 2c1c2: 2e 1b sub r18, r30 2c1c4: 3f 0b sbc r19, r31 2c1c6: c9 01 movw r24, r18 2c1c8: 24 36 cpi r18, 0x64 ; 100 2c1ca: 31 05 cpc r19, r1 2c1cc: 10 f4 brcc .+4 ; 0x2c1d2 <__vector_17+0xe9c> 2c1ce: 84 e6 ldi r24, 0x64 ; 100 2c1d0: 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); 2c1d2: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2c1d6: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> 2c1da: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.493+0x1> 2c1de: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.493> deceleration_time += timer; 2c1e2: c8 0e add r12, r24 2c1e4: d9 1e adc r13, r25 2c1e6: e1 1c adc r14, r1 2c1e8: f1 1c adc r15, r1 2c1ea: c0 92 9b 05 sts 0x059B, r12 ; 0x80059b 2c1ee: d0 92 9c 05 sts 0x059C, r13 ; 0x80059c 2c1f2: e0 92 9d 05 sts 0x059D, r14 ; 0x80059d 2c1f6: f0 92 9e 05 sts 0x059E, r15 ; 0x80059e #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2c1fa: fe 01 movw r30, r28 2c1fc: e4 5b subi r30, 0xB4 ; 180 2c1fe: ff 4f sbci r31, 0xFF ; 255 2c200: 80 81 ld r24, Z 2c202: 88 23 and r24, r24 2c204: 09 f4 brne .+2 ; 0x2c208 <__vector_17+0xed2> 2c206: bf ce rjmp .-642 ; 0x2bf86 <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 2c208: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2c20c: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 2c210: a0 91 7c 05 lds r26, 0x057C ; 0x80057c 2c214: b0 91 7d 05 lds r27, 0x057D ; 0x80057d 2c218: 20 91 97 05 lds r18, 0x0597 ; 0x800597 2c21c: 42 0f add r20, r18 2c21e: 51 1d adc r21, r1 2c220: 61 1d adc r22, r1 2c222: 71 1d adc r23, r1 2c224: 48 17 cp r20, r24 2c226: 59 07 cpc r21, r25 2c228: 6a 07 cpc r22, r26 2c22a: 7b 07 cpc r23, r27 2c22c: 08 f4 brcc .+2 ; 0x2c230 <__vector_17+0xefa> 2c22e: ab ce rjmp .-682 ; 0x2bf86 <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 2c230: 35 96 adiw r30, 0x05 ; 5 2c232: 20 81 ld r18, Z 2c234: 31 81 ldd r19, Z+1 ; 0x01 2c236: 30 93 92 05 sts 0x0592, r19 ; 0x800592 2c23a: 20 93 91 05 sts 0x0591, r18 ; 0x800591 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 2c23e: 80 91 7e 05 lds r24, 0x057E ; 0x80057e 2c242: 88 23 and r24, r24 2c244: 09 f4 brne .+2 ; 0x2c248 <__vector_17+0xf12> 2c246: 33 cf rjmp .-410 ; 0x2c0ae <__vector_17+0xd78> 2c248: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2c24c: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2c250: 82 17 cp r24, r18 2c252: 93 07 cpc r25, r19 2c254: 08 f0 brcs .+2 ; 0x2c258 <__vector_17+0xf22> 2c256: 2b cf rjmp .-426 ; 0x2c0ae <__vector_17+0xd78> 2c258: 37 cf rjmp .-402 ; 0x2c0c8 <__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; 2c25a: 80 e4 ldi r24, 0x40 ; 64 2c25c: 9c e9 ldi r25, 0x9C ; 156 2c25e: 8d cf rjmp .-230 ; 0x2c17a <__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 2c260: 81 31 cpi r24, 0x11 ; 17 2c262: f7 e2 ldi r31, 0x27 ; 39 2c264: 9f 07 cpc r25, r31 2c266: 20 f0 brcs .+8 ; 0x2c270 <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 2c268: 96 95 lsr r25 2c26a: 87 95 ror r24 step_loops = 2; 2c26c: 22 e0 ldi r18, 0x02 ; 2 2c26e: 8a cf rjmp .-236 ; 0x2c184 <__vector_17+0xe4e> } else { step_loops = 1; 2c270: 21 e0 ldi r18, 0x01 ; 1 2c272: 20 93 97 05 sts 0x0597, r18 ; 0x800597 2c276: 80 32 cpi r24, 0x20 ; 32 2c278: 91 05 cpc r25, r1 2c27a: 08 f0 brcs .+2 ; 0x2c27e <__vector_17+0xf48> 2c27c: 85 cf rjmp .-246 ; 0x2c188 <__vector_17+0xe52> 2c27e: 80 e2 ldi r24, 0x20 ; 32 2c280: 90 e0 ldi r25, 0x00 ; 0 2c282: 82 cf rjmp .-252 ; 0x2c188 <__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; 2c284: dc 01 movw r26, r24 2c286: b6 95 lsr r27 2c288: a7 95 ror r26 2c28a: ac 7f andi r26, 0xFC ; 252 2c28c: a6 52 subi r26, 0x26 ; 38 2c28e: bd 46 sbci r27, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c290: fd 01 movw r30, r26 2c292: 25 91 lpm r18, Z+ 2c294: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c296: fd 01 movw r30, r26 2c298: 32 96 adiw r30, 0x02 ; 2 2c29a: a5 91 lpm r26, Z+ 2c29c: b4 91 lpm r27, Z 2c29e: 87 70 andi r24, 0x07 ; 7 2c2a0: 99 27 eor r25, r25 2c2a2: 8a 9f mul r24, r26 2c2a4: f0 01 movw r30, r0 2c2a6: 8b 9f mul r24, r27 2c2a8: f0 0d add r31, r0 2c2aa: 9a 9f mul r25, r26 2c2ac: f0 0d add r31, r0 2c2ae: 11 24 eor r1, r1 2c2b0: a3 e0 ldi r26, 0x03 ; 3 2c2b2: f6 95 lsr r31 2c2b4: e7 95 ror r30 2c2b6: aa 95 dec r26 2c2b8: e1 f7 brne .-8 ; 0x2c2b2 <__vector_17+0xf7c> 2c2ba: 83 cf rjmp .-250 ; 0x2c1c2 <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 2c2bc: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2c2c0: 88 23 and r24, r24 2c2c2: 71 f0 breq .+28 ; 0x2c2e0 <__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; 2c2c4: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 2c2c6: 20 91 74 05 lds r18, 0x0574 ; 0x800574 2c2ca: 30 91 75 05 lds r19, 0x0575 ; 0x800575 2c2ce: 30 93 e6 04 sts 0x04E6, r19 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2c2d2: 20 93 e5 04 sts 0x04E5, r18 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> 2c2d6: 30 93 e2 04 sts 0x04E2, r19 ; 0x8004e2 <_ZL9main_Rate.lto_priv.493+0x1> 2c2da: 20 93 e1 04 sts 0x04E1, r18 ; 0x8004e1 <_ZL9main_Rate.lto_priv.493> 2c2de: 54 ce rjmp .-856 ; 0x2bf88 <__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); 2c2e0: 8e a9 ldd r24, Y+54 ; 0x36 2c2e2: 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; 2c2e4: 81 34 cpi r24, 0x41 ; 65 2c2e6: 4c e9 ldi r20, 0x9C ; 156 2c2e8: 94 07 cpc r25, r20 2c2ea: 08 f0 brcs .+2 ; 0x2c2ee <__vector_17+0xfb8> 2c2ec: 4e c0 rjmp .+156 ; 0x2c38a <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2c2ee: 81 32 cpi r24, 0x21 ; 33 2c2f0: 5e e4 ldi r21, 0x4E ; 78 2c2f2: 95 07 cpc r25, r21 2c2f4: 08 f4 brcc .+2 ; 0x2c2f8 <__vector_17+0xfc2> 2c2f6: 4c c0 rjmp .+152 ; 0x2c390 <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 2c2f8: 96 95 lsr r25 2c2fa: 87 95 ror r24 2c2fc: 96 95 lsr r25 2c2fe: 87 95 ror r24 step_loops = 4; 2c300: 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; 2c302: 20 93 97 05 sts 0x0597, r18 ; 0x800597 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c306: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c308: 81 15 cp r24, r1 2c30a: f8 e0 ldi r31, 0x08 ; 8 2c30c: 9f 07 cpc r25, r31 2c30e: 08 f4 brcc .+2 ; 0x2c312 <__vector_17+0xfdc> 2c310: 51 c0 rjmp .+162 ; 0x2c3b4 <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c312: e9 2f mov r30, r25 2c314: ff 27 eor r31, r31 2c316: ee 0f add r30, r30 2c318: ff 1f adc r31, r31 2c31a: ee 0f add r30, r30 2c31c: ff 1f adc r31, r31 2c31e: 9f 01 movw r18, r30 2c320: 26 52 subi r18, 0x26 ; 38 2c322: 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); 2c324: f9 01 movw r30, r18 2c326: 32 96 adiw r30, 0x02 ; 2 2c328: 65 91 lpm r22, Z+ 2c32a: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c32c: f9 01 movw r30, r18 2c32e: 25 91 lpm r18, Z+ 2c330: 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. ); 2c332: 78 9f mul r23, r24 2c334: a0 01 movw r20, r0 2c336: 68 9f mul r22, r24 2c338: 00 0c add r0, r0 2c33a: 41 1d adc r20, r1 2c33c: 11 24 eor r1, r1 2c33e: 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); 2c340: c9 01 movw r24, r18 2c342: 84 1b sub r24, r20 2c344: 95 0b sbc r25, r21 2c346: 84 36 cpi r24, 0x64 ; 100 2c348: 91 05 cpc r25, r1 2c34a: 10 f4 brcc .+4 ; 0x2c350 <__vector_17+0x101a> 2c34c: 84 e6 ldi r24, 0x64 ; 100 2c34e: 90 e0 ldi r25, 0x00 ; 0 2c350: 90 93 75 05 sts 0x0575, r25 ; 0x800575 2c354: 80 93 74 05 sts 0x0574, r24 ; 0x800574 step_loops_nominal = step_loops; 2c358: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2c35c: 80 93 9a 05 sts 0x059A, r24 ; 0x80059a #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 2c360: fe 01 movw r30, r28 2c362: e4 5b subi r30, 0xB4 ; 180 2c364: ff 4f sbci r31, 0xFF ; 255 2c366: 80 81 ld r24, Z 2c368: 88 23 and r24, r24 2c36a: 09 f4 brne .+2 ; 0x2c36e <__vector_17+0x1038> 2c36c: ab cf rjmp .-170 ; 0x2c2c4 <__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) 2c36e: 80 91 7e 05 lds r24, 0x057E ; 0x80057e 2c372: 88 23 and r24, r24 2c374: 41 f0 breq .+16 ; 0x2c386 <__vector_17+0x1050> target_adv_steps = current_adv_steps; 2c376: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2c37a: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2c37e: 90 93 92 05 sts 0x0592, r25 ; 0x800592 2c382: 80 93 91 05 sts 0x0591, r24 ; 0x800591 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { // Due to E-jerk, there can be discontinuities in pressure state where an // acceleration or deceleration can be skipped or joined with the previous block. // If LA was not previously active, re-check the pressure level la_state = ADV_INIT; 2c386: 81 e0 ldi r24, 0x01 ; 1 2c388: 9e cf rjmp .-196 ; 0x2c2c6 <__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; 2c38a: 80 e4 ldi r24, 0x40 ; 64 2c38c: 9c e9 ldi r25, 0x9C ; 156 2c38e: b4 cf rjmp .-152 ; 0x2c2f8 <__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 2c390: 81 31 cpi r24, 0x11 ; 17 2c392: e7 e2 ldi r30, 0x27 ; 39 2c394: 9e 07 cpc r25, r30 2c396: 20 f0 brcs .+8 ; 0x2c3a0 <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 2c398: 96 95 lsr r25 2c39a: 87 95 ror r24 step_loops = 2; 2c39c: 22 e0 ldi r18, 0x02 ; 2 2c39e: b1 cf rjmp .-158 ; 0x2c302 <__vector_17+0xfcc> } else { step_loops = 1; 2c3a0: 21 e0 ldi r18, 0x01 ; 1 2c3a2: 20 93 97 05 sts 0x0597, r18 ; 0x800597 2c3a6: 80 32 cpi r24, 0x20 ; 32 2c3a8: 91 05 cpc r25, r1 2c3aa: 08 f0 brcs .+2 ; 0x2c3ae <__vector_17+0x1078> 2c3ac: ac cf rjmp .-168 ; 0x2c306 <__vector_17+0xfd0> 2c3ae: 80 e2 ldi r24, 0x20 ; 32 2c3b0: 90 e0 ldi r25, 0x00 ; 0 2c3b2: a9 cf rjmp .-174 ; 0x2c306 <__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; 2c3b4: 9c 01 movw r18, r24 2c3b6: 36 95 lsr r19 2c3b8: 27 95 ror r18 2c3ba: 2c 7f andi r18, 0xFC ; 252 2c3bc: 26 52 subi r18, 0x26 ; 38 2c3be: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c3c0: f9 01 movw r30, r18 2c3c2: 45 91 lpm r20, Z+ 2c3c4: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c3c6: f9 01 movw r30, r18 2c3c8: 32 96 adiw r30, 0x02 ; 2 2c3ca: 65 91 lpm r22, Z+ 2c3cc: 74 91 lpm r23, Z 2c3ce: 87 70 andi r24, 0x07 ; 7 2c3d0: 99 27 eor r25, r25 2c3d2: 86 9f mul r24, r22 2c3d4: 90 01 movw r18, r0 2c3d6: 87 9f mul r24, r23 2c3d8: 30 0d add r19, r0 2c3da: 96 9f mul r25, r22 2c3dc: 30 0d add r19, r0 2c3de: 11 24 eor r1, r1 2c3e0: a3 e0 ldi r26, 0x03 ; 3 2c3e2: 36 95 lsr r19 2c3e4: 27 95 ror r18 2c3e6: aa 95 dec r26 2c3e8: e1 f7 brne .-8 ; 0x2c3e2 <__vector_17+0x10ac> 2c3ea: ca 01 movw r24, r20 2c3ec: 82 1b sub r24, r18 2c3ee: 93 0b sbc r25, r19 2c3f0: aa cf rjmp .-172 ; 0x2c346 <__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; 2c3f2: de 01 movw r26, r28 2c3f4: a3 5b subi r26, 0xB3 ; 179 2c3f6: bf 4f sbci r27, 0xFF ; 255 2c3f8: 4d 91 ld r20, X+ 2c3fa: 5c 91 ld r21, X 2c3fc: 11 97 sbiw r26, 0x01 ; 1 2c3fe: 70 e0 ldi r23, 0x00 ; 0 2c400: 60 e0 ldi r22, 0x00 ; 0 2c402: 40 93 70 05 sts 0x0570, r20 ; 0x800570 2c406: 50 93 71 05 sts 0x0571, r21 ; 0x800571 2c40a: 60 93 72 05 sts 0x0572, r22 ; 0x800572 2c40e: 70 93 73 05 sts 0x0573, r23 ; 0x800573 e_step_loops = current_block->advance_step_loops; 2c412: 16 96 adiw r26, 0x06 ; 6 2c414: 9c 91 ld r25, X 2c416: 90 93 6f 05 sts 0x056F, r25 ; 0x80056f if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 2c41a: 98 2f mov r25, r24 2c41c: 92 70 andi r25, 0x02 ; 2 2c41e: 09 f4 brne .+2 ; 0x2c422 <__vector_17+0x10ec> 2c420: cb cd rjmp .-1130 ; 0x2bfb8 <__vector_17+0xc82> 2c422: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2c426: 99 23 and r25, r25 2c428: 09 f4 brne .+2 ; 0x2c42c <__vector_17+0x10f6> 2c42a: c6 cd rjmp .-1140 ; 0x2bfb8 <__vector_17+0xc82> 2c42c: 2e 17 cp r18, r30 2c42e: 3f 07 cpc r19, r31 2c430: 08 f0 brcs .+2 ; 0x2c434 <__vector_17+0x10fe> 2c432: c2 cd rjmp .-1148 ; 0x2bfb8 <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2c434: 44 0f add r20, r20 2c436: 55 1f adc r21, r21 2c438: 66 1f adc r22, r22 2c43a: 77 1f adc r23, r23 2c43c: 40 93 70 05 sts 0x0570, r20 ; 0x800570 2c440: 50 93 71 05 sts 0x0571, r21 ; 0x800571 2c444: 60 93 72 05 sts 0x0572, r22 ; 0x800572 2c448: 70 93 73 05 sts 0x0573, r23 ; 0x800573 LA_phase = 0; 2c44c: 10 92 8f 05 sts 0x058F, r1 ; 0x80058f 2c450: b3 cd rjmp .-1178 ; 0x2bfb8 <__vector_17+0xc82> 2c452: 80 93 70 05 sts 0x0570, r24 ; 0x800570 2c456: 90 93 71 05 sts 0x0571, r25 ; 0x800571 2c45a: a0 93 72 05 sts 0x0572, r26 ; 0x800572 2c45e: b0 93 73 05 sts 0x0573, r27 ; 0x800573 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 2c462: 61 11 cpse r22, r1 2c464: 1b c0 rjmp .+54 ; 0x2c49c <__vector_17+0x1166> { eISR_Rate = timer; 2c466: f0 93 6e 05 sts 0x056E, r31 ; 0x80056e 2c46a: e0 93 6d 05 sts 0x056D, r30 ; 0x80056d nextAdvanceISR = timer; 2c46e: f0 93 e4 04 sts 0x04E4, r31 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2c472: e0 93 e3 04 sts 0x04E3, r30 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 2c476: 80 91 8f 05 lds r24, 0x058F ; 0x80058f 2c47a: 87 fd sbrc r24, 7 2c47c: 58 c0 rjmp .+176 ; 0x2c52e <__vector_17+0x11f8> if (step_loops == e_step_loops) 2c47e: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2c482: 10 91 6f 05 lds r17, 0x056F ; 0x80056f 2c486: 28 81 ld r18, Y 2c488: 39 81 ldd r19, Y+1 ; 0x01 2c48a: 81 13 cpse r24, r17 2c48c: 35 c0 rjmp .+106 ; 0x2c4f8 <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 2c48e: 81 e0 ldi r24, 0x01 ; 1 2c490: 2e 17 cp r18, r30 2c492: 3f 07 cpc r19, r31 2c494: 08 f4 brcc .+2 ; 0x2c498 <__vector_17+0x1162> 2c496: 49 c0 rjmp .+146 ; 0x2c52a <__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); 2c498: 80 e0 ldi r24, 0x00 ; 0 2c49a: 47 c0 rjmp .+142 ; 0x2c52a <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 2c49c: 64 30 cpi r22, 0x04 ; 4 2c49e: 28 f5 brcc .+74 ; 0x2c4ea <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 2c4a0: 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); 2c4a2: 63 30 cpi r22, 0x03 ; 3 2c4a4: a9 f0 breq .+42 ; 0x2c4d0 <__vector_17+0x119a> 2c4a6: 66 95 lsr r22 2c4a8: af 01 movw r20, r30 2c4aa: 02 c0 rjmp .+4 ; 0x2c4b0 <__vector_17+0x117a> 2c4ac: 56 95 lsr r21 2c4ae: 47 95 ror r20 2c4b0: 6a 95 dec r22 2c4b2: e2 f7 brpl .-8 ; 0x2c4ac <__vector_17+0x1176> 2c4b4: 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); 2c4b6: 70 93 6e 05 sts 0x056E, r23 ; 0x80056e 2c4ba: 60 93 6d 05 sts 0x056D, r22 ; 0x80056d } nextAdvanceISR = eISR_Rate; 2c4be: 80 91 6d 05 lds r24, 0x056D ; 0x80056d 2c4c2: 90 91 6e 05 lds r25, 0x056E ; 0x80056e 2c4c6: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2c4ca: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> 2c4ce: d3 cf rjmp .-90 ; 0x2c476 <__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; 2c4d0: 9f 01 movw r18, r30 2c4d2: ab ea ldi r26, 0xAB ; 171 2c4d4: ba ea ldi r27, 0xAA ; 170 2c4d6: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 2c4da: 41 e1 ldi r20, 0x11 ; 17 2c4dc: 96 95 lsr r25 2c4de: 87 95 ror r24 2c4e0: 77 95 ror r23 2c4e2: 67 95 ror r22 2c4e4: 4a 95 dec r20 2c4e6: d1 f7 brne .-12 ; 0x2c4dc <__vector_17+0x11a6> 2c4e8: e6 cf rjmp .-52 ; 0x2c4b6 <__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); 2c4ea: 70 e0 ldi r23, 0x00 ; 0 2c4ec: 6f 5f subi r22, 0xFF ; 255 2c4ee: 7f 4f sbci r23, 0xFF ; 255 2c4f0: cf 01 movw r24, r30 2c4f2: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 2c4f6: df cf rjmp .-66 ; 0x2c4b6 <__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); 2c4f8: 83 30 cpi r24, 0x03 ; 3 2c4fa: 09 f4 brne .+2 ; 0x2c4fe <__vector_17+0x11c8> 2c4fc: cf c0 rjmp .+414 ; 0x2c69c <__vector_17+0x1366> 2c4fe: 86 95 lsr r24 2c500: a9 01 movw r20, r18 2c502: 02 c0 rjmp .+4 ; 0x2c508 <__vector_17+0x11d2> 2c504: 56 95 lsr r21 2c506: 47 95 ror r20 2c508: 8a 95 dec r24 2c50a: e2 f7 brpl .-8 ; 0x2c504 <__vector_17+0x11ce> 2c50c: 13 30 cpi r17, 0x03 ; 3 2c50e: 09 f4 brne .+2 ; 0x2c512 <__vector_17+0x11dc> 2c510: d3 c0 rjmp .+422 ; 0x2c6b8 <__vector_17+0x1382> 2c512: 16 95 lsr r17 2c514: bf 01 movw r22, r30 2c516: 02 c0 rjmp .+4 ; 0x2c51c <__vector_17+0x11e6> 2c518: 76 95 lsr r23 2c51a: 67 95 ror r22 2c51c: 1a 95 dec r17 2c51e: e2 f7 brpl .-8 ; 0x2c518 <__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); 2c520: 81 e0 ldi r24, 0x01 ; 1 2c522: 46 17 cp r20, r22 2c524: 57 07 cpc r21, r23 2c526: 08 f0 brcs .+2 ; 0x2c52a <__vector_17+0x11f4> 2c528: b7 cf rjmp .-146 ; 0x2c498 <__vector_17+0x1162> 2c52a: 80 93 8f 05 sts 0x058F, r24 ; 0x80058f } } // Check for serial chars. This executes roughtly inbetween 50-60% of the total runtime of the // entire isr, making this spot a much better choice than checking during esteps MSerial.checkRx(); 2c52e: 0f 94 2f 22 call 0x2445e ; 0x2445e #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 2c532: 40 91 7a 05 lds r20, 0x057A ; 0x80057a 2c536: 50 91 7b 05 lds r21, 0x057B ; 0x80057b 2c53a: 60 91 7c 05 lds r22, 0x057C ; 0x80057c 2c53e: 70 91 7d 05 lds r23, 0x057D ; 0x80057d 2c542: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2c546: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2c54a: 80 89 ldd r24, Z+16 ; 0x10 2c54c: 91 89 ldd r25, Z+17 ; 0x11 2c54e: a2 89 ldd r26, Z+18 ; 0x12 2c550: b3 89 ldd r27, Z+19 ; 0x13 2c552: 48 17 cp r20, r24 2c554: 59 07 cpc r21, r25 2c556: 6a 07 cpc r22, r26 2c558: 7b 07 cpc r23, r27 2c55a: 80 f0 brcs .+32 ; 0x2c57c <__vector_17+0x1246> current_block = NULL; 2c55c: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 2c560: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f extern volatile uint8_t block_buffer_tail; // Called when the current block is no longer needed. Discards the block and makes the memory // available for new blocks. FORCE_INLINE void plan_discard_current_block() { if (block_buffer_head != block_buffer_tail) { 2c564: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2c568: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 2c56c: 98 17 cp r25, r24 2c56e: 31 f0 breq .+12 ; 0x2c57c <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c570: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 2c574: 8f 5f subi r24, 0xFF ; 255 2c576: 8f 70 andi r24, 0x0F ; 15 2c578: 80 93 54 0e sts 0x0E54, r24 ; 0x800e54 return mask; } void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) 2c57c: 80 91 69 06 lds r24, 0x0669 ; 0x800669 2c580: 81 30 cpi r24, 0x01 ; 1 2c582: 49 f1 breq .+82 ; 0x2c5d6 <__vector_17+0x12a0> 2c584: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2c588: 88 23 and r24, r24 2c58a: 29 f1 breq .+74 ; 0x2c5d6 <__vector_17+0x12a0> 2c58c: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 2c590: 81 11 cpse r24, r1 2c592: 21 c0 rjmp .+66 ; 0x2c5d6 <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 2c594: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c598: 81 e0 ldi r24, 0x01 ; 1 2c59a: 29 2f mov r18, r25 2c59c: 24 70 andi r18, 0x04 ; 4 2c59e: 92 fd sbrc r25, 2 2c5a0: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 2c5a2: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c5a6: 82 60 ori r24, 0x02 ; 2 2c5a8: 97 ff sbrs r25, 7 2c5aa: 03 c0 rjmp .+6 ; 0x2c5b2 <__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) { 2c5ac: 21 11 cpse r18, r1 2c5ae: 13 c0 rjmp .+38 ; 0x2c5d6 <__vector_17+0x12a0> 2c5b0: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 2c5b2: 80 93 0d 05 sts 0x050D, r24 ; 0x80050d tmc2130_sg_stop_on_crash = false; 2c5b6: 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 2c5ba: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.496+0x8> 2c5be: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.496+0x9> 2c5c2: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.496+0xa> 2c5c6: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.496+0xb> 2c5ca: 20 e0 ldi r18, 0x00 ; 0 2c5cc: 30 e0 ldi r19, 0x00 ; 0 2c5ce: 40 e8 ldi r20, 0x80 ; 128 2c5d0: 5f eb ldi r21, 0xBF ; 191 2c5d2: 0e 94 7b 8a call 0x114f6 ; 0x114f6 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c5d6: 60 91 e3 04 lds r22, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> 2c5da: 70 91 e4 04 lds r23, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> if (eisr) 2c5de: 61 15 cp r22, r1 2c5e0: 71 05 cpc r23, r1 2c5e2: 09 f0 breq .+2 ; 0x2c5e6 <__vector_17+0x12b0> 2c5e4: 46 c0 rjmp .+140 ; 0x2c672 <__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) { 2c5e6: 40 91 df 04 lds r20, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2c5ea: 50 91 e0 04 lds r21, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2c5ee: 20 91 91 05 lds r18, 0x0591 ; 0x800591 2c5f2: 30 91 92 05 lds r19, 0x0592 ; 0x800592 2c5f6: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2c5fa: 24 17 cp r18, r20 2c5fc: 35 07 cpc r19, r21 2c5fe: 08 f0 brcs .+2 ; 0x2c602 <__vector_17+0x12cc> 2c600: 6c c0 rjmp .+216 ; 0x2c6da <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 2c602: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c606: 91 30 cpi r25, 0x01 ; 1 2c608: 41 f0 breq .+16 ; 0x2c61a <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 2c60a: 42 1b sub r20, r18 2c60c: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 2c60e: 94 17 cp r25, r20 2c610: 15 06 cpc r1, r21 2c612: 19 f0 breq .+6 ; 0x2c61a <__vector_17+0x12e4> 2c614: 10 f0 brcs .+4 ; 0x2c61a <__vector_17+0x12e4> e_step_loops = d_steps; 2c616: 40 93 6f 05 sts 0x056F, r20 ; 0x80056f } e_steps -= e_step_loops; 2c61a: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c61e: 89 1b sub r24, r25 2c620: 80 93 90 05 sts 0x0590, r24 ; 0x800590 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c624: 88 23 and r24, r24 2c626: 39 f0 breq .+14 ; 0x2c636 <__vector_17+0x1300> 2c628: 87 fd sbrc r24, 7 2c62a: 53 c0 rjmp .+166 ; 0x2c6d2 <__vector_17+0x139c> 2c62c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c630: 80 64 ori r24, 0x40 ; 64 2c632: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 2c636: 20 91 6f 05 lds r18, 0x056F ; 0x80056f 2c63a: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2c63e: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2c642: 82 1b sub r24, r18 2c644: 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; 2c646: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2c64a: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> } if (current_adv_steps == target_adv_steps) { 2c64e: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2c652: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2c656: 80 91 91 05 lds r24, 0x0591 ; 0x800591 2c65a: 90 91 92 05 lds r25, 0x0592 ; 0x800592 2c65e: 28 17 cp r18, r24 2c660: 39 07 cpc r19, r25 2c662: 09 f0 breq .+2 ; 0x2c666 <__vector_17+0x1330> 2c664: 66 c0 rjmp .+204 ; 0x2c732 <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 2c666: 8f ef ldi r24, 0xFF ; 255 2c668: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c66a: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2c66e: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c672: 40 91 90 05 lds r20, 0x0590 ; 0x800590 2c676: 41 11 cpse r20, r1 2c678: 61 c0 rjmp .+194 ; 0x2c73c <__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) 2c67a: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> 2c67e: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 2c682: 20 91 e5 04 lds r18, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.491> 2c686: 30 91 e6 04 lds r19, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.491+0x1> 2c68a: 8f 3f cpi r24, 0xFF ; 255 2c68c: 98 07 cpc r25, r24 2c68e: 09 f0 breq .+2 ; 0x2c692 <__vector_17+0x135c> 2c690: 88 c0 rjmp .+272 ; 0x2c7a2 <__vector_17+0x146c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 2c692: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c696: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c69a: 8e c0 rjmp .+284 ; 0x2c7b8 <__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; 2c69c: ab ea ldi r26, 0xAB ; 171 2c69e: ba ea ldi r27, 0xAA ; 170 2c6a0: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 2c6a4: ab 01 movw r20, r22 2c6a6: bc 01 movw r22, r24 2c6a8: 31 e1 ldi r19, 0x11 ; 17 2c6aa: 76 95 lsr r23 2c6ac: 67 95 ror r22 2c6ae: 57 95 ror r21 2c6b0: 47 95 ror r20 2c6b2: 3a 95 dec r19 2c6b4: d1 f7 brne .-12 ; 0x2c6aa <__vector_17+0x1374> 2c6b6: 2a cf rjmp .-428 ; 0x2c50c <__vector_17+0x11d6> 2c6b8: 9f 01 movw r18, r30 2c6ba: ab ea ldi r26, 0xAB ; 171 2c6bc: ba ea ldi r27, 0xAA ; 170 2c6be: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 2c6c2: 21 e1 ldi r18, 0x11 ; 17 2c6c4: 96 95 lsr r25 2c6c6: 87 95 ror r24 2c6c8: 77 95 ror r23 2c6ca: 67 95 ror r22 2c6cc: 2a 95 dec r18 2c6ce: d1 f7 brne .-12 ; 0x2c6c4 <__vector_17+0x138e> 2c6d0: 27 cf rjmp .-434 ; 0x2c520 <__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); 2c6d2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c6d6: 8f 7b andi r24, 0xBF ; 191 2c6d8: ac cf rjmp .-168 ; 0x2c632 <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 2c6da: 42 17 cp r20, r18 2c6dc: 53 07 cpc r21, r19 2c6de: 08 f0 brcs .+2 ; 0x2c6e2 <__vector_17+0x13ac> 2c6e0: b6 cf rjmp .-148 ; 0x2c64e <__vector_17+0x1318> // compression if (e_step_loops != 1) { 2c6e2: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c6e6: 91 30 cpi r25, 0x01 ; 1 2c6e8: 41 f0 breq .+16 ; 0x2c6fa <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 2c6ea: 24 1b sub r18, r20 2c6ec: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 2c6ee: 92 17 cp r25, r18 2c6f0: 13 06 cpc r1, r19 2c6f2: 19 f0 breq .+6 ; 0x2c6fa <__vector_17+0x13c4> 2c6f4: 10 f0 brcs .+4 ; 0x2c6fa <__vector_17+0x13c4> e_step_loops = d_steps; 2c6f6: 20 93 6f 05 sts 0x056F, r18 ; 0x80056f } e_steps += e_step_loops; 2c6fa: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c6fe: 89 0f add r24, r25 2c700: 80 93 90 05 sts 0x0590, r24 ; 0x800590 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c704: 88 23 and r24, r24 2c706: 39 f0 breq .+14 ; 0x2c716 <__vector_17+0x13e0> 2c708: 87 fd sbrc r24, 7 2c70a: 0f c0 rjmp .+30 ; 0x2c72a <__vector_17+0x13f4> 2c70c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c710: 80 64 ori r24, 0x40 ; 64 2c712: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 2c716: 80 91 6f 05 lds r24, 0x056F ; 0x80056f 2c71a: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> 2c71e: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 2c722: 82 0f add r24, r18 2c724: 93 2f mov r25, r19 2c726: 91 1d adc r25, r1 2c728: 8e cf rjmp .-228 ; 0x2c646 <__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); 2c72a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c72e: 8f 7b andi r24, 0xBF ; 191 2c730: f0 cf rjmp .-32 ; 0x2c712 <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c732: 80 91 6d 05 lds r24, 0x056D ; 0x80056d 2c736: 90 91 6e 05 lds r25, 0x056E ; 0x80056e 2c73a: 97 cf rjmp .-210 ; 0x2c66a <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c73c: 80 91 8f 05 lds r24, 0x058F ; 0x80058f 2c740: 87 fd sbrc r24, 7 2c742: 0e c0 rjmp .+28 ; 0x2c760 <__vector_17+0x142a> 2c744: 08 2e mov r0, r24 2c746: 00 0c add r0, r0 2c748: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c74a: 21 e0 ldi r18, 0x01 ; 1 2c74c: 30 e0 ldi r19, 0x00 ; 0 2c74e: 61 15 cp r22, r1 2c750: 71 05 cpc r23, r1 2c752: 11 f0 breq .+4 ; 0x2c758 <__vector_17+0x1422> 2c754: 30 e0 ldi r19, 0x00 ; 0 2c756: 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)) { 2c758: 82 17 cp r24, r18 2c75a: 93 07 cpc r25, r19 2c75c: 09 f0 breq .+2 ; 0x2c760 <__vector_17+0x142a> 2c75e: 8d cf rjmp .-230 ; 0x2c67a <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 2c760: 20 91 6f 05 lds r18, 0x056F ; 0x80056f 2c764: 67 2b or r22, r23 2c766: 11 f0 breq .+4 ; 0x2c76c <__vector_17+0x1436> 2c768: 20 91 97 05 lds r18, 0x0597 ; 0x800597 max_ticks = min(abs(e_steps), max_ticks); 2c76c: 84 2f mov r24, r20 2c76e: 04 2e mov r0, r20 2c770: 00 0c add r0, r0 2c772: 99 0b sbc r25, r25 2c774: 97 ff sbrs r25, 7 2c776: 03 c0 rjmp .+6 ; 0x2c77e <__vector_17+0x1448> 2c778: 91 95 neg r25 2c77a: 81 95 neg r24 2c77c: 91 09 sbc r25, r1 2c77e: 30 e0 ldi r19, 0x00 ; 0 2c780: 28 17 cp r18, r24 2c782: 39 07 cpc r19, r25 2c784: 0c f4 brge .+2 ; 0x2c788 <__vector_17+0x1452> 2c786: c9 01 movw r24, r18 2c788: 21 e0 ldi r18, 0x01 ; 1 2c78a: 47 ff sbrs r20, 7 2c78c: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 2c78e: 38 e0 ldi r19, 0x08 ; 8 2c790: 36 b9 out 0x06, r19 ; 6 e_steps += (rev? 1: -1); 2c792: 90 91 90 05 lds r25, 0x0590 ; 0x800590 2c796: 92 0f add r25, r18 2c798: 90 93 90 05 sts 0x0590, r25 ; 0x800590 STEP_NC_LO(E_AXIS); #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.stStep(rev); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } while(--max_ticks); 2c79c: 81 50 subi r24, 0x01 ; 1 2c79e: c1 f7 brne .-16 ; 0x2c790 <__vector_17+0x145a> 2c7a0: 6c cf rjmp .-296 ; 0x2c67a <__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) 2c7a2: ac 01 movw r20, r24 2c7a4: 48 5d subi r20, 0xD8 ; 216 2c7a6: 5f 4f sbci r21, 0xFF ; 255 2c7a8: 42 17 cp r20, r18 2c7aa: 53 07 cpc r21, r19 2c7ac: 08 f0 brcs .+2 ; 0x2c7b0 <__vector_17+0x147a> 2c7ae: 71 cf rjmp .-286 ; 0x2c692 <__vector_17+0x135c> OCR1A = nextAdvanceISR; 2c7b0: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c7b4: 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) { 2c7b8: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c7bc: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c7c0: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c7c4: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c7c8: 40 96 adiw r24, 0x10 ; 16 2c7ca: 28 17 cp r18, r24 2c7cc: 39 07 cpc r19, r25 2c7ce: 48 f4 brcc .+18 ; 0x2c7e2 <__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; 2c7d0: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c7d4: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c7d8: 40 96 adiw r24, 0x10 ; 16 2c7da: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c7de: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 2c7e2: ff 91 pop r31 2c7e4: ef 91 pop r30 2c7e6: df 91 pop r29 2c7e8: cf 91 pop r28 2c7ea: bf 91 pop r27 2c7ec: af 91 pop r26 2c7ee: 9f 91 pop r25 2c7f0: 8f 91 pop r24 2c7f2: 7f 91 pop r23 2c7f4: 6f 91 pop r22 2c7f6: 5f 91 pop r21 2c7f8: 4f 91 pop r20 2c7fa: 3f 91 pop r19 2c7fc: 2f 91 pop r18 2c7fe: 1f 91 pop r17 2c800: 0f 91 pop r16 2c802: ff 90 pop r15 2c804: ef 90 pop r14 2c806: df 90 pop r13 2c808: cf 90 pop r12 2c80a: 8f 90 pop r8 2c80c: 7f 90 pop r7 2c80e: 6f 90 pop r6 2c810: 0f 90 pop r0 2c812: 0b be out 0x3b, r0 ; 59 2c814: 0f 90 pop r0 2c816: 0f be out 0x3f, r0 ; 63 2c818: 0f 90 pop r0 2c81a: 1f 90 pop r1 2c81c: 18 95 reti 0002c81e : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 2c81e: 90 91 76 05 lds r25, 0x0576 ; 0x800576 check_z_endstop = check; 2c822: 80 93 76 05 sts 0x0576, r24 ; 0x800576 CRITICAL_SECTION_START; 2c826: 2f b7 in r18, 0x3f ; 63 2c828: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c82a: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.495> 2c82e: 8b 7f andi r24, 0xFB ; 251 2c830: 80 93 0b 05 sts 0x050B, r24 ; 0x80050b <_ZL11endstop_hit.lto_priv.495> CRITICAL_SECTION_END; 2c834: 2f bf out 0x3f, r18 ; 63 return old; } 2c836: 89 2f mov r24, r25 2c838: 08 95 ret 0002c83a : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 2c83a: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.495> CRITICAL_SECTION_START; 2c83e: 2f b7 in r18, 0x3f ; 63 2c840: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c842: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.495> 2c846: 9b 7f andi r25, 0xFB ; 251 2c848: 90 93 0b 05 sts 0x050B, r25 ; 0x80050b <_ZL11endstop_hit.lto_priv.495> CRITICAL_SECTION_END; 2c84c: 2f bf out 0x3f, r18 ; 63 return hit; } 2c84e: 82 fb bst r24, 2 2c850: 88 27 eor r24, r24 2c852: 80 f9 bld r24, 0 2c854: 08 95 ret 0002c856 : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 2c856: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.495> endstop_hit = 0; 2c85a: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.495> return old; 2c85e: 81 e0 ldi r24, 0x01 ; 1 2c860: 91 11 cpse r25, r1 2c862: 01 c0 rjmp .+2 ; 0x2c866 2c864: 80 e0 ldi r24, 0x00 ; 0 } 2c866: 08 95 ret 0002c868 : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 2c868: 90 91 de 04 lds r25, 0x04DE ; 0x8004de 2c86c: 91 30 cpi r25, 0x01 ; 1 2c86e: a1 f0 breq .+40 ; 0x2c898 2c870: 28 f0 brcs .+10 ; 0x2c87c 2c872: 92 30 cpi r25, 0x02 ; 2 2c874: a9 f0 breq .+42 ; 0x2c8a0 2c876: 93 30 cpi r25, 0x03 ; 3 2c878: c1 f0 breq .+48 ; 0x2c8aa 2c87a: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 2c87c: 81 11 cpse r24, r1 2c87e: 02 c0 rjmp .+4 ; 0x2c884 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(); 2c880: 0d 94 97 22 jmp 0x2452e ; 0x2452e switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c884: 82 30 cpi r24, 0x02 ; 2 2c886: 11 f4 brne .+4 ; 0x2c88c break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 2c888: 0d 94 76 32 jmp 0x264ec ; 0x264ec 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) 2c88c: 85 30 cpi r24, 0x05 ; 5 2c88e: 09 f0 breq .+2 ; 0x2c892 2c890: 50 c0 rjmp .+160 ; 0x2c932 Sound_DoSound_Alert(false); 2c892: 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); 2c894: 0d 94 75 22 jmp 0x244ea ; 0x244ea 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) 2c898: 88 23 and r24, r24 2c89a: 91 f3 breq .-28 ; 0x2c880 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c89c: 82 30 cpi r24, 0x02 ; 2 2c89e: a1 f3 breq .-24 ; 0x2c888 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c8a0: 85 30 cpi r24, 0x05 ; 5 2c8a2: 09 f0 breq .+2 ; 0x2c8a6 2c8a4: 46 c0 rjmp .+140 ; 0x2c932 Sound_DoSound_Alert(true); 2c8a6: 81 e0 ldi r24, 0x01 ; 1 2c8a8: f5 cf rjmp .-22 ; 0x2c894 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) 2c8aa: 88 23 and r24, r24 2c8ac: 49 f3 breq .-46 ; 0x2c880 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c8ae: 82 30 cpi r24, 0x02 ; 2 2c8b0: 59 f3 breq .-42 ; 0x2c888 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c8b2: 85 30 cpi r24, 0x05 ; 5 2c8b4: 71 f3 breq .-36 ; 0x2c892 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 2c8b6: 86 30 cpi r24, 0x06 ; 6 2c8b8: e1 f4 brne .+56 ; 0x2c8f2 2c8ba: 85 e0 ldi r24, 0x05 ; 5 2c8bc: 27 e2 ldi r18, 0x27 ; 39 2c8be: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 2c8c0: 4f b7 in r20, 0x3f ; 63 2c8c2: f8 94 cli 2c8c4: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c8c8: 94 60 ori r25, 0x04 ; 4 2c8ca: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c8ce: 4f bf out 0x3f, r20 ; 63 2c8d0: f9 01 movw r30, r18 2c8d2: 31 97 sbiw r30, 0x01 ; 1 2c8d4: f1 f7 brne .-4 ; 0x2c8d2 delayMicroseconds(75); WRITE(BEEPER,LOW); 2c8d6: 4f b7 in r20, 0x3f ; 63 2c8d8: f8 94 cli 2c8da: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c8de: 9b 7f andi r25, 0xFB ; 251 2c8e0: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c8e4: 4f bf out 0x3f, r20 ; 63 2c8e6: f9 01 movw r30, r18 2c8e8: 31 97 sbiw r30, 0x01 ; 1 2c8ea: f1 f7 brne .-4 ; 0x2c8e8 2c8ec: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 2c8ee: 41 f7 brne .-48 ; 0x2c8c0 2c8f0: 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) 2c8f2: 87 30 cpi r24, 0x07 ; 7 2c8f4: f1 f4 brne .+60 ; 0x2c932 } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 2c8f6: 81 e0 ldi r24, 0x01 ; 1 2c8f8: 0e 94 b1 8b call 0x11762 ; 0x11762 2c8fc: 84 e1 ldi r24, 0x14 ; 20 2c8fe: 23 e7 ldi r18, 0x73 ; 115 2c900: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 2c902: 4f b7 in r20, 0x3f ; 63 2c904: f8 94 cli 2c906: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c90a: 94 60 ori r25, 0x04 ; 4 2c90c: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c910: 4f bf out 0x3f, r20 ; 63 2c912: f9 01 movw r30, r18 2c914: 31 97 sbiw r30, 0x01 ; 1 2c916: f1 f7 brne .-4 ; 0x2c914 delayMicroseconds(94); WRITE(BEEPER,LOW); 2c918: 4f b7 in r20, 0x3f ; 63 2c91a: f8 94 cli 2c91c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c920: 9b 7f andi r25, 0xFB ; 251 2c922: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c926: 4f bf out 0x3f, r20 ; 63 2c928: f9 01 movw r30, r18 2c92a: 31 97 sbiw r30, 0x01 ; 1 2c92c: f1 f7 brne .-4 ; 0x2c92a 2c92e: 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++) 2c930: 41 f7 brne .-48 ; 0x2c902 Sound_DoSound_Blind_Alert(); break; default: break; } } 2c932: 08 95 ret 0002c934 : //! @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 ) { 2c934: 2f 92 push r2 2c936: 3f 92 push r3 2c938: 4f 92 push r4 2c93a: 5f 92 push r5 2c93c: 6f 92 push r6 2c93e: 7f 92 push r7 2c940: 8f 92 push r8 2c942: 9f 92 push r9 2c944: af 92 push r10 2c946: bf 92 push r11 2c948: cf 92 push r12 2c94a: df 92 push r13 2c94c: ef 92 push r14 2c94e: ff 92 push r15 2c950: 0f 93 push r16 2c952: 1f 93 push r17 2c954: cf 93 push r28 2c956: df 93 push r29 2c958: 00 d0 rcall .+0 ; 0x2c95a 2c95a: 00 d0 rcall .+0 ; 0x2c95c 2c95c: cd b7 in r28, 0x3d ; 61 2c95e: de b7 in r29, 0x3e ; 62 2c960: 5c 01 movw r10, r24 2c962: 6c 83 std Y+4, r22 ; 0x04 2c964: 34 2e mov r3, r20 2c966: 3b 83 std Y+3, r19 ; 0x03 2c968: 2a 83 std Y+2, r18 ; 0x02 2c96a: 48 01 movw r8, r16 2c96c: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 2c96e: 00 97 sbiw r24, 0x00 ; 0 2c970: 09 f0 breq .+2 ; 0x2c974 2c972: 51 c0 rjmp .+162 ; 0x2ca16 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); 2c974: 87 01 movw r16, r14 2c976: 22 2d mov r18, r2 2c978: a4 01 movw r20, r8 2c97a: 6a 81 ldd r22, Y+2 ; 0x02 2c97c: 7b 81 ldd r23, Y+3 ; 0x03 2c97e: 83 2d mov r24, r3 2c980: 0f 94 04 35 call 0x26a08 ; 0x26a08 2c984: d1 2c mov r13, r1 2c986: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 2c988: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2c98c: 2b 01 movw r4, r22 2c98e: 3c 01 movw r6, r24 lcd_consume_click(); 2c990: 0e 94 be 71 call 0xe37c ; 0xe37c KEEPALIVE_STATE(PAUSED_FOR_USER); 2c994: 84 e0 ldi r24, 0x04 ; 4 2c996: 80 93 96 02 sts 0x0296, r24 ; 0x800296 2c99a: de 82 std Y+6, r13 ; 0x06 2c99c: cd 82 std Y+5, r12 ; 0x05 2c99e: 24 e6 ldi r18, 0x64 ; 100 2c9a0: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 2c9a2: 82 e3 ldi r24, 0x32 ; 50 2c9a4: 90 e0 ldi r25, 0x00 ; 0 2c9a6: 0e 94 98 8e call 0x11d30 ; 0x11d30 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 2c9aa: 3c 81 ldd r19, Y+4 ; 0x04 2c9ac: 31 11 cpse r19, r1 2c9ae: 3a c0 rjmp .+116 ; 0x2ca24 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 2c9b0: 80 91 34 05 lds r24, 0x0534 ; 0x800534 2c9b4: 90 91 35 05 lds r25, 0x0535 ; 0x800535 2c9b8: 00 97 sbiw r24, 0x00 ; 0 2c9ba: 09 f0 breq .+2 ; 0x2c9be 2c9bc: 42 c0 rjmp .+132 ; 0x2ca42 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 2c9be: 0e 94 c3 71 call 0xe386 ; 0xe386 2c9c2: 88 23 and r24, r24 2c9c4: 09 f4 brne .+2 ; 0x2c9c8 2c9c6: 67 c0 rjmp .+206 ; 0x2ca96 if (msg_next == NULL) { 2c9c8: 8d 81 ldd r24, Y+5 ; 0x05 2c9ca: 9e 81 ldd r25, Y+6 ; 0x06 2c9cc: 89 2b or r24, r25 2c9ce: 09 f0 breq .+2 ; 0x2c9d2 2c9d0: 5e c0 rjmp .+188 ; 0x2ca8e if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 2c9d2: 82 e0 ldi r24, 0x02 ; 2 2c9d4: 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; 2c9d8: 91 e0 ldi r25, 0x01 ; 1 2c9da: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 2c9de: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 2c9e2: 83 2d mov r24, r3 2c9e4: 26 96 adiw r28, 0x06 ; 6 2c9e6: 0f b6 in r0, 0x3f ; 63 2c9e8: f8 94 cli 2c9ea: de bf out 0x3e, r29 ; 62 2c9ec: 0f be out 0x3f, r0 ; 63 2c9ee: cd bf out 0x3d, r28 ; 61 2c9f0: df 91 pop r29 2c9f2: cf 91 pop r28 2c9f4: 1f 91 pop r17 2c9f6: 0f 91 pop r16 2c9f8: ff 90 pop r15 2c9fa: ef 90 pop r14 2c9fc: df 90 pop r13 2c9fe: cf 90 pop r12 2ca00: bf 90 pop r11 2ca02: af 90 pop r10 2ca04: 9f 90 pop r9 2ca06: 8f 90 pop r8 2ca08: 7f 90 pop r7 2ca0a: 6f 90 pop r6 2ca0c: 5f 90 pop r5 2ca0e: 4f 90 pop r4 2ca10: 3f 90 pop r3 2ca12: 2f 90 pop r2 2ca14: 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; 2ca16: 0f 94 55 35 call 0x26aaa ; 0x26aaa 2ca1a: 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) { 2ca1c: 89 2b or r24, r25 2ca1e: 09 f0 breq .+2 ; 0x2ca22 2ca20: b3 cf rjmp .-154 ; 0x2c988 2ca22: a8 cf rjmp .-176 ; 0x2c974 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) { 2ca24: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2ca28: 64 19 sub r22, r4 2ca2a: 75 09 sbc r23, r5 2ca2c: 86 09 sbc r24, r6 2ca2e: 97 09 sbc r25, r7 2ca30: 61 33 cpi r22, 0x31 ; 49 2ca32: 75 47 sbci r23, 0x75 ; 117 2ca34: 81 05 cpc r24, r1 2ca36: 91 05 cpc r25, r1 2ca38: 08 f4 brcc .+2 ; 0x2ca3c 2ca3a: ba cf rjmp .-140 ; 0x2c9b0 current_selection = LCD_BUTTON_TIMEOUT; 2ca3c: 33 24 eor r3, r3 2ca3e: 3a 94 dec r3 2ca40: c8 cf rjmp .-112 ; 0x2c9d2 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 2ca42: 2d 81 ldd r18, Y+5 ; 0x05 2ca44: 3e 81 ldd r19, Y+6 ; 0x06 2ca46: 23 2b or r18, r19 2ca48: f9 f4 brne .+62 ; 0x2ca88 if (third_choice) { // third_choice is not nullptr, safe to dereference 2ca4a: e1 14 cp r14, r1 2ca4c: f1 04 cpc r15, r1 2ca4e: b1 f0 breq .+44 ; 0x2ca7c if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2ca50: 97 ff sbrs r25, 7 2ca52: 0f c0 rjmp .+30 ; 0x2ca72 2ca54: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 2ca56: 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); 2ca58: 87 01 movw r16, r14 2ca5a: 22 2d mov r18, r2 2ca5c: a4 01 movw r20, r8 2ca5e: 6a 81 ldd r22, Y+2 ; 0x02 2ca60: 7b 81 ldd r23, Y+3 ; 0x03 2ca62: 83 2d mov r24, r3 2ca64: 0f 94 04 35 call 0x26a08 ; 0x26a08 lcd_encoder = 0; 2ca68: 10 92 35 05 sts 0x0535, r1 ; 0x800535 2ca6c: 10 92 34 05 sts 0x0534, r1 ; 0x800534 2ca70: a6 cf rjmp .-180 ; 0x2c9be 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) { 2ca72: 32 e0 ldi r19, 0x02 ; 2 2ca74: 33 16 cp r3, r19 2ca76: 81 f3 breq .-32 ; 0x2ca58 // Rotating knob clockwise current_selection++; 2ca78: 33 94 inc r3 2ca7a: ee cf rjmp .-36 ; 0x2ca58 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2ca7c: 39 2e mov r3, r25 2ca7e: 30 94 com r3 2ca80: 33 1c adc r3, r3 2ca82: 33 24 eor r3, r3 2ca84: 33 1c adc r3, r3 2ca86: e8 cf rjmp .-48 ; 0x2ca58 } } 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); 2ca88: 87 e0 ldi r24, 0x07 ; 7 2ca8a: 0f 94 34 64 call 0x2c868 ; 0x2c868 goto exit; } else break; } } if (multi_screen) { 2ca8e: c1 14 cp r12, r1 2ca90: d1 04 cpc r13, r1 2ca92: 79 f4 brne .+30 ; 0x2cab2 2ca94: 84 cf rjmp .-248 ; 0x2c99e 2ca96: 99 81 ldd r25, Y+1 ; 0x01 2ca98: 91 50 subi r25, 0x01 ; 1 2ca9a: 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) { 2ca9c: 91 11 cpse r25, r1 2ca9e: 81 cf rjmp .-254 ; 0x2c9a2 goto exit; } else break; } } if (multi_screen) { 2caa0: c1 14 cp r12, r1 2caa2: d1 04 cpc r13, r1 2caa4: 61 f0 breq .+24 ; 0x2cabe if (msg_next == NULL) { 2caa6: 2d 81 ldd r18, Y+5 ; 0x05 2caa8: 3e 81 ldd r19, Y+6 ; 0x06 2caaa: 23 2b or r18, r19 2caac: 11 f4 brne .+4 ; 0x2cab2 2caae: be 82 std Y+6, r11 ; 0x06 2cab0: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 2cab2: 8d 81 ldd r24, Y+5 ; 0x05 2cab4: 9e 81 ldd r25, Y+6 ; 0x06 2cab6: 0f 94 55 35 call 0x26aaa ; 0x26aaa 2caba: 9e 83 std Y+6, r25 ; 0x06 2cabc: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 2cabe: 8d 81 ldd r24, Y+5 ; 0x05 2cac0: 9e 81 ldd r25, Y+6 ; 0x06 2cac2: 89 2b or r24, r25 2cac4: 09 f0 breq .+2 ; 0x2cac8 2cac6: 6b cf rjmp .-298 ; 0x2c99e lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 2cac8: 87 01 movw r16, r14 2caca: 22 2d mov r18, r2 2cacc: a4 01 movw r20, r8 2cace: 6a 81 ldd r22, Y+2 ; 0x02 2cad0: 7b 81 ldd r23, Y+3 ; 0x03 2cad2: 83 2d mov r24, r3 2cad4: 0f 94 04 35 call 0x26a08 ; 0x26a08 2cad8: 62 cf rjmp .-316 ; 0x2c99e 0002cada : //! @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) { 2cada: bf 92 push r11 2cadc: cf 92 push r12 2cade: df 92 push r13 2cae0: ef 92 push r14 2cae2: ff 92 push r15 2cae4: 0f 93 push r16 2cae6: 1f 93 push r17 2cae8: cf 93 push r28 2caea: df 93 push r29 2caec: ec 01 movw r28, r24 2caee: d6 2e mov r13, r22 2caf0: 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); 2caf2: 8a e3 ldi r24, 0x3A ; 58 2caf4: 9f e4 ldi r25, 0x4F ; 79 2caf6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cafa: 8c 01 movw r16, r24 2cafc: 8b ef ldi r24, 0xFB ; 251 2cafe: 96 e5 ldi r25, 0x56 ; 86 2cb00: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cb04: 2a e0 ldi r18, 0x0A ; 10 2cb06: c2 2e mov r12, r18 2cb08: f1 2c mov r15, r1 2cb0a: e1 2c mov r14, r1 2cb0c: 9c 01 movw r18, r24 2cb0e: 4b 2d mov r20, r11 2cb10: 6d 2d mov r22, r13 2cb12: ce 01 movw r24, r28 2cb14: 0f 94 9a 64 call 0x2c934 ; 0x2c934 } 2cb18: df 91 pop r29 2cb1a: cf 91 pop r28 2cb1c: 1f 91 pop r17 2cb1e: 0f 91 pop r16 2cb20: ff 90 pop r15 2cb22: ef 90 pop r14 2cb24: df 90 pop r13 2cb26: cf 90 pop r12 2cb28: bf 90 pop r11 2cb2a: 08 95 ret 0002cb2c : //! @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) { 2cb2c: bf 92 push r11 2cb2e: cf 92 push r12 2cb30: df 92 push r13 2cb32: ef 92 push r14 2cb34: ff 92 push r15 2cb36: 0f 93 push r16 2cb38: 1f 93 push r17 2cb3a: cf 93 push r28 2cb3c: df 93 push r29 2cb3e: ec 01 movw r28, r24 2cb40: d6 2e mov r13, r22 2cb42: 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); 2cb44: 8c e6 ldi r24, 0x6C ; 108 2cb46: 9d e3 ldi r25, 0x3D ; 61 2cb48: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cb4c: 8c 01 movw r16, r24 2cb4e: 86 e6 ldi r24, 0x66 ; 102 2cb50: 9d e3 ldi r25, 0x3D ; 61 2cb52: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cb56: 2a e0 ldi r18, 0x0A ; 10 2cb58: c2 2e mov r12, r18 2cb5a: f1 2c mov r15, r1 2cb5c: e1 2c mov r14, r1 2cb5e: 9c 01 movw r18, r24 2cb60: 4b 2d mov r20, r11 2cb62: 6d 2d mov r22, r13 2cb64: ce 01 movw r24, r28 2cb66: 0f 94 9a 64 call 0x2c934 ; 0x2c934 } 2cb6a: df 91 pop r29 2cb6c: cf 91 pop r28 2cb6e: 1f 91 pop r17 2cb70: 0f 91 pop r16 2cb72: ff 90 pop r15 2cb74: ef 90 pop r14 2cb76: df 90 pop r13 2cb78: cf 90 pop r12 2cb7a: bf 90 pop r11 2cb7c: 08 95 ret 0002cb7e : //! ---------------------- | ---------------- //! 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) { 2cb7e: af 92 push r10 2cb80: bf 92 push r11 2cb82: cf 92 push r12 2cb84: df 92 push r13 2cb86: ef 92 push r14 2cb88: ff 92 push r15 2cb8a: 0f 93 push r16 2cb8c: 1f 93 push r17 2cb8e: cf 93 push r28 2cb90: 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); 2cb92: 88 23 and r24, r24 2cb94: 29 f0 breq .+10 ; 0x2cba0 2cb96: 61 e0 ldi r22, 0x01 ; 1 2cb98: 8f e5 ldi r24, 0x5F ; 95 2cb9a: 9f e0 ldi r25, 0x0F ; 15 2cb9c: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 FORCE_BL_ON_START; 2cba0: 81 e0 ldi r24, 0x01 ; 1 2cba2: 0e 94 8d 8b call 0x1171a ; 0x1171a while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2cba6: 8b e8 ldi r24, 0x8B ; 139 2cba8: e8 2e mov r14, r24 2cbaa: 84 ea ldi r24, 0xA4 ; 164 2cbac: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cbae: 97 ed ldi r25, 0xD7 ; 215 2cbb0: c9 2e mov r12, r25 2cbb2: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2cbb4: 2c e3 ldi r18, 0x3C ; 60 2cbb6: a2 2e mov r10, r18 2cbb8: b1 2c mov r11, r1 2cbba: 0c 2f mov r16, r28 2cbbc: 10 e0 ldi r17, 0x00 ; 0 2cbbe: 1f 92 push r1 2cbc0: cf 93 push r28 2cbc2: ff 92 push r15 2cbc4: ef 92 push r14 2cbc6: 0f 94 08 dc call 0x3b810 ; 0x3b810 switch (state) { 2cbca: 0f 90 pop r0 2cbcc: 0f 90 pop r0 2cbce: 0f 90 pop r0 2cbd0: 0f 90 pop r0 2cbd2: cf 30 cpi r28, 0x0F ; 15 2cbd4: a0 f7 brcc .-24 ; 0x2cbbe 2cbd6: f8 01 movw r30, r16 2cbd8: 88 27 eor r24, r24 2cbda: ee 50 subi r30, 0x0E ; 14 2cbdc: fa 49 sbci r31, 0x9A ; 154 2cbde: 8e 4f sbci r24, 0xFE ; 254 2cbe0: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 2cbe4: 7e 39 cpi r23, 0x9E ; 158 2cbe6: 30 3b cpi r19, 0xB0 ; 176 2cbe8: fe 39 cpi r31, 0x9E ; 158 2cbea: 8e 39 cpi r24, 0x9E ; 158 2cbec: e4 3a cpi r30, 0xA4 ; 164 2cbee: 5a 3b cpi r21, 0xBA ; 186 2cbf0: fa 39 cpi r31, 0x9A ; 154 2cbf2: 74 3a cpi r23, 0xA4 ; 164 2cbf4: 92 3a cpi r25, 0xA2 ; 162 2cbf6: 0e 3b cpi r16, 0xBE ; 190 2cbf8: 10 3a cpi r17, 0xA0 ; 160 2cbfa: aa 3a cpi r26, 0xAA ; 170 2cbfc: c8 3a cpi r28, 0xA8 ; 168 2cbfe: b4 39 cpi r27, 0x94 ; 148 2cc00: b4 39 cpi r27, 0x94 ; 148 // 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; 2cc02: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 2cc06: 8f e5 ldi r24, 0x5F ; 95 2cc08: 9f e0 ldi r25, 0x0F ; 15 2cc0a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2cc0e: 82 30 cpi r24, 0x02 ; 2 2cc10: 39 f4 brne .+14 ; 0x2cc20 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 2cc12: 82 e1 ldi r24, 0x12 ; 18 2cc14: 96 e5 ldi r25, 0x56 ; 86 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 2cc16: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cc1a: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 2cc1e: 0f c0 rjmp .+30 ; 0x2cc3e // 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); 2cc20: 8d ea ldi r24, 0xAD ; 173 2cc22: 95 e5 ldi r25, 0x55 ; 85 2cc24: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cc28: 40 e0 ldi r20, 0x00 ; 0 2cc2a: 60 e0 ldi r22, 0x00 ; 0 2cc2c: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2cc30: 81 11 cpse r24, r1 2cc32: 07 c0 rjmp .+14 ; 0x2cc42 2cc34: 61 e0 ldi r22, 0x01 ; 1 2cc36: 8f e5 ldi r24, 0x5F ; 95 2cc38: 9f e0 ldi r25, 0x0F ; 15 2cc3a: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 2cc3e: c1 e0 ldi r28, 0x01 ; 1 2cc40: bc cf rjmp .-136 ; 0x2cbba 2cc42: 60 e0 ldi r22, 0x00 ; 0 2cc44: 8f e5 ldi r24, 0x5F ; 95 2cc46: 9f e0 ldi r25, 0x0F ; 15 2cc48: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 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); 2cc4c: 10 e0 ldi r17, 0x00 ; 0 2cc4e: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 2cc50: 80 e0 ldi r24, 0x00 ; 0 2cc52: 0e 94 8d 8b call 0x1171a ; 0x1171a const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 2cc56: 1f 93 push r17 2cc58: 0f 93 push r16 2cc5a: 8e e6 ldi r24, 0x6E ; 110 2cc5c: 90 e7 ldi r25, 0x70 ; 112 2cc5e: 9f 93 push r25 2cc60: 8f 93 push r24 2cc62: 0f 94 08 dc call 0x3b810 ; 0x3b810 switch (state) { 2cc66: 0f 90 pop r0 2cc68: 0f 90 pop r0 2cc6a: 0f 90 pop r0 2cc6c: 0f 90 pop r0 2cc6e: cd 30 cpi r28, 0x0D ; 13 2cc70: 09 f4 brne .+2 ; 0x2cc74 2cc72: ff c0 rjmp .+510 ; 0x2ce72 2cc74: ce 30 cpi r28, 0x0E ; 14 2cc76: 09 f4 brne .+2 ; 0x2cc7a 2cc78: 11 c1 rjmp .+546 ; 0x2ce9c case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 2cc7a: 8c ec ldi r24, 0xCC ; 204 2cc7c: 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) { 2cc7e: cc 23 and r28, r28 2cc80: 09 f4 brne .+2 ; 0x2cc84 2cc82: 0e c1 rjmp .+540 ; 0x2cea0 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 2cc84: 81 e0 ldi r24, 0x01 ; 1 2cc86: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_update(2); 2cc8a: 82 e0 ldi r24, 0x02 ; 2 } 2cc8c: cf 91 pop r28 2cc8e: 1f 91 pop r17 2cc90: 0f 91 pop r16 2cc92: ff 90 pop r15 2cc94: ef 90 pop r14 2cc96: df 90 pop r13 2cc98: cf 90 pop r12 2cc9a: bf 90 pop r11 2cc9c: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 2cc9e: 0c 94 6d 6f jmp 0xdeda ; 0xdeda lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2cca2: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> 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)) { 2cca6: 81 e0 ldi r24, 0x01 ; 1 2cca8: 0e 94 1f f9 call 0x1f23e ; 0x1f23e state = S::Selftest; 2ccac: 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)) { 2ccae: 88 23 and r24, r24 2ccb0: 09 f4 brne .+2 ; 0x2ccb4 2ccb2: 83 cf rjmp .-250 ; 0x2cbba state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 2ccb4: 82 e0 ldi r24, 0x02 ; 2 2ccb6: 0e 94 1f f9 call 0x1f23e ; 0x1f23e // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 2ccba: 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)) { 2ccbc: 88 23 and r24, r24 2ccbe: 09 f4 brne .+2 ; 0x2ccc2 2ccc0: 7c cf rjmp .-264 ; 0x2cbba // 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)) { 2ccc2: 84 e0 ldi r24, 0x04 ; 4 2ccc4: 0e 94 1f f9 call 0x1f23e ; 0x1f23e state = S::Z; 2ccc8: 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)) { 2ccca: 88 23 and r24, r24 2cccc: 09 f4 brne .+2 ; 0x2ccd0 2ccce: 75 cf rjmp .-278 ; 0x2cbba state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 2ccd0: 88 e0 ldi r24, 0x08 ; 8 2ccd2: 0e 94 1f f9 call 0x1f23e ; 0x1f23e state = S::ThermalModel; 2ccd6: 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)) { 2ccd8: 88 23 and r24, r24 2ccda: 09 f4 brne .+2 ; 0x2ccde 2ccdc: 6e cf rjmp .-292 ; 0x2cbba state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 2ccde: 80 e1 ldi r24, 0x10 ; 16 2cce0: 0e 94 1f f9 call 0x1f23e ; 0x1f23e state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 2cce4: 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)) { 2cce6: 81 11 cpse r24, r1 2cce8: 68 cf rjmp .-304 ; 0x2cbba state = S::IsFil; 2ccea: c6 e0 ldi r28, 0x06 ; 6 2ccec: 66 cf rjmp .-308 ; 0x2cbba // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 2ccee: 84 e6 ldi r24, 0x64 ; 100 2ccf0: 95 e5 ldi r25, 0x55 ; 85 2ccf2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2ccf6: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 wizard_event = lcd_selftest(); 2ccfa: 0f 94 4c 1a call 0x23498 ; 0x23498 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); 2ccfe: 81 11 cpse r24, r1 2cd00: 9e cf rjmp .-196 ; 0x2cc3e } 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); 2cd02: ce e0 ldi r28, 0x0E ; 14 2cd04: 5a cf rjmp .-332 ; 0x2cbba break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 2cd06: 86 e2 ldi r24, 0x26 ; 38 2cd08: 95 e5 ldi r25, 0x55 ; 85 2cd0a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cd0e: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 wizard_event = gcode_M45(false, 0); 2cd12: 80 e0 ldi r24, 0x00 ; 0 2cd14: 0e 94 47 e7 call 0x1ce8e ; 0x1ce8e 2cd18: f2 cf rjmp .-28 ; 0x2ccfe state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 2cd1a: 8e ef ldi r24, 0xFE ; 254 2cd1c: 94 e5 ldi r25, 0x54 ; 84 2cd1e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cd22: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 2cd26: 80 ed ldi r24, 0xD0 ; 208 2cd28: 94 e5 ldi r25, 0x54 ; 84 2cd2a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cd2e: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 2cd32: 80 eb ldi r24, 0xB0 ; 176 2cd34: 94 e5 ldi r25, 0x54 ; 84 2cd36: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cd3a: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 wizard_event = gcode_M45(true, 0); 2cd3e: 81 e0 ldi r24, 0x01 ; 1 2cd40: 0e 94 47 e7 call 0x1ce8e ; 0x1ce8e if (!wizard_event) { 2cd44: 88 23 and r24, r24 2cd46: e9 f2 breq .-70 ; 0x2cd02 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 2cd48: 60 e0 ldi r22, 0x00 ; 0 2cd4a: 70 e0 ldi r23, 0x00 ; 0 2cd4c: 88 ed ldi r24, 0xD8 ; 216 2cd4e: 91 e4 ldi r25, 0x41 ; 65 2cd50: 0e 94 26 6f call 0xde4c ; 0xde4c if(!MMU2::mmu2.Enabled()) { 2cd54: 80 91 95 13 lds r24, 0x1395 ; 0x801395 2cd58: 81 30 cpi r24, 0x01 ; 1 2cd5a: 09 f4 brne .+2 ; 0x2cd5e 2cd5c: 70 cf rjmp .-288 ; 0x2cc3e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cd5e: d0 92 6b 0e sts 0x0E6B, r13 ; 0x800e6b 2cd62: c0 92 6a 0e sts 0x0E6A, r12 ; 0x800e6a //current filament needs to be unloaded and then new filament should be loaded //start to preheat nozzle for unloading remaining PLA filament setTargetHotend(PLA_PREHEAT_HOTEND_TEMP); lcd_display_message_fullscreen_P(_T(MSG_WIZARD_WILL_PREHEAT)); 2cd66: 8b e8 ldi r24, 0x8B ; 139 2cd68: 94 e5 ldi r25, 0x54 ; 84 2cd6a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cd6e: 0f 94 55 35 call 0x26aaa ; 0x26aaa wait_preheat(); 2cd72: 0f 94 62 35 call 0x26ac4 ; 0x26ac4 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 2cd76: 60 e0 ldi r22, 0x00 ; 0 2cd78: 70 e0 ldi r23, 0x00 ; 0 2cd7a: cb 01 movw r24, r22 2cd7c: 0f 94 a7 16 call 0x22d4e ; 0x22d4e lcd_wizard_load(); // load filament 2cd80: 0f 94 45 36 call 0x26c8a ; 0x26c8a 2cd84: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 2cd88: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 2cd8c: 58 cf rjmp .-336 ; 0x2cc3e state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 2cd8e: 8b e4 ldi r24, 0x4B ; 75 2cd90: 94 e5 ldi r25, 0x54 ; 84 2cd92: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cd96: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 lcd_commands_type = LcdCommands::ThermalModel; 2cd9a: 85 e0 ldi r24, 0x05 ; 5 2cd9c: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2cda0: 05 e0 ldi r16, 0x05 ; 5 2cda2: 10 e0 ldi r17, 0x00 ; 0 2cda4: 55 cf rjmp .-342 ; 0x2cc50 2cda6: d0 92 6b 0e sts 0x0E6B, r13 ; 0x800e6b 2cdaa: c0 92 6a 0e sts 0x0E6A, r12 ; 0x800e6a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2cdae: b0 92 69 0e sts 0x0E69, r11 ; 0x800e69 2cdb2: a0 92 68 0e sts 0x0E68, r10 ; 0x800e68 #endif //THERMAL_MODEL case S::IsFil: //start to preheat nozzle and bed to save some time later setTargetHotend(PLA_PREHEAT_HOTEND_TEMP); setTargetBed(PLA_PREHEAT_HPB_TEMP); wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, LCD_MIDDLE_BUTTON_CHOICE); 2cdb6: 85 e3 ldi r24, 0x35 ; 53 2cdb8: 94 e5 ldi r25, 0x54 ; 84 2cdba: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cdbe: 41 e0 ldi r20, 0x01 ; 1 2cdc0: 60 e0 ldi r22, 0x00 ; 0 2cdc2: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2cdc6: 88 23 and r24, r24 2cdc8: 09 f1 breq .+66 ; 0x2ce0c state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 2cdca: 80 91 95 13 lds r24, 0x1395 ; 0x801395 else state = S::Preheat; 2cdce: 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; 2cdd0: 81 30 cpi r24, 0x01 ; 1 2cdd2: 09 f0 breq .+2 ; 0x2cdd6 2cdd4: f2 ce rjmp .-540 ; 0x2cbba 2cdd6: c8 e0 ldi r28, 0x08 ; 8 2cdd8: f0 ce rjmp .-544 ; 0x2cbba else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 2cdda: 20 e0 ldi r18, 0x00 ; 0 2cddc: 41 e0 ldi r20, 0x01 ; 1 2cdde: 70 e0 ldi r23, 0x00 ; 0 2cde0: 60 e0 ldi r22, 0x00 ; 0 2cde2: 84 ec ldi r24, 0xC4 ; 196 2cde4: 99 e3 ldi r25, 0x39 ; 57 2cde6: 0f 94 ef ce call 0x39dde ; 0x39dde lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 2cdea: 84 ef ldi r24, 0xF4 ; 244 2cdec: 93 e5 ldi r25, 0x53 ; 83 2cdee: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cdf2: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 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); 2cdf6: 07 e0 ldi r16, 0x07 ; 7 2cdf8: 10 e0 ldi r17, 0x00 ; 0 2cdfa: 2a cf rjmp .-428 ; 0x2cc50 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(); 2cdfc: 0f 94 62 35 call 0x26ac4 ; 0x26ac4 lcd_wizard_load(); 2ce00: 0f 94 45 36 call 0x26c8a ; 0x26c8a state = S::Lay1CalHot; 2ce04: cb e0 ldi r28, 0x0B ; 11 2ce06: d9 ce rjmp .-590 ; 0x2cbba break; case S::LoadFilCold: lcd_wizard_load(); 2ce08: 0f 94 45 36 call 0x26c8a ; 0x26c8a 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; 2ce0c: ca e0 ldi r28, 0x0A ; 10 2ce0e: d5 ce rjmp .-598 ; 0x2cbba case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 2ce10: 81 e0 ldi r24, 0x01 ; 1 2ce12: 0f 94 27 36 call 0x26c4e ; 0x26c4e menu_goto(lcd_v2_calibration, 0, true); 2ce16: 20 e0 ldi r18, 0x00 ; 0 2ce18: 41 e0 ldi r20, 0x01 ; 1 2ce1a: 70 e0 ldi r23, 0x00 ; 0 2ce1c: 60 e0 ldi r22, 0x00 ; 0 2ce1e: 8c e4 ldi r24, 0x4C ; 76 2ce20: 9b e3 ldi r25, 0x3B ; 59 2ce22: 0f 94 ef ce call 0x39dde ; 0x39dde 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: 0a e0 ldi r16, 0x0A ; 10 2ce28: 10 e0 ldi r17, 0x00 ; 0 2ce2a: 12 cf rjmp .-476 ; 0x2cc50 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); 2ce2c: 80 e0 ldi r24, 0x00 ; 0 2ce2e: 0f 94 27 36 call 0x26c4e ; 0x26c4e lcd_commands_type = LcdCommands::Layer1Cal; 2ce32: 84 e0 ldi r24, 0x04 ; 4 2ce34: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2ce38: 0b e0 ldi r16, 0x0B ; 11 2ce3a: 10 e0 ldi r17, 0x00 ; 0 2ce3c: 09 cf rjmp .-494 ; 0x2cc50 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); 2ce3e: 81 ea ldi r24, 0xA1 ; 161 2ce40: 93 e5 ldi r25, 0x53 ; 83 2ce42: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2ce46: 41 e0 ldi r20, 0x01 ; 1 2ce48: 60 e0 ldi r22, 0x00 ; 0 2ce4a: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 2ce4e: 81 11 cpse r24, r1 2ce50: 07 c0 rjmp .+14 ; 0x2ce60 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 2ce52: 81 e7 ldi r24, 0x71 ; 113 2ce54: 93 e5 ldi r25, 0x53 ; 83 2ce56: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2ce5a: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 2ce5e: d6 cf rjmp .-84 ; 0x2ce0c state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 2ce60: 8b e0 ldi r24, 0x0B ; 11 2ce62: 93 e5 ldi r25, 0x53 ; 83 2ce64: d8 ce rjmp .-592 ; 0x2cc16 2ce66: 60 e0 ldi r22, 0x00 ; 0 2ce68: 8f e5 ldi r24, 0x5F ; 95 2ce6a: 9f e0 ldi r25, 0x0F ; 15 2ce6c: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 2ce70: ef ce rjmp .-546 ; 0x2cc50 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 2ce72: 8d ea ldi r24, 0xAD ; 173 2ce74: 92 e5 ldi r25, 0x52 ; 82 2ce76: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2ce7a: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2ce7c: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.454> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 2ce80: 8d ea ldi r24, 0xAD ; 173 2ce82: 90 e7 ldi r25, 0x70 ; 112 2ce84: 0f 94 be 0b call 0x2177c ; 0x2177c lcd_return_to_status(); 2ce88: 0f 94 23 27 call 0x24e46 ; 0x24e46 default: // exiting for later re-entry break; } if (msg) { 2ce8c: 01 15 cp r16, r1 2ce8e: 11 05 cpc r17, r1 2ce90: 09 f4 brne .+2 ; 0x2ce94 2ce92: f8 ce rjmp .-528 ; 0x2cc84 lcd_show_fullscreen_message_and_wait_P(msg); 2ce94: c8 01 movw r24, r16 2ce96: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 2ce9a: f4 ce rjmp .-536 ; 0x2cc84 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 2ce9c: 8b e4 ldi r24, 0x4B ; 75 2ce9e: 92 e5 ldi r25, 0x52 ; 82 2cea0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cea4: 8c 01 movw r16, r24 2cea6: f2 cf rjmp .-28 ; 0x2ce8c 0002cea8 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 2cea8: 8f e1 ldi r24, 0x1F ; 31 2ceaa: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 2ceae: 81 11 cpse r24, r1 2ceb0: 06 c0 rjmp .+12 ; 0x2cebe // 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); 2ceb2: 8f e1 ldi r24, 0x1F ; 31 2ceb4: 0e 94 e5 e6 call 0x1cdca ; 0x1cdca lcd_wizard(WizState::Run); 2ceb8: 80 e0 ldi r24, 0x00 ; 0 2ceba: 0d 94 bf 65 jmp 0x2cb7e ; 0x2cb7e 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); 2cebe: 83 e4 ldi r24, 0x43 ; 67 2cec0: 9f e4 ldi r25, 0x4F ; 79 2cec2: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cec6: 41 e0 ldi r20, 0x01 ; 1 2cec8: 60 e0 ldi r22, 0x00 ; 0 2ceca: 0f 94 6d 65 call 0x2cada ; 0x2cada } if (result) { 2cece: 88 23 and r24, r24 2ced0: 81 f3 breq .-32 ; 0x2ceb2 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 2ced2: 0f 94 23 27 call 0x24e46 ; 0x24e46 lcd_update_enable(true); 2ced6: 81 e0 ldi r24, 0x01 ; 1 2ced8: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_update(2); 2cedc: 82 e0 ldi r24, 0x02 ; 2 2cede: 0c 94 6d 6f jmp 0xdeda ; 0xdeda 0002cee2 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 2cee2: cf 93 push r28 2cee4: 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); 2cee6: 8e e2 ldi r24, 0x2E ; 46 2cee8: 92 e5 ldi r25, 0x52 ; 82 2ceea: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2ceee: 41 e0 ldi r20, 0x01 ; 1 2cef0: 4c 27 eor r20, r28 2cef2: 60 e0 ldi r22, 0x00 ; 0 2cef4: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c 2cef8: 91 e0 ldi r25, 0x01 ; 1 2cefa: 81 11 cpse r24, r1 2cefc: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 2cefe: c9 17 cp r28, r25 2cf00: 59 f0 breq .+22 ; 0x2cf18 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 2cf02: 84 e0 ldi r24, 0x04 ; 4 2cf04: 92 e5 ldi r25, 0x52 ; 82 2cf06: cc 23 and r28, r28 2cf08: 11 f0 breq .+4 ; 0x2cf0e 2cf0a: 83 e9 ldi r24, 0x93 ; 147 2cf0c: 97 e4 ldi r25, 0x47 ; 71 2cf0e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 } #endif //STEEL_SHEET } 2cf12: 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)); 2cf14: 0d 94 dc 35 jmp 0x26bb8 ; 0x26bb8 } #endif //STEEL_SHEET } 2cf18: cf 91 pop r28 2cf1a: 08 95 ret 0002cf1c : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 2cf1c: cf 93 push r28 2cf1e: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 2cf20: 8b ed ldi r24, 0xDB ; 219 2cf22: 91 e5 ldi r25, 0x51 ; 81 2cf24: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cf28: 40 e0 ldi r20, 0x00 ; 0 2cf2a: 6c 2f mov r22, r28 2cf2c: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c if (result == LCD_LEFT_BUTTON_CHOICE) { 2cf30: 81 11 cpse r24, r1 2cf32: 03 c0 rjmp .+6 ; 0x2cf3a lcd_mesh_calibration_z(); } } 2cf34: 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(); 2cf36: 0d 94 65 27 jmp 0x24eca ; 0x24eca } } 2cf3a: cf 91 pop r28 2cf3c: 08 95 ret 0002cf3e : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 2cf3e: cf 93 push r28 2cf40: c8 2f mov r28, r24 if (!lang_select(lang)) 2cf42: 0e 94 fa 72 call 0xe5f4 ; 0xe5f4 2cf46: 81 11 cpse r24, r1 2cf48: 37 c0 rjmp .+110 ; 0x2cfb8 { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 2cf4a: 8e eb ldi r24, 0xBE ; 190 2cf4c: 9e e4 ldi r25, 0x4E ; 78 2cf4e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cf52: 40 e0 ldi r20, 0x00 ; 0 2cf54: 60 e0 ldi r22, 0x00 ; 0 2cf56: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c 2cf5a: 81 11 cpse r24, r1 2cf5c: 20 c0 rjmp .+64 ; 0x2cf9e #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 2cf5e: 0e 94 af 72 call 0xe55e ; 0xe55e if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 2cf62: c2 30 cpi r28, 0x02 ; 2 2cf64: e0 f0 brcs .+56 ; 0x2cf9e 2cf66: 8c 17 cp r24, r28 2cf68: d0 f0 brcs .+52 ; 0x2cf9e softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 2cf6a: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 2cf6c: 8a ea ldi r24, 0xAA ; 170 2cf6e: 95 e5 ldi r25, 0x55 ; 85 2cf70: dc 01 movw r26, r24 2cf72: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e6> 2cf76: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e7> 2cf7a: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e8> 2cf7e: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e9> boot_app_flags = BOOT_APP_FLG_USER0; 2cf82: 80 e8 ldi r24, 0x80 ; 128 2cf84: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e5> boot_copy_size = 0; 2cf88: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7e3> 2cf8c: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7e2> bootapp_reboot_user0(lang << 3); 2cf90: cc 0f add r28, r28 2cf92: cc 0f add r28, r28 2cf94: cc 0f add r28, r28 boot_reserved = reserved; 2cf96: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7e4> // bootapp_print_vars(); softReset(); 2cf9a: 0e 94 12 68 call 0xd024 ; 0xd024 lang_boot_update_start(lang); lcd_update_enable(true); 2cf9e: 81 e0 ldi r24, 0x01 ; 1 2cfa0: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 menu_goto(lcd_language_menu, 0, true, true); 2cfa4: 21 e0 ldi r18, 0x01 ; 1 2cfa6: 41 e0 ldi r20, 0x01 ; 1 2cfa8: 70 e0 ldi r23, 0x00 ; 0 2cfaa: 60 e0 ldi r22, 0x00 ; 0 2cfac: 8a e3 ldi r24, 0x3A ; 58 2cfae: 9b e3 ldi r25, 0x3B ; 59 2cfb0: 0f 94 ef ce call 0x39dde ; 0x39dde 2cfb4: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout } } 2cfb8: cf 91 pop r28 2cfba: 08 95 ret 0002cfbc : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 2cfbc: cf 93 push r28 MENU_BEGIN(); 2cfbe: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 2cfc2: 10 92 12 05 sts 0x0512, r1 ; 0x800512 2cfc6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2cfca: 84 30 cpi r24, 0x04 ; 4 2cfcc: 08 f0 brcs .+2 ; 0x2cfd0 2cfce: 4a c0 rjmp .+148 ; 0x2d064 2cfd0: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 2cfd4: 0e 94 e3 71 call 0xe3c6 ; 0xe3c6 2cfd8: 88 23 and r24, r24 2cfda: 31 f0 breq .+12 ; 0x2cfe8 2cfdc: 8b e5 ldi r24, 0x5B ; 91 2cfde: 9d e3 ldi r25, 0x3D ; 61 2cfe0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2cfe4: 0f 94 90 d1 call 0x3a320 ; 0x3a320 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 2cfe8: 8e e6 ldi r24, 0x6E ; 110 2cfea: 95 e6 ldi r25, 0x65 ; 101 2cfec: 0e 94 f9 71 call 0xe3f2 ; 0xe3f2 2cff0: 0f 94 73 ce call 0x39ce6 ; 0x39ce6 2cff4: 88 23 and r24, r24 2cff6: 21 f0 breq .+8 ; 0x2d000 { menu_setlang(0); 2cff8: 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(); } 2cffa: 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); 2cffc: 0d 94 9f 67 jmp 0x2cf3e ; 0x2cf3e 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(); 2d000: 0e 94 af 72 call 0xe55e ; 0xe55e 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 2d004: 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 2d006: 82 30 cpi r24, 0x02 ; 2 2d008: 51 f4 brne .+20 ; 0x2d01e 2d00a: 0e 94 d0 71 call 0xe3a0 ; 0xe3a0 { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 2d00e: 0e 94 f9 71 call 0xe3f2 ; 0xe3f2 2d012: 0f 94 73 ce call 0x39ce6 ; 0x39ce6 2d016: 88 23 and r24, r24 2d018: 81 f0 breq .+32 ; 0x2d03a { menu_setlang(1); 2d01a: 81 e0 ldi r24, 0x01 ; 1 2d01c: ee cf rjmp .-36 ; 0x2cffa 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)))) 2d01e: 8c 2f mov r24, r28 2d020: 0e 94 60 72 call 0xe4c0 ; 0xe4c0 2d024: 0e 94 f9 71 call 0xe3f2 ; 0xe3f2 2d028: 0f 94 73 ce call 0x39ce6 ; 0x39ce6 2d02c: 88 23 and r24, r24 2d02e: 11 f0 breq .+4 ; 0x2d034 { menu_setlang(i); 2d030: 8c 2f mov r24, r28 2d032: e3 cf rjmp .-58 ; 0x2cffa 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 2d034: cf 5f subi r28, 0xFF ; 255 2d036: c8 30 cpi r28, 0x08 ; 8 2d038: 91 f7 brne .-28 ; 0x2d01e return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 2d03a: 88 ed ldi r24, 0xD8 ; 216 2d03c: 9e e4 ldi r25, 0x4E ; 78 2d03e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d042: 68 ee ldi r22, 0xE8 ; 232 2d044: 7a e3 ldi r23, 0x3A ; 58 2d046: 0f 94 43 d1 call 0x3a286 ; 0x3a286 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 2d04a: 0f 94 99 ce call 0x39d32 ; 0x39d32 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 2d04e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2d052: 8f 5f subi r24, 0xFF ; 255 2d054: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2d058: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2d05c: 8f 5f subi r24, 0xFF ; 255 2d05e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2d062: b1 cf rjmp .-158 ; 0x2cfc6 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 2d064: cf 91 pop r28 2d066: 08 95 ret 0002d068 : } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 2d068: cf 93 push r28 2d06a: df 93 push r29 MENU_BEGIN(); 2d06c: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 2d070: 10 92 12 05 sts 0x0512, r1 ; 0x800512 2d074: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2d078: 84 30 cpi r24, 0x04 ; 4 2d07a: 58 f5 brcc .+86 ; 0x2d0d2 2d07c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 uint8_t cnt = lang_get_count(); 2d080: 0e 94 af 72 call 0xe55e ; 0xe55e 2d084: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 2d086: 89 ec ldi r24, 0xC9 ; 201 2d088: 97 e5 ldi r25, 0x57 ; 87 2d08a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d08e: 0f 94 90 d1 call 0x3a320 ; 0x3a320 for (uint8_t i = 8; i < cnt; i++) //all community languages 2d092: c8 e0 ldi r28, 0x08 ; 8 2d094: cd 17 cp r28, r29 2d096: 80 f4 brcc .+32 ; 0x2d0b8 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 2d098: 8c 2f mov r24, r28 2d09a: 0e 94 60 72 call 0xe4c0 ; 0xe4c0 2d09e: 0e 94 f9 71 call 0xe3f2 ; 0xe3f2 2d0a2: 0f 94 73 ce call 0x39ce6 ; 0x39ce6 2d0a6: 88 23 and r24, r24 2d0a8: 29 f0 breq .+10 ; 0x2d0b4 { menu_setlang(i); 2d0aa: 8c 2f mov r24, r28 return; } MENU_END(); } 2d0ac: df 91 pop r29 2d0ae: 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); 2d0b0: 0d 94 9f 67 jmp 0x2cf3e ; 0x2cf3e 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 2d0b4: cf 5f subi r28, 0xFF ; 255 2d0b6: ee cf rjmp .-36 ; 0x2d094 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 2d0b8: 0f 94 99 ce call 0x39d32 ; 0x39d32 #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 2d0bc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2d0c0: 8f 5f subi r24, 0xFF ; 255 2d0c2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2d0c6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2d0ca: 8f 5f subi r24, 0xFF ; 255 2d0cc: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2d0d0: d1 cf rjmp .-94 ; 0x2d074 { menu_setlang(i); return; } MENU_END(); } 2d0d2: df 91 pop r29 2d0d4: cf 91 pop r28 2d0d6: 08 95 ret 0002d0d8 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 2d0d8: cf 92 push r12 2d0da: ef 92 push r14 2d0dc: ff 92 push r15 2d0de: 0f 93 push r16 2d0e0: 1f 93 push r17 2d0e2: cf 93 push r28 2d0e4: 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); 2d0e6: 86 e6 ldi r24, 0x66 ; 102 2d0e8: 9d e3 ldi r25, 0x3D ; 61 2d0ea: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d0ee: 0f 94 04 db call 0x3b608 ; 0x3b608 <__strlen_P> 2d0f2: c8 2e mov r12, r24 2d0f4: 89 e1 ldi r24, 0x19 ; 25 2d0f6: 9c e4 ldi r25, 0x4C ; 76 2d0f8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d0fc: 7c 01 movw r14, r24 2d0fe: 8c e6 ldi r24, 0x6C ; 108 2d100: 9d e3 ldi r25, 0x3D ; 61 2d102: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d106: 8c 01 movw r16, r24 2d108: 86 e6 ldi r24, 0x66 ; 102 2d10a: 9d e3 ldi r25, 0x3D ; 61 2d10c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d110: ec 01 movw r28, r24 2d112: 8e ee ldi r24, 0xEE ; 238 2d114: 9b e4 ldi r25, 0x4B ; 75 2d116: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d11a: c3 94 inc r12 2d11c: c3 94 inc r12 2d11e: 9e 01 movw r18, r28 2d120: 40 e0 ldi r20, 0x00 ; 0 2d122: 60 e0 ldi r22, 0x00 ; 0 2d124: 0f 94 9a 64 call 0x2c934 ; 0x2c934 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 2d128: 81 30 cpi r24, 0x01 ; 1 2d12a: 29 f4 brne .+10 ; 0x2d136 load_filament_final_feed(); 2d12c: 0e 94 59 65 call 0xcab2 ; 0xcab2 st_synchronize(); 2d130: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 2d134: d8 cf rjmp .-80 ; 0x2d0e6 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) { 2d136: 82 30 cpi r24, 0x02 ; 2 2d138: 61 f4 brne .+24 ; 0x2d152 unload_filament(FILAMENTCHANGE_FINALRETRACT); 2d13a: 60 e0 ldi r22, 0x00 ; 0 2d13c: 70 e0 ldi r23, 0x00 ; 0 2d13e: cb 01 movw r24, r22 } } 2d140: df 91 pop r29 2d142: cf 91 pop r28 2d144: 1f 91 pop r17 2d146: 0f 91 pop r16 2d148: ff 90 pop r15 2d14a: ef 90 pop r14 2d14c: 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); 2d14e: 0d 94 a7 16 jmp 0x22d4e ; 0x22d4e } } 2d152: df 91 pop r29 2d154: cf 91 pop r28 2d156: 1f 91 pop r17 2d158: 0f 91 pop r16 2d15a: ff 90 pop r15 2d15c: ef 90 pop r14 2d15e: cf 90 pop r12 2d160: 08 95 ret 0002d162 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 2d162: 0f 93 push r16 2d164: 1f 93 push r17 2d166: cf 93 push r28 2d168: df 93 push r29 2d16a: 8c 01 movw r16, r24 2d16c: 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; 2d16e: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 2d172: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 2d176: 0f 94 b3 22 call 0x24566 ; 0x24566 2d17a: 81 11 cpse r24, r1 2d17c: 04 c0 rjmp .+8 ; 0x2d186 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2d17e: d0 93 69 0e sts 0x0E69, r29 ; 0x800e69 2d182: c0 93 68 0e sts 0x0E68, r28 ; 0x800e68 { const FilamentAction action = eFilamentAction; 2d186: c0 91 a3 03 lds r28, 0x03A3 ; 0x8003a3 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 2d18a: 87 ef ldi r24, 0xF7 ; 247 2d18c: 8c 0f add r24, r28 2d18e: 82 30 cpi r24, 0x02 ; 2 2d190: f8 f4 brcc .+62 ; 0x2d1d0 { lcd_return_to_status(); 2d192: 0f 94 23 27 call 0x24e46 ; 0x24e46 if (action == FilamentAction::Lay1Cal) 2d196: ca 30 cpi r28, 0x0A ; 10 2d198: 41 f4 brne .+16 ; 0x2d1aa { lcd_commands_type = LcdCommands::Layer1Cal; 2d19a: 84 e0 ldi r24, 0x04 ; 4 2d19c: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 } menu_back(); clearFilamentAction(); } } } 2d1a0: df 91 pop r29 2d1a2: cf 91 pop r28 2d1a4: 1f 91 pop r17 2d1a6: 0f 91 pop r16 2d1a8: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 2d1aa: 60 e0 ldi r22, 0x00 ; 0 2d1ac: 70 e0 ldi r23, 0x00 ; 0 2d1ae: 80 e2 ldi r24, 0x20 ; 32 2d1b0: 91 e4 ldi r25, 0x41 ; 65 2d1b2: 0e 94 26 6f call 0xde4c ; 0xde4c if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2d1b6: 8f e5 ldi r24, 0x5F ; 95 2d1b8: 9f e0 ldi r25, 0x0F ; 15 2d1ba: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2d1be: 88 23 and r24, r24 2d1c0: 79 f3 breq .-34 ; 0x2d1a0 lcd_wizard(WizState::LoadFilHot); 2d1c2: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 2d1c4: df 91 pop r29 2d1c6: cf 91 pop r28 2d1c8: 1f 91 pop r17 2d1ca: 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); 2d1cc: 0d 94 bf 65 jmp 0x2cb7e ; 0x2cb7e 2d1d0: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); // the current temperature is within +-TEMP_HYSTERESIS of the target // then continue with the filament action if any is set if (bFilamentSkipPreheat || abs((int)current_temperature[0] - (int)nTemp) < TEMP_HYSTERESIS) 2d1d4: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 2d1d8: 81 11 cpse r24, r1 2d1da: 12 c0 rjmp .+36 ; 0x2d200 2d1dc: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2d1e0: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 2d1e4: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 2d1e8: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 2d1ec: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 2d1f0: 60 1b sub r22, r16 2d1f2: 71 0b sbc r23, r17 2d1f4: 6c 5f subi r22, 0xFC ; 252 2d1f6: 7f 4f sbci r23, 0xFF ; 255 2d1f8: 69 30 cpi r22, 0x09 ; 9 2d1fa: 71 05 cpc r23, r1 2d1fc: 08 f0 brcs .+2 ; 0x2d200 2d1fe: 60 c0 rjmp .+192 ; 0x2d2c0 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 2d200: c1 50 subi r28, 0x01 ; 1 2d202: c8 30 cpi r28, 0x08 ; 8 2d204: 88 f5 brcc .+98 ; 0x2d268 2d206: ec 2f mov r30, r28 2d208: f0 e0 ldi r31, 0x00 ; 0 2d20a: 88 27 eor r24, r24 2d20c: e5 5f subi r30, 0xF5 ; 245 2d20e: f6 49 sbci r31, 0x96 ; 150 2d210: 8e 4f sbci r24, 0xFE ; 254 2d212: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 2d216: 86 3a cpi r24, 0xA6 ; 166 2d218: 86 3a cpi r24, 0xA6 ; 166 2d21a: 86 3a cpi r24, 0xA6 ; 166 2d21c: 06 3a cpi r16, 0xA6 ; 166 2d21e: 28 3a cpi r18, 0xA8 ; 168 2d220: 4e 3b cpi r20, 0xBE ; 190 2d222: 14 3b cpi r17, 0xB4 ; 180 2d224: 6a 3a cpi r22, 0xAA ; 170 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2d226: ca e9 ldi r28, 0x9A ; 154 2d228: d9 ed ldi r29, 0xD9 ; 217 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2d22a: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2d22e: 88 23 and r24, r24 2d230: 29 f0 breq .+10 ; 0x2d23c Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2d232: 82 e0 ldi r24, 0x02 ; 2 2d234: 0f 94 34 64 call 0x2c868 ; 0x2c868 bFilamentWaitingFlag = false; 2d238: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c } if (filamentActionMenu) { 2d23c: 20 97 sbiw r28, 0x00 ; 0 2d23e: 09 f4 brne .+2 ; 0x2d242 2d240: af cf rjmp .-162 ; 0x2d1a0 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2d242: 0f 94 e9 2e call 0x25dd2 ; 0x25dd2 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2d246: 61 e0 ldi r22, 0x01 ; 1 2d248: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2d24a: df 91 pop r29 2d24c: cf 91 pop r28 2d24e: 1f 91 pop r17 2d250: 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); 2d252: 0d 94 32 d0 jmp 0x3a064 ; 0x3a064 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2d256: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2d25a: 88 23 and r24, r24 2d25c: 41 f0 breq .+16 ; 0x2d26e 2d25e: 61 e0 ldi r22, 0x01 ; 1 2d260: 88 ec ldi r24, 0xC8 ; 200 2d262: 99 e3 ldi r25, 0x39 ; 57 2d264: 0f 94 32 d0 call 0x3a064 ; 0x3a064 // 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; 2d268: d0 e0 ldi r29, 0x00 ; 0 2d26a: c0 e0 ldi r28, 0x00 ; 0 2d26c: de cf rjmp .-68 ; 0x2d22a case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2d26e: 0f 94 e9 2e call 0x25dd2 ; 0x25dd2 if (eFilamentAction == FilamentAction::AutoLoad) { 2d272: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 2d276: 82 30 cpi r24, 0x02 ; 2 2d278: 19 f4 brne .+6 ; 0x2d280 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2d27a: 81 e0 ldi r24, 0x01 ; 1 2d27c: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 } if (eFilamentAction == FilamentAction::Load) 2d280: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 2d284: 81 30 cpi r24, 0x01 ; 1 2d286: 31 f4 brne .+12 ; 0x2d294 enquecommand_P(MSG_M701); // load filament 2d288: 61 e0 ldi r22, 0x01 ; 1 2d28a: 83 ec ldi r24, 0xC3 ; 195 2d28c: 9f e6 ldi r25, 0x6F ; 111 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2d28e: 0e 94 5c 89 call 0x112b8 ; 0x112b8 2d292: ea cf rjmp .-44 ; 0x2d268 eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 2d294: 83 30 cpi r24, 0x03 ; 3 2d296: 41 f7 brne .-48 ; 0x2d268 enquecommand_P(MSG_M702); // unload filament 2d298: 61 e0 ldi r22, 0x01 ; 1 2d29a: 82 e5 ldi r24, 0x52 ; 82 2d29c: 9c e6 ldi r25, 0x6C ; 108 2d29e: f7 cf rjmp .-18 ; 0x2d28e break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2d2a0: c4 e1 ldi r28, 0x14 ; 20 2d2a2: d9 ed ldi r29, 0xD9 ; 217 2d2a4: c2 cf rjmp .-124 ; 0x2d22a break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2d2a6: 0f 94 e9 2e call 0x25dd2 ; 0x25dd2 MMU2::mmu2.unload(); 2d2aa: 0f 94 22 a0 call 0x34044 ; 0x34044 // 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(); 2d2ae: 0f 94 c4 36 call 0x26d88 ; 0x26d88 2d2b2: da cf rjmp .-76 ; 0x2d268 break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2d2b4: c2 e9 ldi r28, 0x92 ; 146 2d2b6: d9 ed ldi r29, 0xD9 ; 217 2d2b8: b8 cf rjmp .-144 ; 0x2d22a break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2d2ba: ca e8 ldi r28, 0x8A ; 138 2d2bc: d9 ed ldi r29, 0xD9 ; 217 2d2be: b5 cf rjmp .-150 ; 0x2d22a menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2d2c0: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2d2c4: 88 23 and r24, r24 2d2c6: 21 f0 breq .+8 ; 0x2d2d0 2d2c8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2d2cc: 88 23 and r24, r24 2d2ce: a1 f1 breq .+104 ; 0x2d338 // 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; 2d2d0: 81 e0 ldi r24, 0x01 ; 1 2d2d2: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 2d2d6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2d2da: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0,3, PSTR(">")); 2d2de: 46 ea ldi r20, 0xA6 ; 166 2d2e0: 52 ea ldi r21, 0xA2 ; 162 2d2e2: 63 e0 ldi r22, 0x03 ; 3 2d2e4: 80 e0 ldi r24, 0x00 ; 0 2d2e6: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_puts_at_P(1, 3, _T(MSG_CANCEL)); 2d2ea: 8a e3 ldi r24, 0x3A ; 58 2d2ec: 9f e4 ldi r25, 0x4F ; 79 2d2ee: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d2f2: ac 01 movw r20, r24 2d2f4: 63 e0 ldi r22, 0x03 ; 3 2d2f6: 81 e0 ldi r24, 0x01 ; 1 2d2f8: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(0, 1); 2d2fc: 61 e0 ldi r22, 0x01 ; 1 2d2fe: 80 e0 ldi r24, 0x00 ; 0 2d300: 0e 94 a6 6f call 0xdf4c ; 0xdf4c switch (eFilamentAction) 2d304: e0 91 a3 03 lds r30, 0x03A3 ; 0x8003a3 2d308: e1 50 subi r30, 0x01 ; 1 2d30a: e8 30 cpi r30, 0x08 ; 8 2d30c: a8 f4 brcc .+42 ; 0x2d338 2d30e: f0 e0 ldi r31, 0x00 ; 0 2d310: 88 27 eor r24, r24 2d312: e2 57 subi r30, 0x72 ; 114 2d314: f6 49 sbci r31, 0x96 ; 150 2d316: 8e 4f sbci r24, 0xFE ; 254 2d318: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 2d31c: aa 39 cpi r26, 0x9A ; 154 2d31e: aa 39 cpi r26, 0x9A ; 154 2d320: 7e 3a cpi r23, 0xAE ; 174 2d322: aa 39 cpi r26, 0x9A ; 154 2d324: 7e 3a cpi r23, 0xAE ; 174 2d326: 56 3b cpi r21, 0xB6 ; 182 2d328: 02 3b cpi r16, 0xB2 ; 178 2d32a: aa 39 cpi r26, 0x9A ; 154 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2d32c: 8e ec ldi r24, 0xCE ; 206 2d32e: 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)); 2d330: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2d334: 0e 94 91 6f call 0xdf22 ; 0xdf22 // handled earlier break; } } if (bFilamentWaitingFlag) { 2d338: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2d33c: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2d33e: 0f 94 10 2f call 0x25e20 ; 0x25e20 } if (lcd_clicked()) 2d342: 0e 94 c3 71 call 0xe386 ; 0xe386 2d346: 88 23 and r24, r24 2d348: 09 f4 brne .+2 ; 0x2d34c 2d34a: 2a cf rjmp .-428 ; 0x2d1a0 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2d34c: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c if (!bFilamentPreheatState) 2d350: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2d354: 81 11 cpse r24, r1 2d356: 0e c0 rjmp .+28 ; 0x2d374 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2d358: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 2d35c: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2d360: 0e 94 4b 68 call 0xd096 ; 0xd096 2d364: 81 11 cpse r24, r1 2d366: 04 c0 rjmp .+8 ; 0x2d370 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2d368: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 2d36c: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 menu_back(); 2d370: 0f 94 8d d1 call 0x3a31a ; 0x3a31a } menu_back(); 2d374: 0f 94 8d d1 call 0x3a31a ; 0x3a31a clearFilamentAction(); } } } 2d378: df 91 pop r29 2d37a: cf 91 pop r28 2d37c: 1f 91 pop r17 2d37e: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2d380: 0d 94 c4 36 jmp 0x26d88 ; 0x26d88 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)); 2d384: 87 eb ldi r24, 0xB7 ; 183 2d386: 9b e4 ldi r25, 0x4B ; 75 2d388: d3 cf rjmp .-90 ; 0x2d330 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2d38a: 81 ea ldi r24, 0xA1 ; 161 2d38c: 9b e4 ldi r25, 0x4B ; 75 2d38e: d0 cf rjmp .-96 ; 0x2d330 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2d390: 8d e8 ldi r24, 0x8D ; 141 2d392: 9b e4 ldi r25, 0x4B ; 75 2d394: cd cf rjmp .-102 ; 0x2d330 0002d396 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2d396: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2d39a: 40 91 95 13 lds r20, 0x1395 ; 0x801395 2d39e: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 2d3a2: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 2d3a6: 41 30 cpi r20, 0x01 ; 1 2d3a8: 59 f0 breq .+22 ; 0x2d3c0 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() 2d3aa: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2d3ae: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2d3b2: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2d3b6: 28 17 cp r18, r24 2d3b8: 39 07 cpc r19, r25 2d3ba: 5c f4 brge .+22 ; 0x2d3d2 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2d3bc: 0d 94 c7 36 jmp 0x26d8e ; 0x26d8e 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() 2d3c0: 90 91 6b 13 lds r25, 0x136B ; 0x80136b 2d3c4: 91 11 cpse r25, r1 2d3c6: f1 cf rjmp .-30 ; 0x2d3aa && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2d3c8: 86 50 subi r24, 0x06 ; 6 2d3ca: 82 30 cpi r24, 0x02 ; 2 2d3cc: 70 f7 brcc .-36 ; 0x2d3aa 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() 2d3ce: 40 93 5e 06 sts 0x065E, r20 ; 0x80065e && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2d3d2: 81 e0 ldi r24, 0x01 ; 1 2d3d4: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d mFilamentItem(target_temperature[0], target_temperature_bed); 2d3d8: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 2d3dc: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 2d3e0: c9 01 movw r24, r18 2d3e2: 0f 94 b1 68 call 0x2d162 ; 0x2d162 bFilamentSkipPreheat = false; // Reset flag 2d3e6: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e } else { lcd_generic_preheat_menu(); } } 2d3ea: 08 95 ret 0002d3ec : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2d3ec: 82 e0 ldi r24, 0x02 ; 2 2d3ee: 0d 94 cb 69 jmp 0x2d396 ; 0x2d396 0002d3f2 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2d3f2: 81 e0 ldi r24, 0x01 ; 1 2d3f4: 0d 94 cb 69 jmp 0x2d396 ; 0x2d396 0002d3f8 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2d3f8: 83 e0 ldi r24, 0x03 ; 3 2d3fa: 0d 94 cb 69 jmp 0x2d396 ; 0x2d396 0002d3fe : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2d3fe: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2d402: 6c e3 ldi r22, 0x3C ; 60 2d404: 70 e0 ldi r23, 0x00 ; 0 2d406: 87 ed ldi r24, 0xD7 ; 215 2d408: 90 e0 ldi r25, 0x00 ; 0 2d40a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d40e : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2d40e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2d412: 65 e5 ldi r22, 0x55 ; 85 2d414: 70 e0 ldi r23, 0x00 ; 0 2d416: 86 ee ldi r24, 0xE6 ; 230 2d418: 90 e0 ldi r25, 0x00 ; 0 2d41a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d41e : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2d41e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2d422: 69 e6 ldi r22, 0x69 ; 105 2d424: 70 e0 ldi r23, 0x00 ; 0 2d426: 84 e0 ldi r24, 0x04 ; 4 2d428: 91 e0 ldi r25, 0x01 ; 1 2d42a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d42e : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2d42e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2d432: 6e e6 ldi r22, 0x6E ; 110 2d434: 70 e0 ldi r23, 0x00 ; 0 2d436: 83 e1 ldi r24, 0x13 ; 19 2d438: 91 e0 ldi r25, 0x01 ; 1 2d43a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d43e : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2d43e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2d442: 6b e4 ldi r22, 0x4B ; 75 2d444: 70 e0 ldi r23, 0x00 ; 0 2d446: 87 ed ldi r24, 0xD7 ; 215 2d448: 90 e0 ldi r25, 0x00 ; 0 2d44a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d44e : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2d44e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2d452: 6a e5 ldi r22, 0x5A ; 90 2d454: 70 e0 ldi r23, 0x00 ; 0 2d456: 83 e1 ldi r24, 0x13 ; 19 2d458: 91 e0 ldi r25, 0x01 ; 1 2d45a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d45e : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2d45e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2d462: 64 e6 ldi r22, 0x64 ; 100 2d464: 70 e0 ldi r23, 0x00 ; 0 2d466: 8f ef ldi r24, 0xFF ; 255 2d468: 90 e0 ldi r25, 0x00 ; 0 2d46a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d46e : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2d46e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2d472: 64 e6 ldi r22, 0x64 ; 100 2d474: 70 e0 ldi r23, 0x00 ; 0 2d476: 8c ed ldi r24, 0xDC ; 220 2d478: 90 e0 ldi r25, 0x00 ; 0 2d47a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d47e : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2d47e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2d482: 64 e6 ldi r22, 0x64 ; 100 2d484: 70 e0 ldi r23, 0x00 ; 0 2d486: 8e ef ldi r24, 0xFE ; 254 2d488: 90 e0 ldi r25, 0x00 ; 0 2d48a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d48e : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2d48e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2d492: 62 e3 ldi r22, 0x32 ; 50 2d494: 70 e0 ldi r23, 0x00 ; 0 2d496: 80 ef ldi r24, 0xF0 ; 240 2d498: 90 e0 ldi r25, 0x00 ; 0 2d49a: 0d 94 b1 68 jmp 0x2d162 ; 0x2d162 0002d49e : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d49e: 80 e0 ldi r24, 0x00 ; 0 2d4a0: 0f 94 34 64 call 0x2c868 ; 0x2c868 #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2d4a4: 0e 94 79 e4 call 0x1c8f2 ; 0x1c8f2 lcd_return_to_status(); 2d4a8: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 0002d4ac : } 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){ 2d4ac: cf 92 push r12 2d4ae: df 92 push r13 2d4b0: ef 92 push r14 2d4b2: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2d4b4: 41 11 cpse r20, r1 2d4b6: 04 c0 rjmp .+8 ; 0x2d4c0 2d4b8: 20 91 de 04 lds r18, 0x04DE ; 0x8004de 2d4bc: 22 30 cpi r18, 0x02 ; 2 2d4be: d1 f0 breq .+52 ; 0x2d4f4 2d4c0: 9b 01 movw r18, r22 2d4c2: 6c 01 movw r12, r24 2d4c4: f1 2c mov r15, r1 2d4c6: e1 2c mov r14, r1 if(!tone_) { 2d4c8: 67 2b or r22, r23 2d4ca: c9 f4 brne .+50 ; 0x2d4fe WRITE(BEEPER, HIGH); 2d4cc: 9f b7 in r25, 0x3f ; 63 2d4ce: f8 94 cli 2d4d0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d4d4: 84 60 ori r24, 0x04 ; 4 2d4d6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d4da: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2d4dc: c7 01 movw r24, r14 2d4de: b6 01 movw r22, r12 2d4e0: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 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); 2d4e4: 9f b7 in r25, 0x3f ; 63 2d4e6: f8 94 cli 2d4e8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d4ec: 8b 7f andi r24, 0xFB ; 251 2d4ee: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d4f2: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2d4f4: ff 90 pop r15 2d4f6: ef 90 pop r14 2d4f8: df 90 pop r13 2d4fa: cf 90 pop r12 2d4fc: 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); 2d4fe: 22 0f add r18, r18 2d500: 33 1f adc r19, r19 2d502: 50 e0 ldi r21, 0x00 ; 0 2d504: 40 e0 ldi r20, 0x00 ; 0 2d506: 60 e0 ldi r22, 0x00 ; 0 2d508: 74 e2 ldi r23, 0x24 ; 36 2d50a: 84 ef ldi r24, 0xF4 ; 244 2d50c: 90 e0 ldi r25, 0x00 ; 0 2d50e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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; 2d512: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2d514: 21 15 cp r18, r1 2d516: 31 05 cpc r19, r1 2d518: 81 e0 ldi r24, 0x01 ; 1 2d51a: 48 07 cpc r20, r24 2d51c: 51 05 cpc r21, r1 2d51e: 44 f0 brlt .+16 ; 0x2d530 pwm_freq /= 64; // Increase prescaler to 64 2d520: 86 e0 ldi r24, 0x06 ; 6 2d522: 56 95 lsr r21 2d524: 47 95 ror r20 2d526: 37 95 ror r19 2d528: 27 95 ror r18 2d52a: 8a 95 dec r24 2d52c: d1 f7 brne .-12 ; 0x2d522 prescalarbits = 0b011; 2d52e: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2d530: 21 50 subi r18, 0x01 ; 1 2d532: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2d534: 4f b7 in r20, 0x3f ; 63 2d536: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2d538: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d53c: 88 7f andi r24, 0xF8 ; 248 2d53e: 89 2b or r24, r25 2d540: 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); 2d544: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d548: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d54c: 26 9f mul r18, r22 2d54e: c0 01 movw r24, r0 2d550: 27 9f mul r18, r23 2d552: 90 0d add r25, r0 2d554: 36 9f mul r19, r22 2d556: 90 0d add r25, r0 2d558: 11 24 eor r1, r1 2d55a: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d55e: 6f ef ldi r22, 0xFF ; 255 2d560: 70 e0 ldi r23, 0x00 ; 0 2d562: 51 ff sbrs r21, 1 2d564: 04 c0 rjmp .+8 ; 0x2d56e 2d566: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d56a: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d56e: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 2d572: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d576: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2d57a: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d57e: 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); 2d582: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d586: 83 60 ori r24, 0x03 ; 3 2d588: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d58c: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2d58e: c7 01 movw r24, r14 2d590: b6 01 movw r22, r12 2d592: 0f 94 62 3d call 0x27ac4 ; 0x27ac4 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2d596: 2f b7 in r18, 0x3f ; 63 2d598: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2d59a: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d59e: 88 7f andi r24, 0xF8 ; 248 2d5a0: 85 60 ori r24, 0x05 ; 5 2d5a2: 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); 2d5a6: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d5aa: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d5ae: 3f ef ldi r19, 0xFF ; 255 2d5b0: 34 9f mul r19, r20 2d5b2: c0 01 movw r24, r0 2d5b4: 35 9f mul r19, r21 2d5b6: 90 0d add r25, r0 2d5b8: 11 24 eor r1, r1 2d5ba: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d5be: 6f ef ldi r22, 0xFF ; 255 2d5c0: 70 e0 ldi r23, 0x00 ; 0 2d5c2: 31 ff sbrs r19, 1 2d5c4: 04 c0 rjmp .+8 ; 0x2d5ce 2d5c6: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d5ca: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d5ce: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 2d5d2: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d5d6: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2d5da: 8f ef ldi r24, 0xFF ; 255 2d5dc: 90 e0 ldi r25, 0x00 ; 0 2d5de: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d5e2: 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)); 2d5e6: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d5ea: 8c 7f andi r24, 0xFC ; 252 2d5ec: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d5f0: 2f bf out 0x3f, r18 ; 63 2d5f2: 78 cf rjmp .-272 ; 0x2d4e4 0002d5f4 : /// 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() { 2d5f4: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2d5f6: c0 91 de 04 lds r28, 0x04DE ; 0x8004de 2d5fa: c2 30 cpi r28, 0x02 ; 2 2d5fc: 59 f1 breq .+86 ; 0x2d654 // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2d5fe: c1 30 cpi r28, 0x01 ; 1 2d600: 69 f4 brne .+26 ; 0x2d61c if (bFirst) return; 2d602: 80 91 6c 05 lds r24, 0x056C ; 0x80056c <_ZL6bFirst.lto_priv.513> 2d606: 81 11 cpse r24, r1 2d608: 25 c0 rjmp .+74 ; 0x2d654 Sound_MakeCustom(80, 0, false); 2d60a: 40 e0 ldi r20, 0x00 ; 0 2d60c: 70 e0 ldi r23, 0x00 ; 0 2d60e: 60 e0 ldi r22, 0x00 ; 0 2d610: 80 e5 ldi r24, 0x50 ; 80 2d612: 90 e0 ldi r25, 0x00 ; 0 2d614: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac bFirst = true; 2d618: c0 93 6c 05 sts 0x056C, r28 ; 0x80056c <_ZL6bFirst.lto_priv.513> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 2d61c: 60 ed ldi r22, 0xD0 ; 208 2d61e: 77 e0 ldi r23, 0x07 ; 7 2d620: 89 e6 ldi r24, 0x69 ; 105 2d622: 95 e0 ldi r25, 0x05 ; 5 2d624: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired_cont(unsigned short)> 2d628: 88 23 and r24, r24 2d62a: a1 f0 breq .+40 ; 0x2d654 beep_timer.start(); 2d62c: 89 e6 ldi r24, 0x69 ; 105 2d62e: 95 e0 ldi r25, 0x05 ; 5 2d630: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2d634: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 2d638: 81 11 cpse r24, r1 2d63a: 08 c0 rjmp .+16 ; 0x2d64c Sound_MakeCustom(80, 0, false); 2d63c: 40 e0 ldi r20, 0x00 ; 0 2d63e: 70 e0 ldi r23, 0x00 ; 0 2d640: 60 e0 ldi r22, 0x00 ; 0 2d642: 80 e5 ldi r24, 0x50 ; 80 2d644: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2d646: 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); 2d648: 0d 94 56 6a jmp 0x2d4ac ; 0x2d4ac } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d64c: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2d64e: 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); 2d650: 0d 94 34 64 jmp 0x2c868 ; 0x2c868 } } #endif // BEEPER > 0 } 2d654: cf 91 pop r28 2d656: 08 95 ret 0002d658 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2d658: 82 30 cpi r24, 0x02 ; 2 2d65a: b9 f0 breq .+46 ; 0x2d68a 2d65c: 83 30 cpi r24, 0x03 ; 3 2d65e: e9 f0 breq .+58 ; 0x2d69a 2d660: 81 30 cpi r24, 0x01 ; 1 2d662: 59 f0 breq .+22 ; 0x2d67a 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; 2d664: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d668: 61 30 cpi r22, 0x01 ; 1 2d66a: 29 f4 brne .+10 ; 0x2d676 2d66c: 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; 2d66e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2d672: 00 00 nop } 2d674: 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; 2d676: 8e 7f andi r24, 0xFE ; 254 2d678: fa cf rjmp .-12 ; 0x2d66e case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2d67a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d67e: 61 11 cpse r22, r1 2d680: 02 c0 rjmp .+4 ; 0x2d686 2d682: 82 60 ori r24, 0x02 ; 2 2d684: f4 cf rjmp .-24 ; 0x2d66e 2d686: 8d 7f andi r24, 0xFD ; 253 2d688: f2 cf rjmp .-28 ; 0x2d66e case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2d68a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d68e: 61 30 cpi r22, 0x01 ; 1 2d690: 11 f4 brne .+4 ; 0x2d696 2d692: 84 60 ori r24, 0x04 ; 4 2d694: ec cf rjmp .-40 ; 0x2d66e 2d696: 8b 7f andi r24, 0xFB ; 251 2d698: ea cf rjmp .-44 ; 0x2d66e case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2d69a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d69e: 61 11 cpse r22, r1 2d6a0: 02 c0 rjmp .+4 ; 0x2d6a6 2d6a2: 80 64 ori r24, 0x40 ; 64 2d6a4: e4 cf rjmp .-56 ; 0x2d66e 2d6a6: 8f 7b andi r24, 0xBF ; 191 2d6a8: e2 cf rjmp .-60 ; 0x2d66e 0002d6aa : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2d6aa: cf 93 push r28 if (cacheDirty_) { 2d6ac: 80 91 74 0e lds r24, 0x0E74 ; 0x800e74 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2d6b0: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2d6b2: 88 23 and r24, r24 2d6b4: a1 f0 breq .+40 ; 0x2d6de if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2d6b6: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 2d6ba: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 2d6be: 60 91 6e 0e lds r22, 0x0E6E ; 0x800e6e 2d6c2: 70 91 6f 0e lds r23, 0x0E6F ; 0x800e6f 2d6c6: 28 e7 ldi r18, 0x78 ; 120 2d6c8: 3e e0 ldi r19, 0x0E ; 14 2d6ca: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 2d6ce: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 2d6d2: 0f 94 ed a5 call 0x34bda ; 0x34bda 2d6d6: c8 2f mov r28, r24 2d6d8: 81 11 cpse r24, r1 2d6da: 04 c0 rjmp .+8 ; 0x2d6e4 cacheDirty_ = 0; } return true; fail: return false; 2d6dc: c0 e0 ldi r28, 0x00 ; 0 } 2d6de: 8c 2f mov r24, r28 2d6e0: cf 91 pop r28 2d6e2: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2d6e4: 40 91 70 0e lds r20, 0x0E70 ; 0x800e70 2d6e8: 50 91 71 0e lds r21, 0x0E71 ; 0x800e71 2d6ec: 60 91 72 0e lds r22, 0x0E72 ; 0x800e72 2d6f0: 70 91 73 0e lds r23, 0x0E73 ; 0x800e73 2d6f4: 41 15 cp r20, r1 2d6f6: 51 05 cpc r21, r1 2d6f8: 61 05 cpc r22, r1 2d6fa: 71 05 cpc r23, r1 2d6fc: 91 f0 breq .+36 ; 0x2d722 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2d6fe: 28 e7 ldi r18, 0x78 ; 120 2d700: 3e e0 ldi r19, 0x0E ; 14 2d702: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 2d706: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 2d70a: 0f 94 ed a5 call 0x34bda ; 0x34bda 2d70e: 88 23 and r24, r24 2d710: 29 f3 breq .-54 ; 0x2d6dc goto fail; } cacheMirrorBlock_ = 0; 2d712: 10 92 70 0e sts 0x0E70, r1 ; 0x800e70 2d716: 10 92 71 0e sts 0x0E71, r1 ; 0x800e71 2d71a: 10 92 72 0e sts 0x0E72, r1 ; 0x800e72 2d71e: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 } cacheDirty_ = 0; 2d722: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 2d726: db cf rjmp .-74 ; 0x2d6de 0002d728 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2d728: cf 92 push r12 2d72a: df 92 push r13 2d72c: ef 92 push r14 2d72e: ff 92 push r15 2d730: cf 93 push r28 2d732: 6b 01 movw r12, r22 2d734: 7c 01 movw r14, r24 2d736: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2d738: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 2d73c: 90 91 6d 0e lds r25, 0x0E6D ; 0x800e6d 2d740: a0 91 6e 0e lds r26, 0x0E6E ; 0x800e6e 2d744: b0 91 6f 0e lds r27, 0x0E6F ; 0x800e6f 2d748: 8c 15 cp r24, r12 2d74a: 9d 05 cpc r25, r13 2d74c: ae 05 cpc r26, r14 2d74e: bf 05 cpc r27, r15 2d750: 01 f1 breq .+64 ; 0x2d792 if (!cacheFlush()) goto fail; 2d752: 0f 94 55 6b call 0x2d6aa ; 0x2d6aa 2d756: 81 11 cpse r24, r1 2d758: 08 c0 rjmp .+16 ; 0x2d76a } if (dirty) cacheDirty_ = true; return true; fail: return false; 2d75a: c0 e0 ldi r28, 0x00 ; 0 } 2d75c: 8c 2f mov r24, r28 2d75e: cf 91 pop r28 2d760: ff 90 pop r15 2d762: ef 90 pop r14 2d764: df 90 pop r13 2d766: cf 90 pop r12 2d768: 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; 2d76a: 28 e7 ldi r18, 0x78 ; 120 2d76c: 3e e0 ldi r19, 0x0E ; 14 2d76e: b7 01 movw r22, r14 2d770: a6 01 movw r20, r12 2d772: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 2d776: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 2d77a: 0f 94 51 a6 call 0x34ca2 ; 0x34ca2 2d77e: 88 23 and r24, r24 2d780: 61 f3 breq .-40 ; 0x2d75a cacheBlockNumber_ = blockNumber; 2d782: c0 92 6c 0e sts 0x0E6C, r12 ; 0x800e6c 2d786: d0 92 6d 0e sts 0x0E6D, r13 ; 0x800e6d 2d78a: e0 92 6e 0e sts 0x0E6E, r14 ; 0x800e6e 2d78e: f0 92 6f 0e sts 0x0E6F, r15 ; 0x800e6f } if (dirty) cacheDirty_ = true; 2d792: cc 23 and r28, r28 2d794: 21 f0 breq .+8 ; 0x2d79e 2d796: 81 e0 ldi r24, 0x01 ; 1 2d798: 80 93 74 0e sts 0x0E74, r24 ; 0x800e74 2d79c: df cf rjmp .-66 ; 0x2d75c return true; 2d79e: c1 e0 ldi r28, 0x01 ; 1 2d7a0: dd cf rjmp .-70 ; 0x2d75c 0002d7a2 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2d7a2: 4f 92 push r4 2d7a4: 5f 92 push r5 2d7a6: 6f 92 push r6 2d7a8: 7f 92 push r7 2d7aa: 8f 92 push r8 2d7ac: 9f 92 push r9 2d7ae: af 92 push r10 2d7b0: bf 92 push r11 2d7b2: cf 92 push r12 2d7b4: df 92 push r13 2d7b6: ef 92 push r14 2d7b8: ff 92 push r15 2d7ba: 0f 93 push r16 2d7bc: 1f 93 push r17 2d7be: cf 93 push r28 2d7c0: df 93 push r29 2d7c2: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2d7c4: 42 30 cpi r20, 0x02 ; 2 2d7c6: 51 05 cpc r21, r1 2d7c8: 61 05 cpc r22, r1 2d7ca: 71 05 cpc r23, r1 2d7cc: 90 f4 brcc .+36 ; 0x2d7f2 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2d7ce: 80 e0 ldi r24, 0x00 ; 0 } 2d7d0: df 91 pop r29 2d7d2: cf 91 pop r28 2d7d4: 1f 91 pop r17 2d7d6: 0f 91 pop r16 2d7d8: ff 90 pop r15 2d7da: ef 90 pop r14 2d7dc: df 90 pop r13 2d7de: cf 90 pop r12 2d7e0: bf 90 pop r11 2d7e2: af 90 pop r10 2d7e4: 9f 90 pop r9 2d7e6: 8f 90 pop r8 2d7e8: 7f 90 pop r7 2d7ea: 6f 90 pop r6 2d7ec: 5f 90 pop r5 2d7ee: 4f 90 pop r4 2d7f0: 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; 2d7f2: 89 85 ldd r24, Y+9 ; 0x09 2d7f4: 9a 85 ldd r25, Y+10 ; 0x0a 2d7f6: ab 85 ldd r26, Y+11 ; 0x0b 2d7f8: bc 85 ldd r27, Y+12 ; 0x0c 2d7fa: 01 96 adiw r24, 0x01 ; 1 2d7fc: a1 1d adc r26, r1 2d7fe: b1 1d adc r27, r1 2d800: 84 17 cp r24, r20 2d802: 95 07 cpc r25, r21 2d804: a6 07 cpc r26, r22 2d806: b7 07 cpc r27, r23 2d808: 10 f3 brcs .-60 ; 0x2d7ce tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2d80a: 8f 89 ldd r24, Y+23 ; 0x17 2d80c: 80 31 cpi r24, 0x10 ; 16 2d80e: c9 f5 brne .+114 ; 0x2d882 lba = fatStartBlock_ + (cluster >> 8); 2d810: 85 2e mov r8, r21 2d812: 96 2e mov r9, r22 2d814: a7 2e mov r10, r23 2d816: bb 24 eor r11, r11 2d818: 8b 89 ldd r24, Y+19 ; 0x13 2d81a: 9c 89 ldd r25, Y+20 ; 0x14 2d81c: ad 89 ldd r26, Y+21 ; 0x15 2d81e: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d820: 88 0e add r8, r24 2d822: 99 1e adc r9, r25 2d824: aa 1e adc r10, r26 2d826: bb 1e adc r11, r27 2d828: 28 01 movw r4, r16 2d82a: 39 01 movw r6, r18 2d82c: 6a 01 movw r12, r20 2d82e: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2d830: 41 e0 ldi r20, 0x01 ; 1 2d832: c5 01 movw r24, r10 2d834: b4 01 movw r22, r8 2d836: 0f 94 94 6b call 0x2d728 ; 0x2d728 2d83a: 88 23 and r24, r24 2d83c: 41 f2 breq .-112 ; 0x2d7ce // store entry if (fatType_ == 16) { 2d83e: 9f 89 ldd r25, Y+23 ; 0x17 2d840: 90 31 cpi r25, 0x10 ; 16 2d842: 81 f5 brne .+96 ; 0x2d8a4 cacheBuffer_.fat16[cluster & 0XFF] = value; 2d844: dd 24 eor r13, r13 2d846: ee 24 eor r14, r14 2d848: ff 24 eor r15, r15 2d84a: f6 01 movw r30, r12 2d84c: ee 0f add r30, r30 2d84e: ff 1f adc r31, r31 2d850: e8 58 subi r30, 0x88 ; 136 2d852: f1 4f sbci r31, 0xF1 ; 241 2d854: 11 83 std Z+1, r17 ; 0x01 2d856: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2d858: 9a 89 ldd r25, Y+18 ; 0x12 2d85a: 92 30 cpi r25, 0x02 ; 2 2d85c: 08 f4 brcc .+2 ; 0x2d860 2d85e: b8 cf rjmp .-144 ; 0x2d7d0 2d860: 4d 81 ldd r20, Y+5 ; 0x05 2d862: 5e 81 ldd r21, Y+6 ; 0x06 2d864: 6f 81 ldd r22, Y+7 ; 0x07 2d866: 78 85 ldd r23, Y+8 ; 0x08 2d868: 84 0e add r8, r20 2d86a: 95 1e adc r9, r21 2d86c: a6 1e adc r10, r22 2d86e: b7 1e adc r11, r23 2d870: 80 92 70 0e sts 0x0E70, r8 ; 0x800e70 2d874: 90 92 71 0e sts 0x0E71, r9 ; 0x800e71 2d878: a0 92 72 0e sts 0x0E72, r10 ; 0x800e72 2d87c: b0 92 73 0e sts 0x0E73, r11 ; 0x800e73 2d880: a7 cf rjmp .-178 ; 0x2d7d0 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d882: 80 32 cpi r24, 0x20 ; 32 2d884: 09 f0 breq .+2 ; 0x2d888 2d886: a3 cf rjmp .-186 ; 0x2d7ce lba = fatStartBlock_ + (cluster >> 7); 2d888: 8b 89 ldd r24, Y+19 ; 0x13 2d88a: 9c 89 ldd r25, Y+20 ; 0x14 2d88c: ad 89 ldd r26, Y+21 ; 0x15 2d88e: be 89 ldd r27, Y+22 ; 0x16 2d890: 4a 01 movw r8, r20 2d892: 5b 01 movw r10, r22 2d894: e7 e0 ldi r30, 0x07 ; 7 2d896: b6 94 lsr r11 2d898: a7 94 ror r10 2d89a: 97 94 ror r9 2d89c: 87 94 ror r8 2d89e: ea 95 dec r30 2d8a0: d1 f7 brne .-12 ; 0x2d896 2d8a2: be cf rjmp .-132 ; 0x2d820 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2d8a4: e8 94 clt 2d8a6: c7 f8 bld r12, 7 2d8a8: dd 24 eor r13, r13 2d8aa: ee 24 eor r14, r14 2d8ac: ff 24 eor r15, r15 2d8ae: f6 01 movw r30, r12 2d8b0: ee 0f add r30, r30 2d8b2: ff 1f adc r31, r31 2d8b4: ee 0f add r30, r30 2d8b6: ff 1f adc r31, r31 2d8b8: e8 58 subi r30, 0x88 ; 136 2d8ba: f1 4f sbci r31, 0xF1 ; 241 2d8bc: 40 82 st Z, r4 2d8be: 51 82 std Z+1, r5 ; 0x01 2d8c0: 62 82 std Z+2, r6 ; 0x02 2d8c2: 73 82 std Z+3, r7 ; 0x03 2d8c4: c9 cf rjmp .-110 ; 0x2d858 0002d8c6 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2d8c6: cf 92 push r12 2d8c8: df 92 push r13 2d8ca: ef 92 push r14 2d8cc: ff 92 push r15 2d8ce: 0f 93 push r16 2d8d0: 1f 93 push r17 2d8d2: cf 93 push r28 2d8d4: df 93 push r29 2d8d6: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2d8d8: 81 85 ldd r24, Z+9 ; 0x09 2d8da: 92 85 ldd r25, Z+10 ; 0x0a 2d8dc: a3 85 ldd r26, Z+11 ; 0x0b 2d8de: b4 85 ldd r27, Z+12 ; 0x0c 2d8e0: 01 96 adiw r24, 0x01 ; 1 2d8e2: a1 1d adc r26, r1 2d8e4: b1 1d adc r27, r1 2d8e6: 84 17 cp r24, r20 2d8e8: 95 07 cpc r25, r21 2d8ea: a6 07 cpc r26, r22 2d8ec: b7 07 cpc r27, r23 2d8ee: 50 f4 brcc .+20 ; 0x2d904 *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2d8f0: 80 e0 ldi r24, 0x00 ; 0 } 2d8f2: df 91 pop r29 2d8f4: cf 91 pop r28 2d8f6: 1f 91 pop r17 2d8f8: 0f 91 pop r16 2d8fa: ff 90 pop r15 2d8fc: ef 90 pop r14 2d8fe: df 90 pop r13 2d900: cf 90 pop r12 2d902: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2d904: 87 89 ldd r24, Z+23 ; 0x17 2d906: 80 31 cpi r24, 0x10 ; 16 2d908: a9 f5 brne .+106 ; 0x2d974 lba = fatStartBlock_ + (cluster >> 8); 2d90a: bb 27 eor r27, r27 2d90c: a7 2f mov r26, r23 2d90e: 96 2f mov r25, r22 2d910: 85 2f mov r24, r21 2d912: c3 88 ldd r12, Z+19 ; 0x13 2d914: d4 88 ldd r13, Z+20 ; 0x14 2d916: e5 88 ldd r14, Z+21 ; 0x15 2d918: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d91a: 8c 0d add r24, r12 2d91c: 9d 1d adc r25, r13 2d91e: ae 1d adc r26, r14 2d920: bf 1d adc r27, r15 2d922: e9 01 movw r28, r18 2d924: 6a 01 movw r12, r20 2d926: 7b 01 movw r14, r22 2d928: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2d92a: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 2d92e: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 2d932: 60 91 6e 0e lds r22, 0x0E6E ; 0x800e6e 2d936: 70 91 6f 0e lds r23, 0x0E6F ; 0x800e6f 2d93a: 84 17 cp r24, r20 2d93c: 95 07 cpc r25, r21 2d93e: a6 07 cpc r26, r22 2d940: b7 07 cpc r27, r23 2d942: 49 f5 brne .+82 ; 0x2d996 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2d944: f8 01 movw r30, r16 2d946: 87 89 ldd r24, Z+23 ; 0x17 2d948: 80 31 cpi r24, 0x10 ; 16 2d94a: 69 f5 brne .+90 ; 0x2d9a6 *value = cacheBuffer_.fat16[cluster & 0XFF]; 2d94c: b7 01 movw r22, r14 2d94e: a6 01 movw r20, r12 2d950: 55 27 eor r21, r21 2d952: 66 27 eor r22, r22 2d954: 77 27 eor r23, r23 2d956: 44 0f add r20, r20 2d958: 55 1f adc r21, r21 2d95a: 48 58 subi r20, 0x88 ; 136 2d95c: 51 4f sbci r21, 0xF1 ; 241 2d95e: fa 01 movw r30, r20 2d960: 80 81 ld r24, Z 2d962: 91 81 ldd r25, Z+1 ; 0x01 2d964: b0 e0 ldi r27, 0x00 ; 0 2d966: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2d968: 88 83 st Y, r24 2d96a: 99 83 std Y+1, r25 ; 0x01 2d96c: aa 83 std Y+2, r26 ; 0x02 2d96e: bb 83 std Y+3, r27 ; 0x03 2d970: 81 e0 ldi r24, 0x01 ; 1 2d972: bf cf rjmp .-130 ; 0x2d8f2 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d974: 80 32 cpi r24, 0x20 ; 32 2d976: 09 f0 breq .+2 ; 0x2d97a 2d978: bb cf rjmp .-138 ; 0x2d8f0 lba = fatStartBlock_ + (cluster >> 7); 2d97a: c3 88 ldd r12, Z+19 ; 0x13 2d97c: d4 88 ldd r13, Z+20 ; 0x14 2d97e: e5 88 ldd r14, Z+21 ; 0x15 2d980: f6 88 ldd r15, Z+22 ; 0x16 2d982: db 01 movw r26, r22 2d984: ca 01 movw r24, r20 2d986: c7 e0 ldi r28, 0x07 ; 7 2d988: b6 95 lsr r27 2d98a: a7 95 ror r26 2d98c: 97 95 ror r25 2d98e: 87 95 ror r24 2d990: ca 95 dec r28 2d992: d1 f7 brne .-12 ; 0x2d988 2d994: c2 cf rjmp .-124 ; 0x2d91a } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2d996: 40 e0 ldi r20, 0x00 ; 0 2d998: bc 01 movw r22, r24 2d99a: cd 01 movw r24, r26 2d99c: 0f 94 94 6b call 0x2d728 ; 0x2d728 2d9a0: 81 11 cpse r24, r1 2d9a2: d0 cf rjmp .-96 ; 0x2d944 2d9a4: a5 cf rjmp .-182 ; 0x2d8f0 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2d9a6: b7 01 movw r22, r14 2d9a8: a6 01 movw r20, r12 2d9aa: 4f 77 andi r20, 0x7F ; 127 2d9ac: 55 27 eor r21, r21 2d9ae: 66 27 eor r22, r22 2d9b0: 77 27 eor r23, r23 2d9b2: 44 0f add r20, r20 2d9b4: 55 1f adc r21, r21 2d9b6: 44 0f add r20, r20 2d9b8: 55 1f adc r21, r21 2d9ba: 48 58 subi r20, 0x88 ; 136 2d9bc: 51 4f sbci r21, 0xF1 ; 241 2d9be: fa 01 movw r30, r20 2d9c0: 80 81 ld r24, Z 2d9c2: 91 81 ldd r25, Z+1 ; 0x01 2d9c4: a2 81 ldd r26, Z+2 ; 0x02 2d9c6: b3 81 ldd r27, Z+3 ; 0x03 2d9c8: bf 70 andi r27, 0x0F ; 15 2d9ca: ce cf rjmp .-100 ; 0x2d968 0002d9cc : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2d9cc: 4f 92 push r4 2d9ce: 5f 92 push r5 2d9d0: 6f 92 push r6 2d9d2: 7f 92 push r7 2d9d4: af 92 push r10 2d9d6: bf 92 push r11 2d9d8: cf 92 push r12 2d9da: df 92 push r13 2d9dc: ef 92 push r14 2d9de: ff 92 push r15 2d9e0: 0f 93 push r16 2d9e2: 1f 93 push r17 2d9e4: cf 93 push r28 2d9e6: df 93 push r29 2d9e8: 00 d0 rcall .+0 ; 0x2d9ea 2d9ea: 1f 92 push r1 2d9ec: cd b7 in r28, 0x3d ; 61 2d9ee: de b7 in r29, 0x3e ; 62 2d9f0: 8c 01 movw r16, r24 2d9f2: 49 83 std Y+1, r20 ; 0x01 2d9f4: 5a 83 std Y+2, r21 ; 0x02 2d9f6: 6b 83 std Y+3, r22 ; 0x03 2d9f8: 7c 83 std Y+4, r23 ; 0x04 2d9fa: 59 01 movw r10, r18 uint32_t s = 0; 2d9fc: c1 2c mov r12, r1 2d9fe: d1 2c mov r13, r1 2da00: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2da02: 41 2c mov r4, r1 2da04: 82 e0 ldi r24, 0x02 ; 2 2da06: 58 2e mov r5, r24 2da08: 61 2c mov r6, r1 2da0a: 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; 2da0c: 49 81 ldd r20, Y+1 ; 0x01 2da0e: 5a 81 ldd r21, Y+2 ; 0x02 2da10: 6b 81 ldd r22, Y+3 ; 0x03 2da12: 7c 81 ldd r23, Y+4 ; 0x04 2da14: 9e 01 movw r18, r28 2da16: 2f 5f subi r18, 0xFF ; 255 2da18: 3f 4f sbci r19, 0xFF ; 255 2da1a: c8 01 movw r24, r16 2da1c: 0f 94 63 6c call 0x2d8c6 ; 0x2d8c6 2da20: 88 23 and r24, r24 2da22: 19 f1 breq .+70 ; 0x2da6a s += 512UL << clusterSizeShift_; 2da24: f8 01 movw r30, r16 2da26: 85 85 ldd r24, Z+13 ; 0x0d 2da28: a3 01 movw r20, r6 2da2a: 92 01 movw r18, r4 2da2c: 04 c0 rjmp .+8 ; 0x2da36 2da2e: 22 0f add r18, r18 2da30: 33 1f adc r19, r19 2da32: 44 1f adc r20, r20 2da34: 55 1f adc r21, r21 2da36: 8a 95 dec r24 2da38: d2 f7 brpl .-12 ; 0x2da2e 2da3a: da 01 movw r26, r20 2da3c: c9 01 movw r24, r18 2da3e: c8 0e add r12, r24 2da40: d9 1e adc r13, r25 2da42: ea 1e adc r14, r26 2da44: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2da46: 49 81 ldd r20, Y+1 ; 0x01 2da48: 5a 81 ldd r21, Y+2 ; 0x02 2da4a: 6b 81 ldd r22, Y+3 ; 0x03 2da4c: 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; 2da4e: 87 89 ldd r24, Z+23 ; 0x17 2da50: 80 31 cpi r24, 0x10 ; 16 2da52: f1 f4 brne .+60 ; 0x2da90 2da54: 81 e0 ldi r24, 0x01 ; 1 2da56: 48 3f cpi r20, 0xF8 ; 248 2da58: 5f 4f sbci r21, 0xFF ; 255 2da5a: 61 05 cpc r22, r1 2da5c: 71 05 cpc r23, r1 2da5e: b0 f2 brcs .-84 ; 0x2da0c *size = s; 2da60: f5 01 movw r30, r10 2da62: c0 82 st Z, r12 2da64: d1 82 std Z+1, r13 ; 0x01 2da66: e2 82 std Z+2, r14 ; 0x02 2da68: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2da6a: 0f 90 pop r0 2da6c: 0f 90 pop r0 2da6e: 0f 90 pop r0 2da70: 0f 90 pop r0 2da72: df 91 pop r29 2da74: cf 91 pop r28 2da76: 1f 91 pop r17 2da78: 0f 91 pop r16 2da7a: ff 90 pop r15 2da7c: ef 90 pop r14 2da7e: df 90 pop r13 2da80: cf 90 pop r12 2da82: bf 90 pop r11 2da84: af 90 pop r10 2da86: 7f 90 pop r7 2da88: 6f 90 pop r6 2da8a: 5f 90 pop r5 2da8c: 4f 90 pop r4 2da8e: 08 95 ret return cluster >= FAT32EOC_MIN; 2da90: 81 e0 ldi r24, 0x01 ; 1 2da92: 48 3f cpi r20, 0xF8 ; 248 2da94: 5f 4f sbci r21, 0xFF ; 255 2da96: 6f 4f sbci r22, 0xFF ; 255 2da98: 7f 40 sbci r23, 0x0F ; 15 2da9a: 08 f4 brcc .+2 ; 0x2da9e 2da9c: b7 cf rjmp .-146 ; 0x2da0c 2da9e: e0 cf rjmp .-64 ; 0x2da60 0002daa0 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2daa0: cf 92 push r12 2daa2: df 92 push r13 2daa4: ef 92 push r14 2daa6: ff 92 push r15 2daa8: 1f 93 push r17 2daaa: cf 93 push r28 2daac: df 93 push r29 2daae: ec 01 movw r28, r24 2dab0: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2dab2: e1 11 cpse r30, r1 2dab4: 09 c0 rjmp .+18 ; 0x2dac8 2dab6: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2dab8: df 91 pop r29 2daba: cf 91 pop r28 2dabc: 1f 91 pop r17 2dabe: ff 90 pop r15 2dac0: ef 90 pop r14 2dac2: df 90 pop r13 2dac4: cf 90 pop r12 2dac6: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2dac8: 89 81 ldd r24, Y+1 ; 0x01 2daca: 80 ff sbrs r24, 0 2dacc: f4 cf rjmp .-24 ; 0x2dab6 gfOffset = curPosition_ & 0X1FF; // offset in block 2dace: 48 85 ldd r20, Y+8 ; 0x08 2dad0: 59 85 ldd r21, Y+9 ; 0x09 2dad2: 6a 85 ldd r22, Y+10 ; 0x0a 2dad4: 7b 85 ldd r23, Y+11 ; 0x0b 2dad6: 9a 01 movw r18, r20 2dad8: 31 70 andi r19, 0x01 ; 1 2dada: 3a a3 std Y+34, r19 ; 0x22 2dadc: 29 a3 std Y+33, r18 ; 0x21 2dade: 89 8d ldd r24, Y+25 ; 0x19 2dae0: 9a 8d ldd r25, Y+26 ; 0x1a 2dae2: 6a 01 movw r12, r20 2dae4: 7b 01 movw r14, r22 2dae6: f9 e0 ldi r31, 0x09 ; 9 2dae8: f6 94 lsr r15 2daea: e7 94 ror r14 2daec: d7 94 ror r13 2daee: c7 94 ror r12 2daf0: fa 95 dec r31 2daf2: d1 f7 brne .-12 ; 0x2dae8 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2daf4: e2 30 cpi r30, 0x02 ; 2 2daf6: 79 f4 brne .+30 ; 0x2db16 // 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); 2daf8: fc 01 movw r30, r24 2dafa: 82 8d ldd r24, Z+26 ; 0x1a 2dafc: 93 8d ldd r25, Z+27 ; 0x1b 2dafe: a4 8d ldd r26, Z+28 ; 0x1c 2db00: b5 8d ldd r27, Z+29 ; 0x1d 2db02: 8c 0d add r24, r12 2db04: 9d 1d adc r25, r13 2db06: ae 1d adc r26, r14 2db08: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2db0a: 8d 8f std Y+29, r24 ; 0x1d 2db0c: 9e 8f std Y+30, r25 ; 0x1e 2db0e: af 8f std Y+31, r26 ; 0x1f 2db10: b8 a3 std Y+32, r27 ; 0x20 } return true; 2db12: 81 e0 ldi r24, 0x01 ; 1 2db14: d1 cf rjmp .-94 ; 0x2dab8 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);} 2db16: fc 01 movw r30, r24 2db18: 14 81 ldd r17, Z+4 ; 0x04 2db1a: 11 50 subi r17, 0x01 ; 1 2db1c: 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) { 2db1e: 23 2b or r18, r19 2db20: 71 f4 brne .+28 ; 0x2db3e 2db22: 11 11 cpse r17, r1 2db24: 0c c0 rjmp .+24 ; 0x2db3e // start of new cluster if (curPosition_ == 0) { 2db26: 45 2b or r20, r21 2db28: 46 2b or r20, r22 2db2a: 47 2b or r20, r23 2db2c: 31 f5 brne .+76 ; 0x2db7a // use first cluster in file curCluster_ = firstCluster_; 2db2e: 8d 89 ldd r24, Y+21 ; 0x15 2db30: 9e 89 ldd r25, Y+22 ; 0x16 2db32: af 89 ldd r26, Y+23 ; 0x17 2db34: b8 8d ldd r27, Y+24 ; 0x18 2db36: 8c 83 std Y+4, r24 ; 0x04 2db38: 9d 83 std Y+5, r25 ; 0x05 2db3a: ae 83 std Y+6, r26 ; 0x06 2db3c: bf 83 std Y+7, r27 ; 0x07 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2db3e: e9 8d ldd r30, Y+25 ; 0x19 2db40: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2db42: 8c 81 ldd r24, Y+4 ; 0x04 2db44: 9d 81 ldd r25, Y+5 ; 0x05 2db46: ae 81 ldd r26, Y+6 ; 0x06 2db48: bf 81 ldd r27, Y+7 ; 0x07 2db4a: 02 97 sbiw r24, 0x02 ; 2 2db4c: a1 09 sbc r26, r1 2db4e: b1 09 sbc r27, r1 2db50: 25 85 ldd r18, Z+13 ; 0x0d 2db52: 04 c0 rjmp .+8 ; 0x2db5c 2db54: 88 0f add r24, r24 2db56: 99 1f adc r25, r25 2db58: aa 1f adc r26, r26 2db5a: bb 1f adc r27, r27 2db5c: 2a 95 dec r18 2db5e: d2 f7 brpl .-12 ; 0x2db54 2db60: 46 85 ldd r20, Z+14 ; 0x0e 2db62: 57 85 ldd r21, Z+15 ; 0x0f 2db64: 60 89 ldd r22, Z+16 ; 0x10 2db66: 71 89 ldd r23, Z+17 ; 0x11 2db68: 84 0f add r24, r20 2db6a: 95 1f adc r25, r21 2db6c: a6 1f adc r26, r22 2db6e: b7 1f adc r27, r23 2db70: 81 0f add r24, r17 2db72: 91 1d adc r25, r1 2db74: a1 1d adc r26, r1 2db76: b1 1d adc r27, r1 2db78: c8 cf rjmp .-112 ; 0x2db0a if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2db7a: 4c 81 ldd r20, Y+4 ; 0x04 2db7c: 5d 81 ldd r21, Y+5 ; 0x05 2db7e: 6e 81 ldd r22, Y+6 ; 0x06 2db80: 7f 81 ldd r23, Y+7 ; 0x07 2db82: 9e 01 movw r18, r28 2db84: 2c 5f subi r18, 0xFC ; 252 2db86: 3f 4f sbci r19, 0xFF ; 255 2db88: 0f 94 63 6c call 0x2d8c6 ; 0x2d8c6 2db8c: 81 11 cpse r24, r1 2db8e: d7 cf rjmp .-82 ; 0x2db3e 2db90: 92 cf rjmp .-220 ; 0x2dab6 0002db92 : * 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) { 2db92: df 92 push r13 2db94: ef 92 push r14 2db96: ff 92 push r15 2db98: 0f 93 push r16 2db9a: 1f 93 push r17 2db9c: cf 93 push r28 2db9e: df 93 push r29 2dba0: 8c 01 movw r16, r24 2dba2: eb 01 movw r28, r22 2dba4: 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; 2dba6: 8d e0 ldi r24, 0x0D ; 13 2dba8: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2dbaa: 40 e2 ldi r20, 0x20 ; 32 2dbac: 50 e0 ldi r21, 0x00 ; 0 2dbae: be 01 movw r22, r28 2dbb0: c8 01 movw r24, r16 2dbb2: 0f 94 0a a7 call 0x34e14 ; 0x34e14 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2dbb6: 80 32 cpi r24, 0x20 ; 32 2dbb8: 91 05 cpc r25, r1 2dbba: 71 f0 breq .+28 ; 0x2dbd8 2dbbc: 21 e0 ldi r18, 0x01 ; 1 2dbbe: 89 2b or r24, r25 2dbc0: 09 f4 brne .+2 ; 0x2dbc4 2dbc2: 20 e0 ldi r18, 0x00 ; 0 2dbc4: 82 2f mov r24, r18 2dbc6: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2dbc8: df 91 pop r29 2dbca: cf 91 pop r28 2dbcc: 1f 91 pop r17 2dbce: 0f 91 pop r16 2dbd0: ff 90 pop r15 2dbd2: ef 90 pop r14 2dbd4: df 90 pop r13 2dbd6: 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; 2dbd8: 28 81 ld r18, Y 2dbda: 22 23 and r18, r18 2dbdc: 09 f4 brne .+2 ; 0x2dbe0 2dbde: 3f c0 rjmp .+126 ; 0x2dc5e // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2dbe0: 25 3e cpi r18, 0xE5 ; 229 2dbe2: 19 f3 breq .-58 ; 0x2dbaa 2dbe4: 2e 32 cpi r18, 0x2E ; 46 2dbe6: 09 f3 breq .-62 ; 0x2dbaa //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) 2dbe8: 3b 85 ldd r19, Y+11 ; 0x0b 2dbea: 3f 73 andi r19, 0x3F ; 63 2dbec: 3f 30 cpi r19, 0x0F ; 15 2dbee: 99 f5 brne .+102 ; 0x2dc56 2dbf0: e1 14 cp r14, r1 2dbf2: f1 04 cpc r15, r1 2dbf4: 81 f1 breq .+96 ; 0x2dc56 { 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) 2dbf6: 4a 8d ldd r20, Y+26 ; 0x1a 2dbf8: 5b 8d ldd r21, Y+27 ; 0x1b 2dbfa: 45 2b or r20, r21 2dbfc: 61 f5 brne .+88 ; 0x2dc56 2dbfe: 2f 71 andi r18, 0x1F ; 31 2dc00: 3f ef ldi r19, 0xFF ; 255 2dc02: 32 0f add r19, r18 2dc04: 34 30 cpi r19, 0x04 ; 4 2dc06: 38 f5 brcc .+78 ; 0x2dc56 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2dc08: 21 50 subi r18, 0x01 ; 1 2dc0a: 33 0b sbc r19, r19 2dc0c: d2 9e mul r13, r18 2dc0e: c0 01 movw r24, r0 2dc10: d3 9e mul r13, r19 2dc12: 90 0d add r25, r0 2dc14: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2dc16: f7 01 movw r30, r14 2dc18: e8 0f add r30, r24 2dc1a: f9 1f adc r31, r25 2dc1c: 29 81 ldd r18, Y+1 ; 0x01 2dc1e: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2dc20: 2b 81 ldd r18, Y+3 ; 0x03 2dc22: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2dc24: 2d 81 ldd r18, Y+5 ; 0x05 2dc26: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2dc28: 2f 81 ldd r18, Y+7 ; 0x07 2dc2a: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2dc2c: 29 85 ldd r18, Y+9 ; 0x09 2dc2e: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2dc30: 2e 85 ldd r18, Y+14 ; 0x0e 2dc32: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2dc34: 28 89 ldd r18, Y+16 ; 0x10 2dc36: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2dc38: 2a 89 ldd r18, Y+18 ; 0x12 2dc3a: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2dc3c: 2c 89 ldd r18, Y+20 ; 0x14 2dc3e: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2dc40: 2e 89 ldd r18, Y+22 ; 0x16 2dc42: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2dc44: 28 8d ldd r18, Y+24 ; 0x18 2dc46: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2dc48: 2c 8d ldd r18, Y+28 ; 0x1c 2dc4a: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2dc4c: 2e 8d ldd r18, Y+30 ; 0x1e 2dc4e: 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) 2dc50: 28 81 ld r18, Y 2dc52: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2dc54: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2dc56: 2b 85 ldd r18, Y+11 ; 0x0b 2dc58: 23 fd sbrc r18, 3 2dc5a: a7 cf rjmp .-178 ; 0x2dbaa 2dc5c: b5 cf rjmp .-150 ; 0x2dbc8 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: 80 e0 ldi r24, 0x00 ; 0 2dc60: b3 cf rjmp .-154 ; 0x2dbc8 0002dc62 : * \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() { 2dc62: cf 93 push r28 2dc64: df 93 push r29 2dc66: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2dc68: 8b 81 ldd r24, Y+3 ; 0x03 2dc6a: 88 23 and r24, r24 2dc6c: 49 f1 breq .+82 ; 0x2dcc0 if (flags_ & F_FILE_DIR_DIRTY) { 2dc6e: 89 81 ldd r24, Y+1 ; 0x01 2dc70: 87 ff sbrs r24, 7 2dc72: 22 c0 rjmp .+68 ; 0x2dcb8 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2dc74: 61 e0 ldi r22, 0x01 ; 1 2dc76: ce 01 movw r24, r28 2dc78: 0f 94 32 a4 call 0x34864 ; 0x34864 2dc7c: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2dc7e: 89 2b or r24, r25 2dc80: f9 f0 breq .+62 ; 0x2dcc0 2dc82: 80 81 ld r24, Z 2dc84: 85 3e cpi r24, 0xE5 ; 229 2dc86: e1 f0 breq .+56 ; 0x2dcc0 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2dc88: 8b 81 ldd r24, Y+3 ; 0x03 2dc8a: 82 30 cpi r24, 0x02 ; 2 2dc8c: 40 f4 brcc .+16 ; 0x2dc9e 2dc8e: 89 89 ldd r24, Y+17 ; 0x11 2dc90: 9a 89 ldd r25, Y+18 ; 0x12 2dc92: ab 89 ldd r26, Y+19 ; 0x13 2dc94: bc 89 ldd r27, Y+20 ; 0x14 2dc96: 84 8f std Z+28, r24 ; 0x1c 2dc98: 95 8f std Z+29, r25 ; 0x1d 2dc9a: a6 8f std Z+30, r26 ; 0x1e 2dc9c: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2dc9e: 8d 89 ldd r24, Y+21 ; 0x15 2dca0: 9e 89 ldd r25, Y+22 ; 0x16 2dca2: 93 8f std Z+27, r25 ; 0x1b 2dca4: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2dca6: 8d 89 ldd r24, Y+21 ; 0x15 2dca8: 9e 89 ldd r25, Y+22 ; 0x16 2dcaa: af 89 ldd r26, Y+23 ; 0x17 2dcac: b8 8d ldd r27, Y+24 ; 0x18 2dcae: b5 8b std Z+21, r27 ; 0x15 2dcb0: 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; 2dcb2: 89 81 ldd r24, Y+1 ; 0x01 2dcb4: 8f 77 andi r24, 0x7F ; 127 2dcb6: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2dcb8: df 91 pop r29 2dcba: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2dcbc: 0d 94 55 6b jmp 0x2d6aa ; 0x2d6aa fail: writeError = true; 2dcc0: 81 e0 ldi r24, 0x01 ; 1 2dcc2: 88 83 st Y, r24 return false; } 2dcc4: 80 e0 ldi r24, 0x00 ; 0 2dcc6: df 91 pop r29 2dcc8: cf 91 pop r28 2dcca: 08 95 ret 0002dccc : * \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) { 2dccc: 8f 92 push r8 2dcce: 9f 92 push r9 2dcd0: af 92 push r10 2dcd2: bf 92 push r11 2dcd4: cf 92 push r12 2dcd6: df 92 push r13 2dcd8: ef 92 push r14 2dcda: ff 92 push r15 2dcdc: 0f 93 push r16 2dcde: 1f 93 push r17 2dce0: cf 93 push r28 2dce2: df 93 push r29 2dce4: ec 01 movw r28, r24 2dce6: 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; 2dce8: 81 11 cpse r24, r1 2dcea: 0e c0 rjmp .+28 ; 0x2dd08 done: return true; fail: return false; 2dcec: 80 e0 ldi r24, 0x00 ; 0 } 2dcee: df 91 pop r29 2dcf0: cf 91 pop r28 2dcf2: 1f 91 pop r17 2dcf4: 0f 91 pop r16 2dcf6: ff 90 pop r15 2dcf8: ef 90 pop r14 2dcfa: df 90 pop r13 2dcfc: cf 90 pop r12 2dcfe: bf 90 pop r11 2dd00: af 90 pop r10 2dd02: 9f 90 pop r9 2dd04: 8f 90 pop r8 2dd06: 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; 2dd08: 09 89 ldd r16, Y+17 ; 0x11 2dd0a: 1a 89 ldd r17, Y+18 ; 0x12 2dd0c: 2b 89 ldd r18, Y+19 ; 0x13 2dd0e: 3c 89 ldd r19, Y+20 ; 0x14 2dd10: 04 17 cp r16, r20 2dd12: 15 07 cpc r17, r21 2dd14: 26 07 cpc r18, r22 2dd16: 37 07 cpc r19, r23 2dd18: 48 f3 brcs .-46 ; 0x2dcec 2dd1a: 4a 01 movw r8, r20 2dd1c: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2dd1e: 82 30 cpi r24, 0x02 ; 2 2dd20: 31 f4 brne .+12 ; 0x2dd2e curPosition_ = pos; 2dd22: 88 86 std Y+8, r8 ; 0x08 2dd24: 99 86 std Y+9, r9 ; 0x09 2dd26: aa 86 std Y+10, r10 ; 0x0a 2dd28: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2dd2a: 81 e0 ldi r24, 0x01 ; 1 2dd2c: e0 cf rjmp .-64 ; 0x2dcee if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2dd2e: 81 14 cp r8, r1 2dd30: 91 04 cpc r9, r1 2dd32: a1 04 cpc r10, r1 2dd34: b1 04 cpc r11, r1 2dd36: 49 f4 brne .+18 ; 0x2dd4a // set position to start of file curCluster_ = 0; 2dd38: 1c 82 std Y+4, r1 ; 0x04 2dd3a: 1d 82 std Y+5, r1 ; 0x05 2dd3c: 1e 82 std Y+6, r1 ; 0x06 2dd3e: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2dd40: 18 86 std Y+8, r1 ; 0x08 2dd42: 19 86 std Y+9, r1 ; 0x09 2dd44: 1a 86 std Y+10, r1 ; 0x0a 2dd46: 1b 86 std Y+11, r1 ; 0x0b 2dd48: f0 cf rjmp .-32 ; 0x2dd2a goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2dd4a: 08 85 ldd r16, Y+8 ; 0x08 2dd4c: 19 85 ldd r17, Y+9 ; 0x09 2dd4e: 2a 85 ldd r18, Y+10 ; 0x0a 2dd50: 3b 85 ldd r19, Y+11 ; 0x0b 2dd52: e9 8d ldd r30, Y+25 ; 0x19 2dd54: fa 8d ldd r31, Y+26 ; 0x1a 2dd56: 85 85 ldd r24, Z+13 ; 0x0d 2dd58: 90 e0 ldi r25, 0x00 ; 0 2dd5a: 09 96 adiw r24, 0x09 ; 9 2dd5c: b9 01 movw r22, r18 2dd5e: a8 01 movw r20, r16 2dd60: 41 50 subi r20, 0x01 ; 1 2dd62: 51 09 sbc r21, r1 2dd64: 61 09 sbc r22, r1 2dd66: 71 09 sbc r23, r1 2dd68: 08 2e mov r0, r24 2dd6a: 04 c0 rjmp .+8 ; 0x2dd74 2dd6c: 76 95 lsr r23 2dd6e: 67 95 ror r22 2dd70: 57 95 ror r21 2dd72: 47 95 ror r20 2dd74: 0a 94 dec r0 2dd76: d2 f7 brpl .-12 ; 0x2dd6c nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2dd78: 75 01 movw r14, r10 2dd7a: 64 01 movw r12, r8 2dd7c: e1 e0 ldi r30, 0x01 ; 1 2dd7e: ce 1a sub r12, r30 2dd80: d1 08 sbc r13, r1 2dd82: e1 08 sbc r14, r1 2dd84: f1 08 sbc r15, r1 2dd86: 04 c0 rjmp .+8 ; 0x2dd90 2dd88: f6 94 lsr r15 2dd8a: e7 94 ror r14 2dd8c: d7 94 ror r13 2dd8e: c7 94 ror r12 2dd90: 8a 95 dec r24 2dd92: d2 f7 brpl .-12 ; 0x2dd88 if (nNew < nCur || curPosition_ == 0) { 2dd94: c4 16 cp r12, r20 2dd96: d5 06 cpc r13, r21 2dd98: e6 06 cpc r14, r22 2dd9a: f7 06 cpc r15, r23 2dd9c: 20 f0 brcs .+8 ; 0x2dda6 2dd9e: 01 2b or r16, r17 2dda0: 02 2b or r16, r18 2dda2: 03 2b or r16, r19 2dda4: 11 f5 brne .+68 ; 0x2ddea // must follow chain from first cluster curCluster_ = firstCluster_; 2dda6: 8d 89 ldd r24, Y+21 ; 0x15 2dda8: 9e 89 ldd r25, Y+22 ; 0x16 2ddaa: af 89 ldd r26, Y+23 ; 0x17 2ddac: b8 8d ldd r27, Y+24 ; 0x18 2ddae: 8c 83 std Y+4, r24 ; 0x04 2ddb0: 9d 83 std Y+5, r25 ; 0x05 2ddb2: ae 83 std Y+6, r26 ; 0x06 2ddb4: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2ddb6: 8e 01 movw r16, r28 2ddb8: 0c 5f subi r16, 0xFC ; 252 2ddba: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2ddbc: c1 14 cp r12, r1 2ddbe: d1 04 cpc r13, r1 2ddc0: e1 04 cpc r14, r1 2ddc2: f1 04 cpc r15, r1 2ddc4: 09 f4 brne .+2 ; 0x2ddc8 2ddc6: ad cf rjmp .-166 ; 0x2dd22 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2ddc8: 4c 81 ldd r20, Y+4 ; 0x04 2ddca: 5d 81 ldd r21, Y+5 ; 0x05 2ddcc: 6e 81 ldd r22, Y+6 ; 0x06 2ddce: 7f 81 ldd r23, Y+7 ; 0x07 2ddd0: 98 01 movw r18, r16 2ddd2: 89 8d ldd r24, Y+25 ; 0x19 2ddd4: 9a 8d ldd r25, Y+26 ; 0x1a 2ddd6: 0f 94 63 6c call 0x2d8c6 ; 0x2d8c6 2ddda: 91 e0 ldi r25, 0x01 ; 1 2dddc: c9 1a sub r12, r25 2ddde: d1 08 sbc r13, r1 2dde0: e1 08 sbc r14, r1 2dde2: f1 08 sbc r15, r1 2dde4: 81 11 cpse r24, r1 2dde6: ea cf rjmp .-44 ; 0x2ddbc 2dde8: 81 cf rjmp .-254 ; 0x2dcec if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2ddea: c4 1a sub r12, r20 2ddec: d5 0a sbc r13, r21 2ddee: e6 0a sbc r14, r22 2ddf0: f7 0a sbc r15, r23 2ddf2: e1 cf rjmp .-62 ; 0x2ddb6 0002ddf4 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 2ddf4: 80 91 85 17 lds r24, 0x1785 ; 0x801785 2ddf8: 88 23 and r24, r24 2ddfa: 61 f0 breq .+24 ; 0x2de14 2ddfc: 0e 94 cc e4 call 0x1c998 ; 0x1c998 2de00: 88 23 and r24, r24 2de02: 41 f0 breq .+16 ; 0x2de14 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 2de04: 80 eb ldi r24, 0xB0 ; 176 2de06: 9e e3 ldi r25, 0x3E ; 62 2de08: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2de0c: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 2de10: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 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; 2de14: 86 e0 ldi r24, 0x06 ; 6 2de16: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 2de1a: fa cf rjmp .-12 ; 0x2de10 0002de1c : 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() { 2de1c: cf 93 push r28 2de1e: df 93 push r29 if (MMU2::mmu2.Enabled()) { 2de20: 80 91 95 13 lds r24, 0x1395 ; 0x801395 2de24: 81 30 cpi r24, 0x01 ; 1 2de26: e9 f4 brne .+58 ; 0x2de62 const uint8_t filament = choose_menu_P( 2de28: 8a e3 ldi r24, 0x3A ; 58 2de2a: 9f e4 ldi r25, 0x4F ; 79 2de2c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2de30: ec 01 movw r28, r24 2de32: 82 e1 ldi r24, 0x12 ; 18 2de34: 9f e3 ldi r25, 0x3F ; 63 2de36: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,_T(MSG_CANCEL)); 2de3a: be 01 movw r22, r28 2de3c: 0e 94 ca d9 call 0x1b394 ; 0x1b394 if (filament < MMU_FILAMENT_COUNT) { 2de40: 85 30 cpi r24, 0x05 ; 5 2de42: a0 f5 brcc .+104 ; 0x2deac lay1cal_filament = filament; 2de44: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 <_ZL16lay1cal_filament.lto_priv.455> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 2de48: 8a e0 ldi r24, 0x0A ; 10 2de4a: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 menu_goto(lcd_generic_preheat_menu, 0, true); 2de4e: 20 e0 ldi r18, 0x00 ; 0 2de50: 41 e0 ldi r20, 0x01 ; 1 2de52: 70 e0 ldi r23, 0x00 ; 0 2de54: 60 e0 ldi r22, 0x00 ; 0 2de56: 82 ee ldi r24, 0xE2 ; 226 2de58: 9a e3 ldi r25, 0x3A ; 58 } 2de5a: df 91 pop r29 2de5c: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 2de5e: 0d 94 ef ce jmp 0x39dde ; 0x39dde menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2de62: 8f e5 ldi r24, 0x5F ; 95 2de64: 9f e0 ldi r25, 0x0F ; 15 2de66: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2de6a: 81 11 cpse r24, r1 2de6c: ed cf rjmp .-38 ; 0x2de48 { bool loaded = false; if (fsensor.isReady()) { 2de6e: 80 91 85 17 lds r24, 0x1785 ; 0x801785 2de72: 82 30 cpi r24, 0x02 ; 2 2de74: f9 f4 brne .+62 ; 0x2deb4 loaded = fsensor.getFilamentPresent(); 2de76: 0e 94 cc e4 call 0x1c998 ; 0x1c998 2de7a: 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) { 2de7c: 91 11 cpse r25, r1 2de7e: e4 cf rjmp .-56 ; 0x2de48 lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 2de80: 8c e1 ldi r24, 0x1C ; 28 2de82: 9f e4 ldi r25, 0x4F ; 79 2de84: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2de88: 0f 94 55 35 call 0x26aaa ; 0x26aaa lcd_consume_click(); 2de8c: 0e 94 be 71 call 0xe37c ; 0xe37c 2de90: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 2de92: 84 e6 ldi r24, 0x64 ; 100 2de94: 90 e0 ldi r25, 0x00 ; 0 2de96: 0e 94 98 8e call 0x11d30 ; 0x11d30 if (lcd_clicked()) { 2de9a: 0e 94 c3 71 call 0xe386 ; 0xe386 2de9e: 81 11 cpse r24, r1 2dea0: 02 c0 rjmp .+4 ; 0x2dea6 2dea2: 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 2dea4: b1 f7 brne .-20 ; 0x2de92 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 2dea6: 81 e0 ldi r24, 0x01 ; 1 2dea8: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 2deac: df 91 pop r29 2deae: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 2deb0: 0d 94 8d d1 jmp 0x3a31a ; 0x3a31a { 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); 2deb4: 85 e3 ldi r24, 0x35 ; 53 2deb6: 94 e5 ldi r25, 0x54 ; 84 2deb8: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2debc: 41 e0 ldi r20, 0x01 ; 1 2debe: 60 e0 ldi r22, 0x00 ; 0 2dec0: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c 2dec4: 91 e0 ldi r25, 0x01 ; 1 2dec6: 81 11 cpse r24, r1 2dec8: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 2deca: 81 e0 ldi r24, 0x01 ; 1 2decc: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 2ded0: d5 cf rjmp .-86 ; 0x2de7c 0002ded2 : 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()") { 2ded2: cf 93 push r28 2ded4: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 { //0: N/A; 1: OFF; 2: ON uint8_t pinda_state = STATE_NA; uint8_t idler_state = STATE_NA; pinda_state = READ(Z_MIN_PIN); 2ded8: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 2deda: 48 e6 ldi r20, 0x68 ; 104 2dedc: 50 e7 ldi r21, 0x70 ; 112 2dede: 60 e0 ldi r22, 0x00 ; 0 2dee0: 80 e0 ldi r24, 0x00 ; 0 2dee2: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(LCD_WIDTH - 14, 0); 2dee6: 60 e0 ldi r22, 0x00 ; 0 2dee8: 86 e0 ldi r24, 0x06 ; 6 2deea: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print_state(pinda_state); 2deee: c4 fb bst r28, 4 2def0: 88 27 eor r24, r24 2def2: 80 f9 bld r24, 0 2def4: 0f 94 11 27 call 0x24e22 ; 0x24e22 if (MMU2::mmu2.Enabled()) { 2def8: 80 91 95 13 lds r24, 0x1395 ; 0x801395 2defc: 81 30 cpi r24, 0x01 ; 1 2defe: 99 f4 brne .+38 ; 0x2df26 inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 2df00: c1 e0 ldi r28, 0x01 ; 1 2df02: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 2df06: 81 11 cpse r24, r1 2df08: 01 c0 rjmp .+2 ; 0x2df0c 2df0a: 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 2df0c: 42 e6 ldi r20, 0x62 ; 98 2df0e: 50 e7 ldi r21, 0x70 ; 112 2df10: 60 e0 ldi r22, 0x00 ; 0 2df12: 8a e0 ldi r24, 0x0A ; 10 2df14: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(LCD_WIDTH - 3, 0); 2df18: 60 e0 ldi r22, 0x00 ; 0 2df1a: 81 e1 ldi r24, 0x11 ; 17 2df1c: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print_state(finda_state); 2df20: 8c 2f mov r24, r28 2df22: 0f 94 11 27 call 0x24e22 ; 0x24e22 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 2df26: 0e 94 cc e4 call 0x1c998 ; 0x1c998 2df2a: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 2df2c: 8c eb ldi r24, 0xBC ; 188 2df2e: 9c e3 ldi r25, 0x3C ; 60 2df30: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2df34: ac 01 movw r20, r24 2df36: 61 e0 ldi r22, 0x01 ; 1 2df38: 80 e0 ldi r24, 0x00 ; 0 2df3a: 0e 94 ba 6f call 0xdf74 ; 0xdf74 lcd_set_cursor(LCD_WIDTH - 3, 1); 2df3e: 61 e0 ldi r22, 0x01 ; 1 2df40: 81 e1 ldi r24, 0x11 ; 17 2df42: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print_state(idler_state); 2df46: 8c 2f mov r24, r28 2df48: 0f 94 11 27 call 0x24e22 ; 0x24e22 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(); } 2df4c: 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(); 2df4e: 0d 94 2f d2 jmp 0x3a45e ; 0x3a45e 0002df52 : 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){ 2df52: 2f 92 push r2 2df54: 3f 92 push r3 2df56: 4f 92 push r4 2df58: 5f 92 push r5 2df5a: 6f 92 push r6 2df5c: 7f 92 push r7 2df5e: 8f 92 push r8 2df60: 9f 92 push r9 2df62: af 92 push r10 2df64: bf 92 push r11 2df66: cf 92 push r12 2df68: df 92 push r13 2df6a: ef 92 push r14 2df6c: ff 92 push r15 2df6e: 0f 93 push r16 2df70: 1f 93 push r17 2df72: cf 93 push r28 2df74: df 93 push r29 2df76: 00 d0 rcall .+0 ; 0x2df78 2df78: 1f 92 push r1 2df7a: 1f 92 push r1 2df7c: cd b7 in r28, 0x3d ; 61 2df7e: de b7 in r29, 0x3e ; 62 2df80: 1c 01 movw r2, r24 2df82: 2a 01 movw r4, r20 2df84: 3b 01 movw r6, r22 2df86: 00 e2 ldi r16, 0x20 ; 32 2df88: 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){ 2df8a: 19 82 std Y+1, r1 ; 0x01 2df8c: 99 81 ldd r25, Y+1 ; 0x01 2df8e: 89 2f mov r24, r25 2df90: 90 e0 ldi r25, 0x00 ; 0 2df92: 9b 83 std Y+3, r25 ; 0x03 2df94: 8a 83 std Y+2, r24 ; 0x02 2df96: 80 17 cp r24, r16 2df98: 91 07 cpc r25, r17 2df9a: 9c f5 brge .+102 ; 0x2e002 if (points[j] > points[j + 1]) 2df9c: 88 0f add r24, r24 2df9e: 99 1f adc r25, r25 2dfa0: 88 0f add r24, r24 2dfa2: 99 1f adc r25, r25 2dfa4: 9d 83 std Y+5, r25 ; 0x05 2dfa6: 8c 83 std Y+4, r24 ; 0x04 2dfa8: 82 0d add r24, r2 2dfaa: 93 1d adc r25, r3 2dfac: 9b 83 std Y+3, r25 ; 0x03 2dfae: 8a 83 std Y+2, r24 ; 0x02 2dfb0: fc 01 movw r30, r24 2dfb2: c0 80 ld r12, Z 2dfb4: d1 80 ldd r13, Z+1 ; 0x01 2dfb6: e2 80 ldd r14, Z+2 ; 0x02 2dfb8: f3 80 ldd r15, Z+3 ; 0x03 2dfba: 8c 81 ldd r24, Y+4 ; 0x04 2dfbc: 9d 81 ldd r25, Y+5 ; 0x05 2dfbe: 04 96 adiw r24, 0x04 ; 4 2dfc0: 82 0d add r24, r2 2dfc2: 93 1d adc r25, r3 2dfc4: 9d 83 std Y+5, r25 ; 0x05 2dfc6: 8c 83 std Y+4, r24 ; 0x04 2dfc8: fc 01 movw r30, r24 2dfca: 80 80 ld r8, Z 2dfcc: 91 80 ldd r9, Z+1 ; 0x01 2dfce: a2 80 ldd r10, Z+2 ; 0x02 2dfd0: b3 80 ldd r11, Z+3 ; 0x03 2dfd2: a5 01 movw r20, r10 2dfd4: 94 01 movw r18, r8 2dfd6: c7 01 movw r24, r14 2dfd8: b6 01 movw r22, r12 2dfda: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 2dfde: 18 16 cp r1, r24 2dfe0: 64 f4 brge .+24 ; 0x2dffa SWAP(points[j], points[j + 1]); 2dfe2: ea 81 ldd r30, Y+2 ; 0x02 2dfe4: fb 81 ldd r31, Y+3 ; 0x03 2dfe6: 80 82 st Z, r8 2dfe8: 91 82 std Z+1, r9 ; 0x01 2dfea: a2 82 std Z+2, r10 ; 0x02 2dfec: b3 82 std Z+3, r11 ; 0x03 2dfee: ec 81 ldd r30, Y+4 ; 0x04 2dff0: fd 81 ldd r31, Y+5 ; 0x05 2dff2: c0 82 st Z, r12 2dff4: d1 82 std Z+1, r13 ; 0x01 2dff6: e2 82 std Z+2, r14 ; 0x02 2dff8: 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){ 2dffa: f9 81 ldd r31, Y+1 ; 0x01 2dffc: ff 5f subi r31, 0xFF ; 255 2dffe: f9 83 std Y+1, r31 ; 0x01 2e000: c5 cf rjmp .-118 ; 0x2df8c 2e002: 01 50 subi r16, 0x01 ; 1 2e004: 11 09 sbc r17, r1 2e006: 08 f6 brcc .-126 ; 0x2df8a /// 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]; 2e008: f1 01 movw r30, r2 2e00a: e0 5c subi r30, 0xC0 ; 192 2e00c: 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); 2e00e: 20 81 ld r18, Z 2e010: 31 81 ldd r19, Z+1 ; 0x01 2e012: 42 81 ldd r20, Z+2 ; 0x02 2e014: 53 81 ldd r21, Z+3 ; 0x03 2e016: c3 01 movw r24, r6 2e018: b2 01 movw r22, r4 2e01a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 2e01e: 6b 01 movw r12, r22 2e020: 7c 01 movw r14, r24 2e022: 20 e0 ldi r18, 0x00 ; 0 2e024: 30 e0 ldi r19, 0x00 ; 0 2e026: 40 e0 ldi r20, 0x00 ; 0 2e028: 5f eb ldi r21, 0xBF ; 191 2e02a: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2e02e: 87 fd sbrc r24, 7 2e030: 10 c0 rjmp .+32 ; 0x2e052 2e032: 20 e0 ldi r18, 0x00 ; 0 2e034: 30 e0 ldi r19, 0x00 ; 0 2e036: 40 e0 ldi r20, 0x00 ; 0 2e038: 5f e3 ldi r21, 0x3F ; 63 2e03a: c7 01 movw r24, r14 2e03c: b6 01 movw r22, r12 2e03e: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 2e042: 18 16 cp r1, r24 2e044: 5c f4 brge .+22 ; 0x2e05c 2e046: c1 2c mov r12, r1 2e048: d1 2c mov r13, r1 2e04a: e1 2c mov r14, r1 2e04c: 8f e3 ldi r24, 0x3F ; 63 2e04e: f8 2e mov r15, r24 2e050: 05 c0 rjmp .+10 ; 0x2e05c 2e052: c1 2c mov r12, r1 2e054: d1 2c mov r13, r1 2e056: e1 2c mov r14, r1 2e058: 9f eb ldi r25, 0xBF ; 191 2e05a: f9 2e mov r15, r25 } 2e05c: c7 01 movw r24, r14 2e05e: b6 01 movw r22, r12 2e060: 0f 90 pop r0 2e062: 0f 90 pop r0 2e064: 0f 90 pop r0 2e066: 0f 90 pop r0 2e068: 0f 90 pop r0 2e06a: df 91 pop r29 2e06c: cf 91 pop r28 2e06e: 1f 91 pop r17 2e070: 0f 91 pop r16 2e072: ff 90 pop r15 2e074: ef 90 pop r14 2e076: df 90 pop r13 2e078: cf 90 pop r12 2e07a: bf 90 pop r11 2e07c: af 90 pop r10 2e07e: 9f 90 pop r9 2e080: 8f 90 pop r8 2e082: 7f 90 pop r7 2e084: 6f 90 pop r6 2e086: 5f 90 pop r5 2e088: 4f 90 pop r4 2e08a: 3f 90 pop r3 2e08c: 2f 90 pop r2 2e08e: 08 95 ret 0002e090 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2e090: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2e094: 60 93 35 13 sts 0x1335, r22 ; 0x801335 2e098: 70 93 36 13 sts 0x1336, r23 ; 0x801336 2e09c: 80 93 37 13 sts 0x1337, r24 ; 0x801337 2e0a0: 90 93 38 13 sts 0x1338, r25 ; 0x801338 } 2e0a4: 08 95 ret 0002e0a6 : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2e0a6: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 2e0aa: 88 23 and r24, r24 2e0ac: 69 f0 breq .+26 ; 0x2e0c8 2e0ae: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 2e0b2: 88 23 and r24, r24 2e0b4: 49 f0 breq .+18 ; 0x2e0c8 SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2e0b6: 8b e9 ldi r24, 0x9B ; 155 2e0b8: 99 ea ldi r25, 0xA9 ; 169 2e0ba: 0e 94 17 7b call 0xf62e ; 0xf62e retryAttempts--; 2e0be: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 2e0c2: 81 50 subi r24, 0x01 ; 1 2e0c4: 80 93 7a 13 sts 0x137A, r24 ; 0x80137a } } 2e0c8: 08 95 ret 0002e0ca : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2e0ca: 9f 92 push r9 2e0cc: af 92 push r10 2e0ce: bf 92 push r11 2e0d0: cf 92 push r12 2e0d2: df 92 push r13 2e0d4: ef 92 push r14 2e0d6: ff 92 push r15 2e0d8: 0f 93 push r16 2e0da: 1f 93 push r17 2e0dc: cf 93 push r28 2e0de: df 93 push r29 2e0e0: cd b7 in r28, 0x3d ; 61 2e0e2: de b7 in r29, 0x3e ; 62 2e0e4: e0 97 sbiw r28, 0x30 ; 48 2e0e6: 0f b6 in r0, 0x3f ; 63 2e0e8: f8 94 cli 2e0ea: de bf out 0x3e, r29 ; 62 2e0ec: 0f be out 0x3f, r0 ; 63 2e0ee: cd bf out 0x3d, r28 ; 61 2e0f0: 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()]; 2e0f2: e0 90 63 13 lds r14, 0x1363 ; 0x801363 2e0f6: fe 01 movw r30, r28 2e0f8: 31 96 adiw r30, 0x01 ; 1 2e0fa: 21 e0 ldi r18, 0x01 ; 1 2e0fc: 30 e0 ldi r19, 0x00 ; 0 2e0fe: 5f 01 movw r10, r30 2e100: f1 2c mov r15, r1 2e102: 40 e1 ldi r20, 0x10 ; 16 2e104: c4 2e mov r12, r20 2e106: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2e108: 50 e2 ldi r21, 0x20 ; 32 2e10a: 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()]; 2e10c: c7 01 movw r24, r14 2e10e: 82 1b sub r24, r18 2e110: 93 0b sbc r25, r19 2e112: b6 01 movw r22, r12 2e114: 0f 94 23 de call 0x3bc46 ; 0x3bc46 <__divmodhi4> 2e118: dc 01 movw r26, r24 2e11a: bb 27 eor r27, r27 2e11c: aa 5d subi r26, 0xDA ; 218 2e11e: bc 4e sbci r27, 0xEC ; 236 2e120: 9d 96 adiw r26, 0x2d ; 45 2e122: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2e124: 48 2f mov r20, r24 2e126: 50 e0 ldi r21, 0x00 ; 0 2e128: 94 e0 ldi r25, 0x04 ; 4 2e12a: 55 95 asr r21 2e12c: 47 95 ror r20 2e12e: 9a 95 dec r25 2e130: e1 f7 brne .-8 ; 0x2e12a lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2e132: 96 ef ldi r25, 0xF6 ; 246 2e134: 94 0f add r25, r20 2e136: 96 30 cpi r25, 0x06 ; 6 2e138: a8 f1 brcs .+106 ; 0x2e1a4 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2e13a: 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); 2e13c: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2e13e: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2e140: 96 ef ldi r25, 0xF6 ; 246 2e142: 98 0f add r25, r24 2e144: 96 30 cpi r25, 0x06 ; 6 2e146: 80 f1 brcs .+96 ; 0x2e1a8 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2e148: 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); 2e14a: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2e14c: 92 82 std Z+2, r9 ; 0x02 2e14e: 2f 5f subi r18, 0xFF ; 255 2e150: 3f 4f sbci r19, 0xFF ; 255 2e152: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2e154: 21 31 cpi r18, 0x11 ; 17 2e156: 31 05 cpc r19, r1 2e158: c9 f6 brne .-78 ; 0x2e10c 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 2e15a: 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); 2e15c: 84 e1 ldi r24, 0x14 ; 20 2e15e: 9a ea ldi r25, 0xAA ; 170 2e160: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2e164: 8e e0 ldi r24, 0x0E ; 14 2e166: 9a ea ldi r25, 0xAA ; 170 2e168: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2e16c: c8 01 movw r24, r16 2e16e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOPGM(", last bytes: "); 2e172: 86 ec ldi r24, 0xC6 ; 198 2e174: 99 ea ldi r25, 0xA9 ; 169 2e176: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(lrb); 2e17a: c5 01 movw r24, r10 2e17c: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 } 2e180: e0 96 adiw r28, 0x30 ; 48 2e182: 0f b6 in r0, 0x3f ; 63 2e184: f8 94 cli 2e186: de bf out 0x3e, r29 ; 62 2e188: 0f be out 0x3f, r0 ; 63 2e18a: cd bf out 0x3d, r28 ; 61 2e18c: df 91 pop r29 2e18e: cf 91 pop r28 2e190: 1f 91 pop r17 2e192: 0f 91 pop r16 2e194: ff 90 pop r15 2e196: ef 90 pop r14 2e198: df 90 pop r13 2e19a: cf 90 pop r12 2e19c: bf 90 pop r11 2e19e: af 90 pop r10 2e1a0: 9f 90 pop r9 2e1a2: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2e1a4: 49 5a subi r20, 0xA9 ; 169 2e1a6: ca cf rjmp .-108 ; 0x2e13c 2e1a8: 89 5a subi r24, 0xA9 ; 169 2e1aa: cf cf rjmp .-98 ; 0x2e14a 0002e1ac : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2e1ac: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2e1ae: 90 91 3a 13 lds r25, 0x133A ; 0x80133a 2e1b2: 9a 30 cpi r25, 0x0A ; 10 2e1b4: 11 f4 brne .+4 ; 0x2e1ba cause = ss; 2e1b6: 60 93 39 13 sts 0x1339, r22 ; 0x801339 } --occurrences; 2e1ba: 91 50 subi r25, 0x01 ; 1 2e1bc: 90 93 3a 13 sts 0x133A, r25 ; 0x80133a FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2e1c0: 91 11 cpse r25, r1 2e1c2: 0d c0 rjmp .+26 ; 0x2e1de 2e1c4: c9 01 movw r24, r18 LogError(msg_P); 2e1c6: 0f 94 65 70 call 0x2e0ca ; 0x2e0ca SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2e1ca: 87 eb ldi r24, 0xB7 ; 183 2e1cc: 99 ea ldi r25, 0xA9 ; 169 2e1ce: 0e 94 17 7b call 0xf62e ; 0xf62e /// @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; } 2e1d2: 8a e0 ldi r24, 0x0A ; 10 2e1d4: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a 2e1d8: 80 91 39 13 lds r24, 0x1339 ; 0x801339 2e1dc: 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 2e1de: 80 e0 ldi r24, 0x00 ; 0 } } 2e1e0: 08 95 ret 0002e1e2 : } *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) { 2e1e2: cf 93 push r28 2e1e4: df 93 push r29 2e1e6: cd b7 in r28, 0x3d ; 61 2e1e8: de b7 in r29, 0x3e ; 62 2e1ea: 2e 97 sbiw r28, 0x0e ; 14 2e1ec: 0f b6 in r0, 0x3f ; 63 2e1ee: f8 94 cli 2e1f0: de bf out 0x3e, r29 ; 62 2e1f2: 0f be out 0x3f, r0 ; 63 2e1f4: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2e1f6: 2e e3 ldi r18, 0x3E ; 62 2e1f8: 30 e0 ldi r19, 0x00 ; 0 2e1fa: 3a 83 std Y+2, r19 ; 0x02 2e1fc: 29 83 std Y+1, r18 ; 0x01 2e1fe: fe 01 movw r30, r28 2e200: 33 96 adiw r30, 0x03 ; 3 2e202: 2c e0 ldi r18, 0x0C ; 12 2e204: df 01 movw r26, r30 2e206: 1d 92 st X+, r1 2e208: 2a 95 dec r18 2e20a: e9 f7 brne .-6 ; 0x2e206 2e20c: de 01 movw r26, r28 2e20e: 12 96 adiw r26, 0x02 ; 2 2e210: 48 2f mov r20, r24 2e212: fc 01 movw r30, r24 2e214: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2e216: 8e 2f mov r24, r30 2e218: 84 1b sub r24, r20 2e21a: 86 17 cp r24, r22 2e21c: 40 f4 brcc .+16 ; 0x2e22e uint8_t b = txbuff[i]; 2e21e: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2e220: 90 ee ldi r25, 0xE0 ; 224 2e222: 98 0f add r25, r24 2e224: 90 36 cpi r25, 0x60 ; 96 2e226: 08 f0 brcs .+2 ; 0x2e22a b = '.'; 2e228: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2e22a: 8d 93 st X+, r24 2e22c: f4 cf rjmp .-24 ; 0x2e216 } tmp[size + 1] = 0; 2e22e: f9 01 movw r30, r18 2e230: e6 0f add r30, r22 2e232: f1 1d adc r31, r1 2e234: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2e236: 4e e0 ldi r20, 0x0E ; 14 2e238: 50 e0 ldi r21, 0x00 ; 0 2e23a: 6a e1 ldi r22, 0x1A ; 26 2e23c: 7a ea ldi r23, 0xAA ; 170 2e23e: ce 01 movw r24, r28 2e240: 01 96 adiw r24, 0x01 ; 1 2e242: 0f 94 25 db call 0x3b64a ; 0x3b64a 2e246: 89 2b or r24, r25 2e248: 59 f4 brne .+22 ; 0x2e260 2e24a: 4e e0 ldi r20, 0x0E ; 14 2e24c: 50 e0 ldi r21, 0x00 ; 0 2e24e: be 01 movw r22, r28 2e250: 6f 5f subi r22, 0xFF ; 255 2e252: 7f 4f sbci r23, 0xFF ; 255 2e254: 8d e7 ldi r24, 0x7D ; 125 2e256: 92 e1 ldi r25, 0x12 ; 18 2e258: 0f 94 b8 e3 call 0x3c770 ; 0x3c770 2e25c: 89 2b or r24, r25 2e25e: 61 f0 breq .+24 ; 0x2e278 // 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); 2e260: 84 e1 ldi r24, 0x14 ; 20 2e262: 9a ea ldi r25, 0xAA ; 170 2e264: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2e268: 8e e0 ldi r24, 0x0E ; 14 2e26a: 9a ea ldi r25, 0xAA ; 170 2e26c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2e270: ce 01 movw r24, r28 2e272: 01 96 adiw r24, 0x01 ; 1 2e274: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 } strncpy(lastMsg, tmp, rqs); 2e278: 4e e0 ldi r20, 0x0E ; 14 2e27a: 50 e0 ldi r21, 0x00 ; 0 2e27c: be 01 movw r22, r28 2e27e: 6f 5f subi r22, 0xFF ; 255 2e280: 7f 4f sbci r23, 0xFF ; 255 2e282: 8d e7 ldi r24, 0x7D ; 125 2e284: 92 e1 ldi r25, 0x12 ; 18 2e286: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c } 2e28a: 2e 96 adiw r28, 0x0e ; 14 2e28c: 0f b6 in r0, 0x3f ; 63 2e28e: f8 94 cli 2e290: de bf out 0x3e, r29 ; 62 2e292: 0f be out 0x3f, r0 ; 63 2e294: cd bf out 0x3d, r28 ; 61 2e296: df 91 pop r29 2e298: cf 91 pop r28 2e29a: 08 95 ret 0002e29c : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2e29c: cf 92 push r12 2e29e: df 92 push r13 2e2a0: ef 92 push r14 2e2a2: ff 92 push r15 2e2a4: 1f 93 push r17 2e2a6: cf 93 push r28 2e2a8: df 93 push r29 2e2aa: cd b7 in r28, 0x3d ; 61 2e2ac: de b7 in r29, 0x3e ; 62 2e2ae: 62 97 sbiw r28, 0x12 ; 18 2e2b0: 0f b6 in r0, 0x3f ; 63 2e2b2: f8 94 cli 2e2b4: de bf out 0x3e, r29 ; 62 2e2b6: 0f be out 0x3f, r0 ; 63 2e2b8: cd bf out 0x3d, r28 ; 61 2e2ba: 4e 87 std Y+14, r20 ; 0x0e 2e2bc: 5f 87 std Y+15, r21 ; 0x0f 2e2be: 68 8b std Y+16, r22 ; 0x10 2e2c0: 79 8b std Y+17, r23 ; 0x11 2e2c2: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2e2c4: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2e2c6: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e2c8: 51 11 cpse r21, r1 2e2ca: 31 c0 rjmp .+98 ; 0x2e32e *dst = '0'; 2e2cc: 80 e3 ldi r24, 0x30 ; 48 2e2ce: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e2d0: 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); 2e2d2: e1 e0 ldi r30, 0x01 ; 1 2e2d4: e1 0f add r30, r17 2e2d6: 81 e0 ldi r24, 0x01 ; 1 2e2d8: 90 e0 ldi r25, 0x00 ; 0 2e2da: 8c 0f add r24, r28 2e2dc: 9d 1f adc r25, r29 2e2de: 8e 0f add r24, r30 2e2e0: 91 1d adc r25, r1 2e2e2: fc 01 movw r30, r24 2e2e4: 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 2e2e6: 9a e2 ldi r25, 0x2A ; 42 2e2e8: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e2ea: 81 11 cpse r24, r1 2e2ec: 27 c0 rjmp .+78 ; 0x2e33c *dst = '0'; 2e2ee: 80 e3 ldi r24, 0x30 ; 48 2e2f0: 81 83 std Z+1, r24 ; 0x01 return 1; 2e2f2: 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); 2e2f4: 1e 5f subi r17, 0xFE ; 254 2e2f6: 18 0f add r17, r24 txbuff[i] = '\n'; 2e2f8: e1 e0 ldi r30, 0x01 ; 1 2e2fa: f0 e0 ldi r31, 0x00 ; 0 2e2fc: ec 0f add r30, r28 2e2fe: fd 1f adc r31, r29 2e300: e1 0f add r30, r17 2e302: f1 1d adc r31, r1 2e304: 8a e0 ldi r24, 0x0A ; 10 2e306: 80 83 st Z, r24 ++i; 2e308: 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); 2e30a: fe 01 movw r30, r28 2e30c: 31 96 adiw r30, 0x01 ; 1 2e30e: 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--){ 2e310: 6f 01 movw r12, r30 2e312: c1 0e add r12, r17 2e314: d1 1c adc r13, r1 2e316: ec 14 cp r14, r12 2e318: fd 04 cpc r15, r13 2e31a: b1 f0 breq .+44 ; 0x2e348 fputc(*buffer, uart2io); 2e31c: f7 01 movw r30, r14 2e31e: 81 91 ld r24, Z+ 2e320: 7f 01 movw r14, r30 2e322: 6f e6 ldi r22, 0x6F ; 111 2e324: 72 e1 ldi r23, 0x12 ; 18 2e326: 90 e0 ldi r25, 0x00 ; 0 2e328: 0f 94 ae db call 0x3b75c ; 0x3b75c 2e32c: f4 cf rjmp .-24 ; 0x2e316 2e32e: be 01 movw r22, r28 2e330: 6e 5f subi r22, 0xFE ; 254 2e332: 7f 4f sbci r23, 0xFF ; 255 2e334: 0f 94 71 c2 call 0x384e2 ; 0x384e2 2e338: 18 2f mov r17, r24 2e33a: cb cf rjmp .-106 ; 0x2e2d2 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); 2e33c: bf 01 movw r22, r30 2e33e: 6f 5f subi r22, 0xFF ; 255 2e340: 7f 4f sbci r23, 0xFF ; 255 2e342: 0f 94 71 c2 call 0x384e2 ; 0x384e2 2e346: d6 cf rjmp .-84 ; 0x2e2f4 LogRequestMsg(txbuff, len); 2e348: 61 2f mov r22, r17 2e34a: ce 01 movw r24, r28 2e34c: 01 96 adiw r24, 0x01 ; 1 2e34e: 0f 94 f1 70 call 0x2e1e2 ; 0x2e1e2 RecordUARTActivity(); 2e352: 0f 94 48 70 call 0x2e090 ; 0x2e090 } 2e356: 62 96 adiw r28, 0x12 ; 18 2e358: 0f b6 in r0, 0x3f ; 63 2e35a: f8 94 cli 2e35c: de bf out 0x3e, r29 ; 62 2e35e: 0f be out 0x3f, r0 ; 63 2e360: cd bf out 0x3d, r28 ; 61 2e362: df 91 pop r29 2e364: cf 91 pop r28 2e366: 1f 91 pop r17 2e368: ff 90 pop r15 2e36a: ef 90 pop r14 2e36c: df 90 pop r13 2e36e: cf 90 pop r12 2e370: 08 95 ret 0002e372 : 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) { 2e372: 8f 92 push r8 2e374: 9f 92 push r9 2e376: af 92 push r10 2e378: bf 92 push r11 2e37a: df 92 push r13 2e37c: ef 92 push r14 2e37e: ff 92 push r15 2e380: 0f 93 push r16 2e382: 1f 93 push r17 2e384: cf 93 push r28 2e386: df 93 push r29 2e388: cd b7 in r28, 0x3d ; 61 2e38a: de b7 in r29, 0x3e ; 62 2e38c: 67 97 sbiw r28, 0x17 ; 23 2e38e: 0f b6 in r0, 0x3f ; 63 2e390: f8 94 cli 2e392: de bf out 0x3e, r29 ; 62 2e394: 0f be out 0x3f, r0 ; 63 2e396: cd bf out 0x3d, r28 ; 61 2e398: 18 2f mov r17, r24 2e39a: 7b 01 movw r14, r22 2e39c: d4 2e mov r13, r20 2e39e: 07 e5 ldi r16, 0x57 ; 87 2e3a0: 0b 8b std Y+19, r16 ; 0x13 2e3a2: 8c 8b std Y+20, r24 ; 0x14 2e3a4: 7e 8b std Y+22, r23 ; 0x16 2e3a6: 6d 8b std Y+21, r22 ; 0x15 2e3a8: ce 01 movw r24, r28 2e3aa: 43 96 adiw r24, 0x13 ; 19 2e3ac: 0f 94 9d c2 call 0x3853a ; 0x3853a 2e3b0: 8f 8b std Y+23, r24 ; 0x17 2e3b2: 0e 87 std Y+14, r16 ; 0x0e 2e3b4: 1f 87 std Y+15, r17 ; 0x0f 2e3b6: f9 8a std Y+17, r15 ; 0x11 2e3b8: e8 8a std Y+16, r14 ; 0x10 2e3ba: ce 01 movw r24, r28 2e3bc: 0e 96 adiw r24, 0x0e ; 14 2e3be: 0f 94 9d c2 call 0x3853a ; 0x3853a 2e3c2: 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; 2e3c4: 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) { 2e3c6: 11 11 cpse r17, r1 2e3c8: 27 c0 rjmp .+78 ; 0x2e418 *dst = '0'; 2e3ca: 80 e3 ldi r24, 0x30 ; 48 2e3cc: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e3ce: 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); 2e3d0: e1 e0 ldi r30, 0x01 ; 1 2e3d2: e8 0f add r30, r24 dst[i] = ' '; 2e3d4: 21 e0 ldi r18, 0x01 ; 1 2e3d6: 30 e0 ldi r19, 0x00 ; 0 2e3d8: 2c 0f add r18, r28 2e3da: 3d 1f adc r19, r29 2e3dc: 2e 0f add r18, r30 2e3de: 31 1d adc r19, r1 2e3e0: f9 01 movw r30, r18 2e3e2: 90 e2 ldi r25, 0x20 ; 32 2e3e4: 90 83 st Z, r25 return i + 1; 2e3e6: 02 e0 ldi r16, 0x02 ; 2 2e3e8: 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); 2e3ea: aa 24 eor r10, r10 2e3ec: a3 94 inc r10 2e3ee: b1 2c mov r11, r1 2e3f0: ac 0e add r10, r28 2e3f2: bd 1e adc r11, r29 2e3f4: a0 0e add r10, r16 2e3f6: 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) { 2e3f8: e1 14 cp r14, r1 2e3fa: f1 04 cpc r15, r1 2e3fc: 39 f1 breq .+78 ; 0x2e44c *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2e3fe: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2e400: c7 01 movw r24, r14 2e402: 88 27 eor r24, r24 2e404: 90 7f andi r25, 0xF0 ; 240 2e406: 89 2b or r24, r25 2e408: 71 f4 brne .+28 ; 0x2e426 value <<= 4U; 2e40a: 24 e0 ldi r18, 0x04 ; 4 2e40c: ee 0c add r14, r14 2e40e: ff 1c adc r15, r15 2e410: 2a 95 dec r18 2e412: e1 f7 brne .-8 ; 0x2e40c --charsOut; 2e414: 11 50 subi r17, 0x01 ; 1 2e416: f4 cf rjmp .-24 ; 0x2e400 2e418: be 01 movw r22, r28 2e41a: 6e 5f subi r22, 0xFE ; 254 2e41c: 7f 4f sbci r23, 0xFF ; 255 2e41e: 81 2f mov r24, r17 2e420: 0f 94 71 c2 call 0x384e2 ; 0x384e2 2e424: d5 cf rjmp .-86 ; 0x2e3d0 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2e426: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2e428: 88 2d mov r24, r8 2e42a: 8a 19 sub r24, r10 2e42c: 81 17 cp r24, r17 2e42e: 90 f4 brcc .+36 ; 0x2e454 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2e430: 8f 2d mov r24, r15 2e432: 82 95 swap r24 2e434: 8f 70 andi r24, 0x0F ; 15 2e436: 94 e0 ldi r25, 0x04 ; 4 2e438: ee 0c add r14, r14 2e43a: ff 1c adc r15, r15 2e43c: 9a 95 dec r25 2e43e: e1 f7 brne .-8 ; 0x2e438 2e440: 0f 94 67 c2 call 0x384ce ; 0x384ce 2e444: f4 01 movw r30, r8 2e446: 81 93 st Z+, r24 2e448: 4f 01 movw r8, r30 2e44a: ee cf rjmp .-36 ; 0x2e428 } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2e44c: 80 e3 ldi r24, 0x30 ; 48 2e44e: f5 01 movw r30, r10 2e450: 80 83 st Z, r24 return 1; 2e452: 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); 2e454: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2e456: e1 e0 ldi r30, 0x01 ; 1 2e458: f0 e0 ldi r31, 0x00 ; 0 2e45a: ec 0f add r30, r28 2e45c: fd 1f adc r31, r29 2e45e: e1 0f add r30, r17 2e460: f1 1d adc r31, r1 2e462: 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 2e464: 9a e2 ldi r25, 0x2A ; 42 2e466: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e468: 81 11 cpse r24, r1 2e46a: 21 c0 rjmp .+66 ; 0x2e4ae *dst = '0'; 2e46c: 80 e3 ldi r24, 0x30 ; 48 2e46e: 81 83 std Z+1, r24 ; 0x01 return 1; 2e470: 81 e0 ldi r24, 0x01 ; 1 2e472: 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); 2e474: 18 0f add r17, r24 txbuff[i] = '\n'; 2e476: e1 e0 ldi r30, 0x01 ; 1 2e478: f0 e0 ldi r31, 0x00 ; 0 2e47a: ec 0f add r30, r28 2e47c: fd 1f adc r31, r29 2e47e: e1 0f add r30, r17 2e480: f1 1d adc r31, r1 2e482: 8a e0 ldi r24, 0x0A ; 10 2e484: 80 83 st Z, r24 ++i; 2e486: 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); 2e488: 9e 01 movw r18, r28 2e48a: 2f 5f subi r18, 0xFF ; 255 2e48c: 3f 4f sbci r19, 0xFF ; 255 2e48e: 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--){ 2e490: 59 01 movw r10, r18 2e492: a1 0e add r10, r17 2e494: b1 1c adc r11, r1 2e496: ea 14 cp r14, r10 2e498: fb 04 cpc r15, r11 2e49a: 79 f0 breq .+30 ; 0x2e4ba fputc(*buffer, uart2io); 2e49c: f7 01 movw r30, r14 2e49e: 81 91 ld r24, Z+ 2e4a0: 7f 01 movw r14, r30 2e4a2: 6f e6 ldi r22, 0x6F ; 111 2e4a4: 72 e1 ldi r23, 0x12 ; 18 2e4a6: 90 e0 ldi r25, 0x00 ; 0 2e4a8: 0f 94 ae db call 0x3b75c ; 0x3b75c 2e4ac: f4 cf rjmp .-24 ; 0x2e496 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); 2e4ae: bf 01 movw r22, r30 2e4b0: 6f 5f subi r22, 0xFF ; 255 2e4b2: 7f 4f sbci r23, 0xFF ; 255 2e4b4: 0f 94 71 c2 call 0x384e2 ; 0x384e2 2e4b8: dc cf rjmp .-72 ; 0x2e472 LogRequestMsg(txbuff, len); 2e4ba: 61 2f mov r22, r17 2e4bc: ce 01 movw r24, r28 2e4be: 01 96 adiw r24, 0x01 ; 1 2e4c0: 0f 94 f1 70 call 0x2e1e2 ; 0x2e1e2 RecordUARTActivity(); 2e4c4: 0f 94 48 70 call 0x2e090 ; 0x2e090 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2e4c8: d0 92 29 13 sts 0x1329, r13 ; 0x801329 } 2e4cc: 67 96 adiw r28, 0x17 ; 23 2e4ce: 0f b6 in r0, 0x3f ; 63 2e4d0: f8 94 cli 2e4d2: de bf out 0x3e, r29 ; 62 2e4d4: 0f be out 0x3f, r0 ; 63 2e4d6: cd bf out 0x3d, r28 ; 61 2e4d8: df 91 pop r29 2e4da: cf 91 pop r28 2e4dc: 1f 91 pop r17 2e4de: 0f 91 pop r16 2e4e0: ff 90 pop r15 2e4e2: ef 90 pop r14 2e4e4: df 90 pop r13 2e4e6: bf 90 pop r11 2e4e8: af 90 pop r10 2e4ea: 9f 90 pop r9 2e4ec: 8f 90 pop r8 2e4ee: 08 95 ret 0002e4f0 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2e4f0: 20 91 74 13 lds r18, 0x1374 ; 0x801374 2e4f4: 2f 5f subi r18, 0xFF ; 255 2e4f6: 20 93 74 13 sts 0x1374, r18 ; 0x801374 if (regIndex >= initRegs8Count) { 2e4fa: 22 30 cpi r18, 0x02 ; 2 2e4fc: 78 f4 brcc .+30 ; 0x2e51c return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2e4fe: 30 e0 ldi r19, 0x00 ; 0 2e500: f9 01 movw r30, r18 2e502: eb 54 subi r30, 0x4B ; 75 2e504: f6 45 sbci r31, 0x56 ; 86 2e506: 84 91 lpm r24, Z 2e508: 2e 58 subi r18, 0x8E ; 142 2e50a: 3c 4e sbci r19, 0xEC ; 236 2e50c: f9 01 movw r30, r18 2e50e: 60 81 ld r22, Z 2e510: 70 e0 ldi r23, 0x00 ; 0 2e512: 49 e0 ldi r20, 0x09 ; 9 2e514: 0f 94 b9 71 call 0x2e372 ; 0x2e372 } return false; 2e518: 80 e0 ldi r24, 0x00 ; 0 2e51a: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2e51c: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2e51e: 08 95 ret 0002e520 : * \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) { 2e520: 8f 92 push r8 2e522: 9f 92 push r9 2e524: af 92 push r10 2e526: bf 92 push r11 2e528: cf 92 push r12 2e52a: df 92 push r13 2e52c: ef 92 push r14 2e52e: ff 92 push r15 2e530: cf 93 push r28 2e532: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2e534: 28 ed ldi r18, 0xD8 ; 216 2e536: 36 e1 ldi r19, 0x16 ; 22 2e538: 30 93 76 0e sts 0x0E76, r19 ; 0x800e76 2e53c: 20 93 75 0e sts 0x0E75, r18 ; 0x800e75 fatType_ = 0; 2e540: 10 92 f4 16 sts 0x16F4, r1 ; 0x8016f4 allocSearchStart_ = 2; 2e544: 42 e0 ldi r20, 0x02 ; 2 2e546: 50 e0 ldi r21, 0x00 ; 0 2e548: 60 e0 ldi r22, 0x00 ; 0 2e54a: 70 e0 ldi r23, 0x00 ; 0 2e54c: 40 93 dd 16 sts 0x16DD, r20 ; 0x8016dd 2e550: 50 93 de 16 sts 0x16DE, r21 ; 0x8016de 2e554: 60 93 df 16 sts 0x16DF, r22 ; 0x8016df 2e558: 70 93 e0 16 sts 0x16E0, r23 ; 0x8016e0 cacheDirty_ = 0; // cacheFlush() will write block if true 2e55c: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 cacheMirrorBlock_ = 0; 2e560: 10 92 70 0e sts 0x0E70, r1 ; 0x800e70 2e564: 10 92 71 0e sts 0x0E71, r1 ; 0x800e71 2e568: 10 92 72 0e sts 0x0E72, r1 ; 0x800e72 2e56c: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 cacheBlockNumber_ = 0XFFFFFFFF; 2e570: 4f ef ldi r20, 0xFF ; 255 2e572: 5f ef ldi r21, 0xFF ; 255 2e574: ba 01 movw r22, r20 2e576: 40 93 6c 0e sts 0x0E6C, r20 ; 0x800e6c 2e57a: 50 93 6d 0e sts 0x0E6D, r21 ; 0x800e6d 2e57e: 60 93 6e 0e sts 0x0E6E, r22 ; 0x800e6e 2e582: 70 93 6f 0e sts 0x0E6F, r23 ; 0x800e6f // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2e586: 88 23 and r24, r24 2e588: 09 f4 brne .+2 ; 0x2e58c 2e58a: 70 c0 rjmp .+224 ; 0x2e66c if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e58c: 40 e0 ldi r20, 0x00 ; 0 2e58e: 60 e0 ldi r22, 0x00 ; 0 2e590: 70 e0 ldi r23, 0x00 ; 0 2e592: cb 01 movw r24, r22 2e594: 0f 94 94 6b call 0x2d728 ; 0x2d728 2e598: 81 11 cpse r24, r1 2e59a: 0d c0 rjmp .+26 ; 0x2e5b6 fatType_ = 32; } return true; fail: return false; 2e59c: c0 e0 ldi r28, 0x00 ; 0 } 2e59e: 8c 2f mov r24, r28 2e5a0: df 91 pop r29 2e5a2: cf 91 pop r28 2e5a4: ff 90 pop r15 2e5a6: ef 90 pop r14 2e5a8: df 90 pop r13 2e5aa: cf 90 pop r12 2e5ac: bf 90 pop r11 2e5ae: af 90 pop r10 2e5b0: 9f 90 pop r9 2e5b2: 8f 90 pop r8 2e5b4: 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 || 2e5b6: 80 91 36 10 lds r24, 0x1036 ; 0x801036 2e5ba: 8f 77 andi r24, 0x7F ; 127 2e5bc: 79 f7 brne .-34 ; 0x2e59c 2e5be: 80 91 42 10 lds r24, 0x1042 ; 0x801042 2e5c2: 90 91 43 10 lds r25, 0x1043 ; 0x801043 2e5c6: a0 91 44 10 lds r26, 0x1044 ; 0x801044 2e5ca: b0 91 45 10 lds r27, 0x1045 ; 0x801045 2e5ce: 84 36 cpi r24, 0x64 ; 100 2e5d0: 91 05 cpc r25, r1 2e5d2: a1 05 cpc r26, r1 2e5d4: b1 05 cpc r27, r1 2e5d6: 10 f3 brcs .-60 ; 0x2e59c p->totalSectors < 100 || p->firstSector == 0) { 2e5d8: c0 90 3e 10 lds r12, 0x103E ; 0x80103e 2e5dc: d0 90 3f 10 lds r13, 0x103F ; 0x80103f 2e5e0: e0 90 40 10 lds r14, 0x1040 ; 0x801040 2e5e4: f0 90 41 10 lds r15, 0x1041 ; 0x801041 if (part) { if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; part_t* p = &cacheBuffer_.mbr.part[part-1]; if ((p->boot & 0X7F) !=0 || p->totalSectors < 100 || 2e5e8: c1 14 cp r12, r1 2e5ea: d1 04 cpc r13, r1 2e5ec: e1 04 cpc r14, r1 2e5ee: f1 04 cpc r15, r1 2e5f0: a9 f2 breq .-86 ; 0x2e59c // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e5f2: 40 e0 ldi r20, 0x00 ; 0 2e5f4: c7 01 movw r24, r14 2e5f6: b6 01 movw r22, r12 2e5f8: 0f 94 94 6b call 0x2d728 ; 0x2d728 2e5fc: c8 2f mov r28, r24 2e5fe: 88 23 and r24, r24 2e600: 69 f2 breq .-102 ; 0x2e59c fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e602: 80 91 83 0e lds r24, 0x0E83 ; 0x800e83 2e606: 90 91 84 0e lds r25, 0x0E84 ; 0x800e84 2e60a: 81 15 cp r24, r1 2e60c: 92 40 sbci r25, 0x02 ; 2 2e60e: 31 f6 brne .-116 ; 0x2e59c fbs->fatCount == 0 || 2e610: a0 91 88 0e lds r26, 0x0E88 ; 0x800e88 } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e614: aa 23 and r26, r26 2e616: 11 f2 breq .-124 ; 0x2e59c fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e618: 60 91 86 0e lds r22, 0x0E86 ; 0x800e86 2e61c: 70 91 87 0e lds r23, 0x0E87 ; 0x800e87 volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2e620: 61 15 cp r22, r1 2e622: 71 05 cpc r23, r1 2e624: 09 f4 brne .+2 ; 0x2e628 2e626: ba cf rjmp .-140 ; 0x2e59c fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2e628: 20 91 85 0e lds r18, 0x0E85 ; 0x800e85 } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e62c: 22 23 and r18, r18 2e62e: 09 f4 brne .+2 ; 0x2e632 2e630: b5 cf rjmp .-150 ; 0x2e59c fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2e632: a0 93 ef 16 sts 0x16EF, r26 ; 0x8016ef blocksPerCluster_ = fbs->sectorsPerCluster; 2e636: 20 93 e1 16 sts 0x16E1, r18 ; 0x8016e1 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2e63a: 90 e0 ldi r25, 0x00 ; 0 2e63c: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2e63e: 30 e0 ldi r19, 0x00 ; 0 2e640: e1 e0 ldi r30, 0x01 ; 1 2e642: f0 e0 ldi r31, 0x00 ; 0 2e644: d8 2f mov r29, r24 2e646: af 01 movw r20, r30 2e648: 08 2e mov r0, r24 2e64a: 02 c0 rjmp .+4 ; 0x2e650 2e64c: 44 0f add r20, r20 2e64e: 55 1f adc r21, r21 2e650: 0a 94 dec r0 2e652: e2 f7 brpl .-8 ; 0x2e64c 2e654: 24 17 cp r18, r20 2e656: 35 07 cpc r19, r21 2e658: 69 f0 breq .+26 ; 0x2e674 2e65a: 41 e0 ldi r20, 0x01 ; 1 2e65c: 48 0f add r20, r24 2e65e: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2e660: 89 30 cpi r24, 0x09 ; 9 2e662: 91 05 cpc r25, r1 2e664: 79 f7 brne .-34 ; 0x2e644 2e666: 40 93 ea 16 sts 0x16EA, r20 ; 0x8016ea 2e66a: 98 cf rjmp .-208 ; 0x2e59c * 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; 2e66c: c1 2c mov r12, r1 2e66e: d1 2c mov r13, r1 2e670: 76 01 movw r14, r12 2e672: bf cf rjmp .-130 ; 0x2e5f2 2e674: 80 93 ea 16 sts 0x16EA, r24 ; 0x8016ea clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2e678: 20 91 8e 0e lds r18, 0x0E8E ; 0x800e8e 2e67c: 30 91 8f 0e lds r19, 0x0E8F ; 0x800e8f 2e680: 50 e0 ldi r21, 0x00 ; 0 2e682: 40 e0 ldi r20, 0x00 ; 0 2e684: 21 15 cp r18, r1 2e686: 31 05 cpc r19, r1 2e688: 41 f4 brne .+16 ; 0x2e69a 2e68a: 20 91 9c 0e lds r18, 0x0E9C ; 0x800e9c 2e68e: 30 91 9d 0e lds r19, 0x0E9D ; 0x800e9d 2e692: 40 91 9e 0e lds r20, 0x0E9E ; 0x800e9e 2e696: 50 91 9f 0e lds r21, 0x0E9F ; 0x800e9f 2e69a: 20 93 e2 16 sts 0x16E2, r18 ; 0x8016e2 2e69e: 30 93 e3 16 sts 0x16E3, r19 ; 0x8016e3 2e6a2: 40 93 e4 16 sts 0x16E4, r20 ; 0x8016e4 2e6a6: 50 93 e5 16 sts 0x16E5, r21 ; 0x8016e5 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2e6aa: 46 01 movw r8, r12 2e6ac: 57 01 movw r10, r14 2e6ae: 86 0e add r8, r22 2e6b0: 97 1e adc r9, r23 2e6b2: a1 1c adc r10, r1 2e6b4: b1 1c adc r11, r1 2e6b6: 80 92 f0 16 sts 0x16F0, r8 ; 0x8016f0 2e6ba: 90 92 f1 16 sts 0x16F1, r9 ; 0x8016f1 2e6be: a0 92 f2 16 sts 0x16F2, r10 ; 0x8016f2 2e6c2: b0 92 f3 16 sts 0x16F3, r11 ; 0x8016f3 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2e6c6: e0 91 89 0e lds r30, 0x0E89 ; 0x800e89 2e6ca: f0 91 8a 0e lds r31, 0x0E8A ; 0x800e8a 2e6ce: f0 93 f6 16 sts 0x16F6, r31 ; 0x8016f6 2e6d2: e0 93 f5 16 sts 0x16F5, r30 ; 0x8016f5 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2e6d6: b0 e0 ldi r27, 0x00 ; 0 2e6d8: 0f 94 db dd call 0x3bbb6 ; 0x3bbb6 <__muluhisi3> 2e6dc: dc 01 movw r26, r24 2e6de: cb 01 movw r24, r22 2e6e0: 88 0d add r24, r8 2e6e2: 99 1d adc r25, r9 2e6e4: aa 1d adc r26, r10 2e6e6: bb 1d adc r27, r11 2e6e8: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 2e6ec: 90 93 f8 16 sts 0x16F8, r25 ; 0x8016f8 2e6f0: a0 93 f9 16 sts 0x16F9, r26 ; 0x8016f9 2e6f4: b0 93 fa 16 sts 0x16FA, r27 ; 0x8016fa // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2e6f8: 25 e0 ldi r18, 0x05 ; 5 2e6fa: ee 0f add r30, r30 2e6fc: ff 1f adc r31, r31 2e6fe: 2a 95 dec r18 2e700: e1 f7 brne .-8 ; 0x2e6fa 2e702: e1 50 subi r30, 0x01 ; 1 2e704: fe 4f sbci r31, 0xFE ; 254 2e706: ef 2f mov r30, r31 2e708: ff 27 eor r31, r31 2e70a: e6 95 lsr r30 2e70c: 8e 0f add r24, r30 2e70e: 9f 1f adc r25, r31 2e710: a1 1d adc r26, r1 2e712: b1 1d adc r27, r1 2e714: 80 93 eb 16 sts 0x16EB, r24 ; 0x8016eb 2e718: 90 93 ec 16 sts 0x16EC, r25 ; 0x8016ec 2e71c: a0 93 ed 16 sts 0x16ED, r26 ; 0x8016ed 2e720: b0 93 ee 16 sts 0x16EE, r27 ; 0x8016ee // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2e724: 80 90 8b 0e lds r8, 0x0E8B ; 0x800e8b 2e728: 90 90 8c 0e lds r9, 0x0E8C ; 0x800e8c 2e72c: b1 2c mov r11, r1 2e72e: a1 2c mov r10, r1 2e730: 81 14 cp r8, r1 2e732: 91 04 cpc r9, r1 2e734: 41 f4 brne .+16 ; 0x2e746 2e736: 80 90 98 0e lds r8, 0x0E98 ; 0x800e98 2e73a: 90 90 99 0e lds r9, 0x0E99 ; 0x800e99 2e73e: a0 90 9a 0e lds r10, 0x0E9A ; 0x800e9a 2e742: b0 90 9b 0e lds r11, 0x0E9B ; 0x800e9b fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2e746: c8 1a sub r12, r24 2e748: d9 0a sbc r13, r25 2e74a: ea 0a sbc r14, r26 2e74c: fb 0a sbc r15, r27 2e74e: c8 0c add r12, r8 2e750: d9 1c adc r13, r9 2e752: ea 1c adc r14, r10 2e754: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2e756: 04 c0 rjmp .+8 ; 0x2e760 2e758: f6 94 lsr r15 2e75a: e7 94 ror r14 2e75c: d7 94 ror r13 2e75e: c7 94 ror r12 2e760: da 95 dec r29 2e762: d2 f7 brpl .-12 ; 0x2e758 2e764: c0 92 e6 16 sts 0x16E6, r12 ; 0x8016e6 2e768: d0 92 e7 16 sts 0x16E7, r13 ; 0x8016e7 2e76c: e0 92 e8 16 sts 0x16E8, r14 ; 0x8016e8 2e770: f0 92 e9 16 sts 0x16E9, r15 ; 0x8016e9 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2e774: 85 ef ldi r24, 0xF5 ; 245 2e776: c8 16 cp r12, r24 2e778: 8f e0 ldi r24, 0x0F ; 15 2e77a: d8 06 cpc r13, r24 2e77c: e1 04 cpc r14, r1 2e77e: f1 04 cpc r15, r1 2e780: 20 f4 brcc .+8 ; 0x2e78a fatType_ = 12; 2e782: 8c e0 ldi r24, 0x0C ; 12 2e784: 80 93 f4 16 sts 0x16F4, r24 ; 0x8016f4 2e788: 09 cf rjmp .-494 ; 0x2e59c if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2e78a: 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) { 2e78c: 25 ef ldi r18, 0xF5 ; 245 2e78e: c2 16 cp r12, r18 2e790: 2f ef ldi r18, 0xFF ; 255 2e792: d2 06 cpc r13, r18 2e794: e1 04 cpc r14, r1 2e796: f1 04 cpc r15, r1 2e798: 88 f0 brcs .+34 ; 0x2e7bc fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2e79a: 80 91 a4 0e lds r24, 0x0EA4 ; 0x800ea4 2e79e: 90 91 a5 0e lds r25, 0x0EA5 ; 0x800ea5 2e7a2: a0 91 a6 0e lds r26, 0x0EA6 ; 0x800ea6 2e7a6: b0 91 a7 0e lds r27, 0x0EA7 ; 0x800ea7 2e7aa: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 2e7ae: 90 93 f8 16 sts 0x16F8, r25 ; 0x8016f8 2e7b2: a0 93 f9 16 sts 0x16F9, r26 ; 0x8016f9 2e7b6: b0 93 fa 16 sts 0x16FA, r27 ; 0x8016fa fatType_ = 32; 2e7ba: 80 e2 ldi r24, 0x20 ; 32 2e7bc: 80 93 f4 16 sts 0x16F4, r24 ; 0x8016f4 2e7c0: ee ce rjmp .-548 ; 0x2e59e 0002e7c2 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2e7c2: 20 e0 ldi r18, 0x00 ; 0 2e7c4: 30 e0 ldi r19, 0x00 ; 0 2e7c6: 40 ea ldi r20, 0xA0 ; 160 2e7c8: 52 e4 ldi r21, 0x42 ; 66 2e7ca: 60 e0 ldi r22, 0x00 ; 0 2e7cc: 70 e0 ldi r23, 0x00 ; 0 2e7ce: 80 ea ldi r24, 0xA0 ; 160 2e7d0: 92 ec ldi r25, 0xC2 ; 194 2e7d2: 0d 94 e5 c2 jmp 0x385ca ; 0x385ca 0002e7d6 : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2e7d6: 90 91 96 13 lds r25, 0x1396 ; 0x801396 2e7da: 91 fd sbrc r25, 1 2e7dc: 17 c0 rjmp .+46 ; 0x2e80c return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2e7de: 88 23 and r24, r24 2e7e0: a9 f0 breq .+42 ; 0x2e80c 2e7e2: 92 fd sbrc r25, 2 2e7e4: 13 c0 rjmp .+38 ; 0x2e80c Disable_E0(); 2e7e6: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 resume_hotend_temp = thermal_degTargetHotend(); 2e7ea: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 2e7ee: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 2e7f2: 90 93 8b 13 sts 0x138B, r25 ; 0x80138b 2e7f6: 80 93 8a 13 sts 0x138A, r24 ; 0x80138a mmu_print_saved |= SavedState::CooldownPending; 2e7fa: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2e7fe: 84 60 ori r24, 0x04 ; 4 2e800: 80 93 96 13 sts 0x1396, r24 ; 0x801396 LogEchoEvent_P(PSTR("Heater cooldown pending")); 2e804: 8a e9 ldi r24, 0x9A ; 154 2e806: 96 ea ldi r25, 0xA6 ; 166 2e808: 0d 94 09 c3 jmp 0x38612 ; 0x38612 } } 2e80c: 08 95 ret 0002e80e : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2e80e: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2e812: 80 ff sbrs r24, 0 2e814: 47 c0 rjmp .+142 ; 0x2e8a4 LogEchoEvent_P(PSTR("Resuming XYZ")); 2e816: 82 eb ldi r24, 0xB2 ; 178 2e818: 96 ea ldi r25, 0xA6 ; 166 2e81a: 0f 94 09 c3 call 0x38612 ; 0x38612 // 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)); 2e81e: 80 91 82 13 lds r24, 0x1382 ; 0x801382 2e822: 90 91 83 13 lds r25, 0x1383 ; 0x801383 2e826: a0 91 84 13 lds r26, 0x1384 ; 0x801384 2e82a: b0 91 85 13 lds r27, 0x1385 ; 0x801385 pos3d planner_current_position() { return pos3d(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); } void motion_do_blocking_move_to_xy(float rx, float ry, float feedRate_mm_s) { current_position[X_AXIS] = rx; 2e82e: 40 91 7e 13 lds r20, 0x137E ; 0x80137e 2e832: 50 91 7f 13 lds r21, 0x137F ; 0x80137f 2e836: 60 91 80 13 lds r22, 0x1380 ; 0x801380 2e83a: 70 91 81 13 lds r23, 0x1381 ; 0x801381 2e83e: 40 93 40 07 sts 0x0740, r20 ; 0x800740 2e842: 50 93 41 07 sts 0x0741, r21 ; 0x800741 2e846: 60 93 42 07 sts 0x0742, r22 ; 0x800742 2e84a: 70 93 43 07 sts 0x0743, r23 ; 0x800743 current_position[Y_AXIS] = ry; 2e84e: 80 93 44 07 sts 0x0744, r24 ; 0x800744 2e852: 90 93 45 07 sts 0x0745, r25 ; 0x800745 2e856: a0 93 46 07 sts 0x0746, r26 ; 0x800746 2e85a: b0 93 47 07 sts 0x0747, r27 ; 0x800747 planner_line_to_current_position_sync(feedRate_mm_s); 2e85e: 60 e0 ldi r22, 0x00 ; 0 2e860: 70 e0 ldi r23, 0x00 ; 0 2e862: 88 e4 ldi r24, 0x48 ; 72 2e864: 92 e4 ldi r25, 0x42 ; 66 2e866: 0f 94 05 c3 call 0x3860a ; 0x3860a } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2e86a: 80 91 86 13 lds r24, 0x1386 ; 0x801386 2e86e: 90 91 87 13 lds r25, 0x1387 ; 0x801387 2e872: a0 91 88 13 lds r26, 0x1388 ; 0x801388 2e876: b0 91 89 13 lds r27, 0x1389 ; 0x801389 2e87a: 80 93 48 07 sts 0x0748, r24 ; 0x800748 2e87e: 90 93 49 07 sts 0x0749, r25 ; 0x800749 2e882: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 2e886: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b planner_line_to_current_position_sync(feedRate_mm_s); 2e88a: 60 e0 ldi r22, 0x00 ; 0 2e88c: 70 e0 ldi r23, 0x00 ; 0 2e88e: 80 e7 ldi r24, 0x70 ; 112 2e890: 91 e4 ldi r25, 0x41 ; 65 2e892: 0f 94 05 c3 call 0x3860a ; 0x3860a void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2e896: 10 92 50 07 sts 0x0750, r1 ; 0x800750 // From this point forward, power panic should not use // the partial backup in RAM since the extruder is no // longer in parking position marlin_clear_print_state_in_ram(); mmu_print_saved &= ~(SavedState::ParkExtruder); 2e89a: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2e89e: 8e 7f andi r24, 0xFE ; 254 2e8a0: 80 93 96 13 sts 0x1396, r24 ; 0x801396 } } 2e8a4: 08 95 ret 0002e8a6 : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2e8a6: 0f 93 push r16 2e8a8: 1f 93 push r17 2e8aa: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2e8ac: 90 91 96 13 lds r25, 0x1396 ; 0x801396 2e8b0: 91 11 cpse r25, r1 2e8b2: 72 c0 rjmp .+228 ; 0x2e998 2e8b4: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2e8b6: 87 e8 ldi r24, 0x87 ; 135 2e8b8: 96 ea ldi r25, 0xA6 ; 166 2e8ba: 0f 94 09 c3 call 0x38612 ; 0x38612 Disable_E0(); 2e8be: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2e8c2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 /// 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; 2e8c6: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 2e8ca: 81 11 cpse r24, r1 2e8cc: 02 c0 rjmp .+4 ; 0x2e8d2 2e8ce: 0e 94 0f 65 call 0xca1e ; 0xca1e // 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) { 2e8d2: cc 23 and r28, r28 2e8d4: 09 f4 brne .+2 ; 0x2e8d8 2e8d6: 60 c0 rjmp .+192 ; 0x2e998 mmu_print_saved |= SavedState::ParkExtruder; 2e8d8: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2e8dc: 81 60 ori r24, 0x01 ; 1 2e8de: 80 93 96 13 sts 0x1396, r24 ; 0x801396 void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; } pos3d planner_current_position() { return pos3d(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); 2e8e2: 80 91 48 07 lds r24, 0x0748 ; 0x800748 2e8e6: 90 91 49 07 lds r25, 0x0749 ; 0x800749 2e8ea: a0 91 4a 07 lds r26, 0x074A ; 0x80074a 2e8ee: b0 91 4b 07 lds r27, 0x074B ; 0x80074b 2e8f2: 40 91 44 07 lds r20, 0x0744 ; 0x800744 2e8f6: 50 91 45 07 lds r21, 0x0745 ; 0x800745 2e8fa: 60 91 46 07 lds r22, 0x0746 ; 0x800746 2e8fe: 70 91 47 07 lds r23, 0x0747 ; 0x800747 resume_position = planner_current_position(); // save current pos 2e902: 00 91 40 07 lds r16, 0x0740 ; 0x800740 2e906: 10 91 41 07 lds r17, 0x0741 ; 0x800741 2e90a: 20 91 42 07 lds r18, 0x0742 ; 0x800742 2e90e: 30 91 43 07 lds r19, 0x0743 ; 0x800743 2e912: 00 93 7e 13 sts 0x137E, r16 ; 0x80137e 2e916: 10 93 7f 13 sts 0x137F, r17 ; 0x80137f 2e91a: 20 93 80 13 sts 0x1380, r18 ; 0x801380 2e91e: 30 93 81 13 sts 0x1381, r19 ; 0x801381 2e922: 40 93 82 13 sts 0x1382, r20 ; 0x801382 2e926: 50 93 83 13 sts 0x1383, r21 ; 0x801383 2e92a: 60 93 84 13 sts 0x1384, r22 ; 0x801384 2e92e: 70 93 85 13 sts 0x1385, r23 ; 0x801385 2e932: 80 93 86 13 sts 0x1386, r24 ; 0x801386 2e936: 90 93 87 13 sts 0x1387, r25 ; 0x801387 2e93a: a0 93 88 13 sts 0x1388, r26 ; 0x801388 2e93e: b0 93 89 13 sts 0x1389, r27 ; 0x801389 current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2e942: 60 e0 ldi r22, 0x00 ; 0 2e944: 70 e0 ldi r23, 0x00 ; 0 2e946: 80 ea ldi r24, 0xA0 ; 160 2e948: 91 e4 ldi r25, 0x41 ; 65 2e94a: 0e 94 a7 6e call 0xdd4e ; 0xdd4e void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2e94e: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 2e952: 88 23 and r24, r24 2e954: 09 f1 breq .+66 ; 0x2e998 2e956: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 2e95a: 88 23 and r24, r24 2e95c: e9 f0 breq .+58 ; 0x2e998 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; 2e95e: 80 e0 ldi r24, 0x00 ; 0 2e960: 90 e0 ldi r25, 0x00 ; 0 2e962: aa ef ldi r26, 0xFA ; 250 2e964: b2 e4 ldi r27, 0x42 ; 66 2e966: 80 93 40 07 sts 0x0740, r24 ; 0x800740 2e96a: 90 93 41 07 sts 0x0741, r25 ; 0x800741 2e96e: a0 93 42 07 sts 0x0742, r26 ; 0x800742 2e972: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2e976: 10 92 44 07 sts 0x0744, r1 ; 0x800744 2e97a: 10 92 45 07 sts 0x0745, r1 ; 0x800745 2e97e: 10 92 46 07 sts 0x0746, r1 ; 0x800746 2e982: 10 92 47 07 sts 0x0747, r1 ; 0x800747 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2e986: 60 e0 ldi r22, 0x00 ; 0 2e988: 70 e0 ldi r23, 0x00 ; 0 2e98a: 88 e4 ldi r24, 0x48 ; 72 2e98c: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2e98e: cf 91 pop r28 2e990: 1f 91 pop r17 2e992: 0f 91 pop r16 2e994: 0d 94 05 c3 jmp 0x3860a ; 0x3860a 2e998: cf 91 pop r28 2e99a: 1f 91 pop r17 2e99c: 0f 91 pop r16 2e99e: 08 95 ret 0002e9a0 : 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){ 2e9a0: ef 92 push r14 2e9a2: ff 92 push r15 2e9a4: 0f 93 push r16 2e9a6: 1f 93 push r17 2e9a8: cf 93 push r28 2e9aa: df 93 push r29 2e9ac: 1f 92 push r1 2e9ae: 1f 92 push r1 2e9b0: cd b7 in r28, 0x3d ; 61 2e9b2: de b7 in r29, 0x3e ; 62 2e9b4: f8 2e mov r15, r24 2e9b6: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2e9b8: 80 e1 ldi r24, 0x10 ; 16 2e9ba: 97 e2 ldi r25, 0x27 ; 39 2e9bc: 9a 83 std Y+2, r25 ; 0x02 2e9be: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2e9c0: 8a 01 movw r16, r20 2e9c2: 16 95 lsr r17 2e9c4: 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); 2e9c6: 8f 2d mov r24, r15 2e9c8: 0e 94 ab e1 call 0x1c356 ; 0x1c356 while (steps--){ 2e9cc: 01 50 subi r16, 0x01 ; 1 2e9ce: 11 09 sbc r17, r1 2e9d0: 78 f0 brcs .+30 ; 0x2e9f0 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2e9d2: 28 ec ldi r18, 0xC8 ; 200 2e9d4: 30 e0 ldi r19, 0x00 ; 0 2e9d6: ae 01 movw r20, r28 2e9d8: 4f 5f subi r20, 0xFF ; 255 2e9da: 5f 4f sbci r21, 0xFF ; 255 2e9dc: 68 ee ldi r22, 0xE8 ; 232 2e9de: 73 e0 ldi r23, 0x03 ; 3 2e9e0: 8f 2d mov r24, r15 2e9e2: 0e 94 7c e0 call 0x1c0f8 ; 0x1c0f8 update_position_1_step(axes, dir); 2e9e6: 6e 2d mov r22, r14 2e9e8: 8f 2d mov r24, r15 2e9ea: 0e 94 c4 e1 call 0x1c388 ; 0x1c388 2e9ee: ee cf rjmp .-36 ; 0x2e9cc } /// \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); 2e9f0: 6e 2d mov r22, r14 2e9f2: 8f 2d mov r24, r15 2e9f4: 0e 94 ab e1 call 0x1c356 ; 0x1c356 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); } 2e9f8: 0f 90 pop r0 2e9fa: 0f 90 pop r0 2e9fc: df 91 pop r29 2e9fe: cf 91 pop r28 2ea00: 1f 91 pop r17 2ea02: 0f 91 pop r16 2ea04: ff 90 pop r15 2ea06: ef 90 pop r14 2ea08: 08 95 ret 0002ea0a : 2ea0a: ef 92 push r14 2ea0c: ff 92 push r15 2ea0e: 0f 93 push r16 2ea10: 1f 93 push r17 2ea12: cf 93 push r28 2ea14: df 93 push r29 2ea16: cd b7 in r28, 0x3d ; 61 2ea18: de b7 in r29, 0x3e ; 62 2ea1a: 2f 97 sbiw r28, 0x0f ; 15 2ea1c: 0f b6 in r0, 0x3f ; 63 2ea1e: f8 94 cli 2ea20: de bf out 0x3e, r29 ; 62 2ea22: 0f be out 0x3f, r0 ; 63 2ea24: cd bf out 0x3d, r28 ; 61 2ea26: eb e8 ldi r30, 0x8B ; 139 2ea28: f2 e1 ldi r31, 0x12 ; 18 2ea2a: 10 a2 std Z+32, r1 ; 0x20 2ea2c: 11 a2 std Z+33, r1 ; 0x21 2ea2e: 12 a2 std Z+34, r1 ; 0x22 2ea30: 13 a2 std Z+35, r1 ; 0x23 2ea32: 14 a2 std Z+36, r1 ; 0x24 2ea34: 15 a2 std Z+37, r1 ; 0x25 2ea36: 16 a2 std Z+38, r1 ; 0x26 2ea38: 17 a2 std Z+39, r1 ; 0x27 2ea3a: 10 a6 std Z+40, r1 ; 0x28 2ea3c: 11 a6 std Z+41, r1 ; 0x29 2ea3e: 10 92 24 13 sts 0x1324, r1 ; 0x801324 2ea42: 06 e2 ldi r16, 0x26 ; 38 2ea44: 13 e1 ldi r17, 0x13 ; 19 2ea46: ee 24 eor r14, r14 2ea48: e3 94 inc r14 2ea4a: f1 2c mov r15, r1 2ea4c: d8 01 movw r26, r16 2ea4e: 11 96 adiw r26, 0x01 ; 1 2ea50: fc 92 st X, r15 2ea52: ee 92 st -X, r14 2ea54: 12 96 adiw r26, 0x02 ; 2 2ea56: 1c 92 st X, r1 2ea58: 12 97 sbiw r26, 0x02 ; 2 2ea5a: 82 e8 ldi r24, 0x82 ; 130 2ea5c: 13 96 adiw r26, 0x03 ; 3 2ea5e: 8c 93 st X, r24 2ea60: 40 e0 ldi r20, 0x00 ; 0 2ea62: 60 e0 ldi r22, 0x00 ; 0 2ea64: 8b e2 ldi r24, 0x2B ; 43 2ea66: 93 e1 ldi r25, 0x13 ; 19 2ea68: 0f 94 c1 c2 call 0x38582 ; 0x38582 2ea6c: 40 e0 ldi r20, 0x00 ; 0 2ea6e: 60 e0 ldi r22, 0x00 ; 0 2ea70: 80 e3 ldi r24, 0x30 ; 48 2ea72: 93 e1 ldi r25, 0x13 ; 19 2ea74: 0f 94 c1 c2 call 0x38582 ; 0x38582 2ea78: f8 01 movw r30, r16 2ea7a: 17 86 std Z+15, r1 ; 0x0f 2ea7c: 10 8a std Z+16, r1 ; 0x10 2ea7e: 11 8a std Z+17, r1 ; 0x11 2ea80: 12 8a std Z+18, r1 ; 0x12 2ea82: 13 8a std Z+19, r1 ; 0x13 2ea84: 8a e0 ldi r24, 0x0A ; 10 2ea86: 84 8b std Z+20, r24 ; 0x14 2ea88: 40 e0 ldi r20, 0x00 ; 0 2ea8a: 60 e0 ldi r22, 0x00 ; 0 2ea8c: ce 01 movw r24, r28 2ea8e: 01 96 adiw r24, 0x01 ; 1 2ea90: 0f 94 c1 c2 call 0x38582 ; 0x38582 2ea94: 85 e0 ldi r24, 0x05 ; 5 2ea96: fe 01 movw r30, r28 2ea98: 31 96 adiw r30, 0x01 ; 1 2ea9a: de 01 movw r26, r28 2ea9c: 16 96 adiw r26, 0x06 ; 6 2ea9e: 01 90 ld r0, Z+ 2eaa0: 0d 92 st X+, r0 2eaa2: 8a 95 dec r24 2eaa4: e1 f7 brne .-8 ; 0x2ea9e 2eaa6: 85 e0 ldi r24, 0x05 ; 5 2eaa8: fe 01 movw r30, r28 2eaaa: 36 96 adiw r30, 0x06 ; 6 2eaac: ab e3 ldi r26, 0x3B ; 59 2eaae: b3 e1 ldi r27, 0x13 ; 19 2eab0: 01 90 ld r0, Z+ 2eab2: 0d 92 st X+, r0 2eab4: 8a 95 dec r24 2eab6: e1 f7 brne .-8 ; 0x2eab0 2eab8: d8 01 movw r26, r16 2eaba: 5a 96 adiw r26, 0x1a ; 26 2eabc: 1c 92 st X, r1 2eabe: 5a 97 sbiw r26, 0x1a ; 26 2eac0: 5c 96 adiw r26, 0x1c ; 28 2eac2: 1c 92 st X, r1 2eac4: 1e 92 st -X, r1 2eac6: 5b 97 sbiw r26, 0x1b ; 27 2eac8: 8b e3 ldi r24, 0x3B ; 59 2eaca: 93 e1 ldi r25, 0x13 ; 19 2eacc: 0f 94 b0 c2 call 0x38560 ; 0x38560 2ead0: f8 01 movw r30, r16 2ead2: 81 8f std Z+25, r24 ; 0x19 2ead4: 15 8e std Z+29, r1 ; 0x1d 2ead6: 16 8e std Z+30, r1 ; 0x1e 2ead8: 40 e0 ldi r20, 0x00 ; 0 2eada: 60 e0 ldi r22, 0x00 ; 0 2eadc: 85 e4 ldi r24, 0x45 ; 69 2eade: 93 e1 ldi r25, 0x13 ; 19 2eae0: 0f 94 c1 c2 call 0x38582 ; 0x38582 2eae4: d8 01 movw r26, r16 2eae6: 94 96 adiw r26, 0x24 ; 36 2eae8: 1c 92 st X, r1 2eaea: 40 e0 ldi r20, 0x00 ; 0 2eaec: 60 e0 ldi r22, 0x00 ; 0 2eaee: ce 01 movw r24, r28 2eaf0: 0b 96 adiw r24, 0x0b ; 11 2eaf2: 0f 94 c1 c2 call 0x38582 ; 0x38582 2eaf6: 85 e0 ldi r24, 0x05 ; 5 2eaf8: fe 01 movw r30, r28 2eafa: 3b 96 adiw r30, 0x0b ; 11 2eafc: de 01 movw r26, r28 2eafe: 11 96 adiw r26, 0x01 ; 1 2eb00: 01 90 ld r0, Z+ 2eb02: 0d 92 st X+, r0 2eb04: 8a 95 dec r24 2eb06: e1 f7 brne .-8 ; 0x2eb00 2eb08: 85 e0 ldi r24, 0x05 ; 5 2eb0a: fe 01 movw r30, r28 2eb0c: 31 96 adiw r30, 0x01 ; 1 2eb0e: ab e4 ldi r26, 0x4B ; 75 2eb10: b3 e1 ldi r27, 0x13 ; 19 2eb12: 01 90 ld r0, Z+ 2eb14: 0d 92 st X+, r0 2eb16: 8a 95 dec r24 2eb18: e1 f7 brne .-8 ; 0x2eb12 2eb1a: f8 01 movw r30, r16 2eb1c: 12 a6 std Z+42, r1 ; 0x2a 2eb1e: 14 a6 std Z+44, r1 ; 0x2c 2eb20: 13 a6 std Z+43, r1 ; 0x2b 2eb22: 8b e4 ldi r24, 0x4B ; 75 2eb24: 93 e1 ldi r25, 0x13 ; 19 2eb26: 0f 94 b0 c2 call 0x38560 ; 0x38560 2eb2a: d8 01 movw r26, r16 2eb2c: 99 96 adiw r26, 0x29 ; 41 2eb2e: 8c 93 st X, r24 2eb30: 99 97 sbiw r26, 0x29 ; 41 2eb32: dd 96 adiw r26, 0x3d ; 61 2eb34: 1c 92 st X, r1 2eb36: dd 97 sbiw r26, 0x3d ; 61 2eb38: 85 e2 ldi r24, 0x25 ; 37 2eb3a: 93 e1 ldi r25, 0x13 ; 19 2eb3c: df 96 adiw r26, 0x3f ; 63 2eb3e: 9c 93 st X, r25 2eb40: 8e 93 st -X, r24 2eb42: de 97 sbiw r26, 0x3e ; 62 2eb44: f0 92 67 13 sts 0x1367, r15 ; 0x801367 2eb48: e0 92 66 13 sts 0x1366, r14 ; 0x801366 2eb4c: 10 92 68 13 sts 0x1368, r1 ; 0x801368 2eb50: 1f ef ldi r17, 0xFF ; 255 2eb52: 10 93 69 13 sts 0x1369, r17 ; 0x801369 2eb56: 0f 94 19 c3 call 0x38632 ; 0x38632 2eb5a: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 2eb5e: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b 2eb62: 10 92 6c 13 sts 0x136C, r1 ; 0x80136c 2eb66: 10 92 6d 13 sts 0x136D, r1 ; 0x80136d 2eb6a: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f 2eb6e: 10 92 6e 13 sts 0x136E, r1 ; 0x80136e 2eb72: 10 92 71 13 sts 0x1371, r1 ; 0x801371 2eb76: 10 92 70 13 sts 0x1370, r1 ; 0x801370 2eb7a: 10 92 74 13 sts 0x1374, r1 ; 0x801374 2eb7e: 10 92 75 13 sts 0x1375, r1 ; 0x801375 2eb82: 10 92 76 13 sts 0x1376, r1 ; 0x801376 2eb86: 10 92 77 13 sts 0x1377, r1 ; 0x801377 2eb8a: 83 e0 ldi r24, 0x03 ; 3 2eb8c: 80 93 7a 13 sts 0x137A, r24 ; 0x80137a 2eb90: 10 92 7b 13 sts 0x137B, r1 ; 0x80137b 2eb94: 85 e0 ldi r24, 0x05 ; 5 2eb96: 80 93 72 13 sts 0x1372, r24 ; 0x801372 2eb9a: 84 e1 ldi r24, 0x14 ; 20 2eb9c: 80 93 73 13 sts 0x1373, r24 ; 0x801373 2eba0: 83 e6 ldi r24, 0x63 ; 99 2eba2: 80 93 7c 13 sts 0x137C, r24 ; 0x80137c 2eba6: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 2ebaa: 10 92 7e 13 sts 0x137E, r1 ; 0x80137e 2ebae: 10 92 7f 13 sts 0x137F, r1 ; 0x80137f 2ebb2: 10 92 80 13 sts 0x1380, r1 ; 0x801380 2ebb6: 10 92 81 13 sts 0x1381, r1 ; 0x801381 2ebba: 10 92 82 13 sts 0x1382, r1 ; 0x801382 2ebbe: 10 92 83 13 sts 0x1383, r1 ; 0x801383 2ebc2: 10 92 84 13 sts 0x1384, r1 ; 0x801384 2ebc6: 10 92 85 13 sts 0x1385, r1 ; 0x801385 2ebca: 10 92 86 13 sts 0x1386, r1 ; 0x801386 2ebce: 10 92 87 13 sts 0x1387, r1 ; 0x801387 2ebd2: 10 92 88 13 sts 0x1388, r1 ; 0x801388 2ebd6: 10 92 89 13 sts 0x1389, r1 ; 0x801389 2ebda: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b 2ebde: 10 92 8a 13 sts 0x138A, r1 ; 0x80138a 2ebe2: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 2ebe6: 8e e2 ldi r24, 0x2E ; 46 2ebe8: 90 e8 ldi r25, 0x80 ; 128 2ebea: 90 93 8e 13 sts 0x138E, r25 ; 0x80138e 2ebee: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d 2ebf2: 10 93 8f 13 sts 0x138F, r17 ; 0x80138f 2ebf6: 10 93 90 13 sts 0x1390, r17 ; 0x801390 2ebfa: 10 92 92 13 sts 0x1392, r1 ; 0x801392 2ebfe: 10 92 91 13 sts 0x1391, r1 ; 0x801391 2ec02: 10 93 93 13 sts 0x1393, r17 ; 0x801393 2ec06: 82 e0 ldi r24, 0x02 ; 2 2ec08: 80 93 94 13 sts 0x1394, r24 ; 0x801394 2ec0c: 10 92 95 13 sts 0x1395, r1 ; 0x801395 2ec10: 10 92 96 13 sts 0x1396, r1 ; 0x801396 2ec14: 10 92 97 13 sts 0x1397, r1 ; 0x801397 2ec18: 10 92 98 13 sts 0x1398, r1 ; 0x801398 2ec1c: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2ec20: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2ec24: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c 2ec28: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2ec2c: 0f 94 d4 8b call 0x317a8 ; 0x317a8 2ec30: e9 e6 ldi r30, 0x69 ; 105 2ec32: f4 e1 ldi r31, 0x14 ; 20 2ec34: 10 92 f1 14 sts 0x14F1, r1 ; 0x8014f1 2ec38: 10 92 f4 14 sts 0x14F4, r1 ; 0x8014f4 2ec3c: 10 92 16 15 sts 0x1516, r1 ; 0x801516 2ec40: 10 92 19 15 sts 0x1519, r1 ; 0x801519 2ec44: 89 e1 ldi r24, 0x19 ; 25 2ec46: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 2ec4a: 10 92 db 16 sts 0x16DB, r1 ; 0x8016db 2ec4e: 10 92 dc 16 sts 0x16DC, r1 ; 0x8016dc 2ec52: 10 92 f4 16 sts 0x16F4, r1 ; 0x8016f4 2ec56: 10 92 fb 16 sts 0x16FB, r1 ; 0x8016fb 2ec5a: 10 92 fe 16 sts 0x16FE, r1 ; 0x8016fe 2ec5e: 10 92 7c 17 sts 0x177C, r1 ; 0x80177c 2ec62: 10 92 7e 17 sts 0x177E, r1 ; 0x80177e 2ec66: 10 92 7d 17 sts 0x177D, r1 ; 0x80177d 2ec6a: 10 92 0d 16 sts 0x160D, r1 ; 0x80160d 2ec6e: 10 92 0c 16 sts 0x160C, r1 ; 0x80160c 2ec72: 10 92 78 17 sts 0x1778, r1 ; 0x801778 2ec76: 10 92 79 17 sts 0x1779, r1 ; 0x801779 2ec7a: 10 92 7a 17 sts 0x177A, r1 ; 0x80177a 2ec7e: 10 92 7b 17 sts 0x177B, r1 ; 0x80177b 2ec82: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 2ec86: 10 92 80 17 sts 0x1780, r1 ; 0x801780 2ec8a: 10 92 81 17 sts 0x1781, r1 ; 0x801781 2ec8e: 10 92 82 17 sts 0x1782, r1 ; 0x801782 2ec92: 12 82 std Z+2, r1 ; 0x02 2ec94: 13 82 std Z+3, r1 ; 0x03 2ec96: 10 82 st Z, r1 2ec98: 11 82 std Z+1, r1 ; 0x01 2ec9a: 10 92 0b 16 sts 0x160B, r1 ; 0x80160b 2ec9e: 10 92 1e 17 sts 0x171E, r1 ; 0x80171e 2eca2: e9 e3 ldi r30, 0x39 ; 57 2eca4: f5 e1 ldi r31, 0x15 ; 21 2eca6: 82 ed ldi r24, 0xD2 ; 210 2eca8: df 01 movw r26, r30 2ecaa: 1d 92 st X+, r1 2ecac: 8a 95 dec r24 2ecae: e9 f7 brne .-6 ; 0x2ecaa 2ecb0: 10 92 ba 14 sts 0x14BA, r1 ; 0x8014ba 2ecb4: 10 92 b9 14 sts 0x14B9, r1 ; 0x8014b9 2ecb8: 10 92 b8 14 sts 0x14B8, r1 ; 0x8014b8 2ecbc: 8c e7 ldi r24, 0x7C ; 124 2ecbe: 97 e1 ldi r25, 0x17 ; 23 2ecc0: 0f 94 bc 3f call 0x27f78 ; 0x27f78 ::start()> 2ecc4: e2 e6 ldi r30, 0x62 ; 98 2ecc6: f4 e1 ldi r31, 0x14 ; 20 2ecc8: 11 82 std Z+1, r1 ; 0x01 2ecca: 12 82 std Z+2, r1 ; 0x02 2eccc: 13 82 std Z+3, r1 ; 0x03 2ecce: 14 82 std Z+4, r1 ; 0x04 2ecd0: 15 82 std Z+5, r1 ; 0x05 2ecd2: 16 82 std Z+6, r1 ; 0x06 2ecd4: 10 83 st Z, r17 2ecd6: e5 e8 ldi r30, 0x85 ; 133 2ecd8: f7 e1 ldi r31, 0x17 ; 23 2ecda: 15 82 std Z+5, r1 ; 0x05 2ecdc: 17 82 std Z+7, r1 ; 0x07 2ecde: 16 82 std Z+6, r1 ; 0x06 2ece0: 8a eb ldi r24, 0xBA ; 186 2ece2: 9c e4 ldi r25, 0x4C ; 76 2ece4: 96 87 std Z+14, r25 ; 0x0e 2ece6: 85 87 std Z+13, r24 ; 0x0d 2ece8: 10 8a std Z+16, r1 ; 0x10 2ecea: 17 86 std Z+15, r1 ; 0x0f 2ecec: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2ecf0: 60 93 99 17 sts 0x1799, r22 ; 0x801799 2ecf4: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 2ecf8: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 2ecfc: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c 2ed00: 2f 96 adiw r28, 0x0f ; 15 2ed02: 0f b6 in r0, 0x3f ; 63 2ed04: f8 94 cli 2ed06: de bf out 0x3e, r29 ; 62 2ed08: 0f be out 0x3f, r0 ; 63 2ed0a: cd bf out 0x3d, r28 ; 61 2ed0c: df 91 pop r29 2ed0e: cf 91 pop r28 2ed10: 1f 91 pop r17 2ed12: 0f 91 pop r16 2ed14: ff 90 pop r15 2ed16: ef 90 pop r14 2ed18: 08 95 ret 0002ed1a : 2ed1a: 42 e0 ldi r20, 0x02 ; 2 2ed1c: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2ed20: 0d 94 48 d6 jmp 0x3ac90 ; 0x3ac90 0002ed24 : 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; 2ed24: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 2ed28: 83 36 cpi r24, 0x63 ; 99 2ed2a: 09 f4 brne .+2 ; 0x2ed2e 2ed2c: 8f ef ldi r24, 0xFF ; 255 } 2ed2e: 08 95 ret 0002ed30 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2ed30: 9f b7 in r25, 0x3f ; 63 2ed32: f8 94 cli 2ed34: e5 e0 ldi r30, 0x05 ; 5 2ed36: f1 e0 ldi r31, 0x01 ; 1 2ed38: 80 81 ld r24, Z 2ed3a: 80 64 ori r24, 0x40 ; 64 2ed3c: 80 83 st Z, r24 2ed3e: 9f bf out 0x3f, r25 ; 63 } 2ed40: 08 95 ret 0002ed42 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2ed42: 0f 93 push r16 2ed44: 1f 93 push r17 2ed46: cf 93 push r28 2ed48: df 93 push r29 2ed4a: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2ed4c: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2ed50: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2ed52: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 2ed56: 8f 3f cpi r24, 0xFF ; 255 2ed58: 69 f0 breq .+26 ; 0x2ed74 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2ed5a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 2ed5e: 60 1b sub r22, r16 2ed60: 71 0b sbc r23, r17 2ed62: 6c 17 cp r22, r28 2ed64: 7d 07 cpc r23, r29 2ed66: a8 f3 brcs .-22 ; 0x2ed52 } return true; fail: return false; 2ed68: 80 e0 ldi r24, 0x00 ; 0 } 2ed6a: df 91 pop r29 2ed6c: cf 91 pop r28 2ed6e: 1f 91 pop r17 2ed70: 0f 91 pop r16 2ed72: 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; 2ed74: 81 e0 ldi r24, 0x01 ; 1 2ed76: f9 cf rjmp .-14 ; 0x2ed6a 0002ed78 : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2ed78: 82 e2 ldi r24, 0x22 ; 34 2ed7a: 9a ea ldi r25, 0xAA ; 170 2ed7c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2ed80: 60 e0 ldi r22, 0x00 ; 0 2ed82: 8c ea ldi r24, 0xAC ; 172 2ed84: 9c e0 ldi r25, 0x0C ; 12 2ed86: 0e 94 a5 77 call 0xef4a ; 0xef4a if (status == 1) { 2ed8a: 81 30 cpi r24, 0x01 ; 1 2ed8c: 21 f4 brne .+8 ; 0x2ed96 SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2ed8e: 84 e8 ldi r24, 0x84 ; 132 2ed90: 9d e5 ldi r25, 0x5D ; 93 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2ed92: 0c 94 17 7b jmp 0xf62e ; 0xf62e 2ed96: 8e e7 ldi r24, 0x7E ; 126 2ed98: 9d e5 ldi r25, 0x5D ; 93 2ed9a: fb cf rjmp .-10 ; 0x2ed92 0002ed9c : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2ed9c: bc 01 movw r22, r24 2ed9e: 99 0f add r25, r25 2eda0: 88 0b sbc r24, r24 2eda2: 99 0b sbc r25, r25 2eda4: 0f 94 9a d2 call 0x3a534 ; 0x3a534 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2eda8: 0d 94 48 d6 jmp 0x3ac90 ; 0x3ac90 0002edac : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2edac: 0f 93 push r16 2edae: 1f 93 push r17 2edb0: cf 93 push r28 2edb2: df 93 push r29 2edb4: ec 01 movw r28, r24 2edb6: 0f 94 04 db call 0x3b608 ; 0x3b608 <__strlen_P> 2edba: 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) 2edbc: 80 36 cpi r24, 0x60 ; 96 2edbe: 91 05 cpc r25, r1 2edc0: 08 f0 brcs .+2 ; 0x2edc4 2edc2: 85 c0 rjmp .+266 ; 0x2eece return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2edc4: 80 91 7d 10 lds r24, 0x107D ; 0x80107d 2edc8: 81 11 cpse r24, r1 2edca: 05 c0 rjmp .+10 ; 0x2edd6 cmdqueue_pop_front(); 2edcc: 0e 94 58 78 call 0xf0b0 ; 0xf0b0 cmdbuffer_front_already_processed = true; 2edd0: 81 e0 ldi r24, 0x01 ; 1 2edd2: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d } if (bufindr == bufindw && buflen > 0) 2edd6: 40 91 6d 12 lds r20, 0x126D ; 0x80126d 2edda: 50 91 6e 12 lds r21, 0x126E ; 0x80126e 2edde: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.570> 2ede2: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.570+0x1> 2ede6: 48 17 cp r20, r24 2ede8: 59 07 cpc r21, r25 2edea: 41 f4 brne .+16 ; 0x2edfc 2edec: 20 91 7e 10 lds r18, 0x107E ; 0x80107e 2edf0: 30 91 7f 10 lds r19, 0x107F ; 0x80107f 2edf4: 12 16 cp r1, r18 2edf6: 13 06 cpc r1, r19 2edf8: 0c f4 brge .+2 ; 0x2edfc 2edfa: 69 c0 rjmp .+210 ; 0x2eece // 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; 2edfc: 20 91 79 10 lds r18, 0x1079 ; 0x801079 2ee00: 30 91 7a 10 lds r19, 0x107A ; 0x80107a 2ee04: 12 16 cp r1, r18 2ee06: 13 06 cpc r1, r19 2ee08: 0c f0 brlt .+2 ; 0x2ee0c 2ee0a: 41 c0 rjmp .+130 ; 0x2ee8e 2ee0c: 9c 01 movw r18, r24 2ee0e: 2f 59 subi r18, 0x9F ; 159 2ee10: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2ee12: 84 17 cp r24, r20 2ee14: 95 07 cpc r25, r21 2ee16: e8 f5 brcc .+122 ; 0x2ee92 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2ee18: 44 50 subi r20, 0x04 ; 4 2ee1a: 51 09 sbc r21, r1 2ee1c: 40 1b sub r20, r16 2ee1e: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2ee20: 42 17 cp r20, r18 2ee22: 53 07 cpc r21, r19 2ee24: 0c f4 brge .+2 ; 0x2ee28 2ee26: 53 c0 rjmp .+166 ; 0x2eece } } 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); 2ee28: 50 93 6e 12 sts 0x126E, r21 ; 0x80126e 2ee2c: 40 93 6d 12 sts 0x126D, r20 ; 0x80126d void enquecommand_front(const char *cmd, bool from_progmem) { size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); // Does cmd fit the queue? This call shall move bufindr, so the command may be copied. if (cmdqueue_could_enqueue_front(len)) { cmdbuffer[bufindr] = CMDBUFFER_CURRENT_TYPE_UI; 2ee30: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 2ee34: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 2ee38: fc 01 movw r30, r24 2ee3a: e0 58 subi r30, 0x80 ; 128 2ee3c: ff 4e sbci r31, 0xEF ; 239 2ee3e: 23 e0 ldi r18, 0x03 ; 3 2ee40: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2ee42: be 01 movw r22, r28 2ee44: 8d 57 subi r24, 0x7D ; 125 2ee46: 9f 4e sbci r25, 0xEF ; 239 2ee48: 0f 94 fd da call 0x3b5fa ; 0x3b5fa else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2ee4c: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 2ee50: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 2ee54: 01 96 adiw r24, 0x01 ; 1 2ee56: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f 2ee5a: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e SERIAL_ECHO_START; 2ee5e: 84 e1 ldi r24, 0x14 ; 20 2ee60: 9a ea ldi r25, 0xAA ; 170 2ee62: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(enqueingFront); 2ee66: 85 ef ldi r24, 0xF5 ; 245 2ee68: 99 ea ldi r25, 0xA9 ; 169 2ee6a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2ee6e: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 2ee72: 90 91 6e 12 lds r25, 0x126E ; 0x80126e } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2ee76: 8d 57 subi r24, 0x7D ; 125 2ee78: 9f 4e sbci r25, 0xEF ; 239 2ee7a: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_ECHOLNPGM("\""); 2ee7e: 83 ef ldi r24, 0xF3 ; 243 2ee80: 99 ea ldi r25, 0xA9 ; 169 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2ee82: df 91 pop r29 2ee84: cf 91 pop r28 2ee86: 1f 91 pop r17 2ee88: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ee8a: 0c 94 17 7b jmp 0xf62e ; 0xf62e // 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) 2ee8e: 9c 01 movw r18, r24 2ee90: c0 cf rjmp .-128 ; 0x2ee12 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2ee92: c8 01 movw r24, r16 2ee94: 04 96 adiw r24, 0x04 ; 4 2ee96: 48 17 cp r20, r24 2ee98: 59 07 cpc r21, r25 2ee9a: 28 f0 brcs .+10 ; 0x2eea6 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2ee9c: 44 50 subi r20, 0x04 ; 4 2ee9e: 51 09 sbc r21, r1 2eea0: 40 1b sub r20, r16 2eea2: 51 0b sbc r21, r17 2eea4: c1 cf rjmp .-126 ; 0x2ee28 return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2eea6: 89 ee ldi r24, 0xE9 ; 233 2eea8: 91 e0 ldi r25, 0x01 ; 1 2eeaa: bc 01 movw r22, r24 2eeac: 60 1b sub r22, r16 2eeae: 71 0b sbc r23, r17 2eeb0: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2eeb2: 62 17 cp r22, r18 2eeb4: 73 07 cpc r23, r19 2eeb6: 5c f0 brlt .+22 ; 0x2eece memset(cmdbuffer, 0, bufindr); 2eeb8: 70 e0 ldi r23, 0x00 ; 0 2eeba: 60 e0 ldi r22, 0x00 ; 0 2eebc: 80 e8 ldi r24, 0x80 ; 128 2eebe: 90 e1 ldi r25, 0x10 ; 16 2eec0: 0f 94 78 e3 call 0x3c6f0 ; 0x3c6f0 bufindr = bufindr_new; 2eec4: 10 93 6e 12 sts 0x126E, r17 ; 0x80126e 2eec8: 00 93 6d 12 sts 0x126D, r16 ; 0x80126d 2eecc: b1 cf rjmp .-158 ; 0x2ee30 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2eece: 8c ee ldi r24, 0xEC ; 236 2eed0: 99 ea ldi r25, 0xA9 ; 169 2eed2: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(enqueingFront); 2eed6: 85 ef ldi r24, 0xF5 ; 245 2eed8: 99 ea ldi r25, 0xA9 ; 169 2eeda: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2eede: ce 01 movw r24, r28 2eee0: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2eee4: 85 ed ldi r24, 0xD5 ; 213 2eee6: 99 ea ldi r25, 0xA9 ; 169 2eee8: cc cf rjmp .-104 ; 0x2ee82 0002eeea : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2eeea: ab 01 movw r20, r22 2eeec: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2eeee: 8b ef ldi r24, 0xFB ; 251 2eef0: 96 e1 ldi r25, 0x16 ; 22 2eef2: 0f 94 66 6e call 0x2dccc ; 0x2dccc 2eef6: 81 11 cpse r24, r1 2eef8: 02 c0 rjmp .+4 ; 0x2eefe 2eefa: 80 e0 ldi r24, 0x00 ; 0 2eefc: 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() ) 2eefe: 8b ef ldi r24, 0xFB ; 251 2ef00: 96 e1 ldi r25, 0x16 ; 22 2ef02: 0f 94 50 6d call 0x2daa0 ; 0x2daa0 2ef06: 88 23 and r24, r24 2ef08: c1 f3 breq .-16 ; 0x2eefa 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; 2ef0a: 20 91 1c 17 lds r18, 0x171C ; 0x80171c 2ef0e: 30 91 1d 17 lds r19, 0x171D ; 0x80171d 2ef12: 28 58 subi r18, 0x88 ; 136 2ef14: 31 4f sbci r19, 0xF1 ; 241 2ef16: 30 93 17 17 sts 0x1717, r19 ; 0x801717 2ef1a: 20 93 16 17 sts 0x1716, r18 ; 0x801716 bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2ef1e: 08 95 ret 0002ef20 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2ef20: 8f 92 push r8 2ef22: 9f 92 push r9 2ef24: af 92 push r10 2ef26: bf 92 push r11 2ef28: cf 92 push r12 2ef2a: df 92 push r13 2ef2c: ef 92 push r14 2ef2e: ff 92 push r15 2ef30: 0f 93 push r16 2ef32: 1f 93 push r17 2ef34: cf 93 push r28 2ef36: df 93 push r29 2ef38: cd b7 in r28, 0x3d ; 61 2ef3a: de b7 in r29, 0x3e ; 62 2ef3c: ee 97 sbiw r28, 0x3e ; 62 2ef3e: 0f b6 in r0, 0x3f ; 63 2ef40: f8 94 cli 2ef42: de bf out 0x3e, r29 ; 62 2ef44: 0f be out 0x3f, r0 ; 63 2ef46: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2ef48: 80 91 b9 14 lds r24, 0x14B9 ; 0x8014b9 2ef4c: 8f 93 push r24 2ef4e: 80 91 b8 14 lds r24, 0x14B8 ; 0x8014b8 2ef52: 8f 93 push r24 2ef54: 80 e9 ldi r24, 0x90 ; 144 2ef56: 99 ea ldi r25, 0xA9 ; 169 2ef58: 9f 93 push r25 2ef5a: 8f 93 push r24 2ef5c: 8e 01 movw r16, r28 2ef5e: 0f 5d subi r16, 0xDF ; 223 2ef60: 1f 4f sbci r17, 0xFF ; 255 2ef62: 1f 93 push r17 2ef64: 0f 93 push r16 2ef66: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba 2ef6a: 0f 90 pop r0 2ef6c: 0f 90 pop r0 2ef6e: 0f 90 pop r0 2ef70: 0f 90 pop r0 2ef72: 0f 90 pop r0 2ef74: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2ef76: f1 2c mov r15, r1 2ef78: f8 01 movw r30, r16 2ef7a: 01 90 ld r0, Z+ 2ef7c: 00 20 and r0, r0 2ef7e: e9 f7 brne .-6 ; 0x2ef7a 2ef80: 31 97 sbiw r30, 0x01 ; 1 2ef82: e0 1b sub r30, r16 2ef84: f1 0b sbc r31, r17 2ef86: fe 16 cp r15, r30 2ef88: 84 f4 brge .+32 ; 0x2efaa autoname[i]=tolower(autoname[i]); 2ef8a: 68 01 movw r12, r16 2ef8c: cf 0c add r12, r15 2ef8e: d1 1c adc r13, r1 2ef90: f7 fc sbrc r15, 7 2ef92: da 94 dec r13 2ef94: f6 01 movw r30, r12 2ef96: 80 81 ld r24, Z 2ef98: 08 2e mov r0, r24 2ef9a: 00 0c add r0, r0 2ef9c: 99 0b sbc r25, r25 2ef9e: 0f 94 5a e3 call 0x3c6b4 ; 0x3c6b4 2efa2: f6 01 movw r30, r12 2efa4: 80 83 st Z, r24 2efa6: f3 94 inc r15 2efa8: e7 cf rjmp .-50 ; 0x2ef78 dir_t p; root.rewind(); 2efaa: 81 ef ldi r24, 0xF1 ; 241 2efac: 94 e1 ldi r25, 0x14 ; 20 2efae: 0e 94 c8 78 call 0xf190 ; 0xf190 bool found=false; 2efb2: a1 2c mov r10, r1 2efb4: ce 01 movw r24, r28 2efb6: 01 96 adiw r24, 0x01 ; 1 2efb8: 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); 2efba: 8d e2 ldi r24, 0x2D ; 45 2efbc: c8 2e mov r12, r24 2efbe: 81 e7 ldi r24, 0x71 ; 113 2efc0: 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; 2efc2: 80 91 f4 14 lds r24, 0x14F4 ; 0x8014f4 2efc6: 82 30 cpi r24, 0x02 ; 2 2efc8: 08 f4 brcc .+2 ; 0x2efcc 2efca: 50 c0 rjmp .+160 ; 0x2f06c 2efcc: 80 91 f9 14 lds r24, 0x14F9 ; 0x8014f9 2efd0: 90 91 fa 14 lds r25, 0x14FA ; 0x8014fa 2efd4: a0 91 fb 14 lds r26, 0x14FB ; 0x8014fb 2efd8: b0 91 fc 14 lds r27, 0x14FC ; 0x8014fc 2efdc: 8f 71 andi r24, 0x1F ; 31 2efde: 99 27 eor r25, r25 2efe0: aa 27 eor r26, r26 2efe2: bb 27 eor r27, r27 2efe4: 89 2b or r24, r25 2efe6: 8a 2b or r24, r26 2efe8: 8b 2b or r24, r27 2efea: 09 f0 breq .+2 ; 0x2efee 2efec: 3f c0 rjmp .+126 ; 0x2f06c 2efee: 50 e0 ldi r21, 0x00 ; 0 2eff0: 40 e0 ldi r20, 0x00 ; 0 2eff2: b7 01 movw r22, r14 2eff4: 81 ef ldi r24, 0xF1 ; 241 2eff6: 94 e1 ldi r25, 0x14 ; 20 2eff8: 0f 94 c9 6d call 0x2db92 ; 0x2db92 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2effc: 18 16 cp r1, r24 2effe: b4 f5 brge .+108 ; 0x2f06c { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2f000: b1 2c mov r11, r1 2f002: f7 01 movw r30, r14 2f004: 01 90 ld r0, Z+ 2f006: 00 20 and r0, r0 2f008: e9 f7 brne .-6 ; 0x2f004 2f00a: 31 97 sbiw r30, 0x01 ; 1 2f00c: ee 19 sub r30, r14 2f00e: ff 09 sbc r31, r15 2f010: be 16 cp r11, r30 2f012: 74 f4 brge .+28 ; 0x2f030 p.name[i]=tolower(p.name[i]); 2f014: 47 01 movw r8, r14 2f016: 8b 0c add r8, r11 2f018: 91 1c adc r9, r1 2f01a: b7 fc sbrc r11, 7 2f01c: 9a 94 dec r9 2f01e: f4 01 movw r30, r8 2f020: 80 81 ld r24, Z 2f022: 90 e0 ldi r25, 0x00 ; 0 2f024: 0f 94 5a e3 call 0x3c6b4 ; 0x3c6b4 2f028: f4 01 movw r30, r8 2f02a: 80 83 st Z, r24 2f02c: b3 94 inc r11 2f02e: e9 cf rjmp .-46 ; 0x2f002 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2f030: 8a 85 ldd r24, Y+10 ; 0x0a 2f032: 8e 37 cpi r24, 0x7E ; 126 2f034: 31 f2 breq .-116 ; 0x2efc2 if(strncmp((char*)p.name,autoname,5)==0) 2f036: 45 e0 ldi r20, 0x05 ; 5 2f038: 50 e0 ldi r21, 0x00 ; 0 2f03a: b8 01 movw r22, r16 2f03c: c7 01 movw r24, r14 2f03e: 0f 94 b8 e3 call 0x3c770 ; 0x3c770 2f042: 89 2b or r24, r25 2f044: 09 f0 breq .+2 ; 0x2f048 2f046: bd cf rjmp .-134 ; 0x2efc2 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2f048: 1f 93 push r17 2f04a: 0f 93 push r16 2f04c: df 92 push r13 2f04e: cf 92 push r12 2f050: 0e 94 fa 89 call 0x113f4 ; 0x113f4 // M24: Start/resume SD print enquecommand_P(MSG_M24); 2f054: 61 e0 ldi r22, 0x01 ; 1 2f056: 89 e2 ldi r24, 0x29 ; 41 2f058: 91 e7 ldi r25, 0x71 ; 113 2f05a: 0e 94 5c 89 call 0x112b8 ; 0x112b8 2f05e: 0f 90 pop r0 2f060: 0f 90 pop r0 2f062: 0f 90 pop r0 2f064: 0f 90 pop r0 found=true; 2f066: aa 24 eor r10, r10 2f068: a3 94 inc r10 2f06a: ab cf rjmp .-170 ; 0x2efc2 } } if(!found) lastnr=-1; 2f06c: 8f ef ldi r24, 0xFF ; 255 2f06e: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2f070: aa 20 and r10, r10 2f072: 29 f0 breq .+10 ; 0x2f07e lastnr=-1; else lastnr++; 2f074: 80 91 b8 14 lds r24, 0x14B8 ; 0x8014b8 2f078: 90 91 b9 14 lds r25, 0x14B9 ; 0x8014b9 2f07c: 01 96 adiw r24, 0x01 ; 1 2f07e: 90 93 b9 14 sts 0x14B9, r25 ; 0x8014b9 2f082: 80 93 b8 14 sts 0x14B8, r24 ; 0x8014b8 } 2f086: ee 96 adiw r28, 0x3e ; 62 2f088: 0f b6 in r0, 0x3f ; 63 2f08a: f8 94 cli 2f08c: de bf out 0x3e, r29 ; 62 2f08e: 0f be out 0x3f, r0 ; 63 2f090: cd bf out 0x3d, r28 ; 61 2f092: df 91 pop r29 2f094: cf 91 pop r28 2f096: 1f 91 pop r17 2f098: 0f 91 pop r16 2f09a: ff 90 pop r15 2f09c: ef 90 pop r14 2f09e: df 90 pop r13 2f0a0: cf 90 pop r12 2f0a2: bf 90 pop r11 2f0a4: af 90 pop r10 2f0a6: 9f 90 pop r9 2f0a8: 8f 90 pop r8 2f0aa: 08 95 ret 0002f0ac : * \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) { 2f0ac: 8f 92 push r8 2f0ae: 9f 92 push r9 2f0b0: af 92 push r10 2f0b2: bf 92 push r11 2f0b4: cf 92 push r12 2f0b6: df 92 push r13 2f0b8: ef 92 push r14 2f0ba: ff 92 push r15 2f0bc: 0f 93 push r16 2f0be: 1f 93 push r17 2f0c0: cf 93 push r28 2f0c2: df 93 push r29 2f0c4: 00 d0 rcall .+0 ; 0x2f0c6 2f0c6: 1f 92 push r1 2f0c8: cd b7 in r28, 0x3d ; 61 2f0ca: de b7 in r29, 0x3e ; 62 2f0cc: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2f0ce: 83 81 ldd r24, Z+3 ; 0x03 2f0d0: 81 30 cpi r24, 0x01 ; 1 2f0d2: 11 f0 breq .+4 ; 0x2f0d8 // set file to correct position return seekSet(newPos); fail: return false; 2f0d4: 80 e0 ldi r24, 0x00 ; 0 2f0d6: 60 c0 rjmp .+192 ; 0x2f198 * \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; 2f0d8: 81 81 ldd r24, Z+1 ; 0x01 2f0da: 81 ff sbrs r24, 1 2f0dc: fb cf rjmp .-10 ; 0x2f0d4 // 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; 2f0de: 81 89 ldd r24, Z+17 ; 0x11 2f0e0: 92 89 ldd r25, Z+18 ; 0x12 2f0e2: a3 89 ldd r26, Z+19 ; 0x13 2f0e4: b4 89 ldd r27, Z+20 ; 0x14 2f0e6: 89 2b or r24, r25 2f0e8: 8a 2b or r24, r26 2f0ea: 8b 2b or r24, r27 2f0ec: 09 f4 brne .+2 ; 0x2f0f0 2f0ee: 6e c0 rjmp .+220 ; 0x2f1cc 2f0f0: 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; 2f0f2: 40 e0 ldi r20, 0x00 ; 0 2f0f4: 50 e0 ldi r21, 0x00 ; 0 2f0f6: ba 01 movw r22, r20 2f0f8: cf 01 movw r24, r30 2f0fa: 0f 94 66 6e call 0x2dccc ; 0x2dccc 2f0fe: 88 23 and r24, r24 2f100: 49 f3 breq .-46 ; 0x2f0d4 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2f102: f7 01 movw r30, r14 2f104: c1 8c ldd r12, Z+25 ; 0x19 2f106: d2 8c ldd r13, Z+26 ; 0x1a 2f108: 85 88 ldd r8, Z+21 ; 0x15 2f10a: 96 88 ldd r9, Z+22 ; 0x16 2f10c: a7 88 ldd r10, Z+23 ; 0x17 2f10e: 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; 2f110: 82 e0 ldi r24, 0x02 ; 2 2f112: 90 e0 ldi r25, 0x00 ; 0 2f114: a0 e0 ldi r26, 0x00 ; 0 2f116: b0 e0 ldi r27, 0x00 ; 0 2f118: f6 01 movw r30, r12 2f11a: 80 83 st Z, r24 2f11c: 91 83 std Z+1, r25 ; 0x01 2f11e: a2 83 std Z+2, r26 ; 0x02 2f120: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2f122: 9e 01 movw r18, r28 2f124: 2f 5f subi r18, 0xFF ; 255 2f126: 3f 4f sbci r19, 0xFF ; 255 2f128: b5 01 movw r22, r10 2f12a: a4 01 movw r20, r8 2f12c: c6 01 movw r24, r12 2f12e: 0f 94 63 6c call 0x2d8c6 ; 0x2d8c6 2f132: 88 23 and r24, r24 2f134: 79 f2 breq .-98 ; 0x2f0d4 // free cluster if (!fatPut(cluster, 0)) goto fail; 2f136: 00 e0 ldi r16, 0x00 ; 0 2f138: 10 e0 ldi r17, 0x00 ; 0 2f13a: 98 01 movw r18, r16 2f13c: b5 01 movw r22, r10 2f13e: a4 01 movw r20, r8 2f140: c6 01 movw r24, r12 2f142: 0f 94 d1 6b call 0x2d7a2 ; 0x2d7a2 2f146: 88 23 and r24, r24 2f148: 29 f2 breq .-118 ; 0x2f0d4 cluster = next; 2f14a: 89 80 ldd r8, Y+1 ; 0x01 2f14c: 9a 80 ldd r9, Y+2 ; 0x02 2f14e: ab 80 ldd r10, Y+3 ; 0x03 2f150: 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; 2f152: f6 01 movw r30, r12 2f154: 87 89 ldd r24, Z+23 ; 0x17 2f156: 80 31 cpi r24, 0x10 ; 16 2f158: 81 f5 brne .+96 ; 0x2f1ba 2f15a: f8 ef ldi r31, 0xF8 ; 248 2f15c: 8f 16 cp r8, r31 2f15e: ff ef ldi r31, 0xFF ; 255 2f160: 9f 06 cpc r9, r31 2f162: a1 04 cpc r10, r1 2f164: b1 04 cpc r11, r1 2f166: e8 f2 brcs .-70 ; 0x2f122 firstCluster_ = 0; 2f168: f7 01 movw r30, r14 2f16a: 15 8a std Z+21, r1 ; 0x15 2f16c: 16 8a std Z+22, r1 ; 0x16 2f16e: 17 8a std Z+23, r1 ; 0x17 2f170: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2f172: 11 8a std Z+17, r1 ; 0x11 2f174: 12 8a std Z+18, r1 ; 0x12 2f176: 13 8a std Z+19, r1 ; 0x13 2f178: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2f17a: 81 81 ldd r24, Z+1 ; 0x01 2f17c: 80 68 ori r24, 0x80 ; 128 2f17e: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2f180: c7 01 movw r24, r14 2f182: 0f 94 31 6e call 0x2dc62 ; 0x2dc62 2f186: 88 23 and r24, r24 2f188: 09 f4 brne .+2 ; 0x2f18c 2f18a: a4 cf rjmp .-184 ; 0x2f0d4 // set file to correct position return seekSet(newPos); 2f18c: 40 e0 ldi r20, 0x00 ; 0 2f18e: 50 e0 ldi r21, 0x00 ; 0 2f190: ba 01 movw r22, r20 2f192: c7 01 movw r24, r14 2f194: 0f 94 66 6e call 0x2dccc ; 0x2dccc fail: return false; } 2f198: 0f 90 pop r0 2f19a: 0f 90 pop r0 2f19c: 0f 90 pop r0 2f19e: 0f 90 pop r0 2f1a0: df 91 pop r29 2f1a2: cf 91 pop r28 2f1a4: 1f 91 pop r17 2f1a6: 0f 91 pop r16 2f1a8: ff 90 pop r15 2f1aa: ef 90 pop r14 2f1ac: df 90 pop r13 2f1ae: cf 90 pop r12 2f1b0: bf 90 pop r11 2f1b2: af 90 pop r10 2f1b4: 9f 90 pop r9 2f1b6: 8f 90 pop r8 2f1b8: 08 95 ret return cluster >= FAT32EOC_MIN; 2f1ba: 88 ef ldi r24, 0xF8 ; 248 2f1bc: 88 16 cp r8, r24 2f1be: 8f ef ldi r24, 0xFF ; 255 2f1c0: 98 06 cpc r9, r24 2f1c2: a8 06 cpc r10, r24 2f1c4: 8f e0 ldi r24, 0x0F ; 15 2f1c6: b8 06 cpc r11, r24 2f1c8: 78 f6 brcc .-98 ; 0x2f168 2f1ca: ab cf rjmp .-170 ; 0x2f122 // 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; 2f1cc: 81 e0 ldi r24, 0x01 ; 1 2f1ce: e4 cf rjmp .-56 ; 0x2f198 0002f1d0 : +* 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) { 2f1d0: 2f 92 push r2 2f1d2: 3f 92 push r3 2f1d4: 4f 92 push r4 2f1d6: 5f 92 push r5 2f1d8: 6f 92 push r6 2f1da: 7f 92 push r7 2f1dc: 8f 92 push r8 2f1de: 9f 92 push r9 2f1e0: af 92 push r10 2f1e2: bf 92 push r11 2f1e4: cf 92 push r12 2f1e6: df 92 push r13 2f1e8: ef 92 push r14 2f1ea: ff 92 push r15 2f1ec: 0f 93 push r16 2f1ee: 1f 93 push r17 2f1f0: cf 93 push r28 2f1f2: df 93 push r29 2f1f4: cd b7 in r28, 0x3d ; 61 2f1f6: de b7 in r29, 0x3e ; 62 2f1f8: c6 57 subi r28, 0x76 ; 118 2f1fa: d1 09 sbc r29, r1 2f1fc: 0f b6 in r0, 0x3f ; 63 2f1fe: f8 94 cli 2f200: de bf out 0x3e, r29 ; 62 2f202: 0f be out 0x3f, r0 ; 63 2f204: cd bf out 0x3d, r28 ; 61 2f206: 4c 01 movw r8, r24 2f208: 6b 01 movw r12, r22 2f20a: 3a 01 movw r6, r20 2f20c: e5 96 adiw r28, 0x35 ; 53 2f20e: 2f af std Y+63, r18 ; 0x3f 2f210: e5 97 sbiw r28, 0x35 ; 53 2f212: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2f214: 2d b6 in r2, 0x3d ; 61 2f216: 3e b6 in r3, 0x3e ; 62 2f218: 10 2f mov r17, r16 2f21a: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2f21c: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 2f220: 8f 5f subi r24, 0xFF ; 255 2f222: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; // Read the next entry from a directory for (position = parent.curPosition(); parent.readDir(p, longFilename) > 0; position = parent.curPosition()) { 2f226: fb 01 movw r30, r22 2f228: 80 85 ldd r24, Z+8 ; 0x08 2f22a: 91 85 ldd r25, Z+9 ; 0x09 2f22c: a2 85 ldd r26, Z+10 ; 0x0a 2f22e: b3 85 ldd r27, Z+11 ; 0x0b 2f230: 80 93 7e 14 sts 0x147E, r24 ; 0x80147e 2f234: 90 93 7f 14 sts 0x147F, r25 ; 0x80147f 2f238: a0 93 80 14 sts 0x1480, r26 ; 0x801480 2f23c: b0 93 81 14 sts 0x1481, r27 ; 0x801481 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2f240: 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); 2f242: 5e 01 movw r10, r28 2f244: f7 e6 ldi r31, 0x67 ; 103 2f246: af 0e add r10, r31 2f248: 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; 2f24a: f6 01 movw r30, r12 2f24c: 83 81 ldd r24, Z+3 ; 0x03 2f24e: 82 30 cpi r24, 0x02 ; 2 2f250: 08 f4 brcc .+2 ; 0x2f254 2f252: c0 c1 rjmp .+896 ; 0x2f5d4 2f254: 80 85 ldd r24, Z+8 ; 0x08 2f256: 91 85 ldd r25, Z+9 ; 0x09 2f258: a2 85 ldd r26, Z+10 ; 0x0a 2f25a: b3 85 ldd r27, Z+11 ; 0x0b 2f25c: 8f 71 andi r24, 0x1F ; 31 2f25e: 99 27 eor r25, r25 2f260: aa 27 eor r26, r26 2f262: bb 27 eor r27, r27 2f264: 89 2b or r24, r25 2f266: 8a 2b or r24, r26 2f268: 8b 2b or r24, r27 2f26a: 09 f0 breq .+2 ; 0x2f26e 2f26c: b3 c1 rjmp .+870 ; 0x2f5d4 //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'; 2f26e: 10 92 82 14 sts 0x1482, r1 ; 0x801482 2f272: 42 e8 ldi r20, 0x82 ; 130 2f274: 54 e1 ldi r21, 0x14 ; 20 2f276: be 01 movw r22, r28 2f278: 69 5b subi r22, 0xB9 ; 185 2f27a: 7f 4f sbci r23, 0xFF ; 255 2f27c: c6 01 movw r24, r12 2f27e: 0f 94 c9 6d call 0x2db92 ; 0x2db92 } 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()) { 2f282: 18 16 cp r1, r24 2f284: 0c f0 brlt .+2 ; 0x2f288 2f286: a6 c1 rjmp .+844 ; 0x2f5d4 if (recursionCnt > MAX_DIR_DEPTH) 2f288: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 2f28c: 87 30 cpi r24, 0x07 ; 7 2f28e: 08 f0 brcs .+2 ; 0x2f292 2f290: a1 c1 rjmp .+834 ; 0x2f5d4 return; uint8_t pn0 = p.name[0]; 2f292: 28 96 adiw r28, 0x08 ; 8 2f294: 8f ad ldd r24, Y+63 ; 0x3f 2f296: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2f298: 88 23 and r24, r24 2f29a: 09 f4 brne .+2 ; 0x2f29e 2f29c: 9b c1 rjmp .+822 ; 0x2f5d4 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2f29e: 85 3e cpi r24, 0xE5 ; 229 2f2a0: 09 f4 brne .+2 ; 0x2f2a4 2f2a2: 39 c1 rjmp .+626 ; 0x2f516 2f2a4: 8e 32 cpi r24, 0x2E ; 46 2f2a6: 09 f4 brne .+2 ; 0x2f2aa 2f2a8: 36 c1 rjmp .+620 ; 0x2f516 if (longFilename[0] == '.') continue; 2f2aa: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f2ae: 8e 32 cpi r24, 0x2E ; 46 2f2b0: 09 f4 brne .+2 ; 0x2f2b4 2f2b2: 31 c1 rjmp .+610 ; 0x2f516 2f2b4: 63 96 adiw r28, 0x13 ; 19 2f2b6: 8f ad ldd r24, Y+63 ; 0x3f 2f2b8: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2f2ba: 98 2f mov r25, r24 2f2bc: 9a 70 andi r25, 0x0A ; 10 2f2be: 09 f0 breq .+2 ; 0x2f2c2 2f2c0: 2a c1 rjmp .+596 ; 0x2f516 2f2c2: 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; 2f2c4: 91 e0 ldi r25, 0x01 ; 1 2f2c6: 80 31 cpi r24, 0x10 ; 16 2f2c8: 19 f0 breq .+6 ; 0x2f2d0 2f2ca: 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 2f2cc: 80 31 cpi r24, 0x10 ; 16 2f2ce: 31 f4 brne .+12 ; 0x2f2dc 2f2d0: e5 96 adiw r28, 0x35 ; 53 2f2d2: ff ad ldd r31, Y+63 ; 0x3f 2f2d4: e5 97 sbiw r28, 0x35 ; 53 2f2d6: ff 23 and r31, r31 2f2d8: 09 f4 brne .+2 ; 0x2f2dc 2f2da: 94 c0 rjmp .+296 ; 0x2f404 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2f2dc: 90 93 b7 14 sts 0x14B7, r25 ; 0x8014b7 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2f2e0: 80 31 cpi r24, 0x10 ; 16 2f2e2: 61 f0 breq .+24 ; 0x2f2fc 2f2e4: 60 96 adiw r28, 0x10 ; 16 2f2e6: 8f ad ldd r24, Y+63 ; 0x3f 2f2e8: 60 97 sbiw r28, 0x10 ; 16 2f2ea: 87 34 cpi r24, 0x47 ; 71 2f2ec: 09 f0 breq .+2 ; 0x2f2f0 2f2ee: 13 c1 rjmp .+550 ; 0x2f516 2f2f0: 61 96 adiw r28, 0x11 ; 17 2f2f2: 8f ad ldd r24, Y+63 ; 0x3f 2f2f4: 61 97 sbiw r28, 0x11 ; 17 2f2f6: 8e 37 cpi r24, 0x7E ; 126 2f2f8: 09 f4 brne .+2 ; 0x2f2fc 2f2fa: 0d c1 rjmp .+538 ; 0x2f516 switch (lsAction) { 2f2fc: e5 96 adiw r28, 0x35 ; 53 2f2fe: ff ad ldd r31, Y+63 ; 0x3f 2f300: e5 97 sbiw r28, 0x35 ; 53 2f302: f1 30 cpi r31, 0x01 ; 1 2f304: 09 f4 brne .+2 ; 0x2f308 2f306: 1b c1 rjmp .+566 ; 0x2f53e 2f308: f2 30 cpi r31, 0x02 ; 2 2f30a: 09 f4 brne .+2 ; 0x2f30e 2f30c: 25 c1 rjmp .+586 ; 0x2f558 case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2f30e: be 01 movw r22, r28 2f310: 69 5b subi r22, 0xB9 ; 185 2f312: 7f 4f sbci r23, 0xFF ; 255 2f314: 8d e6 ldi r24, 0x6D ; 109 2f316: 94 e1 ldi r25, 0x14 ; 20 2f318: 0e 94 b2 78 call 0xf164 ; 0xf164 2f31c: c4 01 movw r24, r8 2f31e: 0e 94 50 89 call 0x112a0 ; 0x112a0 2f322: 8d e6 ldi r24, 0x6D ; 109 2f324: 94 e1 ldi r25, 0x14 ; 20 2f326: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2f32a: 80 e2 ldi r24, 0x20 ; 32 2f32c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2f330: a7 96 adiw r28, 0x27 ; 39 2f332: 6c ad ldd r22, Y+60 ; 0x3c 2f334: 7d ad ldd r23, Y+61 ; 0x3d 2f336: 8e ad ldd r24, Y+62 ; 0x3e 2f338: 9f ad ldd r25, Y+63 ; 0x3f 2f33a: a7 97 sbiw r28, 0x27 ; 39 2f33c: 4a e0 ldi r20, 0x0A ; 10 2f33e: 0f 94 35 d2 call 0x3a46a ; 0x3a46a SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2f342: 51 fe sbrs r5, 1 2f344: 45 c0 rjmp .+138 ; 0x2f3d0 { crmodDate = p.lastWriteDate; 2f346: a1 96 adiw r28, 0x21 ; 33 2f348: 2e ad ldd r18, Y+62 ; 0x3e 2f34a: 3f ad ldd r19, Y+63 ; 0x3f 2f34c: a1 97 sbiw r28, 0x21 ; 33 2f34e: 30 93 7d 14 sts 0x147D, r19 ; 0x80147d 2f352: 20 93 7c 14 sts 0x147C, r18 ; 0x80147c crmodTime = p.lastWriteTime; 2f356: 6f 96 adiw r28, 0x1f ; 31 2f358: 4e ad ldd r20, Y+62 ; 0x3e 2f35a: 5f ad ldd r21, Y+63 ; 0x3f 2f35c: 6f 97 sbiw r28, 0x1f ; 31 2f35e: 50 93 7b 14 sts 0x147B, r21 ; 0x80147b 2f362: 40 93 7a 14 sts 0x147A, r20 ; 0x80147a if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2f366: 69 96 adiw r28, 0x19 ; 25 2f368: 8e ad ldd r24, Y+62 ; 0x3e 2f36a: 9f ad ldd r25, Y+63 ; 0x3f 2f36c: 69 97 sbiw r28, 0x19 ; 25 2f36e: 28 17 cp r18, r24 2f370: 39 07 cpc r19, r25 2f372: 50 f0 brcs .+20 ; 0x2f388 2f374: 28 17 cp r18, r24 2f376: 39 07 cpc r19, r25 2f378: 99 f4 brne .+38 ; 0x2f3a0 2f37a: 67 96 adiw r28, 0x17 ; 23 2f37c: 2e ad ldd r18, Y+62 ; 0x3e 2f37e: 3f ad ldd r19, Y+63 ; 0x3f 2f380: 67 97 sbiw r28, 0x17 ; 23 2f382: 42 17 cp r20, r18 2f384: 53 07 cpc r21, r19 2f386: 60 f4 brcc .+24 ; 0x2f3a0 crmodDate = p.creationDate; 2f388: 90 93 7d 14 sts 0x147D, r25 ; 0x80147d 2f38c: 80 93 7c 14 sts 0x147C, r24 ; 0x80147c crmodTime = p.creationTime; 2f390: 67 96 adiw r28, 0x17 ; 23 2f392: 8e ad ldd r24, Y+62 ; 0x3e 2f394: 9f ad ldd r25, Y+63 ; 0x3f 2f396: 67 97 sbiw r28, 0x17 ; 23 2f398: 90 93 7b 14 sts 0x147B, r25 ; 0x80147b 2f39c: 80 93 7a 14 sts 0x147A, r24 ; 0x80147a } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2f3a0: 80 91 7d 14 lds r24, 0x147D ; 0x80147d 2f3a4: 8f 93 push r24 2f3a6: 80 91 7c 14 lds r24, 0x147C ; 0x80147c 2f3aa: 8f 93 push r24 2f3ac: 80 91 7b 14 lds r24, 0x147B ; 0x80147b 2f3b0: 8f 93 push r24 2f3b2: 80 91 7a 14 lds r24, 0x147A ; 0x80147a 2f3b6: 8f 93 push r24 2f3b8: 2d e6 ldi r18, 0x6D ; 109 2f3ba: 39 ea ldi r19, 0xA9 ; 169 2f3bc: 3f 93 push r19 2f3be: 2f 93 push r18 2f3c0: 0f 94 08 dc call 0x3b810 ; 0x3b810 2f3c4: 0f 90 pop r0 2f3c6: 0f 90 pop r0 2f3c8: 0f 90 pop r0 2f3ca: 0f 90 pop r0 2f3cc: 0f 90 pop r0 2f3ce: 0f 90 pop r0 } if (lsParams.LFN) 2f3d0: 11 23 and r17, r17 2f3d2: 99 f0 breq .+38 ; 0x2f3fa printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f3d4: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f3d8: 88 23 and r24, r24 2f3da: 09 f4 brne .+2 ; 0x2f3de 2f3dc: ba c0 rjmp .+372 ; 0x2f552 2f3de: 82 e8 ldi r24, 0x82 ; 130 2f3e0: 94 e1 ldi r25, 0x14 ; 20 2f3e2: 9f 93 push r25 2f3e4: 8f 93 push r24 2f3e6: e7 e6 ldi r30, 0x67 ; 103 2f3e8: f9 ea ldi r31, 0xA9 ; 169 2f3ea: ff 93 push r31 2f3ec: ef 93 push r30 2f3ee: 0f 94 08 dc call 0x3b810 ; 0x3b810 2f3f2: 0f 90 pop r0 2f3f4: 0f 90 pop r0 2f3f6: 0f 90 pop r0 2f3f8: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2f3fa: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 manage_heater(); 2f3fe: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 2f402: 89 c0 rjmp .+274 ; 0x2f516 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2f404: 2d b7 in r18, 0x3d ; 61 2f406: 3e b7 in r19, 0x3e ; 62 2f408: e7 96 adiw r28, 0x37 ; 55 2f40a: 3f af std Y+63, r19 ; 0x3f 2f40c: 2e af std Y+62, r18 ; 0x3e 2f40e: 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); 2f410: be 01 movw r22, r28 2f412: 69 5b subi r22, 0xB9 ; 185 2f414: 7f 4f sbci r23, 0xFF ; 255 2f416: c5 01 movw r24, r10 2f418: 0e 94 b2 78 call 0xf164 ; 0xf164 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2f41c: f4 01 movw r30, r8 2f41e: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2f420: 88 23 and r24, r24 2f422: 09 f4 brne .+2 ; 0x2f426 2f424: 86 c0 rjmp .+268 ; 0x2f532 2f426: 01 90 ld r0, Z+ 2f428: 00 20 and r0, r0 2f42a: e9 f7 brne .-6 ; 0x2f426 2f42c: 31 97 sbiw r30, 0x01 ; 1 2f42e: e8 19 sub r30, r8 2f430: f9 09 sbc r31, r9 2f432: d5 01 movw r26, r10 2f434: 0d 90 ld r0, X+ 2f436: 00 20 and r0, r0 2f438: e9 f7 brne .-6 ; 0x2f434 2f43a: ea 19 sub r30, r10 2f43c: fb 09 sbc r31, r11 char path[len]; 2f43e: ea 0f add r30, r26 2f440: fb 1f adc r31, r27 2f442: 31 96 adiw r30, 0x01 ; 1 2f444: 2d b7 in r18, 0x3d ; 61 2f446: 3e b7 in r19, 0x3e ; 62 2f448: 2e 1b sub r18, r30 2f44a: 3f 0b sbc r19, r31 2f44c: 0f b6 in r0, 0x3f ; 63 2f44e: f8 94 cli 2f450: 3e bf out 0x3e, r19 ; 62 2f452: 0f be out 0x3f, r0 ; 63 2f454: 2d bf out 0x3d, r18 ; 61 2f456: ed b7 in r30, 0x3d ; 61 2f458: fe b7 in r31, 0x3e ; 62 2f45a: 31 96 adiw r30, 0x01 ; 1 2f45c: 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 2f45e: 6c e1 ldi r22, 0x1C ; 28 2f460: 73 e0 ldi r23, 0x03 ; 3 2f462: 81 11 cpse r24, r1 2f464: b4 01 movw r22, r8 2f466: c7 01 movw r24, r14 2f468: 0f 94 b1 e3 call 0x3c762 ; 0x3c762 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f46c: b5 01 movw r22, r10 2f46e: c7 01 movw r24, r14 2f470: 0f 94 92 e3 call 0x3c724 ; 0x3c724 strcat(path, "/"); // 1 character 2f474: 6c e1 ldi r22, 0x1C ; 28 2f476: 73 e0 ldi r23, 0x03 ; 3 2f478: c7 01 movw r24, r14 2f47a: 0f 94 92 e3 call 0x3c724 ; 0x3c724 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f47e: 11 23 and r17, r17 2f480: a9 f0 breq .+42 ; 0x2f4ac printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f482: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f486: 81 11 cpse r24, r1 2f488: 57 c0 rjmp .+174 ; 0x2f538 2f48a: c5 01 movw r24, r10 2f48c: 9f 93 push r25 2f48e: 8f 93 push r24 2f490: ff 92 push r15 2f492: ef 92 push r14 2f494: 2c e7 ldi r18, 0x7C ; 124 2f496: 39 ea ldi r19, 0xA9 ; 169 2f498: 3f 93 push r19 2f49a: 2f 93 push r18 2f49c: 0f 94 08 dc call 0x3b810 ; 0x3b810 2f4a0: 0f 90 pop r0 2f4a2: 0f 90 pop r0 2f4a4: 0f 90 pop r0 2f4a6: 0f 90 pop r0 2f4a8: 0f 90 pop r0 2f4aa: 0f 90 pop r0 2f4ac: 1c a2 std Y+36, r1 ; 0x24 2f4ae: 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); 2f4b0: 21 e0 ldi r18, 0x01 ; 1 2f4b2: a5 01 movw r20, r10 2f4b4: b6 01 movw r22, r12 2f4b6: ce 01 movw r24, r28 2f4b8: 84 96 adiw r24, 0x24 ; 36 2f4ba: 0f 94 f3 d6 call 0x3ade6 ; 0x3ade6 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); 2f4be: 83 e2 ldi r24, 0x23 ; 35 2f4c0: fe 01 movw r30, r28 2f4c2: b4 96 adiw r30, 0x24 ; 36 2f4c4: de 01 movw r26, r28 2f4c6: 11 96 adiw r26, 0x01 ; 1 2f4c8: 01 90 ld r0, Z+ 2f4ca: 0d 92 st X+, r0 2f4cc: 8a 95 dec r24 2f4ce: e1 f7 brne .-8 ; 0x2f4c8 2f4d0: 10 fb bst r17, 0 2f4d2: 50 f8 bld r5, 0 2f4d4: 05 2d mov r16, r5 2f4d6: 20 e0 ldi r18, 0x00 ; 0 2f4d8: 50 e0 ldi r21, 0x00 ; 0 2f4da: 40 e0 ldi r20, 0x00 ; 0 2f4dc: be 01 movw r22, r28 2f4de: 6f 5f subi r22, 0xFF ; 255 2f4e0: 7f 4f sbci r23, 0xFF ; 255 2f4e2: c7 01 movw r24, r14 2f4e4: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 2f4e8: ce 01 movw r24, r28 2f4ea: 01 96 adiw r24, 0x01 ; 1 2f4ec: 0e 94 cd 78 call 0xf19a ; 0xf19a // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f4f0: 11 23 and r17, r17 2f4f2: 21 f0 breq .+8 ; 0x2f4fc puts_P(PSTR("DIR_EXIT")); 2f4f4: 83 e7 ldi r24, 0x73 ; 115 2f4f6: 99 ea ldi r25, 0xA9 ; 169 2f4f8: 0f 94 2f dc call 0x3b85e ; 0x3b85e 2f4fc: ce 01 movw r24, r28 2f4fe: 84 96 adiw r24, 0x24 ; 36 2f500: 0e 94 cd 78 call 0xf19a ; 0xf19a 2f504: e7 96 adiw r28, 0x37 ; 55 2f506: ee ad ldd r30, Y+62 ; 0x3e 2f508: ff ad ldd r31, Y+63 ; 0x3f 2f50a: e7 97 sbiw r28, 0x37 ; 55 2f50c: 0f b6 in r0, 0x3f ; 63 2f50e: f8 94 cli 2f510: fe bf out 0x3e, r31 ; 62 2f512: 0f be out 0x3f, r0 ; 63 2f514: 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()) { 2f516: f6 01 movw r30, r12 2f518: 80 85 ldd r24, Z+8 ; 0x08 2f51a: 91 85 ldd r25, Z+9 ; 0x09 2f51c: a2 85 ldd r26, Z+10 ; 0x0a 2f51e: b3 85 ldd r27, Z+11 ; 0x0b 2f520: 80 93 7e 14 sts 0x147E, r24 ; 0x80147e 2f524: 90 93 7f 14 sts 0x147F, r25 ; 0x80147f 2f528: a0 93 80 14 sts 0x1480, r26 ; 0x801480 2f52c: b0 93 81 14 sts 0x1481, r27 ; 0x801481 2f530: 8c ce rjmp .-744 ; 0x2f24a // 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; 2f532: e1 e0 ldi r30, 0x01 ; 1 2f534: f0 e0 ldi r31, 0x00 ; 0 2f536: 7d cf rjmp .-262 ; 0x2f432 // 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); 2f538: 82 e8 ldi r24, 0x82 ; 130 2f53a: 94 e1 ldi r25, 0x14 ; 20 2f53c: a7 cf rjmp .-178 ; 0x2f48c else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f53e: 80 91 83 17 lds r24, 0x1783 ; 0x801783 2f542: 90 91 84 17 lds r25, 0x1784 ; 0x801784 2f546: 01 96 adiw r24, 0x01 ; 1 2f548: 90 93 84 17 sts 0x1784, r25 ; 0x801784 2f54c: 80 93 83 17 sts 0x1783, r24 ; 0x801783 2f550: e2 cf rjmp .-60 ; 0x2f516 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f552: 8d e6 ldi r24, 0x6D ; 109 2f554: 94 e1 ldi r25, 0x14 ; 20 2f556: 45 cf rjmp .-374 ; 0x2f3e2 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f558: be 01 movw r22, r28 2f55a: 69 5b subi r22, 0xB9 ; 185 2f55c: 7f 4f sbci r23, 0xFF ; 255 2f55e: 8d e6 ldi r24, 0x6D ; 109 2f560: 94 e1 ldi r25, 0x14 ; 20 2f562: 0e 94 b2 78 call 0xf164 ; 0xf164 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f566: a1 96 adiw r28, 0x21 ; 33 2f568: 2e ad ldd r18, Y+62 ; 0x3e 2f56a: 3f ad ldd r19, Y+63 ; 0x3f 2f56c: a1 97 sbiw r28, 0x21 ; 33 2f56e: 30 93 7d 14 sts 0x147D, r19 ; 0x80147d 2f572: 20 93 7c 14 sts 0x147C, r18 ; 0x80147c crmodTime = p.lastWriteTime; 2f576: 6f 96 adiw r28, 0x1f ; 31 2f578: 4e ad ldd r20, Y+62 ; 0x3e 2f57a: 5f ad ldd r21, Y+63 ; 0x3f 2f57c: 6f 97 sbiw r28, 0x1f ; 31 2f57e: 50 93 7b 14 sts 0x147B, r21 ; 0x80147b 2f582: 40 93 7a 14 sts 0x147A, r20 ; 0x80147a // There are scenarios when simple modification time is not enough (on MS Windows) // For example - extract an old g-code from an archive onto the SD card. // In such case the creation time is current time (which is correct), but the modification time // stays the same - i.e. old. // Therefore let's pick the most recent timestamp from both creation and modification timestamps if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2f586: 69 96 adiw r28, 0x19 ; 25 2f588: 8e ad ldd r24, Y+62 ; 0x3e 2f58a: 9f ad ldd r25, Y+63 ; 0x3f 2f58c: 69 97 sbiw r28, 0x19 ; 25 2f58e: 28 17 cp r18, r24 2f590: 39 07 cpc r19, r25 2f592: 50 f0 brcs .+20 ; 0x2f5a8 2f594: 28 17 cp r18, r24 2f596: 39 07 cpc r19, r25 2f598: 99 f4 brne .+38 ; 0x2f5c0 2f59a: 67 96 adiw r28, 0x17 ; 23 2f59c: 2e ad ldd r18, Y+62 ; 0x3e 2f59e: 3f ad ldd r19, Y+63 ; 0x3f 2f5a0: 67 97 sbiw r28, 0x17 ; 23 2f5a2: 42 17 cp r20, r18 2f5a4: 53 07 cpc r21, r19 2f5a6: 60 f4 brcc .+24 ; 0x2f5c0 crmodDate = p.creationDate; 2f5a8: 90 93 7d 14 sts 0x147D, r25 ; 0x80147d 2f5ac: 80 93 7c 14 sts 0x147C, r24 ; 0x80147c crmodTime = p.creationTime; 2f5b0: 67 96 adiw r28, 0x17 ; 23 2f5b2: 8e ad ldd r24, Y+62 ; 0x3e 2f5b4: 9f ad ldd r25, Y+63 ; 0x3f 2f5b6: 67 97 sbiw r28, 0x17 ; 23 2f5b8: 90 93 7b 14 sts 0x147B, r25 ; 0x80147b 2f5bc: 80 93 7a 14 sts 0x147A, r24 ; 0x80147a } //writeDate = p.lastAccessDate; if (match != NULL) { 2f5c0: 61 14 cp r6, r1 2f5c2: 71 04 cpc r7, r1 2f5c4: 59 f1 breq .+86 ; 0x2f61c if (strcasecmp(match, filename) == 0) return; 2f5c6: 6d e6 ldi r22, 0x6D ; 109 2f5c8: 74 e1 ldi r23, 0x14 ; 20 2f5ca: c3 01 movw r24, r6 2f5cc: 0f 94 7f e3 call 0x3c6fe ; 0x3c6fe 2f5d0: 89 2b or r24, r25 2f5d2: 59 f5 brne .+86 ; 0x2f62a // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f5d4: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 2f5d8: 81 50 subi r24, 0x01 ; 1 2f5da: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 cnt++; break; } } } // while readDir } 2f5de: 0f b6 in r0, 0x3f ; 63 2f5e0: f8 94 cli 2f5e2: 3e be out 0x3e, r3 ; 62 2f5e4: 0f be out 0x3f, r0 ; 63 2f5e6: 2d be out 0x3d, r2 ; 61 2f5e8: ca 58 subi r28, 0x8A ; 138 2f5ea: df 4f sbci r29, 0xFF ; 255 2f5ec: 0f b6 in r0, 0x3f ; 63 2f5ee: f8 94 cli 2f5f0: de bf out 0x3e, r29 ; 62 2f5f2: 0f be out 0x3f, r0 ; 63 2f5f4: cd bf out 0x3d, r28 ; 61 2f5f6: df 91 pop r29 2f5f8: cf 91 pop r28 2f5fa: 1f 91 pop r17 2f5fc: 0f 91 pop r16 2f5fe: ff 90 pop r15 2f600: ef 90 pop r14 2f602: df 90 pop r13 2f604: cf 90 pop r12 2f606: bf 90 pop r11 2f608: af 90 pop r10 2f60a: 9f 90 pop r9 2f60c: 8f 90 pop r8 2f60e: 7f 90 pop r7 2f610: 6f 90 pop r6 2f612: 5f 90 pop r5 2f614: 4f 90 pop r4 2f616: 3f 90 pop r3 2f618: 2f 90 pop r2 2f61a: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f61c: 80 91 83 17 lds r24, 0x1783 ; 0x801783 2f620: 90 91 84 17 lds r25, 0x1784 ; 0x801784 2f624: 48 16 cp r4, r24 2f626: 19 06 cpc r1, r25 2f628: a9 f2 breq .-86 ; 0x2f5d4 cnt++; 2f62a: 43 94 inc r4 2f62c: 74 cf rjmp .-280 ; 0x2f516 0002f62e : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f62e: cf 92 push r12 2f630: df 92 push r13 2f632: ef 92 push r14 2f634: ff 92 push r15 2f636: 0f 93 push r16 2f638: cf 93 push r28 2f63a: df 93 push r29 2f63c: cd b7 in r28, 0x3d ; 61 2f63e: de b7 in r29, 0x3e ; 62 2f640: a3 97 sbiw r28, 0x23 ; 35 2f642: 0f b6 in r0, 0x3f ; 63 2f644: f8 94 cli 2f646: de bf out 0x3e, r29 ; 62 2f648: 0f be out 0x3f, r0 ; 63 2f64a: cd bf out 0x3d, r28 ; 61 2f64c: 6c 01 movw r12, r24 { curDir=&workDir; 2f64e: 84 e1 ldi r24, 0x14 ; 20 2f650: e8 2e mov r14, r24 2f652: 85 e1 ldi r24, 0x15 ; 21 2f654: f8 2e mov r15, r24 2f656: 86 e1 ldi r24, 0x16 ; 22 2f658: 95 e1 ldi r25, 0x15 ; 21 2f65a: d7 01 movw r26, r14 2f65c: 8d 93 st X+, r24 2f65e: 9c 93 st X, r25 nrFiles=nr; 2f660: 10 92 84 17 sts 0x1784, r1 ; 0x801784 2f664: 10 92 83 17 sts 0x1783, r1 ; 0x801783 curDir->rewind(); 2f668: 0e 94 c8 78 call 0xf190 ; 0xf190 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f66c: 00 e0 ldi r16, 0x00 ; 0 2f66e: 0e 7f andi r16, 0xFE ; 254 2f670: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f672: d7 01 movw r26, r14 2f674: ed 91 ld r30, X+ 2f676: fc 91 ld r31, X 2f678: 83 e2 ldi r24, 0x23 ; 35 2f67a: de 01 movw r26, r28 2f67c: 11 96 adiw r26, 0x01 ; 1 2f67e: 01 90 ld r0, Z+ 2f680: 0d 92 st X+, r0 2f682: 8a 95 dec r24 2f684: e1 f7 brne .-8 ; 0x2f67e 2f686: 22 e0 ldi r18, 0x02 ; 2 2f688: a6 01 movw r20, r12 2f68a: be 01 movw r22, r28 2f68c: 6f 5f subi r22, 0xFF ; 255 2f68e: 7f 4f sbci r23, 0xFF ; 255 2f690: 81 ef ldi r24, 0xF1 ; 241 2f692: 92 e0 ldi r25, 0x02 ; 2 2f694: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 2f698: ce 01 movw r24, r28 2f69a: 01 96 adiw r24, 0x01 ; 1 2f69c: 0e 94 cd 78 call 0xf19a ; 0xf19a } 2f6a0: a3 96 adiw r28, 0x23 ; 35 2f6a2: 0f b6 in r0, 0x3f ; 63 2f6a4: f8 94 cli 2f6a6: de bf out 0x3e, r29 ; 62 2f6a8: 0f be out 0x3f, r0 ; 63 2f6aa: cd bf out 0x3d, r28 ; 61 2f6ac: df 91 pop r29 2f6ae: cf 91 pop r28 2f6b0: 0f 91 pop r16 2f6b2: ff 90 pop r15 2f6b4: ef 90 pop r14 2f6b6: df 90 pop r13 2f6b8: cf 90 pop r12 2f6ba: 08 95 ret 0002f6bc : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f6bc: ef 92 push r14 2f6be: ff 92 push r15 2f6c0: 0f 93 push r16 2f6c2: cf 93 push r28 2f6c4: df 93 push r29 2f6c6: cd b7 in r28, 0x3d ; 61 2f6c8: de b7 in r29, 0x3e ; 62 2f6ca: a3 97 sbiw r28, 0x23 ; 35 2f6cc: 0f b6 in r0, 0x3f ; 63 2f6ce: f8 94 cli 2f6d0: de bf out 0x3e, r29 ; 62 2f6d2: 0f be out 0x3f, r0 ; 63 2f6d4: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f6d6: 24 e1 ldi r18, 0x14 ; 20 2f6d8: e2 2e mov r14, r18 2f6da: 25 e1 ldi r18, 0x15 ; 21 2f6dc: f2 2e mov r15, r18 2f6de: 26 e1 ldi r18, 0x16 ; 22 2f6e0: 35 e1 ldi r19, 0x15 ; 21 2f6e2: d7 01 movw r26, r14 2f6e4: 2d 93 st X+, r18 2f6e6: 3c 93 st X, r19 nrFiles = 0; 2f6e8: 10 92 84 17 sts 0x1784, r1 ; 0x801784 2f6ec: 10 92 83 17 sts 0x1783, r1 ; 0x801783 curDir->seekSet((uint32_t)entry << 5); 2f6f0: b0 e0 ldi r27, 0x00 ; 0 2f6f2: a0 e0 ldi r26, 0x00 ; 0 2f6f4: ac 01 movw r20, r24 2f6f6: bd 01 movw r22, r26 2f6f8: e5 e0 ldi r30, 0x05 ; 5 2f6fa: 44 0f add r20, r20 2f6fc: 55 1f adc r21, r21 2f6fe: 66 1f adc r22, r22 2f700: 77 1f adc r23, r23 2f702: ea 95 dec r30 2f704: d1 f7 brne .-12 ; 0x2f6fa 2f706: c9 01 movw r24, r18 2f708: 0f 94 66 6e call 0x2dccc ; 0x2dccc 2f70c: 00 e0 ldi r16, 0x00 ; 0 2f70e: 0e 7f andi r16, 0xFE ; 254 2f710: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f712: d7 01 movw r26, r14 2f714: ed 91 ld r30, X+ 2f716: fc 91 ld r31, X 2f718: 83 e2 ldi r24, 0x23 ; 35 2f71a: de 01 movw r26, r28 2f71c: 11 96 adiw r26, 0x01 ; 1 2f71e: 01 90 ld r0, Z+ 2f720: 0d 92 st X+, r0 2f722: 8a 95 dec r24 2f724: e1 f7 brne .-8 ; 0x2f71e 2f726: 22 e0 ldi r18, 0x02 ; 2 2f728: 50 e0 ldi r21, 0x00 ; 0 2f72a: 40 e0 ldi r20, 0x00 ; 0 2f72c: be 01 movw r22, r28 2f72e: 6f 5f subi r22, 0xFF ; 255 2f730: 7f 4f sbci r23, 0xFF ; 255 2f732: 81 ef ldi r24, 0xF1 ; 241 2f734: 92 e0 ldi r25, 0x02 ; 2 2f736: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 2f73a: ce 01 movw r24, r28 2f73c: 01 96 adiw r24, 0x01 ; 1 2f73e: 0e 94 cd 78 call 0xf19a ; 0xf19a } 2f742: a3 96 adiw r28, 0x23 ; 35 2f744: 0f b6 in r0, 0x3f ; 63 2f746: f8 94 cli 2f748: de bf out 0x3e, r29 ; 62 2f74a: 0f be out 0x3f, r0 ; 63 2f74c: cd bf out 0x3d, r28 ; 61 2f74e: df 91 pop r29 2f750: cf 91 pop r28 2f752: 0f 91 pop r16 2f754: ff 90 pop r15 2f756: ef 90 pop r14 2f758: 08 95 ret 0002f75a : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f75a: cf 92 push r12 2f75c: df 92 push r13 2f75e: ef 92 push r14 2f760: ff 92 push r15 2f762: 0f 93 push r16 2f764: cf 93 push r28 2f766: df 93 push r29 2f768: cd b7 in r28, 0x3d ; 61 2f76a: de b7 in r29, 0x3e ; 62 2f76c: a3 97 sbiw r28, 0x23 ; 35 2f76e: 0f b6 in r0, 0x3f ; 63 2f770: f8 94 cli 2f772: de bf out 0x3e, r29 ; 62 2f774: 0f be out 0x3f, r0 ; 63 2f776: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f778: 84 e1 ldi r24, 0x14 ; 20 2f77a: c8 2e mov r12, r24 2f77c: 85 e1 ldi r24, 0x15 ; 21 2f77e: d8 2e mov r13, r24 2f780: 86 e1 ldi r24, 0x16 ; 22 2f782: 95 e1 ldi r25, 0x15 ; 21 2f784: d6 01 movw r26, r12 2f786: 8d 93 st X+, r24 2f788: 9c 93 st X, r25 nrFiles=0; 2f78a: 23 e8 ldi r18, 0x83 ; 131 2f78c: e2 2e mov r14, r18 2f78e: 27 e1 ldi r18, 0x17 ; 23 2f790: f2 2e mov r15, r18 2f792: f7 01 movw r30, r14 2f794: 11 82 std Z+1, r1 ; 0x01 2f796: 10 82 st Z, r1 curDir->rewind(); 2f798: 0e 94 c8 78 call 0xf190 ; 0xf190 2f79c: 00 e0 ldi r16, 0x00 ; 0 2f79e: 0e 7f andi r16, 0xFE ; 254 2f7a0: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f7a2: d6 01 movw r26, r12 2f7a4: ed 91 ld r30, X+ 2f7a6: fc 91 ld r31, X 2f7a8: 83 e2 ldi r24, 0x23 ; 35 2f7aa: de 01 movw r26, r28 2f7ac: 11 96 adiw r26, 0x01 ; 1 2f7ae: 01 90 ld r0, Z+ 2f7b0: 0d 92 st X+, r0 2f7b2: 8a 95 dec r24 2f7b4: e1 f7 brne .-8 ; 0x2f7ae 2f7b6: 21 e0 ldi r18, 0x01 ; 1 2f7b8: 50 e0 ldi r21, 0x00 ; 0 2f7ba: 40 e0 ldi r20, 0x00 ; 0 2f7bc: be 01 movw r22, r28 2f7be: 6f 5f subi r22, 0xFF ; 255 2f7c0: 7f 4f sbci r23, 0xFF ; 255 2f7c2: 81 ef ldi r24, 0xF1 ; 241 2f7c4: 92 e0 ldi r25, 0x02 ; 2 2f7c6: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 2f7ca: ce 01 movw r24, r28 2f7cc: 01 96 adiw r24, 0x01 ; 1 2f7ce: 0e 94 cd 78 call 0xf19a ; 0xf19a //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f7d2: f7 01 movw r30, r14 2f7d4: 80 81 ld r24, Z 2f7d6: 91 81 ldd r25, Z+1 ; 0x01 2f7d8: a3 96 adiw r28, 0x23 ; 35 2f7da: 0f b6 in r0, 0x3f ; 63 2f7dc: f8 94 cli 2f7de: de bf out 0x3e, r29 ; 62 2f7e0: 0f be out 0x3f, r0 ; 63 2f7e2: cd bf out 0x3d, r28 ; 61 2f7e4: df 91 pop r29 2f7e6: cf 91 pop r28 2f7e8: 0f 91 pop r16 2f7ea: ff 90 pop r15 2f7ec: ef 90 pop r14 2f7ee: df 90 pop r13 2f7f0: cf 90 pop r12 2f7f2: 08 95 ret 0002f7f4 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f7f4: cf 93 push r28 2f7f6: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f7f8: 8f e2 ldi r24, 0x2F ; 47 2f7fa: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f7fe: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f800: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f802: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2f806: c8 17 cp r28, r24 2f808: 60 f4 brcc .+24 ; 0x2f822 { SERIAL_PROTOCOL(dir_names[i]); 2f80a: cd 9f mul r28, r29 2f80c: c0 01 movw r24, r0 2f80e: 11 24 eor r1, r1 2f810: 85 54 subi r24, 0x45 ; 69 2f812: 9b 4e sbci r25, 0xEB ; 235 2f814: 0e 94 50 89 call 0x112a0 ; 0x112a0 2f818: 8f e2 ldi r24, 0x2F ; 47 2f81a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f81e: cf 5f subi r28, 0xFF ; 255 2f820: f0 cf rjmp .-32 ; 0x2f802 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f822: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f826: 81 11 cpse r24, r1 2f828: 06 c0 rjmp .+12 ; 0x2f836 2f82a: 8d e6 ldi r24, 0x6D ; 109 2f82c: 94 e1 ldi r25, 0x14 ; 20 } 2f82e: df 91 pop r29 2f830: cf 91 pop r28 2f832: 0c 94 50 89 jmp 0x112a0 ; 0x112a0 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f836: 82 e8 ldi r24, 0x82 ; 130 2f838: 94 e1 ldi r25, 0x14 ; 20 2f83a: f9 cf rjmp .-14 ; 0x2f82e 0002f83c : 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) { 2f83c: cf 92 push r12 2f83e: df 92 push r13 2f840: ef 92 push r14 2f842: ff 92 push r15 2f844: 6b 01 movw r12, r22 2f846: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f848: 88 ea ldi r24, 0xA8 ; 168 2f84a: 9c e0 ldi r25, 0x0C ; 12 2f84c: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 2f850: ab 01 movw r20, r22 2f852: bc 01 movw r22, r24 2f854: 4c 0d add r20, r12 2f856: 5d 1d adc r21, r13 2f858: 6e 1d adc r22, r14 2f85a: 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); 2f85c: 88 ea ldi r24, 0xA8 ; 168 2f85e: 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); } 2f860: ff 90 pop r15 2f862: ef 90 pop r14 2f864: df 90 pop r13 2f866: 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); 2f868: 0d 94 9c dd jmp 0x3bb38 ; 0x3bb38 0002f86c : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f86c: cf 93 push r28 2f86e: df 93 push r29 2f870: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f872: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c if (val == EEPROM_EMPTY_VALUE32) { 2f876: 6f 3f cpi r22, 0xFF ; 255 2f878: 2f ef ldi r18, 0xFF ; 255 2f87a: 72 07 cpc r23, r18 2f87c: 82 07 cpc r24, r18 2f87e: 92 07 cpc r25, r18 2f880: 49 f4 brne .+18 ; 0x2f894 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); 2f882: 40 e0 ldi r20, 0x00 ; 0 2f884: 50 e0 ldi r21, 0x00 ; 0 2f886: ba 01 movw r22, r20 2f888: ce 01 movw r24, r28 2f88a: 0f 94 9c dd call 0x3bb38 ; 0x3bb38 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; 2f88e: 60 e0 ldi r22, 0x00 ; 0 2f890: 70 e0 ldi r23, 0x00 ; 0 2f892: cb 01 movw r24, r22 } return val; } 2f894: df 91 pop r29 2f896: cf 91 pop r28 2f898: 08 95 ret 0002f89a : } // 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; 2f89a: e3 e0 ldi r30, 0x03 ; 3 2f89c: f7 e1 ldi r31, 0x17 ; 23 2f89e: 40 81 ld r20, Z 2f8a0: 51 81 ldd r21, Z+1 ; 0x01 2f8a2: 62 81 ldd r22, Z+2 ; 0x02 2f8a4: 73 81 ldd r23, Z+3 ; 0x03 2f8a6: 48 0f add r20, r24 2f8a8: 59 1f adc r21, r25 2f8aa: 61 1d adc r22, r1 2f8ac: 71 1d adc r23, r1 2f8ae: 40 83 st Z, r20 2f8b0: 51 83 std Z+1, r21 ; 0x01 2f8b2: 62 83 std Z+2, r22 ; 0x02 2f8b4: 73 83 std Z+3, r23 ; 0x03 } 2f8b6: 08 95 ret 0002f8b8 : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f8b8: 0f 93 push r16 2f8ba: 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_ ){ 2f8bc: 60 91 18 17 lds r22, 0x1718 ; 0x801718 2f8c0: 70 91 19 17 lds r23, 0x1719 ; 0x801719 2f8c4: 80 91 1a 17 lds r24, 0x171A ; 0x80171a 2f8c8: 90 91 1b 17 lds r25, 0x171B ; 0x80171b 2f8cc: 00 91 6c 0e lds r16, 0x0E6C ; 0x800e6c 2f8d0: 10 91 6d 0e lds r17, 0x0E6D ; 0x800e6d 2f8d4: 20 91 6e 0e lds r18, 0x0E6E ; 0x800e6e 2f8d8: 30 91 6f 0e lds r19, 0x0E6F ; 0x800e6f 2f8dc: 60 17 cp r22, r16 2f8de: 71 07 cpc r23, r17 2f8e0: 82 07 cpc r24, r18 2f8e2: 93 07 cpc r25, r19 2f8e4: 39 f1 breq .+78 ; 0x2f934 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f8e6: 40 e0 ldi r20, 0x00 ; 0 2f8e8: 0f 94 94 6b call 0x2d728 ; 0x2d728 2f8ec: 88 23 and r24, r24 2f8ee: f9 f0 breq .+62 ; 0x2f92e return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f8f0: 20 91 1c 17 lds r18, 0x171C ; 0x80171c 2f8f4: 30 91 1d 17 lds r19, 0x171D ; 0x80171d 2f8f8: 40 91 0c 17 lds r20, 0x170C ; 0x80170c 2f8fc: 50 91 0d 17 lds r21, 0x170D ; 0x80170d 2f900: 60 91 0e 17 lds r22, 0x170E ; 0x80170e 2f904: 70 91 0f 17 lds r23, 0x170F ; 0x80170f 2f908: 42 1b sub r20, r18 2f90a: 53 0b sbc r21, r19 2f90c: 61 09 sbc r22, r1 2f90e: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f910: 41 30 cpi r20, 0x01 ; 1 2f912: 92 e0 ldi r25, 0x02 ; 2 2f914: 59 07 cpc r21, r25 2f916: 61 05 cpc r22, r1 2f918: 71 05 cpc r23, r1 2f91a: 20 f0 brcs .+8 ; 0x2f924 2f91c: 40 e0 ldi r20, 0x00 ; 0 2f91e: 52 e0 ldi r21, 0x02 ; 2 2f920: 60 e0 ldi r22, 0x00 ; 0 2f922: 70 e0 ldi r23, 0x00 ; 0 2f924: 48 58 subi r20, 0x88 ; 136 2f926: 51 4f sbci r21, 0xF1 ; 241 2f928: 9a e0 ldi r25, 0x0A ; 10 2f92a: fa 01 movw r30, r20 2f92c: 90 83 st Z, r25 } return true; } 2f92e: 1f 91 pop r17 2f930: 0f 91 pop r16 2f932: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f934: 81 e0 ldi r24, 0x01 ; 1 2f936: fb cf rjmp .-10 ; 0x2f92e 0002f938 : voltReady = true; } uint16_t IR_sensor_analog::getVoltRaw() { uint16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = voltRaw; } 2f938: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f93a: f8 94 cli 2f93c: 80 91 90 17 lds r24, 0x1790 ; 0x801790 2f940: 90 91 91 17 lds r25, 0x1791 ; 0x801791 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f944: 2f bf out 0x3f, r18 ; 63 return ret; } 2f946: 08 95 ret 0002f948 : const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { 2f948: 80 91 8e 17 lds r24, 0x178E ; 0x80178e 2f94c: 88 23 and r24, r24 2f94e: 29 f0 breq .+10 ; 0x2f95a 2f950: 81 30 cpi r24, 0x01 ; 1 2f952: 39 f0 breq .+14 ; 0x2f962 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); 2f954: 8c e4 ldi r24, 0x4C ; 76 2f956: 9d e5 ldi r25, 0x5D ; 93 2f958: 02 c0 rjmp .+4 ; 0x2f95e } const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { case SensorRevision::_Old: return _T(MSG_IR_03_OR_OLDER); 2f95a: 8c e6 ldi r24, 0x6C ; 108 2f95c: 9d e5 ldi r25, 0x5D ; 93 case SensorRevision::_Rev04: return _T(MSG_IR_04_OR_NEWER); default: return _T(MSG_IR_UNKNOWN); 2f95e: 0c 94 72 73 jmp 0xe6e4 ; 0xe6e4 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); 2f962: 8c e5 ldi r24, 0x5C ; 92 2f964: 9d e5 ldi r25, 0x5D ; 93 2f966: fb cf rjmp .-10 ; 0x2f95e 0002f968 : void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } } void IR_sensor_analog::IR_ANALOG_Check(SensorRevision isVersion, SensorRevision switchTo) { 2f968: cf 93 push r28 bool bTemp = (!CHECK_ALL_HEATERS); 2f96a: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 2f96e: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 2f972: 23 2b or r18, r19 2f974: b9 f4 brne .+46 ; 0x2f9a4 2f976: 20 91 68 0e lds r18, 0x0E68 ; 0x800e68 2f97a: 30 91 69 0e lds r19, 0x0E69 ; 0x800e69 2f97e: 23 2b or r18, r19 2f980: 89 f4 brne .+34 ; 0x2f9a4 bTemp = bTemp && (menu_menu == lcd_status_screen); 2f982: 20 91 66 0e lds r18, 0x0E66 ; 0x800e66 2f986: 30 91 67 0e lds r19, 0x0E67 ; 0x800e67 2f98a: 2c 58 subi r18, 0x8C ; 140 2f98c: 39 43 sbci r19, 0x39 ; 57 2f98e: 51 f4 brne .+20 ; 0x2f9a4 bTemp = bTemp && ((sensorRevision == isVersion) || (sensorRevision == SensorRevision::_Undef)); 2f990: 90 91 8e 17 lds r25, 0x178E ; 0x80178e 2f994: 98 17 cp r25, r24 2f996: 11 f0 breq .+4 ; 0x2f99c 2f998: 9f 3f cpi r25, 0xFF ; 255 2f99a: 21 f4 brne .+8 ; 0x2f9a4 bTemp = bTemp && (state == State::ready); 2f99c: 80 91 85 17 lds r24, 0x1785 ; 0x801785 2f9a0: 82 30 cpi r24, 0x02 ; 2 2f9a2: 31 f0 breq .+12 ; 0x2f9b0 default: break; } } } else { nFSCheckCount = 0; 2f9a4: 10 92 97 17 sts 0x1797, r1 ; 0x801797 2f9a8: 10 92 96 17 sts 0x1796, r1 ; 0x801796 } } 2f9ac: cf 91 pop r28 2f9ae: 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++; 2f9b0: 80 91 96 17 lds r24, 0x1796 ; 0x801796 2f9b4: 90 91 97 17 lds r25, 0x1797 ; 0x801797 2f9b8: 01 96 adiw r24, 0x01 ; 1 if (nFSCheckCount > FS_CHECK_COUNT) { 2f9ba: 85 30 cpi r24, 0x05 ; 5 2f9bc: 91 05 cpc r25, r1 2f9be: 28 f4 brcc .+10 ; 0x2f9ca 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++; 2f9c0: 90 93 97 17 sts 0x1797, r25 ; 0x801797 2f9c4: 80 93 96 17 sts 0x1796, r24 ; 0x801796 2f9c8: f1 cf rjmp .-30 ; 0x2f9ac 2f9ca: c6 2f mov r28, r22 if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary 2f9cc: 10 92 97 17 sts 0x1797, r1 ; 0x801797 2f9d0: 10 92 96 17 sts 0x1796, r1 ; 0x801796 return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 2f9d4: 60 93 8e 17 sts 0x178E, r22 ; 0x80178e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2f9d8: 88 e4 ldi r24, 0x48 ; 72 2f9da: 9d e0 ldi r25, 0x0D ; 13 2f9dc: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 if (bTemp) { nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); 2f9e0: 0f 94 37 15 call 0x22a6e ; 0x22a6e switch (switchTo) { case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); 2f9e4: 8c e6 ldi r24, 0x6C ; 108 2f9e6: 9d e5 ldi r25, 0x5D ; 93 nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); switch (switchTo) { 2f9e8: c1 30 cpi r28, 0x01 ; 1 2f9ea: 11 f4 brne .+4 ; 0x2f9f0 case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); break; case SensorRevision::_Rev04: lcd_setstatuspgm(_T(MSG_IR_04_OR_NEWER)); 2f9ec: 8c e5 ldi r24, 0x5C ; 92 2f9ee: 9d e5 ldi r25, 0x5D ; 93 2f9f0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 } } } else { nFSCheckCount = 0; } } 2f9f4: 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)); 2f9f6: 0d 94 be 0b jmp 0x2177c ; 0x2177c 0002f9fa : * 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() { 2f9fa: 2f 92 push r2 2f9fc: 3f 92 push r3 2f9fe: 4f 92 push r4 2fa00: 5f 92 push r5 2fa02: 6f 92 push r6 2fa04: 7f 92 push r7 2fa06: 8f 92 push r8 2fa08: 9f 92 push r9 2fa0a: af 92 push r10 2fa0c: bf 92 push r11 2fa0e: cf 92 push r12 2fa10: df 92 push r13 2fa12: ef 92 push r14 2fa14: ff 92 push r15 2fa16: 0f 93 push r16 2fa18: 1f 93 push r17 2fa1a: cf 93 push r28 2fa1c: df 93 push r29 2fa1e: cd b7 in r28, 0x3d ; 61 2fa20: de b7 in r29, 0x3e ; 62 2fa22: ed 97 sbiw r28, 0x3d ; 61 2fa24: 0f b6 in r0, 0x3f ; 63 2fa26: f8 94 cli 2fa28: de bf out 0x3e, r29 ; 62 2fa2a: 0f be out 0x3f, r0 ; 63 2fa2c: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2fa2e: 10 92 0d 16 sts 0x160D, r1 ; 0x80160d 2fa32: 10 92 0c 16 sts 0x160C, r1 ; 0x80160c lastSortedFilePosition = 0; 2fa36: 10 92 d7 16 sts 0x16D7, r1 ; 0x8016d7 2fa3a: 10 92 d6 16 sts 0x16D6, r1 ; 0x8016d6 */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2fa3e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fa42: 80 fd sbrc r24, 0 2fa44: ef c0 rjmp .+478 ; 0x2fc24 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2fa46: 89 e0 ldi r24, 0x09 ; 9 2fa48: 9f e0 ldi r25, 0x0F ; 15 2fa4a: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 2fa4e: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2fa50: 82 e0 ldi r24, 0x02 ; 2 2fa52: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2fa56: 0f 94 ad 7b call 0x2f75a ; 0x2f75a 2fa5a: 6c 01 movw r12, r24 if (fileCnt > 0) { 2fa5c: 00 97 sbiw r24, 0x00 ; 0 2fa5e: 09 f4 brne .+2 ; 0x2fa62 2fa60: de c0 rjmp .+444 ; 0x2fc1e // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2fa62: 85 36 cpi r24, 0x65 ; 101 2fa64: 91 05 cpc r25, r1 2fa66: 60 f0 brcs .+24 ; 0x2fa80 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2fa68: 32 e0 ldi r19, 0x02 ; 2 2fa6a: 33 16 cp r3, r19 2fa6c: 31 f0 breq .+12 ; 0x2fa7a lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2fa6e: 89 ef ldi r24, 0xF9 ; 249 2fa70: 9c e5 ldi r25, 0x5C ; 92 2fa72: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2fa76: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 } fileCnt = SDSORT_LIMIT; 2fa7a: f4 e6 ldi r31, 0x64 ; 100 2fa7c: cf 2e mov r12, r31 2fa7e: d1 2c mov r13, r1 } sort_count = fileCnt; 2fa80: d0 92 0d 16 sts 0x160D, r13 ; 0x80160d 2fa84: c0 92 0c 16 sts 0x160C, r12 ; 0x80160c 2fa88: 6e e0 ldi r22, 0x0E ; 14 2fa8a: 66 2e mov r6, r22 2fa8c: 66 e1 ldi r22, 0x16 ; 22 2fa8e: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fa90: f1 2c mov r15, r1 2fa92: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fa94: 76 e1 ldi r23, 0x16 ; 22 2fa96: a7 2e mov r10, r23 2fa98: 75 e1 ldi r23, 0x15 ; 21 2fa9a: b7 2e mov r11, r23 nrFiles = 1; 2fa9c: 88 24 eor r8, r8 2fa9e: 83 94 inc r8 2faa0: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2faa2: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2faa6: 80 fd sbrc r24, 0 2faa8: bd c0 rjmp .+378 ; 0x2fc24 manage_heater(); 2faaa: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 if (i == 0) 2faae: e1 14 cp r14, r1 2fab0: f1 04 cpc r15, r1 2fab2: 09 f0 breq .+2 ; 0x2fab6 2fab4: d0 c0 rjmp .+416 ; 0x2fc56 getfilename(0); 2fab6: 90 e0 ldi r25, 0x00 ; 0 2fab8: 80 e0 ldi r24, 0x00 ; 0 2faba: 0f 94 17 7b call 0x2f62e ; 0x2f62e else getfilename_next(position); sort_entries[i] = position >> 5; 2fabe: 80 91 7e 14 lds r24, 0x147E ; 0x80147e 2fac2: 90 91 7f 14 lds r25, 0x147F ; 0x80147f 2fac6: a0 91 80 14 lds r26, 0x1480 ; 0x801480 2faca: b0 91 81 14 lds r27, 0x1481 ; 0x801481 2face: 55 e0 ldi r21, 0x05 ; 5 2fad0: b6 95 lsr r27 2fad2: a7 95 ror r26 2fad4: 97 95 ror r25 2fad6: 87 95 ror r24 2fad8: 5a 95 dec r21 2fada: d1 f7 brne .-12 ; 0x2fad0 2fadc: f3 01 movw r30, r6 2fade: 81 93 st Z+, r24 2fae0: 91 93 st Z+, r25 2fae2: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fae4: ff ef ldi r31, 0xFF ; 255 2fae6: ef 1a sub r14, r31 2fae8: ff 0a sbc r15, r31 2faea: ce 14 cp r12, r14 2faec: df 04 cpc r13, r15 2faee: c9 f6 brne .-78 ; 0x2faa2 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2faf0: 21 e0 ldi r18, 0x01 ; 1 2faf2: e2 16 cp r14, r18 2faf4: f1 04 cpc r15, r1 2faf6: 09 f4 brne .+2 ; 0x2fafa 2faf8: 92 c0 rjmp .+292 ; 0x2fc1e 2fafa: 32 e0 ldi r19, 0x02 ; 2 2fafc: 33 16 cp r3, r19 2fafe: 09 f4 brne .+2 ; 0x2fb02 2fb00: 8e c0 rjmp .+284 ; 0x2fc1e #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2fb02: 90 93 d7 16 sts 0x16D7, r25 ; 0x8016d7 2fb06: 80 93 d6 16 sts 0x16D6, r24 ; 0x8016d6 #define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs < 0 ? dir1 : !dir1)) #define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1)) #endif uint16_t counter = 0; menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); 2fb0a: 89 ee ldi r24, 0xE9 ; 233 2fb0c: 9c e5 ldi r25, 0x5C ; 92 2fb0e: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 2fb12: ee 9c mul r14, r14 2fb14: 90 01 movw r18, r0 2fb16: ef 9c mul r14, r15 2fb18: 30 0d add r19, r0 2fb1a: 30 0d add r19, r0 2fb1c: 11 24 eor r1, r1 2fb1e: bc 01 movw r22, r24 2fb20: c9 01 movw r24, r18 2fb22: 96 95 lsr r25 2fb24: 87 95 ror r24 2fb26: 0f 94 27 cd call 0x39a4e ; 0x39a4e 2fb2a: 30 e1 ldi r19, 0x10 ; 16 2fb2c: a3 2e mov r10, r19 2fb2e: 36 e1 ldi r19, 0x16 ; 22 2fb30: 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; 2fb32: 91 2c mov r9, r1 2fb34: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2fb36: cc 24 eor r12, r12 2fb38: c3 94 inc r12 2fb3a: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2fb3c: c4 01 movw r24, r8 2fb3e: 0f 94 f8 cc call 0x399f0 ; 0x399f0 counter += i; 2fb42: 8c 0c add r8, r12 2fb44: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2fb46: f5 01 movw r30, r10 2fb48: 01 90 ld r0, Z+ 2fb4a: f0 81 ld r31, Z 2fb4c: e0 2d mov r30, r0 2fb4e: f9 af std Y+57, r31 ; 0x39 2fb50: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2fb52: cf 01 movw r24, r30 2fb54: 0f 94 5e 7b call 0x2f6bc ; 0x2f6bc strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2fb58: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2fb5c: 6d e6 ldi r22, 0x6D ; 109 2fb5e: 74 e1 ldi r23, 0x14 ; 20 2fb60: 88 23 and r24, r24 2fb62: 11 f0 breq .+4 ; 0x2fb68 2fb64: 62 e8 ldi r22, 0x82 ; 130 2fb66: 74 e1 ldi r23, 0x14 ; 20 2fb68: ce 01 movw r24, r28 2fb6a: 01 96 adiw r24, 0x01 ; 1 2fb6c: 0f 94 b1 e3 call 0x3c762 ; 0x3c762 crmod_date_bckp = crmodDate; 2fb70: 60 90 7c 14 lds r6, 0x147C ; 0x80147c 2fb74: 70 90 7d 14 lds r7, 0x147D ; 0x80147d crmod_time_bckp = crmodTime; 2fb78: 20 91 7a 14 lds r18, 0x147A ; 0x80147a 2fb7c: 30 91 7b 14 lds r19, 0x147B ; 0x80147b 2fb80: 3b af std Y+59, r19 ; 0x3b 2fb82: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2fb84: 20 90 b7 14 lds r2, 0x14B7 ; 0x8014b7 2fb88: bf aa std Y+55, r11 ; 0x37 2fb8a: ae aa std Y+54, r10 ; 0x36 2fb8c: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2fb8e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fb92: 80 fd sbrc r24, 0 2fb94: 47 c0 rjmp .+142 ; 0x2fc24 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2fb96: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 const uint16_t o2 = sort_entries[j - 1]; 2fb9a: c8 01 movw r24, r16 2fb9c: 01 97 sbiw r24, 0x01 ; 1 2fb9e: 9d af std Y+61, r25 ; 0x3d 2fba0: 8c af std Y+60, r24 ; 0x3c 2fba2: ee a9 ldd r30, Y+54 ; 0x36 2fba4: ff a9 ldd r31, Y+55 ; 0x37 2fba6: 52 90 ld r5, -Z 2fba8: 42 90 ld r4, -Z 2fbaa: ff ab std Y+55, r31 ; 0x37 2fbac: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2fbae: c2 01 movw r24, r4 2fbb0: 0f 94 5e 7b call 0x2f6bc ; 0x2f6bc char *name2 = LONGEST_FILENAME; // use the string in-place 2fbb4: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2fbb8: 6d e6 ldi r22, 0x6D ; 109 2fbba: 74 e1 ldi r23, 0x14 ; 20 2fbbc: 88 23 and r24, r24 2fbbe: 11 f0 breq .+4 ; 0x2fbc4 2fbc0: 62 e8 ldi r22, 0x82 ; 130 2fbc2: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2fbc4: 31 10 cpse r3, r1 2fbc6: 8a c0 rjmp .+276 ; 0x2fcdc 2fbc8: 80 91 b7 14 lds r24, 0x14B7 ; 0x8014b7 2fbcc: 28 12 cpse r2, r24 2fbce: 83 c0 rjmp .+262 ; 0x2fcd6 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fbd0: 80 91 7c 14 lds r24, 0x147C ; 0x80147c 2fbd4: 90 91 7d 14 lds r25, 0x147D ; 0x80147d 2fbd8: 68 16 cp r6, r24 2fbda: 79 06 cpc r7, r25 2fbdc: 09 f0 breq .+2 ; 0x2fbe0 2fbde: 6c c0 rjmp .+216 ; 0x2fcb8 2fbe0: 80 91 7a 14 lds r24, 0x147A ; 0x80147a 2fbe4: 90 91 7b 14 lds r25, 0x147B ; 0x80147b 2fbe8: 2a ad ldd r18, Y+58 ; 0x3a 2fbea: 3b ad ldd r19, Y+59 ; 0x3b 2fbec: 82 17 cp r24, r18 2fbee: 93 07 cpc r25, r19 2fbf0: 08 f0 brcs .+2 ; 0x2fbf4 2fbf2: 66 c0 rjmp .+204 ; 0x2fcc0 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2fbf4: 00 0f add r16, r16 2fbf6: 11 1f adc r17, r17 2fbf8: f8 01 movw r30, r16 2fbfa: e2 5f subi r30, 0xF2 ; 242 2fbfc: f9 4e sbci r31, 0xE9 ; 233 2fbfe: 28 ad ldd r18, Y+56 ; 0x38 2fc00: 39 ad ldd r19, Y+57 ; 0x39 2fc02: 31 83 std Z+1, r19 ; 0x01 2fc04: 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){ 2fc06: 3f ef ldi r19, 0xFF ; 255 2fc08: c3 1a sub r12, r19 2fc0a: d3 0a sbc r13, r19 2fc0c: 82 e0 ldi r24, 0x02 ; 2 2fc0e: a8 0e add r10, r24 2fc10: b1 1c adc r11, r1 2fc12: ec 14 cp r14, r12 2fc14: fd 04 cpc r15, r13 2fc16: 09 f0 breq .+2 ; 0x2fc1a 2fc18: 91 cf rjmp .-222 ; 0x2fb3c for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2fc1a: 0f 94 19 cd call 0x39a32 ; 0x39a32 } } KEEPALIVE_STATE(NOT_BUSY); 2fc1e: 81 e0 ldi r24, 0x01 ; 1 2fc20: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } 2fc24: ed 96 adiw r28, 0x3d ; 61 2fc26: 0f b6 in r0, 0x3f ; 63 2fc28: f8 94 cli 2fc2a: de bf out 0x3e, r29 ; 62 2fc2c: 0f be out 0x3f, r0 ; 63 2fc2e: cd bf out 0x3d, r28 ; 61 2fc30: df 91 pop r29 2fc32: cf 91 pop r28 2fc34: 1f 91 pop r17 2fc36: 0f 91 pop r16 2fc38: ff 90 pop r15 2fc3a: ef 90 pop r14 2fc3c: df 90 pop r13 2fc3e: cf 90 pop r12 2fc40: bf 90 pop r11 2fc42: af 90 pop r10 2fc44: 9f 90 pop r9 2fc46: 8f 90 pop r8 2fc48: 7f 90 pop r7 2fc4a: 6f 90 pop r6 2fc4c: 5f 90 pop r5 2fc4e: 4f 90 pop r4 2fc50: 3f 90 pop r3 2fc52: 2f 90 pop r2 2fc54: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2fc56: 40 91 7e 14 lds r20, 0x147E ; 0x80147e 2fc5a: 50 91 7f 14 lds r21, 0x147F ; 0x80147f 2fc5e: 60 91 80 14 lds r22, 0x1480 ; 0x801480 2fc62: 70 91 81 14 lds r23, 0x1481 ; 0x801481 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fc66: b0 92 15 15 sts 0x1515, r11 ; 0x801515 2fc6a: a0 92 14 15 sts 0x1514, r10 ; 0x801514 nrFiles = 1; 2fc6e: 90 92 84 17 sts 0x1784, r9 ; 0x801784 2fc72: 80 92 83 17 sts 0x1783, r8 ; 0x801783 curDir->seekSet(position); 2fc76: 86 e1 ldi r24, 0x16 ; 22 2fc78: 95 e1 ldi r25, 0x15 ; 21 2fc7a: 0f 94 66 6e call 0x2dccc ; 0x2dccc 2fc7e: 1e 7f andi r17, 0xFE ; 254 2fc80: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2fc82: e0 91 14 15 lds r30, 0x1514 ; 0x801514 2fc86: f0 91 15 15 lds r31, 0x1515 ; 0x801515 2fc8a: 83 e2 ldi r24, 0x23 ; 35 2fc8c: de 01 movw r26, r28 2fc8e: 11 96 adiw r26, 0x01 ; 1 2fc90: 01 90 ld r0, Z+ 2fc92: 0d 92 st X+, r0 2fc94: 8a 95 dec r24 2fc96: e1 f7 brne .-8 ; 0x2fc90 2fc98: 01 2f mov r16, r17 2fc9a: 22 e0 ldi r18, 0x02 ; 2 2fc9c: 50 e0 ldi r21, 0x00 ; 0 2fc9e: 40 e0 ldi r20, 0x00 ; 0 2fca0: be 01 movw r22, r28 2fca2: 6f 5f subi r22, 0xFF ; 255 2fca4: 7f 4f sbci r23, 0xFF ; 255 2fca6: 81 ef ldi r24, 0xF1 ; 241 2fca8: 92 e0 ldi r25, 0x02 ; 2 2fcaa: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 2fcae: ce 01 movw r24, r28 2fcb0: 01 96 adiw r24, 0x01 ; 1 2fcb2: 0e 94 cd 78 call 0xf19a ; 0xf19a 2fcb6: 03 cf rjmp .-506 ; 0x2fabe 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)) 2fcb8: 86 15 cp r24, r6 2fcba: 97 05 cpc r25, r7 2fcbc: 08 f4 brcc .+2 ; 0x2fcc0 2fcbe: 9a cf rjmp .-204 ; 0x2fbf4 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fcc0: ee a9 ldd r30, Y+54 ; 0x36 2fcc2: ff a9 ldd r31, Y+55 ; 0x37 2fcc4: 53 82 std Z+3, r5 ; 0x03 2fcc6: 42 82 std Z+2, r4 ; 0x02 2fcc8: 0c ad ldd r16, Y+60 ; 0x3c 2fcca: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2fccc: 01 15 cp r16, r1 2fcce: 11 05 cpc r17, r1 2fcd0: 09 f0 breq .+2 ; 0x2fcd4 2fcd2: 5d cf rjmp .-326 ; 0x2fb8e 2fcd4: 8f cf rjmp .-226 ; 0x2fbf4 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)) 2fcd6: 22 20 and r2, r2 2fcd8: 99 f3 breq .-26 ; 0x2fcc0 2fcda: 8c cf rjmp .-232 ; 0x2fbf4 2fcdc: 31 e0 ldi r19, 0x01 ; 1 2fcde: 33 12 cpse r3, r19 2fce0: ef cf rjmp .-34 ; 0x2fcc0 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fce2: 80 91 b7 14 lds r24, 0x14B7 ; 0x8014b7 2fce6: 28 12 cpse r2, r24 2fce8: 07 c0 rjmp .+14 ; 0x2fcf8 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fcea: ce 01 movw r24, r28 2fcec: 01 96 adiw r24, 0x01 ; 1 2fcee: 0f 94 7f e3 call 0x3c6fe ; 0x3c6fe 2fcf2: 97 fd sbrc r25, 7 2fcf4: e5 cf rjmp .-54 ; 0x2fcc0 2fcf6: 7e cf rjmp .-260 ; 0x2fbf4 2fcf8: 21 10 cpse r2, r1 2fcfa: e2 cf rjmp .-60 ; 0x2fcc0 2fcfc: 7b cf rjmp .-266 ; 0x2fbf4 0002fcfe : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fcfe: cf 92 push r12 2fd00: df 92 push r13 2fd02: ef 92 push r14 2fd04: ff 92 push r15 2fd06: 0f 93 push r16 2fd08: 1f 93 push r17 2fd0a: cf 93 push r28 2fd0c: df 93 push r29 2fd0e: cd b7 in r28, 0x3d ; 61 2fd10: de b7 in r29, 0x3e ; 62 2fd12: a3 97 sbiw r28, 0x23 ; 35 2fd14: 0f b6 in r0, 0x3f ; 63 2fd16: f8 94 cli 2fd18: de bf out 0x3e, r29 ; 62 2fd1a: 0f be out 0x3f, r0 ; 63 2fd1c: cd bf out 0x3d, r28 ; 61 2fd1e: 7c 01 movw r14, r24 2fd20: 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) {} 2fd22: 19 82 std Y+1, r1 ; 0x01 2fd24: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fd26: 80 91 19 15 lds r24, 0x1519 ; 0x801519 parent=&workDir; 2fd2a: 96 e1 ldi r25, 0x16 ; 22 2fd2c: c9 2e mov r12, r25 2fd2e: 95 e1 ldi r25, 0x15 ; 21 2fd30: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fd32: 81 11 cpse r24, r1 2fd34: 04 c0 rjmp .+8 ; 0x2fd3e } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fd36: 81 ef ldi r24, 0xF1 ; 241 2fd38: c8 2e mov r12, r24 2fd3a: 84 e1 ldi r24, 0x14 ; 20 2fd3c: 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); 2fd3e: 21 e0 ldi r18, 0x01 ; 1 2fd40: a7 01 movw r20, r14 2fd42: b6 01 movw r22, r12 2fd44: ce 01 movw r24, r28 2fd46: 01 96 adiw r24, 0x01 ; 1 2fd48: 0f 94 f3 d6 call 0x3ade6 ; 0x3ade6 2fd4c: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2fd4e: 88 23 and r24, r24 2fd50: 21 f1 breq .+72 ; 0x2fd9a 2fd52: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2fd56: 85 30 cpi r24, 0x05 ; 5 2fd58: 00 f5 brcc .+64 ; 0x2fd9a SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fd5a: 29 e0 ldi r18, 0x09 ; 9 2fd5c: 82 9f mul r24, r18 2fd5e: c0 01 movw r24, r0 2fd60: 11 24 eor r1, r1 2fd62: b7 01 movw r22, r14 2fd64: 85 54 subi r24, 0x45 ; 69 2fd66: 9b 4e sbci r25, 0xEB ; 235 2fd68: 0f 94 b1 e3 call 0x3c762 ; 0x3c762 puts(relpath); 2fd6c: c7 01 movw r24, r14 2fd6e: 0f 94 d5 e3 call 0x3c7aa ; 0x3c7aa if (workDirDepth < MAX_DIR_DEPTH) { 2fd72: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2fd76: 86 30 cpi r24, 0x06 ; 6 2fd78: 80 f1 brcs .+96 ; 0x2fdda for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2fd7a: 83 e2 ldi r24, 0x23 ; 35 2fd7c: fe 01 movw r30, r28 2fd7e: 31 96 adiw r30, 0x01 ; 1 2fd80: a6 e1 ldi r26, 0x16 ; 22 2fd82: b5 e1 ldi r27, 0x15 ; 21 2fd84: 01 90 ld r0, Z+ 2fd86: 0d 92 st X+, r0 2fd88: 8a 95 dec r24 2fd8a: e1 f7 brne .-8 ; 0x2fd84 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fd8c: 00 23 and r16, r16 2fd8e: 09 f4 brne .+2 ; 0x2fd92 2fd90: 4c c0 rjmp .+152 ; 0x2fe2a presort(); 2fd92: 0f 94 fd 7c call 0x2f9fa ; 0x2f9fa else presort_flag = true; #endif return 1; 2fd96: 10 2f mov r17, r16 2fd98: 0c c0 rjmp .+24 ; 0x2fdb2 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2fd9a: 84 e1 ldi r24, 0x14 ; 20 2fd9c: 9a ea ldi r25, 0xAA ; 170 2fd9e: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2fda2: 83 e1 ldi r24, 0x13 ; 19 2fda4: 91 e7 ldi r25, 0x71 ; 113 2fda6: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(relpath); 2fdaa: c7 01 movw r24, r14 2fdac: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 return 0; 2fdb0: 10 e0 ldi r17, 0x00 ; 0 2fdb2: ce 01 movw r24, r28 2fdb4: 01 96 adiw r24, 0x01 ; 1 2fdb6: 0e 94 cd 78 call 0xf19a ; 0xf19a else presort_flag = true; #endif return 1; } } 2fdba: 81 2f mov r24, r17 2fdbc: a3 96 adiw r28, 0x23 ; 35 2fdbe: 0f b6 in r0, 0x3f ; 63 2fdc0: f8 94 cli 2fdc2: de bf out 0x3e, r29 ; 62 2fdc4: 0f be out 0x3f, r0 ; 63 2fdc6: cd bf out 0x3d, r28 ; 61 2fdc8: df 91 pop r29 2fdca: cf 91 pop r28 2fdcc: 1f 91 pop r17 2fdce: 0f 91 pop r16 2fdd0: ff 90 pop r15 2fdd2: ef 90 pop r14 2fdd4: df 90 pop r13 2fdd6: cf 90 pop r12 2fdd8: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fdda: 8f 5f subi r24, 0xFF ; 255 2fddc: 80 93 0b 16 sts 0x160B, r24 ; 0x80160b workDirParents[d+1] = workDirParents[d]; 2fde0: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fde2: 81 50 subi r24, 0x01 ; 1 2fde4: c8 f0 brcs .+50 ; 0x2fe18 workDirParents[d+1] = workDirParents[d]; 2fde6: 28 2f mov r18, r24 2fde8: 30 e0 ldi r19, 0x00 ; 0 2fdea: a9 01 movw r20, r18 2fdec: 4f 5f subi r20, 0xFF ; 255 2fdee: 5f 4f sbci r21, 0xFF ; 255 2fdf0: 94 9f mul r25, r20 2fdf2: d0 01 movw r26, r0 2fdf4: 95 9f mul r25, r21 2fdf6: b0 0d add r27, r0 2fdf8: 11 24 eor r1, r1 2fdfa: a7 5c subi r26, 0xC7 ; 199 2fdfc: ba 4e sbci r27, 0xEA ; 234 2fdfe: 92 9f mul r25, r18 2fe00: f0 01 movw r30, r0 2fe02: 93 9f mul r25, r19 2fe04: f0 0d add r31, r0 2fe06: 11 24 eor r1, r1 2fe08: e7 5c subi r30, 0xC7 ; 199 2fe0a: fa 4e sbci r31, 0xEA ; 234 2fe0c: 29 2f mov r18, r25 2fe0e: 01 90 ld r0, Z+ 2fe10: 0d 92 st X+, r0 2fe12: 2a 95 dec r18 2fe14: e1 f7 brne .-8 ; 0x2fe0e 2fe16: e5 cf rjmp .-54 ; 0x2fde2 workDirParents[0]=*parent; 2fe18: 83 e2 ldi r24, 0x23 ; 35 2fe1a: f6 01 movw r30, r12 2fe1c: a9 e3 ldi r26, 0x39 ; 57 2fe1e: b5 e1 ldi r27, 0x15 ; 21 2fe20: 01 90 ld r0, Z+ 2fe22: 0d 92 st X+, r0 2fe24: 8a 95 dec r24 2fe26: e1 f7 brne .-8 ; 0x2fe20 2fe28: a8 cf rjmp .-176 ; 0x2fd7a #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2fe2a: 81 e0 ldi r24, 0x01 ; 1 2fe2c: 80 93 ba 14 sts 0x14BA, r24 ; 0x8014ba 2fe30: c0 cf rjmp .-128 ; 0x2fdb2 0002fe32 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2fe32: 93 e2 ldi r25, 0x23 ; 35 2fe34: e1 ef ldi r30, 0xF1 ; 241 2fe36: f4 e1 ldi r31, 0x14 ; 20 2fe38: a6 e1 ldi r26, 0x16 ; 22 2fe3a: b5 e1 ldi r27, 0x15 ; 21 2fe3c: 01 90 ld r0, Z+ 2fe3e: 0d 92 st X+, r0 2fe40: 9a 95 dec r25 2fe42: e1 f7 brne .-8 ; 0x2fe3c workDirDepth = 0; 2fe44: 10 92 0b 16 sts 0x160B, r1 ; 0x80160b curDir=&workDir; 2fe48: 26 e1 ldi r18, 0x16 ; 22 2fe4a: 35 e1 ldi r19, 0x15 ; 21 2fe4c: 30 93 15 15 sts 0x1515, r19 ; 0x801515 2fe50: 20 93 14 15 sts 0x1514, r18 ; 0x801514 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fe54: 81 11 cpse r24, r1 presort(); 2fe56: 0d 94 fd 7c jmp 0x2f9fa ; 0x2f9fa else presort_flag = true; 2fe5a: 81 e0 ldi r24, 0x01 ; 1 2fe5c: 80 93 ba 14 sts 0x14BA, r24 ; 0x8014ba #endif } 2fe60: 08 95 ret 0002fe62 : * * @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) 2fe62: 8f 92 push r8 2fe64: 9f 92 push r9 2fe66: af 92 push r10 2fe68: bf 92 push r11 2fe6a: cf 92 push r12 2fe6c: df 92 push r13 2fe6e: ef 92 push r14 2fe70: ff 92 push r15 2fe72: 0f 93 push r16 2fe74: 1f 93 push r17 2fe76: cf 93 push r28 2fe78: df 93 push r29 2fe7a: cd b7 in r28, 0x3d ; 61 2fe7c: de b7 in r29, 0x3e ; 62 2fe7e: 2d 97 sbiw r28, 0x0d ; 13 2fe80: 0f b6 in r0, 0x3f ; 63 2fe82: f8 94 cli 2fe84: de bf out 0x3e, r29 ; 62 2fe86: 0f be out 0x3f, r0 ; 63 2fe88: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2fe8a: 21 ef ldi r18, 0xF1 ; 241 2fe8c: 34 e1 ldi r19, 0x14 ; 20 2fe8e: 30 93 15 15 sts 0x1515, r19 ; 0x801515 2fe92: 20 93 14 15 sts 0x1514, r18 ; 0x801514 if (!fileName) 2fe96: dc 01 movw r26, r24 2fe98: ed 91 ld r30, X+ 2fe9a: fc 91 ld r31, X 2fe9c: 30 97 sbiw r30, 0x00 ; 0 2fe9e: a1 f4 brne .+40 ; 0x2fec8 } else //relative path { curDir = &workDir; } return 1; 2fea0: 81 e0 ldi r24, 0x01 ; 1 } 2fea2: 2d 96 adiw r28, 0x0d ; 13 2fea4: 0f b6 in r0, 0x3f ; 63 2fea6: f8 94 cli 2fea8: de bf out 0x3e, r29 ; 62 2feaa: 0f be out 0x3f, r0 ; 63 2feac: cd bf out 0x3d, r28 ; 61 2feae: df 91 pop r29 2feb0: cf 91 pop r28 2feb2: 1f 91 pop r17 2feb4: 0f 91 pop r16 2feb6: ff 90 pop r15 2feb8: ef 90 pop r14 2feba: df 90 pop r13 2febc: cf 90 pop r12 2febe: bf 90 pop r11 2fec0: af 90 pop r10 2fec2: 9f 90 pop r9 2fec4: 8f 90 pop r8 2fec6: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2fec8: 20 81 ld r18, Z 2feca: 2f 32 cpi r18, 0x2F ; 47 2fecc: 09 f0 breq .+2 ; 0x2fed0 2fece: 47 c0 rjmp .+142 ; 0x2ff5e 2fed0: 6c 01 movw r12, r24 { cdroot(false); 2fed2: 80 e0 ldi r24, 0x00 ; 0 2fed4: 0f 94 19 7f call 0x2fe32 ; 0x2fe32 dirname_start = fileName + 1; 2fed8: f6 01 movw r30, r12 2feda: 00 81 ld r16, Z 2fedc: 11 81 ldd r17, Z+1 ; 0x01 2fede: 0f 5f subi r16, 0xFF ; 255 2fee0: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2fee2: 96 e1 ldi r25, 0x16 ; 22 2fee4: 89 2e mov r8, r25 2fee6: 95 e1 ldi r25, 0x15 ; 21 2fee8: 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) 2feea: d8 01 movw r26, r16 2feec: 8c 91 ld r24, X 2feee: 88 23 and r24, r24 2fef0: b9 f2 breq .-82 ; 0x2fea0 { dirname_end = strchr(dirname_start, '/'); 2fef2: 6f e2 ldi r22, 0x2F ; 47 2fef4: 70 e0 ldi r23, 0x00 ; 0 2fef6: c8 01 movw r24, r16 2fef8: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 2fefc: 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) 2fefe: 00 97 sbiw r24, 0x00 ; 0 2ff00: 51 f1 breq .+84 ; 0x2ff56 2ff02: 08 17 cp r16, r24 2ff04: 19 07 cpc r17, r25 2ff06: 38 f5 brcc .+78 ; 0x2ff56 { 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); 2ff08: 7c 01 movw r14, r24 2ff0a: e0 1a sub r14, r16 2ff0c: f1 0a sbc r15, r17 2ff0e: bd e0 ldi r27, 0x0D ; 13 2ff10: eb 16 cp r14, r27 2ff12: f1 04 cpc r15, r1 2ff14: 18 f0 brcs .+6 ; 0x2ff1c 2ff16: 8c e0 ldi r24, 0x0C ; 12 2ff18: e8 2e mov r14, r24 2ff1a: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2ff1c: a7 01 movw r20, r14 2ff1e: b8 01 movw r22, r16 2ff20: ce 01 movw r24, r28 2ff22: 01 96 adiw r24, 0x01 ; 1 2ff24: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c subdirname[len] = 0; 2ff28: e1 e0 ldi r30, 0x01 ; 1 2ff2a: f0 e0 ldi r31, 0x00 ; 0 2ff2c: ec 0f add r30, r28 2ff2e: fd 1f adc r31, r29 2ff30: ee 0d add r30, r14 2ff32: ff 1d adc r31, r15 2ff34: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2ff36: 60 e0 ldi r22, 0x00 ; 0 2ff38: ce 01 movw r24, r28 2ff3a: 01 96 adiw r24, 0x01 ; 1 2ff3c: 0f 94 7f 7e call 0x2fcfe ; 0x2fcfe 2ff40: 88 23 and r24, r24 2ff42: 09 f4 brne .+2 ; 0x2ff46 2ff44: ae cf rjmp .-164 ; 0x2fea2 return 0; curDir = &workDir; 2ff46: 90 92 15 15 sts 0x1515, r9 ; 0x801515 2ff4a: 80 92 14 15 sts 0x1514, r8 ; 0x801514 dirname_start = dirname_end + 1; 2ff4e: 85 01 movw r16, r10 2ff50: 0f 5f subi r16, 0xFF ; 255 2ff52: 1f 4f sbci r17, 0xFF ; 255 2ff54: ca cf rjmp .-108 ; 0x2feea } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2ff56: f6 01 movw r30, r12 2ff58: 11 83 std Z+1, r17 ; 0x01 2ff5a: 00 83 st Z, r16 2ff5c: a1 cf rjmp .-190 ; 0x2fea0 } } else //relative path { curDir = &workDir; 2ff5e: 86 e1 ldi r24, 0x16 ; 22 2ff60: 95 e1 ldi r25, 0x15 ; 21 2ff62: 90 93 15 15 sts 0x1515, r25 ; 0x801515 2ff66: 80 93 14 15 sts 0x1514, r24 ; 0x801514 2ff6a: 9a cf rjmp .-204 ; 0x2fea0 0002ff6c : 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*/){ 2ff6c: bf 92 push r11 2ff6e: cf 92 push r12 2ff70: df 92 push r13 2ff72: ef 92 push r14 2ff74: ff 92 push r15 2ff76: 0f 93 push r16 2ff78: 1f 93 push r17 2ff7a: cf 93 push r28 2ff7c: df 93 push r29 2ff7e: 1f 92 push r1 2ff80: 1f 92 push r1 2ff82: cd b7 in r28, 0x3d ; 61 2ff84: de b7 in r29, 0x3e ; 62 if(!mounted) 2ff86: 20 91 6c 14 lds r18, 0x146C ; 0x80146c 2ff8a: 22 23 and r18, r18 2ff8c: 09 f4 brne .+2 ; 0x2ff90 2ff8e: ef c0 rjmp .+478 ; 0x3016e 2ff90: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2ff92: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 2ff96: 88 23 and r24, r24 2ff98: 09 f4 brne .+2 ; 0x2ff9c 2ff9a: 04 c1 rjmp .+520 ; 0x301a4 if(!replace_current){ 2ff9c: 61 11 cpse r22, r1 2ff9e: f6 c0 rjmp .+492 ; 0x3018c if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2ffa0: d0 90 1e 17 lds r13, 0x171E ; 0x80171e 2ffa4: dd 20 and r13, r13 2ffa6: 21 f0 breq .+8 ; 0x2ffb0 // 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); 2ffa8: 82 e3 ldi r24, 0x32 ; 50 2ffaa: 99 ea ldi r25, 0xA9 ; 169 2ffac: 0e 94 a6 7b call 0xf74c ; 0xf74c return; } SERIAL_ECHO_START; 2ffb0: 84 e1 ldi r24, 0x14 ; 20 2ffb2: 9a ea ldi r25, 0xAA ; 170 2ffb4: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(ofSubroutineCallTgt); 2ffb8: 89 e1 ldi r24, 0x19 ; 25 2ffba: 99 ea ldi r25, 0xA9 ; 169 2ffbc: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 2ffc0: c7 01 movw r24, r14 2ffc2: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2ffc6: 8e e0 ldi r24, 0x0E ; 14 2ffc8: 99 ea ldi r25, 0xA9 ; 169 2ffca: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2ffce: 00 91 1e 17 lds r16, 0x171E ; 0x80171e 2ffd2: 25 e5 ldi r18, 0x55 ; 85 2ffd4: 02 9f mul r16, r18 2ffd6: 80 01 movw r16, r0 2ffd8: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2ffda: 0d 5d subi r16, 0xDD ; 221 2ffdc: 18 4e sbci r17, 0xE8 ; 232 2ffde: 8f e2 ldi r24, 0x2F ; 47 2ffe0: f8 01 movw r30, r16 2ffe2: 81 93 st Z+, r24 2ffe4: 8f 01 movw r16, r30 2ffe6: cc 24 eor r12, r12 2ffe8: c3 94 inc r12 for(uint8_t i=0;i 2fff2: d8 16 cp r13, r24 2fff4: b0 f4 brcc .+44 ; 0x30022 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2fff6: db 9c mul r13, r11 2fff8: c0 01 movw r24, r0 2fffa: 11 24 eor r1, r1 2fffc: b8 01 movw r22, r16 2fffe: 87 5c subi r24, 0xC7 ; 199 30000: 9a 4e sbci r25, 0xEA ; 234 30002: 0f 94 4c a4 call 0x34898 ; 0x34898 30006: c8 01 movw r24, r16 30008: 8c 01 movw r16, r24 3000a: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 3000c: f8 01 movw r30, r16 3000e: 20 81 ld r18, Z 30010: 22 23 and r18, r18 30012: 29 f0 breq .+10 ; 0x3001e 30014: f4 e5 ldi r31, 0x54 ; 84 30016: fc 15 cp r31, r12 30018: 10 f0 brcs .+4 ; 0x3001e {t++;cnt++;} //crawl counter forward. 3001a: c3 94 inc r12 3001c: f5 cf rjmp .-22 ; 0x30008 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) 30022: 27 e4 ldi r18, 0x47 ; 71 30024: 2c 15 cp r18, r12 30026: 08 f4 brcc .+2 ; 0x3002a 30028: ae c0 rjmp .+348 ; 0x30186 file.getFilename(t); 3002a: b8 01 movw r22, r16 3002c: 8b ef ldi r24, 0xFB ; 251 3002e: 96 e1 ldi r25, 0x16 ; 22 30030: 0f 94 4c a4 call 0x34898 ; 0x34898 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 30034: 80 91 1e 17 lds r24, 0x171E ; 0x80171e 30038: f5 e5 ldi r31, 0x55 ; 85 3003a: 8f 9f mul r24, r31 3003c: c0 01 movw r24, r0 3003e: 11 24 eor r1, r1 30040: 8d 5d subi r24, 0xDD ; 221 30042: 98 4e sbci r25, 0xE8 ; 232 30044: 0e 94 50 89 call 0x112a0 ; 0x112a0 SERIAL_ECHORPGM(ofPos); 30048: 88 e0 ldi r24, 0x08 ; 8 3004a: 99 ea ldi r25, 0xA9 ; 169 3004c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 30050: 60 91 7f 17 lds r22, 0x177F ; 0x80177f 30054: 70 91 80 17 lds r23, 0x1780 ; 0x801780 30058: 80 91 81 17 lds r24, 0x1781 ; 0x801781 3005c: 90 91 82 17 lds r25, 0x1782 ; 0x801782 30060: 4a e0 ldi r20, 0x0A ; 10 30062: 0f 94 35 d2 call 0x3a46a ; 0x3a46a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 30066: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 3006a: 80 91 1e 17 lds r24, 0x171E ; 0x80171e 3006e: 24 e0 ldi r18, 0x04 ; 4 30070: 82 9f mul r24, r18 30072: f0 01 movw r30, r0 30074: 11 24 eor r1, r1 30076: e1 5e subi r30, 0xE1 ; 225 30078: f8 4e sbci r31, 0xE8 ; 232 3007a: 40 91 7f 17 lds r20, 0x177F ; 0x80177f 3007e: 50 91 80 17 lds r21, 0x1780 ; 0x801780 30082: 60 91 81 17 lds r22, 0x1781 ; 0x801781 30086: 70 91 82 17 lds r23, 0x1782 ; 0x801782 3008a: 40 83 st Z, r20 3008c: 51 83 std Z+1, r21 ; 0x01 3008e: 62 83 std Z+2, r22 ; 0x02 30090: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 30092: 8f 5f subi r24, 0xFF ; 255 30094: 80 93 1e 17 sts 0x171E, r24 ; 0x80171e } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 30098: 8b ef ldi r24, 0xFB ; 251 3009a: 96 e1 ldi r25, 0x16 ; 22 3009c: 0f 94 29 a4 call 0x34852 ; 0x34852 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; 300a0: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b const char *fname=name; 300a4: fa 82 std Y+2, r15 ; 0x02 300a6: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 300a8: ce 01 movw r24, r28 300aa: 01 96 adiw r24, 0x01 ; 1 300ac: 0f 94 31 7f call 0x2fe62 ; 0x2fe62 300b0: 88 23 and r24, r24 300b2: 09 f4 brne .+2 ; 0x300b6 300b4: 5c c0 rjmp .+184 ; 0x3016e */ 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) ){ 300b6: 49 81 ldd r20, Y+1 ; 0x01 300b8: 5a 81 ldd r21, Y+2 ; 0x02 300ba: 60 91 14 15 lds r22, 0x1514 ; 0x801514 300be: 70 91 15 15 lds r23, 0x1515 ; 0x801515 300c2: 21 e0 ldi r18, 0x01 ; 1 300c4: 8b ef ldi r24, 0xFB ; 251 300c6: 96 e1 ldi r25, 0x16 ; 22 300c8: 0f 94 f3 d6 call 0x3ade6 ; 0x3ade6 300cc: 88 23 and r24, r24 300ce: 09 f4 brne .+2 ; 0x300d2 300d0: 77 c0 rjmp .+238 ; 0x301c0 // compute the block to start with if( ! gfComputeNextFileBlock() ) 300d2: 8b ef ldi r24, 0xFB ; 251 300d4: 96 e1 ldi r25, 0x16 ; 22 300d6: 0f 94 50 6d call 0x2daa0 ; 0x2daa0 300da: 88 23 and r24, r24 300dc: 09 f4 brne .+2 ; 0x300e0 300de: 70 c0 rjmp .+224 ; 0x301c0 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; 300e0: 80 91 1c 17 lds r24, 0x171C ; 0x80171c 300e4: 90 91 1d 17 lds r25, 0x171D ; 0x80171d 300e8: 88 58 subi r24, 0x88 ; 136 300ea: 91 4f sbci r25, 0xF1 ; 241 300ec: 90 93 17 17 sts 0x1717, r25 ; 0x801717 300f0: 80 93 16 17 sts 0x1716, r24 ; 0x801716 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 300f4: 89 81 ldd r24, Y+1 ; 0x01 300f6: 9a 81 ldd r25, Y+2 ; 0x02 300f8: 0f 94 17 7b call 0x2f62e ; 0x2f62e filesize = file.fileSize(); 300fc: 80 91 0c 17 lds r24, 0x170C ; 0x80170c 30100: 90 91 0d 17 lds r25, 0x170D ; 0x80170d 30104: a0 91 0e 17 lds r26, 0x170E ; 0x80170e 30108: b0 91 0f 17 lds r27, 0x170F ; 0x80170f 3010c: 80 93 78 17 sts 0x1778, r24 ; 0x801778 30110: 90 93 79 17 sts 0x1779, r25 ; 0x801779 30114: a0 93 7a 17 sts 0x177A, r26 ; 0x80177a 30118: b0 93 7b 17 sts 0x177B, r27 ; 0x80177b SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 3011c: 88 ed ldi r24, 0xD8 ; 216 3011e: 98 ea ldi r25, 0xA8 ; 168 30120: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 printAbsFilenameFast(); 30124: 0f 94 fa 7b call 0x2f7f4 ; 0x2f7f4 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 30128: 80 ed ldi r24, 0xD0 ; 208 3012a: 98 ea ldi r25, 0xA8 ; 168 3012c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 30130: 60 91 78 17 lds r22, 0x1778 ; 0x801778 30134: 70 91 79 17 lds r23, 0x1779 ; 0x801779 30138: 80 91 7a 17 lds r24, 0x177A ; 0x80177a 3013c: 90 91 7b 17 lds r25, 0x177B ; 0x80177b 30140: 4a e0 ldi r20, 0x0A ; 10 30142: 0f 94 35 d2 call 0x3a46a ; 0x3a46a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 30146: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 3014a: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 3014e: 10 92 80 17 sts 0x1780, r1 ; 0x801780 30152: 10 92 81 17 sts 0x1781, r1 ; 0x801781 30156: 10 92 82 17 sts 0x1782, r1 ; 0x801782 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 3015a: 82 ec ldi r24, 0xC2 ; 194 3015c: 98 ea ldi r25, 0xA8 ; 168 3015e: 0e 94 17 7b call 0xf62e ; 0xf62e lcd_setstatuspgm(ofFileSelected); 30162: 82 ec ldi r24, 0xC2 ; 194 30164: 98 ea ldi r25, 0xA8 ; 168 30166: 0f 94 be 0b call 0x2177c ; 0x2177c scrollstuff = 0; 3016a: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 3016e: 0f 90 pop r0 30170: 0f 90 pop r0 30172: df 91 pop r29 30174: cf 91 pop r28 30176: 1f 91 pop r17 30178: 0f 91 pop r16 3017a: ff 90 pop r15 3017c: ef 90 pop r14 3017e: df 90 pop r13 30180: cf 90 pop r12 30182: bf 90 pop r11 30184: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 30186: f8 01 movw r30, r16 30188: 10 82 st Z, r1 3018a: 54 cf rjmp .-344 ; 0x30034 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 3018c: 84 e1 ldi r24, 0x14 ; 20 3018e: 9a ea ldi r25, 0xAA ; 170 30190: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(ofNowDoingFile); 30194: 87 ef ldi r24, 0xF7 ; 247 30196: 98 ea ldi r25, 0xA8 ; 168 30198: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(name); 3019c: c7 01 movw r24, r14 3019e: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 301a2: 7a cf rjmp .-268 ; 0x30098 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 301a4: 10 92 1e 17 sts 0x171E, r1 ; 0x80171e SERIAL_ECHO_START; 301a8: 84 e1 ldi r24, 0x14 ; 20 301aa: 9a ea ldi r25, 0xAA ; 170 301ac: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(ofNowFreshFile); 301b0: 86 ee ldi r24, 0xE6 ; 230 301b2: 98 ea ldi r25, 0xA8 ; 168 301b4: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(name); 301b8: c7 01 movw r24, r14 301ba: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 301be: 70 cf rjmp .-288 ; 0x300a0 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 301c0: 8f ef ldi r24, 0xFF ; 255 301c2: 90 e7 ldi r25, 0x70 ; 112 301c4: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 301c8: 89 81 ldd r24, Y+1 ; 0x01 301ca: 9a 81 ldd r25, Y+2 ; 0x02 301cc: 0e 94 50 89 call 0x112a0 ; 0x112a0 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 301d0: 8e e2 ldi r24, 0x2E ; 46 301d2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 301d6: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 301da: c9 cf rjmp .-110 ; 0x3016e 000301dc : void CardReader::printingHasFinished() { st_synchronize(); 301dc: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 file.close(); 301e0: 8b ef ldi r24, 0xFB ; 251 301e2: 96 e1 ldi r25, 0x16 ; 22 301e4: 0f 94 29 a4 call 0x34852 ; 0x34852 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 301e8: 80 91 1e 17 lds r24, 0x171E ; 0x80171e 301ec: 88 23 and r24, r24 301ee: 69 f1 breq .+90 ; 0x3024a { file_subcall_ctr--; 301f0: 81 50 subi r24, 0x01 ; 1 301f2: 80 93 1e 17 sts 0x171E, r24 ; 0x80171e openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 301f6: 25 e5 ldi r18, 0x55 ; 85 301f8: 82 9f mul r24, r18 301fa: c0 01 movw r24, r0 301fc: 11 24 eor r1, r1 301fe: 61 e0 ldi r22, 0x01 ; 1 30200: 8d 5d subi r24, 0xDD ; 221 30202: 98 4e sbci r25, 0xE8 ; 232 30204: 0f 94 b6 7f call 0x2ff6c ; 0x2ff6c setIndex(filespos[file_subcall_ctr]); 30208: e0 91 1e 17 lds r30, 0x171E ; 0x80171e 3020c: 84 e0 ldi r24, 0x04 ; 4 3020e: e8 9f mul r30, r24 30210: f0 01 movw r30, r0 30212: 11 24 eor r1, r1 30214: e1 5e subi r30, 0xE1 ; 225 30216: f8 4e sbci r31, 0xE8 ; 232 30218: 60 81 ld r22, Z 3021a: 71 81 ldd r23, Z+1 ; 0x01 3021c: 82 81 ldd r24, Z+2 ; 0x02 3021e: 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);}; 30220: 60 93 7f 17 sts 0x177F, r22 ; 0x80177f 30224: 70 93 80 17 sts 0x1780, r23 ; 0x801780 30228: 80 93 81 17 sts 0x1781, r24 ; 0x801781 3022c: 90 93 82 17 sts 0x1782, r25 ; 0x801782 30230: 0f 94 75 77 call 0x2eeea ; 0x2eeea SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 30234: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 30238: 88 23 and r24, r24 3023a: 71 f0 breq .+28 ; 0x30258 { sdprinting = true; 3023c: 81 e0 ldi r24, 0x01 ; 1 3023e: 80 93 6b 14 sts 0x146B, r24 ; 0x80146b 30242: 85 e0 ldi r24, 0x05 ; 5 30244: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> 30248: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 3024a: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b 3024e: 83 e0 ldi r24, 0x03 ; 3 30250: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 30254: 0c 94 a4 83 jmp 0x10748 ; 0x10748 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 30258: 08 95 ret 0003025a : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 3025a: cf 92 push r12 3025c: df 92 push r13 3025e: ef 92 push r14 30260: ff 92 push r15 30262: 0f 93 push r16 30264: 1f 93 push r17 30266: cf 93 push r28 30268: df 93 push r29 3026a: 08 2f mov r16, r24 { mounted = false; 3026c: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c if(root.isOpen()) 30270: 80 91 f4 14 lds r24, 0x14F4 ; 0x8014f4 30274: 88 23 and r24, r24 30276: 21 f0 breq .+8 ; 0x30280 root.close(); 30278: 81 ef ldi r24, 0xF1 ; 241 3027a: 94 e1 ldi r25, 0x14 ; 20 3027c: 0f 94 29 a4 call 0x34852 ; 0x34852 * \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; 30280: 10 92 db 16 sts 0x16DB, r1 ; 0x8016db 30284: 10 92 d8 16 sts 0x16D8, r1 ; 0x8016d8 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 30288: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 3028c: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 3028e: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 SET_OUTPUT(SDSS); 30292: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 30296: 80 64 ori r24, 0x40 ; 64 30298: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 3029c: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 3029e: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 302a0: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 302a2: 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); 302a4: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 302a6: 85 e0 ldi r24, 0x05 ; 5 302a8: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 * Initialize hardware SPI * Set SCK rate to F_CPU/pow(2, 1 + spiRate) for spiRate [0,6] */ static void spiInit(uint8_t spiRate) { // See avr processor documentation SPCR = (1 << SPE) | (1 << MSTR) | (spiRate >> 1); 302ac: 82 e5 ldi r24, 0x52 ; 82 302ae: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 302b0: 1d bc out 0x2d, r1 ; 45 302b2: 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); 302b4: 8f ef ldi r24, 0xFF ; 255 302b6: 0f 94 81 a5 call 0x34b02 ; 0x34b02 302ba: 11 50 subi r17, 0x01 ; 1 302bc: d9 f7 brne .-10 ; 0x302b4 WRITE(MISO, 1); // temporarily enable the MISO line pullup 302be: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 302c0: 20 e0 ldi r18, 0x00 ; 0 302c2: 30 e0 ldi r19, 0x00 ; 0 302c4: a9 01 movw r20, r18 302c6: 60 e0 ldi r22, 0x00 ; 0 302c8: 88 ed ldi r24, 0xD8 ; 216 302ca: 96 e1 ldi r25, 0x16 ; 22 302cc: 0f 94 8d a5 call 0x34b1a ; 0x34b1a 302d0: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 302d4: 81 30 cpi r24, 0x01 ; 1 302d6: 61 f0 breq .+24 ; 0x302f0 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 302d8: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 302dc: 6c 1b sub r22, r28 302de: 7d 0b sbc r23, r29 302e0: 61 3d cpi r22, 0xD1 ; 209 302e2: 77 40 sbci r23, 0x07 ; 7 302e4: 68 f3 brcs .-38 ; 0x302c0 WRITE(MISO, 0); // disable the MISO line pullup 302e6: 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;} 302e8: 81 e0 ldi r24, 0x01 ; 1 302ea: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 302ee: 22 c0 rjmp .+68 ; 0x30334 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 302f0: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 302f2: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 302f6: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 302f8: 85 eb ldi r24, 0xB5 ; 181 302fa: 98 ea ldi r25, 0xA8 ; 168 302fc: 0e 94 17 7b call 0xf62e ; 0xf62e spiSend(0XFF); 30300: 8f ef ldi r24, 0xFF ; 255 30302: 0f 94 81 a5 call 0x34b02 ; 0x34b02 while ((status_ = spiRec()) != 0xFF) 30306: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 3030a: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 3030e: 8f 3f cpi r24, 0xFF ; 255 30310: 59 f1 breq .+86 ; 0x30368 { spiSend(0XFF); 30312: 8f ef ldi r24, 0xFF ; 255 30314: 0f 94 81 a5 call 0x34b02 ; 0x34b02 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 30318: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 3031c: 6c 1b sub r22, r28 3031e: 7d 0b sbc r23, r29 30320: 62 32 cpi r22, 0x22 ; 34 30322: 71 05 cpc r23, r1 30324: 80 f3 brcs .-32 ; 0x30306 30326: 82 e0 ldi r24, 0x02 ; 2 30328: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 3032c: 84 ea ldi r24, 0xA4 ; 164 3032e: 98 ea ldi r25, 0xA8 ; 168 30330: 0e 94 17 7b call 0xf62e ; 0xf62e #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 30334: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 30338: 84 e1 ldi r24, 0x14 ; 20 3033a: 9a ea ldi r25, 0xAA ; 170 3033c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 30340: 82 ef ldi r24, 0xF2 ; 242 30342: 90 e7 ldi r25, 0x70 ; 112 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 30344: 0e 94 17 7b call 0xf62e ; 0xf62e } if (mounted) 30348: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 3034c: 88 23 and r24, r24 3034e: 09 f4 brne .+2 ; 0x30352 30350: 9a c0 rjmp .+308 ; 0x30486 { cdroot(doPresort); 30352: 80 2f mov r24, r16 } } 30354: df 91 pop r29 30356: cf 91 pop r28 30358: 1f 91 pop r17 3035a: 0f 91 pop r16 3035c: ff 90 pop r15 3035e: ef 90 pop r14 30360: df 90 pop r13 30362: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 30364: 0d 94 19 7f jmp 0x2fe32 ; 0x2fe32 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 30368: 2a ea ldi r18, 0xAA ; 170 3036a: 31 e0 ldi r19, 0x01 ; 1 3036c: 40 e0 ldi r20, 0x00 ; 0 3036e: 50 e0 ldi r21, 0x00 ; 0 30370: 68 e0 ldi r22, 0x08 ; 8 30372: 88 ed ldi r24, 0xD8 ; 216 30374: 96 e1 ldi r25, 0x16 ; 22 30376: 0f 94 8d a5 call 0x34b1a ; 0x34b1a 3037a: 82 ff sbrs r24, 2 3037c: 2b c0 rjmp .+86 ; 0x303d4 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;} 3037e: 81 e0 ldi r24, 0x01 ; 1 30380: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 30384: 80 91 db 16 lds r24, 0x16DB ; 0x8016db 30388: c1 2c mov r12, r1 3038a: d1 2c mov r13, r1 3038c: 76 01 movw r14, r12 3038e: 82 30 cpi r24, 0x02 ; 2 30390: 29 f4 brne .+10 ; 0x3039c 30392: c1 2c mov r12, r1 30394: d1 2c mov r13, r1 30396: e1 2c mov r14, r1 30398: 80 e4 ldi r24, 0x40 ; 64 3039a: 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); 3039c: 20 e0 ldi r18, 0x00 ; 0 3039e: 30 e0 ldi r19, 0x00 ; 0 303a0: a9 01 movw r20, r18 303a2: 67 e3 ldi r22, 0x37 ; 55 303a4: 88 ed ldi r24, 0xD8 ; 216 303a6: 96 e1 ldi r25, 0x16 ; 22 303a8: 0f 94 8d a5 call 0x34b1a ; 0x34b1a return cardCommand(cmd, arg); 303ac: a7 01 movw r20, r14 303ae: 96 01 movw r18, r12 303b0: 69 e2 ldi r22, 0x29 ; 41 303b2: 88 ed ldi r24, 0xD8 ; 216 303b4: 96 e1 ldi r25, 0x16 ; 22 303b6: 0f 94 8d a5 call 0x34b1a ; 0x34b1a while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 303ba: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 303be: 88 23 and r24, r24 303c0: b1 f0 breq .+44 ; 0x303ee // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 303c2: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 303c6: 6c 1b sub r22, r28 303c8: 7d 0b sbc r23, r29 303ca: 61 3d cpi r22, 0xD1 ; 209 303cc: 77 40 sbci r23, 0x07 ; 7 303ce: 30 f3 brcs .-52 ; 0x3039c bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 303d0: 8a e0 ldi r24, 0x0A ; 10 303d2: 8b cf rjmp .-234 ; 0x302ea goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 303d4: 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(); 303d6: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 303da: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 303de: 11 50 subi r17, 0x01 ; 1 303e0: d1 f7 brne .-12 ; 0x303d6 if (status_ != 0XAA) { 303e2: 8a 3a cpi r24, 0xAA ; 170 303e4: 11 f0 breq .+4 ; 0x303ea 303e6: 82 e0 ldi r24, 0x02 ; 2 303e8: 80 cf rjmp .-256 ; 0x302ea 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;} 303ea: 82 e0 ldi r24, 0x02 ; 2 303ec: c9 cf rjmp .-110 ; 0x30380 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 303ee: 80 91 db 16 lds r24, 0x16DB ; 0x8016db 303f2: 82 30 cpi r24, 0x02 ; 2 303f4: d1 f4 brne .+52 ; 0x3042a if (cardCommand(CMD58, 0)) { 303f6: 20 e0 ldi r18, 0x00 ; 0 303f8: 30 e0 ldi r19, 0x00 ; 0 303fa: a9 01 movw r20, r18 303fc: 6a e3 ldi r22, 0x3A ; 58 303fe: 88 ed ldi r24, 0xD8 ; 216 30400: 96 e1 ldi r25, 0x16 ; 22 30402: 0f 94 8d a5 call 0x34b1a ; 0x34b1a 30406: 88 23 and r24, r24 30408: 11 f0 breq .+4 ; 0x3040e bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 3040a: 88 e0 ldi r24, 0x08 ; 8 3040c: 6e cf rjmp .-292 ; 0x302ea error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 3040e: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 30412: 80 7c andi r24, 0xC0 ; 192 30414: 80 3c cpi r24, 0xC0 ; 192 30416: 19 f4 brne .+6 ; 0x3041e 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;} 30418: 83 e0 ldi r24, 0x03 ; 3 3041a: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 3041e: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 30422: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 30426: 0f 94 86 a5 call 0x34b0c ; 0x34b0c } chipSelectHigh(); 3042a: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 3042e: 10 92 d9 16 sts 0x16D9, r1 ; 0x8016d9 * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. Reasons for * failure include not finding a valid partition, not finding a valid * FAT file system or an I/O error. */ bool init(Sd2Card* dev) { return init(dev, 1) ? true : init(dev, 0);} 30432: 81 e0 ldi r24, 0x01 ; 1 30434: 0f 94 90 72 call 0x2e520 ; 0x2e520 30438: 81 11 cpse r24, r1 3043a: 0c c0 rjmp .+24 ; 0x30454 3043c: 80 e0 ldi r24, 0x00 ; 0 3043e: 0f 94 90 72 call 0x2e520 ; 0x2e520 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 30442: 81 11 cpse r24, r1 30444: 07 c0 rjmp .+14 ; 0x30454 { SERIAL_ERROR_START; 30446: 8c ee ldi r24, 0xEC ; 236 30448: 99 ea ldi r25, 0xA9 ; 169 3044a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 3044e: 8f ed ldi r24, 0xDF ; 223 30450: 90 e7 ldi r25, 0x70 ; 112 30452: 78 cf rjmp .-272 ; 0x30344 } else if (!root.openRoot(&volume)) 30454: 6d ed ldi r22, 0xDD ; 221 30456: 76 e1 ldi r23, 0x16 ; 22 30458: 81 ef ldi r24, 0xF1 ; 241 3045a: 94 e1 ldi r25, 0x14 ; 20 3045c: 0f 94 d9 a3 call 0x347b2 ; 0x347b2 30460: 81 11 cpse r24, r1 30462: 07 c0 rjmp .+14 ; 0x30472 { SERIAL_ERROR_START; 30464: 8c ee ldi r24, 0xEC ; 236 30466: 99 ea ldi r25, 0xA9 ; 169 30468: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 3046c: 8f ec ldi r24, 0xCF ; 207 3046e: 90 e7 ldi r25, 0x70 ; 112 30470: 69 cf rjmp .-302 ; 0x30344 } else { mounted = true; 30472: 81 e0 ldi r24, 0x01 ; 1 30474: 80 93 6c 14 sts 0x146C, r24 ; 0x80146c SERIAL_ECHO_START; 30478: 84 e1 ldi r24, 0x14 ; 20 3047a: 9a ea ldi r25, 0xAA ; 170 3047c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 30480: 84 ec ldi r24, 0xC4 ; 196 30482: 90 e7 ldi r25, 0x70 ; 112 30484: 5f cf rjmp .-322 ; 0x30344 if (mounted) { cdroot(doPresort); } } 30486: df 91 pop r29 30488: cf 91 pop r28 3048a: 1f 91 pop r17 3048c: 0f 91 pop r16 3048e: ff 90 pop r15 30490: ef 90 pop r14 30492: df 90 pop r13 30494: cf 90 pop r12 30496: 08 95 ret 00030498 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 30498: 4f 92 push r4 3049a: 5f 92 push r5 3049c: 6f 92 push r6 3049e: 7f 92 push r7 304a0: 8f 92 push r8 304a2: 9f 92 push r9 304a4: af 92 push r10 304a6: bf 92 push r11 304a8: cf 92 push r12 304aa: df 92 push r13 304ac: ef 92 push r14 304ae: ff 92 push r15 304b0: 4b 01 movw r8, r22 304b2: 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]; 304b4: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 304b8: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 304bc: 07 2e mov r0, r23 304be: 00 0c add r0, r0 304c0: 88 0b sbc r24, r24 304c2: 99 0b sbc r25, r25 304c4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> if (!degTargetHotend(extruder)) 304c8: 20 e0 ldi r18, 0x00 ; 0 304ca: 30 e0 ldi r19, 0x00 ; 0 304cc: a9 01 movw r20, r18 304ce: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 304d2: 88 23 and r24, r24 304d4: d1 f0 breq .+52 ; 0x3050a #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; 304d6: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.404> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 304da: cc 24 eor r12, r12 304dc: ca 94 dec r12 304de: dc 2c mov r13, r12 304e0: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 304e2: 98 ee ldi r25, 0xE8 ; 232 304e4: 49 2e mov r4, r25 304e6: 93 e0 ldi r25, 0x03 ; 3 304e8: 59 2e mov r5, r25 304ea: 61 2c mov r6, r1 304ec: 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) || 304ee: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.404> 304f2: 81 11 cpse r24, r1 304f4: 0a c0 rjmp .+20 ; 0x3050a 304f6: 2f ef ldi r18, 0xFF ; 255 304f8: c2 16 cp r12, r18 304fa: d2 06 cpc r13, r18 304fc: e2 06 cpc r14, r18 304fe: f2 06 cpc r15, r18 30500: 89 f4 brne .+34 ; 0x30524 (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) { 30502: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 30506: 82 30 cpi r24, 0x02 ; 2 30508: b9 f4 brne .+46 ; 0x30538 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 3050a: ff 90 pop r15 3050c: ef 90 pop r14 3050e: df 90 pop r13 30510: cf 90 pop r12 30512: bf 90 pop r11 30514: af 90 pop r10 30516: 9f 90 pop r9 30518: 8f 90 pop r8 3051a: 7f 90 pop r7 3051c: 6f 90 pop r6 3051e: 5f 90 pop r5 30520: 4f 90 pop r4 30522: 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) || 30524: f7 fc sbrc r15, 7 30526: f1 cf rjmp .-30 ; 0x3050a (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 30528: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 3052c: 6c 19 sub r22, r12 3052e: 7d 09 sbc r23, r13 30530: 68 3b cpi r22, 0xB8 ; 184 30532: 7b 40 sbci r23, 0x0B ; 11 30534: 30 f3 brcs .-52 ; 0x30502 30536: e9 cf rjmp .-46 ; 0x3050a 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) 30538: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 3053c: 68 19 sub r22, r8 3053e: 79 09 sbc r23, r9 30540: 8a 09 sbc r24, r10 30542: 9b 09 sbc r25, r11 30544: 69 3e cpi r22, 0xE9 ; 233 30546: 73 40 sbci r23, 0x03 ; 3 30548: 81 05 cpc r24, r1 3054a: 91 05 cpc r25, r1 3054c: f0 f1 brcs .+124 ; 0x305ca { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 3054e: 81 ea ldi r24, 0xA1 ; 161 30550: 98 ea ldi r25, 0xA8 ; 168 30552: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 30556: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 3055a: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 3055e: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 30562: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 30566: 41 e0 ldi r20, 0x01 ; 1 30568: 0f 94 d2 d5 call 0x3aba4 ; 0x3aba4 SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 3056c: 8d e9 ldi r24, 0x9D ; 157 3056e: 98 ea ldi r25, 0xA8 ; 168 30570: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 30574: 60 e0 ldi r22, 0x00 ; 0 30576: 70 e0 ldi r23, 0x00 ; 0 30578: cb 01 movw r24, r22 3057a: 0f 94 9a d2 call 0x3a534 ; 0x3a534 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 3057e: 89 e9 ldi r24, 0x99 ; 153 30580: 98 ea ldi r25, 0xA8 ; 168 30582: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 if (residencyStart > -1) 30586: f7 fc sbrc r15, 7 30588: 52 c0 rjmp .+164 ; 0x3062e { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 3058a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 3058e: 46 01 movw r8, r12 30590: 57 01 movw r10, r14 30592: 58 eb ldi r21, 0xB8 ; 184 30594: 85 0e add r8, r21 30596: 5b e0 ldi r21, 0x0B ; 11 30598: 95 1e adc r9, r21 3059a: a1 1c adc r10, r1 3059c: b1 1c adc r11, r1 3059e: a5 01 movw r20, r10 305a0: 94 01 movw r18, r8 305a2: 26 1b sub r18, r22 305a4: 37 0b sbc r19, r23 305a6: 48 0b sbc r20, r24 305a8: 59 0b sbc r21, r25 305aa: ca 01 movw r24, r20 305ac: b9 01 movw r22, r18 305ae: a3 01 movw r20, r6 305b0: 92 01 movw r18, r4 305b2: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 305b6: ca 01 movw r24, r20 305b8: b9 01 movw r22, r18 305ba: 0f 94 9a d2 call 0x3a534 ; 0x3a534 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 305be: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 305c2: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 305c6: 4b 01 movw r8, r22 305c8: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 305ca: 90 e0 ldi r25, 0x00 ; 0 305cc: 80 e0 ldi r24, 0x00 ; 0 305ce: 0e 94 98 8e call 0x11d30 ; 0x11d30 #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))) || 305d2: 3f ef ldi r19, 0xFF ; 255 305d4: c3 16 cp r12, r19 305d6: d3 06 cpc r13, r19 305d8: e3 06 cpc r14, r19 305da: f3 06 cpc r15, r19 305dc: 09 f0 breq .+2 ; 0x305e0 305de: 46 c0 rjmp .+140 ; 0x3066c } 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))) || 305e0: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZL16target_direction.lto_priv.552> 305e4: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 305e8: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 305ec: 88 23 and r24, r24 305ee: 19 f1 breq .+70 ; 0x30636 305f0: 07 2e mov r0, r23 305f2: 00 0c add r0, r0 305f4: 88 0b sbc r24, r24 305f6: 99 0b sbc r25, r25 305f8: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 305fc: 20 e0 ldi r18, 0x00 ; 0 305fe: 30 e0 ldi r19, 0x00 ; 0 30600: 40 e8 ldi r20, 0x80 ; 128 30602: 5f e3 ldi r21, 0x3F ; 63 30604: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 30608: 9b 01 movw r18, r22 3060a: ac 01 movw r20, r24 3060c: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 30610: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 30614: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 30618: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 3061c: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 30620: 87 fd sbrc r24, 7 30622: 65 cf rjmp .-310 ; 0x304ee (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 30624: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 30628: 6b 01 movw r12, r22 3062a: 7c 01 movw r14, r24 3062c: 60 cf rjmp .-320 ; 0x304ee } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3062e: 8f e3 ldi r24, 0x3F ; 63 30630: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 30634: c4 cf rjmp .-120 ; 0x305be 30636: 07 2e mov r0, r23 30638: 00 0c add r0, r0 3063a: 88 0b sbc r24, r24 3063c: 99 0b sbc r25, r25 3063e: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__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))) || 30642: 20 e0 ldi r18, 0x00 ; 0 30644: 30 e0 ldi r19, 0x00 ; 0 30646: 40 e8 ldi r20, 0x80 ; 128 30648: 5f e3 ldi r21, 0x3F ; 63 3064a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3064e: 9b 01 movw r18, r22 30650: ac 01 movw r20, r24 30652: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 30656: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 3065a: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 3065e: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 30662: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 30666: 18 16 cp r1, r24 30668: ec f6 brge .-70 ; 0x30624 3066a: 41 cf rjmp .-382 ; 0x304ee 3066c: f7 fc sbrc r15, 7 3066e: 3f cf rjmp .-386 ; 0x304ee 30670: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 30674: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 30678: 07 2e mov r0, r23 3067a: 00 0c add r0, r0 3067c: 88 0b sbc r24, r24 3067e: 99 0b sbc r25, r25 30680: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 30684: 9b 01 movw r18, r22 30686: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 30688: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 3068c: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 30690: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 30694: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 30698: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 3069c: 9f 77 andi r25, 0x7F ; 127 3069e: 20 e0 ldi r18, 0x00 ; 0 306a0: 30 e0 ldi r19, 0x00 ; 0 306a2: 40 ea ldi r20, 0xA0 ; 160 306a4: 50 e4 ldi r21, 0x40 ; 64 306a6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 306aa: 18 16 cp r1, r24 306ac: 0c f0 brlt .+2 ; 0x306b0 306ae: 1f cf rjmp .-450 ; 0x304ee 306b0: b9 cf rjmp .-142 ; 0x30624 000306b2 : // 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) { 306b2: 1f 93 push r17 306b4: cf 93 push r28 306b6: df 93 push r29 306b8: ec 01 movw r28, r24 306ba: 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()) { 306bc: 80 91 68 13 lds r24, 0x1368 ; 0x801368 306c0: 83 30 cpi r24, 0x03 ; 3 306c2: 09 f4 brne .+2 ; 0x306c6 306c4: 4e c0 rjmp .+156 ; 0x30762 306c6: 8c 31 cpi r24, 0x1C ; 28 306c8: 09 f4 brne .+2 ; 0x306cc 306ca: 52 c0 rjmp .+164 ; 0x30770 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 306cc: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 306d0: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 306d4: 8c 17 cp r24, r28 306d6: 9d 07 cpc r25, r29 306d8: 79 f1 breq .+94 ; 0x30738 lastErrorCode = ec; 306da: d0 93 8e 13 sts 0x138E, r29 ; 0x80138e 306de: c0 93 8d 13 sts 0x138D, r28 ; 0x80138d lastErrorSource = res; 306e2: 10 93 8f 13 sts 0x138F, r17 ; 0x80138f LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 306e6: ce 01 movw r24, r28 306e8: 0f 94 1b c3 call 0x38636 ; 0x38636 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); 306ec: e8 2f mov r30, r24 306ee: f0 e0 ldi r31, 0x00 ; 0 306f0: ee 0f add r30, r30 306f2: ff 1f adc r31, r31 306f4: e3 53 subi r30, 0x33 ; 51 306f6: f8 45 sbci r31, 0x58 ; 88 306f8: 85 91 lpm r24, Z+ 306fa: 94 91 lpm r25, Z 306fc: 02 96 adiw r24, 0x02 ; 2 306fe: 0f 94 09 c3 call 0x38612 ; 0x38612 if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 30702: c1 30 cpi r28, 0x01 ; 1 30704: d1 05 cpc r29, r1 30706: c1 f0 breq .+48 ; 0x30738 30708: cc 30 cpi r28, 0x0C ; 12 3070a: 80 e8 ldi r24, 0x80 ; 128 3070c: d8 07 cpc r29, r24 3070e: a1 f0 breq .+40 ; 0x30738 30710: c9 32 cpi r28, 0x29 ; 41 30712: 80 e8 ldi r24, 0x80 ; 128 30714: d8 07 cpc r29, r24 30716: 81 f0 breq .+32 ; 0x30738 IncrementMMUFails(); 30718: 0f 94 25 c2 call 0x3844a ; 0x3844a | (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 3071c: ce 01 movw r24, r28 3071e: 88 27 eor r24, r24 30720: 9e 77 andi r25, 0x7E ; 126 30722: 89 2b or r24, r25 30724: 49 f0 breq .+18 ; 0x30738 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 30726: 80 91 9b 13 lds r24, 0x139B ; 0x80139b 3072a: 90 91 9c 13 lds r25, 0x139C ; 0x80139c 3072e: 01 96 adiw r24, 0x01 ; 1 30730: 90 93 9c 13 sts 0x139C, r25 ; 0x80139c 30734: 80 93 9b 13 sts 0x139B, r24 ; 0x80139b return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 30738: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 3073c: 88 23 and r24, r24 3073e: d9 f0 breq .+54 ; 0x30776 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 30740: 11 e0 ldi r17, 0x01 ; 1 30742: 10 93 5c 0e sts 0x0E5C, r17 ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 30746: ce 01 movw r24, r28 30748: 0f 94 a6 c5 call 0x38b4c ; 0x38b4c 3074c: 8f 3f cpi r24, 0xFF ; 255 3074e: 99 f0 breq .+38 ; 0x30776 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 30750: 10 93 7b 13 sts 0x137B, r17 ; 0x80137b logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 30754: 8a eb ldi r24, 0xBA ; 186 30756: 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"); } 30758: df 91 pop r29 3075a: cf 91 pop r28 3075c: 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"); 3075e: 0c 94 17 7b jmp 0xf62e ; 0xf62e // 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; 30762: 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(); 30766: 0f 94 c2 bb call 0x37784 ; 0x37784 // 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; 3076a: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a 3076e: ae cf rjmp .-164 ; 0x306cc 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; 30770: 10 92 97 13 sts 0x1397, r1 ; 0x801397 30774: f8 cf rjmp .-16 ; 0x30766 30776: 10 92 7b 13 sts 0x137B, r1 ; 0x80137b bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 3077a: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.514> 3077e: 81 11 cpse r24, r1 30780: 06 c0 rjmp .+12 ; 0x3078e 30782: 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"); } 30784: df 91 pop r29 30786: cf 91 pop r28 30788: 1f 91 pop r17 3078a: 0d 94 6c c4 jmp 0x388d8 ; 0x388d8 3078e: df 91 pop r29 30790: cf 91 pop r28 30792: 1f 91 pop r17 30794: 08 95 ret 00030796 : * \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) { 30796: 2f 92 push r2 30798: 3f 92 push r3 3079a: 4f 92 push r4 3079c: 5f 92 push r5 3079e: 6f 92 push r6 307a0: 7f 92 push r7 307a2: 8f 92 push r8 307a4: 9f 92 push r9 307a6: af 92 push r10 307a8: bf 92 push r11 307aa: cf 92 push r12 307ac: df 92 push r13 307ae: ef 92 push r14 307b0: ff 92 push r15 307b2: 0f 93 push r16 307b4: 1f 93 push r17 307b6: cf 93 push r28 307b8: df 93 push r29 307ba: 00 d0 rcall .+0 ; 0x307bc 307bc: 1f 92 push r1 307be: cd b7 in r28, 0x3d ; 61 307c0: de b7 in r29, 0x3e ; 62 307c2: 5c 01 movw r10, r24 307c4: 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; 307c6: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 307ca: 81 30 cpi r24, 0x01 ; 1 307cc: 09 f0 breq .+2 ; 0x307d0 307ce: de c0 rjmp .+444 ; 0x3098c 307d0: 80 91 fc 16 lds r24, 0x16FC ; 0x8016fc 307d4: 81 ff sbrs r24, 1 307d6: da c0 rjmp .+436 ; 0x3098c // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 307d8: 82 fd sbrc r24, 2 307da: bc c0 rjmp .+376 ; 0x30954 * \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) { 307dc: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 307de: 21 2c mov r2, r1 307e0: 32 e0 ldi r19, 0x02 ; 2 307e2: 33 2e mov r3, r19 307e4: 00 91 03 17 lds r16, 0x1703 ; 0x801703 307e8: 10 91 04 17 lds r17, 0x1704 ; 0x801704 307ec: 20 91 05 17 lds r18, 0x1705 ; 0x801705 307f0: 30 91 06 17 lds r19, 0x1706 ; 0x801706 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 307f4: e1 14 cp r14, r1 307f6: f1 04 cpc r15, r1 307f8: 09 f4 brne .+2 ; 0x307fc 307fa: 30 c1 rjmp .+608 ; 0x30a5c uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 307fc: 80 91 14 17 lds r24, 0x1714 ; 0x801714 30800: 90 91 15 17 lds r25, 0x1715 ; 0x801715 uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 //---------------------------------------------------------------------------- bool allocContiguous(uint32_t count, uint32_t* curCluster); uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1);} 30804: dc 01 movw r26, r24 30806: 14 96 adiw r26, 0x04 ; 4 30808: 7c 90 ld r7, X 3080a: 7a 94 dec r7 3080c: b9 01 movw r22, r18 3080e: a8 01 movw r20, r16 30810: 29 e0 ldi r18, 0x09 ; 9 30812: 76 95 lsr r23 30814: 67 95 ror r22 30816: 57 95 ror r21 30818: 47 95 ror r20 3081a: 2a 95 dec r18 3081c: d1 f7 brne .-12 ; 0x30812 3081e: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 30820: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 30822: 71 10 cpse r7, r1 30824: 25 c0 rjmp .+74 ; 0x30870 30826: 01 15 cp r16, r1 30828: 11 05 cpc r17, r1 3082a: 11 f5 brne .+68 ; 0x30870 3082c: 40 91 ff 16 lds r20, 0x16FF ; 0x8016ff 30830: 50 91 00 17 lds r21, 0x1700 ; 0x801700 30834: 60 91 01 17 lds r22, 0x1701 ; 0x801701 30838: 70 91 02 17 lds r23, 0x1702 ; 0x801702 // start of new cluster if (curCluster_ == 0) { 3083c: 41 15 cp r20, r1 3083e: 51 05 cpc r21, r1 30840: 61 05 cpc r22, r1 30842: 71 05 cpc r23, r1 30844: 09 f0 breq .+2 ; 0x30848 30846: a8 c0 rjmp .+336 ; 0x30998 if (firstCluster_ == 0) { 30848: 80 91 10 17 lds r24, 0x1710 ; 0x801710 3084c: 90 91 11 17 lds r25, 0x1711 ; 0x801711 30850: a0 91 12 17 lds r26, 0x1712 ; 0x801712 30854: b0 91 13 17 lds r27, 0x1713 ; 0x801713 30858: 00 97 sbiw r24, 0x00 ; 0 3085a: a1 05 cpc r26, r1 3085c: b1 05 cpc r27, r1 3085e: 09 f0 breq .+2 ; 0x30862 30860: b4 c0 rjmp .+360 ; 0x309ca } 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; 30862: 8b ef ldi r24, 0xFB ; 251 30864: 96 e1 ldi r25, 0x16 ; 22 30866: 0f 94 86 a4 call 0x3490c ; 0x3490c 3086a: 88 23 and r24, r24 3086c: 09 f4 brne .+2 ; 0x30870 3086e: 8e c0 rjmp .+284 ; 0x3098c curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30870: c1 01 movw r24, r2 30872: 80 1b sub r24, r16 30874: 91 0b sbc r25, r17 30876: 67 01 movw r12, r14 30878: 8e 15 cp r24, r14 3087a: 9f 05 cpc r25, r15 3087c: 08 f4 brcc .+2 ; 0x30880 3087e: 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; 30880: e0 91 14 17 lds r30, 0x1714 ; 0x801714 30884: f0 91 15 17 lds r31, 0x1715 ; 0x801715 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 30888: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 3088c: 90 91 00 17 lds r25, 0x1700 ; 0x801700 30890: a0 91 01 17 lds r26, 0x1701 ; 0x801701 30894: b0 91 02 17 lds r27, 0x1702 ; 0x801702 30898: 02 97 sbiw r24, 0x02 ; 2 3089a: a1 09 sbc r26, r1 3089c: b1 09 sbc r27, r1 3089e: 25 85 ldd r18, Z+13 ; 0x0d 308a0: 04 c0 rjmp .+8 ; 0x308aa 308a2: 88 0f add r24, r24 308a4: 99 1f adc r25, r25 308a6: aa 1f adc r26, r26 308a8: bb 1f adc r27, r27 308aa: 2a 95 dec r18 308ac: d2 f7 brpl .-12 ; 0x308a2 308ae: 46 85 ldd r20, Z+14 ; 0x0e 308b0: 57 85 ldd r21, Z+15 ; 0x0f 308b2: 60 89 ldd r22, Z+16 ; 0x10 308b4: 71 89 ldd r23, Z+17 ; 0x11 308b6: 84 0f add r24, r20 308b8: 95 1f adc r25, r21 308ba: a6 1f adc r26, r22 308bc: b7 1f adc r27, r23 308be: 9c 01 movw r18, r24 308c0: ad 01 movw r20, r26 308c2: 27 0d add r18, r7 308c4: 31 1d adc r19, r1 308c6: 41 1d adc r20, r1 308c8: 51 1d adc r21, r1 308ca: 29 01 movw r4, r18 308cc: 3a 01 movw r6, r20 if (n == 512) { 308ce: c1 14 cp r12, r1 308d0: 32 e0 ldi r19, 0x02 ; 2 308d2: d3 06 cpc r13, r19 308d4: 09 f0 breq .+2 ; 0x308d8 308d6: 8a c0 rjmp .+276 ; 0x309ec // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 308d8: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 308dc: 90 91 6d 0e lds r25, 0x0E6D ; 0x800e6d 308e0: a0 91 6e 0e lds r26, 0x0E6E ; 0x800e6e 308e4: b0 91 6f 0e lds r27, 0x0E6F ; 0x800e6f 308e8: 48 16 cp r4, r24 308ea: 59 06 cpc r5, r25 308ec: 6a 06 cpc r6, r26 308ee: 7b 06 cpc r7, r27 308f0: 69 f4 brne .+26 ; 0x3090c 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; 308f2: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 cacheBlockNumber_ = blockNumber; 308f6: 8f ef ldi r24, 0xFF ; 255 308f8: 9f ef ldi r25, 0xFF ; 255 308fa: dc 01 movw r26, r24 308fc: 80 93 6c 0e sts 0x0E6C, r24 ; 0x800e6c 30900: 90 93 6d 0e sts 0x0E6D, r25 ; 0x800e6d 30904: a0 93 6e 0e sts 0x0E6E, r26 ; 0x800e6e 30908: b0 93 6f 0e sts 0x0E6F, r27 ; 0x800e6f return cluster >= FAT32EOC_MIN; } bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst);} bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); 3090c: 95 01 movw r18, r10 3090e: b3 01 movw r22, r6 30910: a2 01 movw r20, r4 30912: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 30916: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 3091a: 0f 94 ed a5 call 0x34bda ; 0x34bda // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 3091e: 88 23 and r24, r24 30920: a9 f1 breq .+106 ; 0x3098c if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 30922: 80 91 03 17 lds r24, 0x1703 ; 0x801703 30926: 90 91 04 17 lds r25, 0x1704 ; 0x801704 3092a: a0 91 05 17 lds r26, 0x1705 ; 0x801705 3092e: b0 91 06 17 lds r27, 0x1706 ; 0x801706 30932: 8c 0d add r24, r12 30934: 9d 1d adc r25, r13 30936: a1 1d adc r26, r1 30938: b1 1d adc r27, r1 3093a: 80 93 03 17 sts 0x1703, r24 ; 0x801703 3093e: 90 93 04 17 sts 0x1704, r25 ; 0x801704 30942: a0 93 05 17 sts 0x1705, r26 ; 0x801705 30946: b0 93 06 17 sts 0x1706, r27 ; 0x801706 src += n; 3094a: ac 0c add r10, r12 3094c: bd 1c adc r11, r13 nToWrite -= n; 3094e: ec 18 sub r14, r12 30950: fd 08 sbc r15, r13 30952: 48 cf rjmp .-368 ; 0x307e4 // 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_) { 30954: 40 91 0c 17 lds r20, 0x170C ; 0x80170c 30958: 50 91 0d 17 lds r21, 0x170D ; 0x80170d 3095c: 60 91 0e 17 lds r22, 0x170E ; 0x80170e 30960: 70 91 0f 17 lds r23, 0x170F ; 0x80170f 30964: 80 91 03 17 lds r24, 0x1703 ; 0x801703 30968: 90 91 04 17 lds r25, 0x1704 ; 0x801704 3096c: a0 91 05 17 lds r26, 0x1705 ; 0x801705 30970: b0 91 06 17 lds r27, 0x1706 ; 0x801706 30974: 48 17 cp r20, r24 30976: 59 07 cpc r21, r25 30978: 6a 07 cpc r22, r26 3097a: 7b 07 cpc r23, r27 3097c: 09 f4 brne .+2 ; 0x30980 3097e: 2e cf rjmp .-420 ; 0x307dc } /** 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);} 30980: 8b ef ldi r24, 0xFB ; 251 30982: 96 e1 ldi r25, 0x16 ; 22 30984: 0f 94 66 6e call 0x2dccc ; 0x2dccc if (!seekEnd()) goto fail; 30988: 81 11 cpse r24, r1 3098a: 28 cf rjmp .-432 ; 0x307dc } return nbyte; fail: // return for write error writeError = true; 3098c: 81 e0 ldi r24, 0x01 ; 1 3098e: 80 93 fb 16 sts 0x16FB, r24 ; 0x8016fb return -1; 30992: 8f ef ldi r24, 0xFF ; 255 30994: 9f ef ldi r25, 0xFF ; 255 30996: 81 c0 rjmp .+258 ; 0x30a9a } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 30998: 9e 01 movw r18, r28 3099a: 2f 5f subi r18, 0xFF ; 255 3099c: 3f 4f sbci r19, 0xFF ; 255 3099e: 0f 94 63 6c call 0x2d8c6 ; 0x2d8c6 309a2: 88 23 and r24, r24 309a4: 99 f3 breq .-26 ; 0x3098c if (vol_->isEOC(next)) { 309a6: 89 81 ldd r24, Y+1 ; 0x01 309a8: 9a 81 ldd r25, Y+2 ; 0x02 309aa: ab 81 ldd r26, Y+3 ; 0x03 309ac: 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; 309ae: e0 91 14 17 lds r30, 0x1714 ; 0x801714 309b2: f0 91 15 17 lds r31, 0x1715 ; 0x801715 309b6: 27 89 ldd r18, Z+23 ; 0x17 309b8: 20 31 cpi r18, 0x10 ; 16 309ba: 81 f4 brne .+32 ; 0x309dc 309bc: 88 3f cpi r24, 0xF8 ; 248 309be: ef ef ldi r30, 0xFF ; 255 309c0: 9e 07 cpc r25, r30 309c2: a1 05 cpc r26, r1 309c4: b1 05 cpc r27, r1 309c6: 08 f0 brcs .+2 ; 0x309ca 309c8: 4c cf rjmp .-360 ; 0x30862 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 309ca: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 309ce: 90 93 00 17 sts 0x1700, r25 ; 0x801700 309d2: a0 93 01 17 sts 0x1701, r26 ; 0x801701 309d6: b0 93 02 17 sts 0x1702, r27 ; 0x801702 309da: 4a cf rjmp .-364 ; 0x30870 return cluster >= FAT32EOC_MIN; 309dc: 88 3f cpi r24, 0xF8 ; 248 309de: ff ef ldi r31, 0xFF ; 255 309e0: 9f 07 cpc r25, r31 309e2: af 07 cpc r26, r31 309e4: ff e0 ldi r31, 0x0F ; 15 309e6: bf 07 cpc r27, r31 309e8: 80 f3 brcs .-32 ; 0x309ca 309ea: 3b cf rjmp .-394 ; 0x30862 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 309ec: 01 15 cp r16, r1 309ee: 11 05 cpc r17, r1 309f0: 69 f5 brne .+90 ; 0x30a4c 309f2: 40 91 03 17 lds r20, 0x1703 ; 0x801703 309f6: 50 91 04 17 lds r21, 0x1704 ; 0x801704 309fa: 60 91 05 17 lds r22, 0x1705 ; 0x801705 309fe: 70 91 06 17 lds r23, 0x1706 ; 0x801706 30a02: 80 91 0c 17 lds r24, 0x170C ; 0x80170c 30a06: 90 91 0d 17 lds r25, 0x170D ; 0x80170d 30a0a: a0 91 0e 17 lds r26, 0x170E ; 0x80170e 30a0e: b0 91 0f 17 lds r27, 0x170F ; 0x80170f 30a12: 48 17 cp r20, r24 30a14: 59 07 cpc r21, r25 30a16: 6a 07 cpc r22, r26 30a18: 7b 07 cpc r23, r27 30a1a: c0 f0 brcs .+48 ; 0x30a4c // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 30a1c: 0f 94 55 6b call 0x2d6aa ; 0x2d6aa 30a20: 88 23 and r24, r24 30a22: 09 f4 brne .+2 ; 0x30a26 30a24: b3 cf rjmp .-154 ; 0x3098c 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; 30a26: 81 e0 ldi r24, 0x01 ; 1 30a28: 80 93 74 0e sts 0x0E74, r24 ; 0x800e74 cacheBlockNumber_ = blockNumber; 30a2c: 40 92 6c 0e sts 0x0E6C, r4 ; 0x800e6c 30a30: 50 92 6d 0e sts 0x0E6D, r5 ; 0x800e6d 30a34: 60 92 6e 0e sts 0x0E6E, r6 ; 0x800e6e 30a38: 70 92 6f 0e sts 0x0E6F, r7 ; 0x800e6f } else { // rewrite part of block if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); 30a3c: a6 01 movw r20, r12 30a3e: b5 01 movw r22, r10 30a40: c8 01 movw r24, r16 30a42: 88 58 subi r24, 0x88 ; 136 30a44: 91 4f sbci r25, 0xF1 ; 241 30a46: 0f 94 6f e3 call 0x3c6de ; 0x3c6de 30a4a: 6b cf rjmp .-298 ; 0x30922 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; 30a4c: 41 e0 ldi r20, 0x01 ; 1 30a4e: c3 01 movw r24, r6 30a50: b2 01 movw r22, r4 30a52: 0f 94 94 6b call 0x2d728 ; 0x2d728 30a56: 81 11 cpse r24, r1 30a58: f1 cf rjmp .-30 ; 0x30a3c 30a5a: 98 cf rjmp .-208 ; 0x3098c } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 30a5c: 80 91 0c 17 lds r24, 0x170C ; 0x80170c 30a60: 90 91 0d 17 lds r25, 0x170D ; 0x80170d 30a64: a0 91 0e 17 lds r26, 0x170E ; 0x80170e 30a68: b0 91 0f 17 lds r27, 0x170F ; 0x80170f 30a6c: 80 17 cp r24, r16 30a6e: 91 07 cpc r25, r17 30a70: a2 07 cpc r26, r18 30a72: b3 07 cpc r27, r19 30a74: 68 f4 brcc .+26 ; 0x30a90 30a76: 80 91 fc 16 lds r24, 0x16FC ; 0x8016fc // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 30a7a: 00 93 0c 17 sts 0x170C, r16 ; 0x80170c 30a7e: 10 93 0d 17 sts 0x170D, r17 ; 0x80170d 30a82: 20 93 0e 17 sts 0x170E, r18 ; 0x80170e 30a86: 30 93 0f 17 sts 0x170F, r19 ; 0x80170f flags_ |= F_FILE_DIR_DIRTY; 30a8a: 80 68 ori r24, 0x80 ; 128 30a8c: 80 93 fc 16 sts 0x16FC, r24 ; 0x8016fc } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 30a90: 80 91 fc 16 lds r24, 0x16FC ; 0x8016fc 30a94: 83 fd sbrc r24, 3 30a96: 18 c0 rjmp .+48 ; 0x30ac8 if (!sync()) goto fail; } return nbyte; 30a98: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 30a9a: 0f 90 pop r0 30a9c: 0f 90 pop r0 30a9e: 0f 90 pop r0 30aa0: 0f 90 pop r0 30aa2: df 91 pop r29 30aa4: cf 91 pop r28 30aa6: 1f 91 pop r17 30aa8: 0f 91 pop r16 30aaa: ff 90 pop r15 30aac: ef 90 pop r14 30aae: df 90 pop r13 30ab0: cf 90 pop r12 30ab2: bf 90 pop r11 30ab4: af 90 pop r10 30ab6: 9f 90 pop r9 30ab8: 8f 90 pop r8 30aba: 7f 90 pop r7 30abc: 6f 90 pop r6 30abe: 5f 90 pop r5 30ac0: 4f 90 pop r4 30ac2: 3f 90 pop r3 30ac4: 2f 90 pop r2 30ac6: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 30ac8: 8b ef ldi r24, 0xFB ; 251 30aca: 96 e1 ldi r25, 0x16 ; 22 30acc: 0f 94 31 6e call 0x2dc62 ; 0x2dc62 30ad0: 81 11 cpse r24, r1 30ad2: e2 cf rjmp .-60 ; 0x30a98 30ad4: 5b cf rjmp .-330 ; 0x3098c 00030ad6 : #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) { 30ad6: 0f 93 push r16 30ad8: cf 93 push r28 30ada: df 93 push r29 30adc: cd b7 in r28, 0x3d ; 61 30ade: de b7 in r29, 0x3e ; 62 30ae0: a3 97 sbiw r28, 0x23 ; 35 30ae2: 0f b6 in r0, 0x3f ; 63 30ae4: f8 94 cli 30ae6: de bf out 0x3e, r29 ; 62 30ae8: 0f be out 0x3f, r0 ; 63 30aea: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 30aec: 20 91 0c 16 lds r18, 0x160C ; 0x80160c 30af0: 30 91 0d 16 lds r19, 0x160D ; 0x80160d 30af4: 82 17 cp r24, r18 30af6: 93 07 cpc r25, r19 30af8: d8 f4 brcc .+54 ; 0x30b30 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 30afa: 61 30 cpi r22, 0x01 ; 1 30afc: 31 f4 brne .+12 ; 0x30b0a 30afe: 21 50 subi r18, 0x01 ; 1 30b00: 31 09 sbc r19, r1 30b02: a9 01 movw r20, r18 30b04: 48 1b sub r20, r24 30b06: 59 0b sbc r21, r25 30b08: ca 01 movw r24, r20 30b0a: 88 0f add r24, r24 30b0c: 99 1f adc r25, r25 30b0e: fc 01 movw r30, r24 30b10: e2 5f subi r30, 0xF2 ; 242 30b12: f9 4e sbci r31, 0xE9 ; 233 30b14: 80 81 ld r24, Z 30b16: 91 81 ldd r25, Z+1 ; 0x01 30b18: 0f 94 5e 7b call 0x2f6bc ; 0x2f6bc else getfilename_afterMaxSorting(nr); } 30b1c: a3 96 adiw r28, 0x23 ; 35 30b1e: 0f b6 in r0, 0x3f ; 63 30b20: f8 94 cli 30b22: de bf out 0x3e, r29 ; 62 30b24: 0f be out 0x3f, r0 ; 63 30b26: cd bf out 0x3d, r28 ; 61 30b28: df 91 pop r29 30b2a: cf 91 pop r28 30b2c: 0f 91 pop r16 30b2e: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 30b30: 46 e1 ldi r20, 0x16 ; 22 30b32: 55 e1 ldi r21, 0x15 ; 21 30b34: 50 93 15 15 sts 0x1515, r21 ; 0x801515 30b38: 40 93 14 15 sts 0x1514, r20 ; 0x801514 nrFiles = entry - sort_count + 1; 30b3c: 82 1b sub r24, r18 30b3e: 93 0b sbc r25, r19 30b40: 01 96 adiw r24, 0x01 ; 1 30b42: 90 93 84 17 sts 0x1784, r25 ; 0x801784 30b46: 80 93 83 17 sts 0x1783, r24 ; 0x801783 curDir->seekSet(lastSortedFilePosition << 5); 30b4a: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 30b4e: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 30b52: 85 e0 ldi r24, 0x05 ; 5 30b54: 44 0f add r20, r20 30b56: 55 1f adc r21, r21 30b58: 8a 95 dec r24 30b5a: e1 f7 brne .-8 ; 0x30b54 30b5c: 70 e0 ldi r23, 0x00 ; 0 30b5e: 60 e0 ldi r22, 0x00 ; 0 30b60: 86 e1 ldi r24, 0x16 ; 22 30b62: 95 e1 ldi r25, 0x15 ; 21 30b64: 0f 94 66 6e call 0x2dccc ; 0x2dccc }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 30b68: 00 e0 ldi r16, 0x00 ; 0 30b6a: 0e 7f andi r16, 0xFE ; 254 30b6c: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 30b6e: e0 91 14 15 lds r30, 0x1514 ; 0x801514 30b72: f0 91 15 15 lds r31, 0x1515 ; 0x801515 30b76: 83 e2 ldi r24, 0x23 ; 35 30b78: de 01 movw r26, r28 30b7a: 11 96 adiw r26, 0x01 ; 1 30b7c: 01 90 ld r0, Z+ 30b7e: 0d 92 st X+, r0 30b80: 8a 95 dec r24 30b82: e1 f7 brne .-8 ; 0x30b7c 30b84: 22 e0 ldi r18, 0x02 ; 2 30b86: 50 e0 ldi r21, 0x00 ; 0 30b88: 40 e0 ldi r20, 0x00 ; 0 30b8a: be 01 movw r22, r28 30b8c: 6f 5f subi r22, 0xFF ; 255 30b8e: 7f 4f sbci r23, 0xFF ; 255 30b90: 81 ef ldi r24, 0xF1 ; 241 30b92: 92 e0 ldi r25, 0x02 ; 2 30b94: 0f 94 e8 78 call 0x2f1d0 ; 0x2f1d0 30b98: ce 01 movw r24, r28 30b9a: 01 96 adiw r24, 0x01 ; 1 30b9c: 0e 94 cd 78 call 0xf19a ; 0xf19a 30ba0: bd cf rjmp .-134 ; 0x30b1c 00030ba2 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 30ba2: 0f 93 push r16 30ba4: 1f 93 push r17 30ba6: cf 93 push r28 30ba8: df 93 push r29 30baa: 1f 92 push r1 30bac: 1f 92 push r1 30bae: cd b7 in r28, 0x3d ; 61 30bb0: de b7 in r29, 0x3e ; 62 { if(!mounted) 30bb2: 20 91 6c 14 lds r18, 0x146C ; 0x80146c 30bb6: 22 23 and r18, r18 30bb8: 69 f1 breq .+90 ; 0x30c14 30bba: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30bbc: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 30bc0: 88 23 and r24, r24 30bc2: 79 f1 breq .+94 ; 0x30c22 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 30bc4: 81 ee ldi r24, 0xE1 ; 225 30bc6: 96 ea ldi r25, 0xA6 ; 166 30bc8: 0e 94 17 7b call 0xf62e ; 0xf62e 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; 30bcc: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b const char *fname=name; 30bd0: 1a 83 std Y+2, r17 ; 0x02 30bd2: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 30bd4: ce 01 movw r24, r28 30bd6: 01 96 adiw r24, 0x01 ; 1 30bd8: 0f 94 31 7f call 0x2fe62 ; 0x2fe62 30bdc: 88 23 and r24, r24 30bde: d1 f0 breq .+52 ; 0x30c14 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 30be0: 49 81 ldd r20, Y+1 ; 0x01 30be2: 5a 81 ldd r21, Y+2 ; 0x02 30be4: 60 91 14 15 lds r22, 0x1514 ; 0x801514 30be8: 70 91 15 15 lds r23, 0x1515 ; 0x801515 30bec: 26 e5 ldi r18, 0x56 ; 86 30bee: 8b ef ldi r24, 0xFB ; 251 30bf0: 96 e1 ldi r25, 0x16 ; 22 30bf2: 0f 94 f3 d6 call 0x3ade6 ; 0x3ade6 30bf6: 81 11 cpse r24, r1 30bf8: 22 c0 rjmp .+68 ; 0x30c3e SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30bfa: 8f ef ldi r24, 0xFF ; 255 30bfc: 90 e7 ldi r25, 0x70 ; 112 30bfe: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 30c02: 89 81 ldd r24, Y+1 ; 0x01 30c04: 9a 81 ldd r25, Y+2 ; 0x02 30c06: 0e 94 50 89 call 0x112a0 ; 0x112a0 30c0a: 8e e2 ldi r24, 0x2E ; 46 30c0c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30c10: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 30c14: 0f 90 pop r0 30c16: 0f 90 pop r0 30c18: df 91 pop r29 30c1a: cf 91 pop r28 30c1c: 1f 91 pop r17 30c1e: 0f 91 pop r16 30c20: 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 30c22: 10 92 1e 17 sts 0x171E, r1 ; 0x80171e SERIAL_ECHO_START; 30c26: 84 e1 ldi r24, 0x14 ; 20 30c28: 9a ea ldi r25, 0xAA ; 170 30c2a: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHORPGM(ofNowFreshFile); 30c2e: 86 ee ldi r24, 0xE6 ; 230 30c30: 98 ea ldi r25, 0xA8 ; 168 30c32: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN(name); 30c36: c8 01 movw r24, r16 30c38: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 30c3c: c7 cf rjmp .-114 ; 0x30bcc 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; 30c3e: 81 e0 ldi r24, 0x01 ; 1 30c40: 80 93 69 14 sts 0x1469, r24 ; 0x801469 getfilename(0, fname); 30c44: 89 81 ldd r24, Y+1 ; 0x01 30c46: 9a 81 ldd r25, Y+2 ; 0x02 30c48: 0f 94 17 7b call 0x2f62e ; 0x2f62e SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 30c4c: 8f ec ldi r24, 0xCF ; 207 30c4e: 96 ea ldi r25, 0xA6 ; 166 30c50: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 printAbsFilenameFast(); 30c54: 0f 94 fa 7b call 0x2f7f4 ; 0x2f7f4 SERIAL_PROTOCOLLN(); 30c58: 0f 94 48 d6 call 0x3ac90 ; 0x3ac90 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30c5c: 82 ec ldi r24, 0xC2 ; 194 30c5e: 98 ea ldi r25, 0xA8 ; 168 30c60: 0e 94 17 7b call 0xf62e ; 0xf62e lcd_setstatuspgm(ofFileSelected); 30c64: 82 ec ldi r24, 0xC2 ; 194 30c66: 98 ea ldi r25, 0xA8 ; 168 30c68: 0f 94 be 0b call 0x2177c ; 0x2177c scrollstuff = 0; 30c6c: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 30c70: d1 cf rjmp .-94 ; 0x30c14 00030c72 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 30c72: 0f 93 push r16 30c74: 1f 93 push r17 30c76: cf 93 push r28 30c78: df 93 push r29 30c7a: ec 01 movw r28, r24 { memset(ip, 0, 4); 30c7c: 84 e0 ldi r24, 0x04 ; 4 30c7e: fe 01 movw r30, r28 30c80: 11 92 st Z+, r1 30c82: 8a 95 dec r24 30c84: e9 f7 brne .-6 ; 0x30c80 /** 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 30c86: 23 e0 ldi r18, 0x03 ; 3 30c88: 30 ea ldi r19, 0xA0 ; 160 30c8a: 4a e0 ldi r20, 0x0A ; 10 30c8c: 50 e9 ldi r21, 0x90 ; 144 30c8e: 60 e3 ldi r22, 0x30 ; 48 30c90: 88 ed ldi r24, 0xD8 ; 216 30c92: 96 e1 ldi r25, 0x16 ; 22 30c94: 0f 94 8d a5 call 0x34b1a ; 0x34b1a 30c98: 88 23 and r24, r24 30c9a: 91 f0 breq .+36 ; 0x30cc0 30c9c: 23 e0 ldi r18, 0x03 ; 3 30c9e: 30 ea ldi r19, 0xA0 ; 160 30ca0: 4a e0 ldi r20, 0x0A ; 10 30ca2: 50 e9 ldi r21, 0x90 ; 144 30ca4: 61 e1 ldi r22, 0x11 ; 17 30ca6: 88 ed ldi r24, 0xD8 ; 216 30ca8: 96 e1 ldi r25, 0x16 ; 22 30caa: 0f 94 8d a5 call 0x34b1a ; 0x34b1a 30cae: 88 23 and r24, r24 30cb0: 39 f0 breq .+14 ; 0x30cc0 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30cb2: 80 e8 ldi r24, 0x80 ; 128 30cb4: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30cb8: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 return false; 30cbc: 80 e0 ldi r24, 0x00 ; 0 30cbe: 2f c0 rjmp .+94 ; 0x30d1e //------------------------------------------------------------------------------ /** 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(); 30cc0: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 30cc4: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30cc6: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 30cca: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 30cce: 8f 3f cpi r24, 0xFF ; 255 30cd0: 69 f4 brne .+26 ; 0x30cec if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30cd2: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 30cd6: 60 1b sub r22, r16 30cd8: 71 0b sbc r23, r17 30cda: 6d 32 cpi r22, 0x2D ; 45 30cdc: 71 40 sbci r23, 0x01 ; 1 30cde: 98 f3 brcs .-26 ; 0x30cc6 30ce0: 81 e1 ldi r24, 0x11 ; 17 30ce2: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 goto fail; } return true; fail: chipSelectHigh(); 30ce6: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 30cea: e6 cf rjmp .-52 ; 0x30cb8 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30cec: 8e 3f cpi r24, 0xFE ; 254 30cee: 11 f0 breq .+4 ; 0x30cf4 30cf0: 8f e0 ldi r24, 0x0F ; 15 30cf2: f7 cf rjmp .-18 ; 0x30ce2 30cf4: 8e 01 movw r16, r28 30cf6: 0c 5f subi r16, 0xFC ; 252 30cf8: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30cfa: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 30cfe: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30d00: c0 17 cp r28, r16 30d02: d1 07 cpc r29, r17 30d04: d1 f7 brne .-12 ; 0x30cfa 30d06: ce ef ldi r28, 0xFE ; 254 30d08: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30d0a: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 30d0e: 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) { 30d10: e1 f7 brne .-8 ; 0x30d0a spiRec(); } chipSelectHigh(); 30d12: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30d16: 8f ef ldi r24, 0xFF ; 255 30d18: 0f 94 81 a5 call 0x34b02 ; 0x34b02 30d1c: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30d1e: df 91 pop r29 30d20: cf 91 pop r28 30d22: 1f 91 pop r17 30d24: 0f 91 pop r16 30d26: 08 95 ret 00030d28 : } 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) 30d28: 8f 92 push r8 30d2a: 9f 92 push r9 30d2c: af 92 push r10 30d2e: bf 92 push r11 30d30: cf 92 push r12 30d32: df 92 push r13 30d34: ef 92 push r14 30d36: ff 92 push r15 30d38: 0f 93 push r16 30d3a: 1f 93 push r17 30d3c: cf 93 push r28 30d3e: df 93 push r29 30d40: 1f 92 push r1 30d42: cd b7 in r28, 0x3d ; 61 30d44: de b7 in r29, 0x3e ; 62 30d46: 6b 01 movw r12, r22 30d48: 7c 01 movw r14, r24 30d4a: 49 01 movw r8, r18 30d4c: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30d4e: 03 30 cpi r16, 0x03 ; 3 30d50: 19 f4 brne .+6 ; 0x30d58 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30d52: 8c e5 ldi r24, 0x5C ; 92 30d54: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30d56: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30d58: 81 14 cp r8, r1 30d5a: 91 04 cpc r9, r1 30d5c: a1 04 cpc r10, r1 30d5e: b1 04 cpc r11, r1 30d60: 09 f4 brne .+2 ; 0x30d64 30d62: 59 c0 rjmp .+178 ; 0x30e16 #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30d64: 8e 2d mov r24, r14 30d66: 0e 94 4d 78 call 0xf09a ; 0xf09a #endif print_hex_byte((val >> 8) & 0xFF); 30d6a: 8d 2d mov r24, r13 30d6c: 0e 94 4d 78 call 0xf09a ; 0xf09a print_hex_byte(val & 0xFF); 30d70: 8c 2d mov r24, r12 30d72: 0e 94 4d 78 call 0xf09a ; 0xf09a XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30d76: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 30d7a: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 30d7e: 80 e2 ldi r24, 0x20 ; 32 30d80: 90 e0 ldi r25, 0x00 ; 0 30d82: 0f 94 ae db call 0x3b75c ; 0x3b75c uint8_t count_line = countperline; 30d86: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30d88: 19 82 std Y+1, r1 ; 0x01 switch (type) 30d8a: 01 30 cpi r16, 0x01 ; 1 30d8c: b1 f1 breq .+108 ; 0x30dfa 30d8e: 88 f1 brcs .+98 ; 0x30df2 30d90: 03 30 cpi r16, 0x03 ; 3 30d92: b9 f1 breq .+110 ; 0x30e02 case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30d94: 8f ef ldi r24, 0xFF ; 255 30d96: c8 1a sub r12, r24 30d98: d8 0a sbc r13, r24 30d9a: e8 0a sbc r14, r24 30d9c: f8 0a sbc r15, r24 putchar(' '); 30d9e: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 30da2: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 30da6: 80 e2 ldi r24, 0x20 ; 32 30da8: 90 e0 ldi r25, 0x00 ; 0 30daa: 0f 94 ae db call 0x3b75c ; 0x3b75c print_hex_byte(data); 30dae: 89 81 ldd r24, Y+1 ; 0x01 30db0: 0e 94 4d 78 call 0xf09a ; 0xf09a count_line--; 30db4: 11 50 subi r17, 0x01 ; 1 count--; 30db6: 81 e0 ldi r24, 0x01 ; 1 30db8: 88 1a sub r8, r24 30dba: 91 08 sbc r9, r1 30dbc: a1 08 sbc r10, r1 30dbe: 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)) 30dc0: 0f b6 in r0, 0x3f ; 63 30dc2: 07 fe sbrs r0, 7 30dc4: 06 c0 rjmp .+12 ; 0x30dd2 30dc6: c4 01 movw r24, r8 30dc8: 9f 71 andi r25, 0x1F ; 31 30dca: 89 2b or r24, r25 30dcc: 11 f4 brne .+4 ; 0x30dd2 manage_heater(); 30dce: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30dd2: 81 14 cp r8, r1 30dd4: 91 04 cpc r9, r1 30dd6: a1 04 cpc r10, r1 30dd8: b1 04 cpc r11, r1 30dda: 11 f0 breq .+4 ; 0x30de0 30ddc: 11 11 cpse r17, r1 30dde: d4 cf rjmp .-88 ; 0x30d88 // 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'); 30de0: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 30de4: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 30de8: 8a e0 ldi r24, 0x0A ; 10 30dea: 90 e0 ldi r25, 0x00 ; 0 30dec: 0f 94 ae db call 0x3b75c ; 0x3b75c 30df0: b3 cf rjmp .-154 ; 0x30d58 while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30df2: f6 01 movw r30, r12 30df4: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30df6: 89 83 std Y+1, r24 ; 0x01 30df8: cd cf rjmp .-102 ; 0x30d94 30dfa: c6 01 movw r24, r12 30dfc: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 30e00: fa cf rjmp .-12 ; 0x30df6 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; 30e02: 21 e0 ldi r18, 0x01 ; 1 30e04: 30 e0 ldi r19, 0x00 ; 0 30e06: ae 01 movw r20, r28 30e08: 4f 5f subi r20, 0xFF ; 255 30e0a: 5f 4f sbci r21, 0xFF ; 255 30e0c: c7 01 movw r24, r14 30e0e: b6 01 movw r22, r12 30e10: 0e 94 76 e3 call 0x1c6ec ; 0x1c6ec 30e14: bf cf rjmp .-130 ; 0x30d94 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30e16: 0f 90 pop r0 30e18: df 91 pop r29 30e1a: cf 91 pop r28 30e1c: 1f 91 pop r17 30e1e: 0f 91 pop r16 30e20: ff 90 pop r15 30e22: ef 90 pop r14 30e24: df 90 pop r13 30e26: cf 90 pop r12 30e28: bf 90 pop r11 30e2a: af 90 pop r10 30e2c: 9f 90 pop r9 30e2e: 8f 90 pop r8 30e30: 08 95 ret 00030e32 : 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 30e32: e7 e0 ldi r30, 0x07 ; 7 30e34: f1 e0 ldi r31, 0x01 ; 1 30e36: 80 81 ld r24, Z 30e38: 8e 7f andi r24, 0xFE ; 254 30e3a: 80 83 st Z, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup 30e3c: 9f b7 in r25, 0x3f ; 63 30e3e: f8 94 cli 30e40: e8 e0 ldi r30, 0x08 ; 8 30e42: f1 e0 ldi r31, 0x01 ; 1 30e44: 80 81 ld r24, Z 30e46: 8e 7f andi r24, 0xFE ; 254 30e48: 80 83 st Z, r24 30e4a: 9f bf out 0x3f, r25 ; 63 state = State::disabled; 30e4c: 10 92 85 17 sts 0x1785, r1 ; 0x801785 } 30e50: 08 95 ret 00030e52 : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 30e52: 80 91 85 17 lds r24, 0x1785 ; 0x801785 30e56: 83 30 cpi r24, 0x03 ; 3 30e58: 11 f4 brne .+4 ; 0x30e5e fsensor.deinit(); // deinit first if there was an error. 30e5a: 0f 94 19 87 call 0x30e32 ; 0x30e32 } // puts_P(PSTR("fsensor::init()")); SET_INPUT(IR_SENSOR_PIN); // input mode 30e5e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 30e62: 8e 7f andi r24, 0xFE ; 254 30e64: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 30e68: 9f b7 in r25, 0x3f ; 63 30e6a: f8 94 cli 30e6c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30e70: 81 60 ori r24, 0x01 ; 1 30e72: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30e76: 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(); } 30e78: 85 e8 ldi r24, 0x85 ; 133 30e7a: 97 e1 ldi r25, 0x17 ; 23 30e7c: 0e 94 95 75 call 0xeb2a ; 0xeb2a 30e80: 85 e8 ldi r24, 0x85 ; 133 30e82: 97 e1 ldi r25, 0x17 ; 23 30e84: 0e 94 95 75 call 0xeb2a ; 0xeb2a #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); 30e88: 88 e4 ldi r24, 0x48 ; 72 30e8a: 9d e0 ldi r25, 0x0D ; 13 30e8c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 30e90: 80 93 8e 17 sts 0x178E, r24 ; 0x80178e } 30e94: 08 95 ret 00030e96 : //! //! @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) 30e96: cf 92 push r12 30e98: df 92 push r13 30e9a: ef 92 push r14 30e9c: ff 92 push r15 30e9e: 69 01 movw r12, r18 30ea0: 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); 30ea2: 2d ec ldi r18, 0xCD ; 205 30ea4: 3c ec ldi r19, 0xCC ; 204 30ea6: 4c e4 ldi r20, 0x4C ; 76 30ea8: 5e e3 ldi r21, 0x3E ; 62 30eaa: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 30eae: 2d ec ldi r18, 0xCD ; 205 30eb0: 3c ec ldi r19, 0xCC ; 204 30eb2: 4c e4 ldi r20, 0x4C ; 76 30eb4: 5e e3 ldi r21, 0x3E ; 62 30eb6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 30eba: 2d ef ldi r18, 0xFD ; 253 30ebc: 3d ea ldi r19, 0xAD ; 173 30ebe: 40 e0 ldi r20, 0x00 ; 0 30ec0: 5d e3 ldi r21, 0x3D ; 61 30ec2: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 30ec6: a7 01 movw r20, r14 30ec8: 96 01 movw r18, r12 30eca: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 30ece: 24 e2 ldi r18, 0x24 ; 36 30ed0: 30 ef ldi r19, 0xF0 ; 240 30ed2: 49 e1 ldi r20, 0x19 ; 25 30ed4: 50 e4 ldi r21, 0x40 ; 64 30ed6: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> } 30eda: ff 90 pop r15 30edc: ef 90 pop r14 30ede: df 90 pop r13 30ee0: cf 90 pop r12 30ee2: 08 95 ret 00030ee4 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 30ee4: 9f b7 in r25, 0x3f ; 63 30ee6: 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)); 30ee8: 80 e1 ldi r24, 0x10 ; 16 30eea: e1 e5 ldi r30, 0x51 ; 81 30eec: f7 e0 ldi r31, 0x07 ; 7 30eee: a1 e6 ldi r26, 0x61 ; 97 30ef0: b7 e0 ldi r27, 0x07 ; 7 30ef2: 01 90 ld r0, Z+ 30ef4: 0d 92 st X+, r0 30ef6: 8a 95 dec r24 30ef8: e1 f7 brne .-8 ; 0x30ef2 CRITICAL_SECTION_END; 30efa: 9f bf out 0x3f, r25 ; 63 } 30efc: 08 95 ret 00030efe : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 30efe: 89 e0 ldi r24, 0x09 ; 9 30f00: 80 93 72 07 sts 0x0772, r24 ; 0x800772 }; const char *ProgressCodeToText(ProgressCode pc) { // @@TODO ?? a better fallback option? return ((uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0]))) ? static_cast(pgm_read_ptr(&progressTexts[(uint16_t)pc])) 30f04: e7 ef ldi r30, 0xF7 ; 247 30f06: f6 ea ldi r31, 0xA6 ; 166 30f08: 85 91 lpm r24, Z+ 30f0a: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 30f0c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 30f10: 0d 94 be 0b jmp 0x2177c ; 0x2177c 00030f14 : 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){ 30f14: cf 93 push r28 30f16: c8 2f mov r28, r24 extruder = ex; 30f18: 80 93 7c 13 sts 0x137C, r24 ; 0x80137c MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 30f1c: 84 e1 ldi r24, 0x14 ; 20 30f1e: 9a ea ldi r25, 0xAA ; 170 30f20: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 30f24: 89 ec ldi r24, 0xC9 ; 201 30f26: 96 ea ldi r25, 0xA6 ; 166 30f28: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 30f2c: 8f eb ldi r24, 0xBF ; 191 30f2e: 96 ea ldi r25, 0xA6 ; 166 30f30: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN((int)ex); 30f34: 8c 2f mov r24, r28 30f36: 90 e0 ldi r25, 0x00 ; 0 } 30f38: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 30f3a: 0d 94 ce 76 jmp 0x2ed9c ; 0x2ed9c 00030f3e : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 30f3e: 0f 93 push r16 30f40: 1f 93 push r17 30f42: cf 93 push r28 30f44: df 93 push r29 30f46: 00 d0 rcall .+0 ; 0x30f48 30f48: 00 d0 rcall .+0 ; 0x30f4a 30f4a: 1f 92 push r1 30f4c: 1f 92 push r1 30f4e: cd b7 in r28, 0x3d ; 61 30f50: de b7 in r29, 0x3e ; 62 30f52: 08 ee ldi r16, 0xE8 ; 232 30f54: 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; 30f56: 1d 82 std Y+5, r1 ; 0x05 30f58: 1e 82 std Y+6, r1 ; 0x06 30f5a: 1f 82 std Y+7, r1 ; 0x07 30f5c: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 30f5e: 19 82 std Y+1, r1 ; 0x01 30f60: 1a 82 std Y+2, r1 ; 0x02 30f62: 1b 82 std Y+3, r1 ; 0x03 30f64: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 30f66: ae 01 movw r20, r28 30f68: 4b 5f subi r20, 0xFB ; 251 30f6a: 5f 4f sbci r21, 0xFF ; 255 30f6c: 6f e6 ldi r22, 0x6F ; 111 30f6e: 80 e0 ldi r24, 0x00 ; 0 30f70: 0f 94 7c 39 call 0x272f8 ; 0x272f8 tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 30f74: ae 01 movw r20, r28 30f76: 4f 5f subi r20, 0xFF ; 255 30f78: 5f 4f sbci r21, 0xFF ; 255 30f7a: 6f e6 ldi r22, 0x6F ; 111 30f7c: 81 e0 ldi r24, 0x01 ; 1 30f7e: 0f 94 7c 39 call 0x272f8 ; 0x272f8 // 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); 30f82: 8d 81 ldd r24, Y+5 ; 0x05 30f84: 9e 81 ldd r25, Y+6 ; 0x06 30f86: af 81 ldd r26, Y+7 ; 0x07 30f88: b8 85 ldd r27, Y+8 ; 0x08 30f8a: b7 fd sbrc r27, 7 30f8c: 07 c0 rjmp .+14 ; 0x30f9c tmc2130_check_overtemp(); 30f8e: 0f 94 f6 3f call 0x27fec ; 0x27fec 30f92: 01 50 subi r16, 0x01 ; 1 30f94: 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)) 30f96: f9 f6 brne .-66 ; 0x30f56 30f98: 80 e0 ldi r24, 0x00 ; 0 30f9a: 09 c0 rjmp .+18 ; 0x30fae 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); 30f9c: 89 81 ldd r24, Y+1 ; 0x01 30f9e: 9a 81 ldd r25, Y+2 ; 0x02 30fa0: ab 81 ldd r26, Y+3 ; 0x03 30fa2: bc 81 ldd r27, Y+4 ; 0x04 30fa4: b7 ff sbrs r27, 7 30fa6: f3 cf rjmp .-26 ; 0x30f8e tmc2130_check_overtemp(); 30fa8: 0f 94 f6 3f call 0x27fec ; 0x27fec 30fac: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 30fae: 28 96 adiw r28, 0x08 ; 8 30fb0: 0f b6 in r0, 0x3f ; 63 30fb2: f8 94 cli 30fb4: de bf out 0x3e, r29 ; 62 30fb6: 0f be out 0x3f, r0 ; 63 30fb8: cd bf out 0x3d, r28 ; 61 30fba: df 91 pop r29 30fbc: cf 91 pop r28 30fbe: 1f 91 pop r17 30fc0: 0f 91 pop r16 30fc2: 08 95 ret 00030fc4 : 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) { 30fc4: 1f 93 push r17 30fc6: cf 93 push r28 30fc8: df 93 push r29 30fca: ec 01 movw r28, r24 30fcc: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 30fce: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 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))); 30fd2: fe 01 movw r30, r28 30fd4: 34 96 adiw r30, 0x04 ; 4 30fd6: 25 91 lpm r18, Z+ 30fd8: 35 91 lpm r19, Z+ 30fda: 45 91 lpm r20, Z+ 30fdc: 54 91 lpm r21, Z 30fde: fe 01 movw r30, r28 30fe0: 65 91 lpm r22, Z+ 30fe2: 75 91 lpm r23, Z+ 30fe4: 85 91 lpm r24, Z+ 30fe6: 94 91 lpm r25, Z 30fe8: 0f 94 e5 c2 call 0x385ca ; 0x385ca step++; 30fec: 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) { 30fee: 11 50 subi r17, 0x01 ; 1 30ff0: 81 f7 brne .-32 ; 0x30fd2 30ff2: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // 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(); } 30ff6: df 91 pop r29 30ff8: cf 91 pop r28 30ffa: 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(); 30ffc: 0d 94 e3 c2 jmp 0x385c6 ; 0x385c6 00031000 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 31000: 0e 94 56 68 call 0xd0ac ; 0xd0ac 31004: 81 11 cpse r24, r1 31006: 04 c0 rjmp .+8 ; 0x31010 lcd_setstatuspgm(MSG_WELCOME); 31008: 8d ea ldi r24, 0xAD ; 173 3100a: 90 e7 ldi r25, 0x70 ; 112 3100c: 0f 94 be 0b call 0x2177c ; 0x2177c } custom_message_type = CustomMsg::Status; 31010: 10 92 72 07 sts 0x0772, r1 ; 0x800772 } 31014: 08 95 ret 00031016 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 31016: 80 91 95 13 lds r24, 0x1395 ; 0x801395 3101a: 88 23 and r24, r24 3101c: 11 f0 breq .+4 ; 0x31022 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; 3101e: 81 e0 ldi r24, 0x01 ; 1 31020: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 31022: 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; } } 31024: 08 95 ret 00031026 : } 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) 31026: 2f 92 push r2 31028: 3f 92 push r3 3102a: 4f 92 push r4 3102c: 5f 92 push r5 3102e: 6f 92 push r6 31030: 7f 92 push r7 31032: 8f 92 push r8 31034: 9f 92 push r9 31036: af 92 push r10 31038: bf 92 push r11 3103a: cf 92 push r12 3103c: df 92 push r13 3103e: ef 92 push r14 31040: ff 92 push r15 31042: 0f 93 push r16 31044: 1f 93 push r17 31046: cf 93 push r28 31048: df 93 push r29 3104a: cd b7 in r28, 0x3d ; 61 3104c: de b7 in r29, 0x3e ; 62 3104e: 2d 97 sbiw r28, 0x0d ; 13 31050: 0f b6 in r0, 0x3f ; 63 31052: f8 94 cli 31054: de bf out 0x3e, r29 ; 62 31056: 0f be out 0x3f, r0 ; 63 31058: cd bf out 0x3d, r28 ; 61 3105a: 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; 3105c: 41 2c mov r4, r1 3105e: 51 2c mov r5, r1 31060: 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; 31062: 6e 31 cpi r22, 0x1E ; 30 31064: 90 f0 brcs .+36 ; 0x3108a 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 31066: 69 3c cpi r22, 0xC9 ; 201 31068: 08 f0 brcs .+2 ; 0x3106c 3106a: 68 ec ldi r22, 0xC8 ; 200 3106c: 70 e0 ldi r23, 0x00 ; 0 3106e: 68 51 subi r22, 0x18 ; 24 31070: 7c 4f sbci r23, 0xFC ; 252 31072: 90 e0 ldi r25, 0x00 ; 0 31074: 80 e0 ldi r24, 0x00 ; 0 31076: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 3107a: 20 e0 ldi r18, 0x00 ; 0 3107c: 30 e0 ldi r19, 0x00 ; 0 3107e: 4a e7 ldi r20, 0x7A ; 122 31080: 54 e4 ldi r21, 0x44 ; 68 31082: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 31086: 2b 01 movw r4, r22 31088: 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) 3108a: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 3108e: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 31092: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 31096: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 3109a: 89 83 std Y+1, r24 ; 0x01 3109c: 9a 83 std Y+2, r25 ; 0x02 3109e: ab 83 std Y+3, r26 ; 0x03 310a0: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 310a2: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 310a6: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 310aa: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 310ae: 8d 83 std Y+5, r24 ; 0x05 310b0: 9e 83 std Y+6, r25 ; 0x06 310b2: 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); 310b4: 20 e0 ldi r18, 0x00 ; 0 310b6: 30 e0 ldi r19, 0x00 ; 0 310b8: 47 ef ldi r20, 0xF7 ; 247 310ba: 50 e0 ldi r21, 0x00 ; 0 310bc: 69 ee ldi r22, 0xE9 ; 233 310be: 8e 2d mov r24, r14 310c0: 0f 94 d6 39 call 0x273ac ; 0x273ac 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 310c4: 81 2c mov r8, r1 310c6: 91 2c mov r9, r1 310c8: 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 310ca: 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 310cc: 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 310ce: 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 310d0: 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 310d2: 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) 310d4: 2f 2c mov r2, r15 310d6: 31 2c mov r3, r1 310d8: 8f 2d mov r24, r15 310da: 8f 71 andi r24, 0x1F ; 31 310dc: 88 87 std Y+8, r24 ; 0x08 310de: 81 11 cpse r24, r1 310e0: 03 c0 rjmp .+6 ; 0x310e8 reg = 0; 310e2: 81 2c mov r8, r1 310e4: 91 2c mov r9, r1 310e6: 54 01 movw r10, r8 310e8: b1 01 movw r22, r2 310ea: 03 2c mov r0, r3 310ec: 00 0c add r0, r0 310ee: 88 0b sbc r24, r24 310f0: 99 0b sbc r25, r25 310f2: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 310f6: 2b ed ldi r18, 0xDB ; 219 310f8: 3f e0 ldi r19, 0x0F ; 15 310fa: 49 ec ldi r20, 0xC9 ; 201 310fc: 50 e4 ldi r21, 0x40 ; 64 310fe: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31102: 6a 87 std Y+10, r22 ; 0x0a 31104: 7b 87 std Y+11, r23 ; 0x0b 31106: 8c 87 std Y+12, r24 ; 0x0c 31108: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 3110a: 20 e0 ldi r18, 0x00 ; 0 3110c: 30 e0 ldi r19, 0x00 ; 0 3110e: a9 01 movw r20, r18 31110: c3 01 movw r24, r6 31112: b2 01 movw r22, r4 31114: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 31118: 81 11 cpse r24, r1 3111a: 4d c0 rjmp .+154 ; 0x311b6 vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 3111c: 2b ed ldi r18, 0xDB ; 219 3111e: 3f e0 ldi r19, 0x0F ; 15 31120: 49 e4 ldi r20, 0x49 ; 73 31122: 50 e4 ldi r21, 0x40 ; 64 31124: 6a 85 ldd r22, Y+10 ; 0x0a 31126: 7b 85 ldd r23, Y+11 ; 0x0b 31128: 8c 85 ldd r24, Y+12 ; 0x0c 3112a: 9d 85 ldd r25, Y+13 ; 0x0d 3112c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31130: 20 e0 ldi r18, 0x00 ; 0 31132: 30 e0 ldi r19, 0x00 ; 0 31134: 40 e8 ldi r20, 0x80 ; 128 31136: 5a e3 ldi r21, 0x3A ; 58 31138: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3113c: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 31140: 20 e0 ldi r18, 0x00 ; 0 31142: 30 e0 ldi r19, 0x00 ; 0 31144: 48 e7 ldi r20, 0x78 ; 120 31146: 53 e4 ldi r21, 0x43 ; 67 31148: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3114c: 20 e0 ldi r18, 0x00 ; 0 3114e: 30 e0 ldi r19, 0x00 ; 0 31150: 40 e0 ldi r20, 0x00 ; 0 31152: 5f e3 ldi r21, 0x3F ; 63 31154: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31158: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 3115c: cc 24 eor r12, r12 3115e: ca 94 dec r12 31160: 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 31162: 8c 2d mov r24, r12 31164: 99 85 ldd r25, Y+9 ; 0x09 31166: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 31168: 8d 15 cp r24, r13 3116a: f9 f0 breq .+62 ; 0x311aa else if (dA == d1) b = 1; //delta == delta1 => bit=1 3116c: 80 17 cp r24, r16 3116e: 09 f4 brne .+2 ; 0x31172 31170: 71 c0 rjmp .+226 ; 0x31254 else { if (dA < d0) // delta < delta0 => switch wbit down 31172: 8d 15 cp r24, r13 31174: 0c f0 brlt .+2 ; 0x31178 31176: 53 c0 rjmp .+166 ; 0x3121e { //printf("dn\n"); b = 0; switch (dA) 31178: 88 23 and r24, r24 3117a: e9 f1 breq .+122 ; 0x311f6 3117c: 81 30 cpi r24, 0x01 ; 1 3117e: 09 f4 brne .+2 ; 0x31182 31180: 44 c0 rjmp .+136 ; 0x3120a 31182: 8f 3f cpi r24, 0xFF ; 255 31184: 09 f0 breq .+2 ; 0x31188 31186: 81 c0 rjmp .+258 ; 0x3128a { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 31188: e2 e0 ldi r30, 0x02 ; 2 3118a: f0 e0 ldi r31, 0x00 ; 0 3118c: ec 0f add r30, r28 3118e: fd 1f adc r31, r29 31190: e1 0f add r30, r17 31192: f1 1d adc r31, r1 31194: 10 82 st Z, r1 31196: 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++; } 31198: e5 e0 ldi r30, 0x05 ; 5 3119a: f0 e0 ldi r31, 0x00 ; 0 3119c: ec 0f add r30, r28 3119e: fd 1f adc r31, r29 311a0: e1 0f add r30, r17 311a2: f1 1d adc r31, r1 311a4: f0 82 st Z, r15 311a6: 1f 5f subi r17, 0xFF ; 255 311a8: 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) 311aa: 14 30 cpi r17, 0x04 ; 4 311ac: 08 f4 brcc .+2 ; 0x311b0 311ae: 56 c0 rjmp .+172 ; 0x3125c 311b0: 6c c0 rjmp .+216 ; 0x3128a 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); 311b2: f8 2e mov r15, r24 311b4: 8f cf rjmp .-226 ; 0x310d4 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); 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: 6a 85 ldd r22, Y+10 ; 0x0a 311c0: 7b 85 ldd r23, Y+11 ; 0x0b 311c2: 8c 85 ldd r24, Y+12 ; 0x0c 311c4: 9d 85 ldd r25, Y+13 ; 0x0d 311c6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 311ca: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 311ce: a3 01 movw r20, r6 311d0: 92 01 movw r18, r4 311d2: 0f 94 de e1 call 0x3c3bc ; 0x3c3bc 311d6: 20 e0 ldi r18, 0x00 ; 0 311d8: 30 e0 ldi r19, 0x00 ; 0 311da: 47 e7 ldi r20, 0x77 ; 119 311dc: 53 e4 ldi r21, 0x43 ; 67 311de: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 311e2: 20 e0 ldi r18, 0x00 ; 0 311e4: 30 e0 ldi r19, 0x00 ; 0 311e6: 40 e0 ldi r20, 0x00 ; 0 311e8: 5f e3 ldi r21, 0x3F ; 63 311ea: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 311ee: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 311f2: c6 2e mov r12, r22 311f4: b6 cf rjmp .-148 ; 0x31162 //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; 311f6: e2 e0 ldi r30, 0x02 ; 2 311f8: f0 e0 ldi r31, 0x00 ; 0 311fa: ec 0f add r30, r28 311fc: fd 1f adc r31, r29 311fe: e1 0f add r30, r17 31200: f1 1d adc r31, r1 31202: 91 e0 ldi r25, 0x01 ; 1 31204: 90 83 st Z, r25 31206: 01 e0 ldi r16, 0x01 ; 1 31208: c7 cf rjmp .-114 ; 0x31198 case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 3120a: e2 e0 ldi r30, 0x02 ; 2 3120c: f0 e0 ldi r31, 0x00 ; 0 3120e: ec 0f add r30, r28 31210: fd 1f adc r31, r29 31212: e1 0f add r30, r17 31214: f1 1d adc r31, r1 31216: 92 e0 ldi r25, 0x02 ; 2 31218: 90 83 st Z, r25 3121a: 02 e0 ldi r16, 0x02 ; 2 3121c: bd cf rjmp .-134 ; 0x31198 default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 3121e: 08 17 cp r16, r24 31220: a4 f5 brge .+104 ; 0x3128a { //printf("up\n"); b = 1; switch (dA) 31222: 82 30 cpi r24, 0x02 ; 2 31224: 09 f4 brne .+2 ; 0x31228 31226: 80 c0 rjmp .+256 ; 0x31328 31228: 83 30 cpi r24, 0x03 ; 3 3122a: 09 f4 brne .+2 ; 0x3122e 3122c: 88 c0 rjmp .+272 ; 0x3133e 3122e: 81 30 cpi r24, 0x01 ; 1 31230: 61 f5 brne .+88 ; 0x3128a { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 31232: e2 e0 ldi r30, 0x02 ; 2 31234: f0 e0 ldi r31, 0x00 ; 0 31236: ec 0f add r30, r28 31238: fd 1f adc r31, r29 3123a: e1 0f add r30, r17 3123c: f1 1d adc r31, r1 3123e: 80 83 st Z, r24 31240: 01 e0 ldi r16, 0x01 ; 1 31242: 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++; } 31244: e5 e0 ldi r30, 0x05 ; 5 31246: f0 e0 ldi r31, 0x00 ; 0 31248: ec 0f add r30, r28 3124a: fd 1f adc r31, r29 3124c: e1 0f add r30, r17 3124e: f1 1d adc r31, r1 31250: f0 82 st Z, r15 31252: 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) 31254: 14 30 cpi r17, 0x04 ; 4 31256: c8 f4 brcc .+50 ; 0x3128a //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 31258: 68 94 set 3125a: b7 f8 bld r11, 7 if ((i & 31) == 31) 3125c: 88 85 ldd r24, Y+8 ; 0x08 3125e: 8f 31 cpi r24, 0x1F ; 31 31260: 09 f0 breq .+2 ; 0x31264 31262: 78 c0 rjmp .+240 ; 0x31354 tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 31264: b1 01 movw r22, r2 31266: e5 e0 ldi r30, 0x05 ; 5 31268: 75 95 asr r23 3126a: 67 95 ror r22 3126c: ea 95 dec r30 3126e: e1 f7 brne .-8 ; 0x31268 //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); 31270: 60 5a subi r22, 0xA0 ; 160 31272: 60 68 ori r22, 0x80 ; 128 31274: a5 01 movw r20, r10 31276: 94 01 movw r18, r8 31278: 8e 2d mov r24, r14 3127a: 0f 94 d6 39 call 0x273ac ; 0x273ac 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); 3127e: 81 e0 ldi r24, 0x01 ; 1 31280: 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; 31282: 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); 31284: 9f ef ldi r25, 0xFF ; 255 31286: f9 12 cpse r15, r25 31288: 94 cf rjmp .-216 ; 0x311b2 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; 3128a: 2a 81 ldd r18, Y+2 ; 0x02 3128c: 30 e0 ldi r19, 0x00 ; 0 3128e: 50 e0 ldi r21, 0x00 ; 0 31290: 40 e0 ldi r20, 0x00 ; 0 31292: 82 e0 ldi r24, 0x02 ; 2 31294: 22 0f add r18, r18 31296: 33 1f adc r19, r19 31298: 44 1f adc r20, r20 3129a: 55 1f adc r21, r21 3129c: 8a 95 dec r24 3129e: d1 f7 brne .-12 ; 0x31294 val |= ((uint32_t)w2) << 4; 312a0: 8b 80 ldd r8, Y+3 ; 0x03 312a2: 91 2c mov r9, r1 312a4: b1 2c mov r11, r1 312a6: a1 2c mov r10, r1 312a8: 94 e0 ldi r25, 0x04 ; 4 312aa: 88 0c add r8, r8 312ac: 99 1c adc r9, r9 312ae: aa 1c adc r10, r10 312b0: bb 1c adc r11, r11 312b2: 9a 95 dec r25 312b4: d1 f7 brne .-12 ; 0x312aa 312b6: 82 2a or r8, r18 312b8: 93 2a or r9, r19 312ba: a4 2a or r10, r20 312bc: 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); 312be: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 312c0: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 312c2: 8c 81 ldd r24, Y+4 ; 0x04 312c4: 90 e0 ldi r25, 0x00 ; 0 312c6: b0 e0 ldi r27, 0x00 ; 0 312c8: a0 e0 ldi r26, 0x00 ; 0 312ca: 9c 01 movw r18, r24 312cc: ad 01 movw r20, r26 312ce: 66 e0 ldi r22, 0x06 ; 6 312d0: 22 0f add r18, r18 312d2: 33 1f adc r19, r19 312d4: 44 1f adc r20, r20 312d6: 55 1f adc r21, r21 312d8: 6a 95 dec r22 312da: d1 f7 brne .-12 ; 0x312d0 312dc: 28 29 or r18, r8 312de: 39 29 or r19, r9 312e0: 4a 29 or r20, r10 312e2: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 312e4: 8d 81 ldd r24, Y+5 ; 0x05 312e6: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 312e8: 8e 81 ldd r24, Y+6 ; 0x06 312ea: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 312ec: 8f 81 ldd r24, Y+7 ; 0x07 312ee: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 312f0: 68 ee ldi r22, 0xE8 ; 232 312f2: 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]); } 312f4: 2d 96 adiw r28, 0x0d ; 13 312f6: 0f b6 in r0, 0x3f ; 63 312f8: f8 94 cli 312fa: de bf out 0x3e, r29 ; 62 312fc: 0f be out 0x3f, r0 ; 63 312fe: cd bf out 0x3d, r28 ; 61 31300: df 91 pop r29 31302: cf 91 pop r28 31304: 1f 91 pop r17 31306: 0f 91 pop r16 31308: ff 90 pop r15 3130a: ef 90 pop r14 3130c: df 90 pop r13 3130e: cf 90 pop r12 31310: bf 90 pop r11 31312: af 90 pop r10 31314: 9f 90 pop r9 31316: 8f 90 pop r8 31318: 7f 90 pop r7 3131a: 6f 90 pop r6 3131c: 5f 90 pop r5 3131e: 4f 90 pop r4 31320: 3f 90 pop r3 31322: 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); 31324: 0d 94 d6 39 jmp 0x273ac ; 0x273ac //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; 31328: e2 e0 ldi r30, 0x02 ; 2 3132a: f0 e0 ldi r31, 0x00 ; 0 3132c: ec 0f add r30, r28 3132e: fd 1f adc r31, r29 31330: e1 0f add r30, r17 31332: f1 1d adc r31, r1 31334: 80 83 st Z, r24 31336: 02 e0 ldi r16, 0x02 ; 2 31338: dd 24 eor r13, r13 3133a: d3 94 inc r13 3133c: 83 cf rjmp .-250 ; 0x31244 case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 3133e: e2 e0 ldi r30, 0x02 ; 2 31340: f0 e0 ldi r31, 0x00 ; 0 31342: ec 0f add r30, r28 31344: fd 1f adc r31, r29 31346: e1 0f add r30, r17 31348: f1 1d adc r31, r1 3134a: 80 83 st Z, r24 3134c: 03 e0 ldi r16, 0x03 ; 3 3134e: f2 e0 ldi r31, 0x02 ; 2 31350: df 2e mov r13, r31 31352: 78 cf rjmp .-272 ; 0x31244 //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; 31354: b6 94 lsr r11 31356: a7 94 ror r10 31358: 97 94 ror r9 3135a: 87 94 ror r8 3135c: 90 cf rjmp .-224 ; 0x3127e 0003135e : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 3135e: 8f 92 push r8 31360: 9f 92 push r9 31362: af 92 push r10 31364: bf 92 push r11 31366: cf 92 push r12 31368: df 92 push r13 3136a: ef 92 push r14 3136c: ff 92 push r15 3136e: 90 91 3c 07 lds r25, 0x073C ; 0x80073c // Perform FW retraction, just if needed, but behave as if the move has never took place in // order to keep E/Z coordinates unchanged. This is done by manipulating the internal planner // position, which requires a sync if(retracting && !retracted[active_extruder]) { 31372: 88 23 and r24, r24 31374: 09 f4 brne .+2 ; 0x31378 31376: 9d c0 rjmp .+314 ; 0x314b2 31378: 91 11 cpse r25, r1 3137a: 92 c0 rjmp .+292 ; 0x314a0 st_synchronize(); 3137c: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 set_destination_to_current(); 31380: 0e 94 00 69 call 0xd200 ; 0xd200 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 31384: 60 91 94 02 lds r22, 0x0294 ; 0x800294 31388: 70 91 95 02 lds r23, 0x0295 ; 0x800295 3138c: 07 2e mov r0, r23 3138e: 00 0c add r0, r0 31390: 88 0b sbc r24, r24 31392: 99 0b sbc r25, r25 31394: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 31398: 20 91 ee 06 lds r18, 0x06EE ; 0x8006ee 3139c: 30 91 ef 06 lds r19, 0x06EF ; 0x8006ef 313a0: 40 91 f0 06 lds r20, 0x06F0 ; 0x8006f0 313a4: 50 91 f1 06 lds r21, 0x06F1 ; 0x8006f1 313a8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 313ac: 2a e0 ldi r18, 0x0A ; 10 313ae: 37 ed ldi r19, 0xD7 ; 215 313b0: 43 e2 ldi r20, 0x23 ; 35 313b2: 5c e3 ldi r21, 0x3C ; 60 313b4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 313b8: 20 91 4c 07 lds r18, 0x074C ; 0x80074c 313bc: 30 91 4d 07 lds r19, 0x074D ; 0x80074d 313c0: 40 91 4e 07 lds r20, 0x074E ; 0x80074e 313c4: 50 91 4f 07 lds r21, 0x074F ; 0x80074f 313c8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 313cc: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 313d0: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 313d4: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 313d8: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_set_e_position(current_position[E_AXIS]); 313dc: 8c e4 ldi r24, 0x4C ; 76 313de: 97 e0 ldi r25, 0x07 ; 7 313e0: 0f 94 99 aa call 0x35532 ; 0x35532 float oldFeedrate = feedrate; 313e4: c0 90 90 02 lds r12, 0x0290 ; 0x800290 313e8: d0 90 91 02 lds r13, 0x0291 ; 0x800291 313ec: e0 90 92 02 lds r14, 0x0292 ; 0x800292 313f0: f0 90 93 02 lds r15, 0x0293 ; 0x800293 feedrate=cs.retract_feedrate*60; 313f4: 20 e0 ldi r18, 0x00 ; 0 313f6: 30 e0 ldi r19, 0x00 ; 0 313f8: 40 e7 ldi r20, 0x70 ; 112 313fa: 52 e4 ldi r21, 0x42 ; 66 313fc: 60 91 f2 06 lds r22, 0x06F2 ; 0x8006f2 31400: 70 91 f3 06 lds r23, 0x06F3 ; 0x8006f3 31404: 80 91 f4 06 lds r24, 0x06F4 ; 0x8006f4 31408: 90 91 f5 06 lds r25, 0x06F5 ; 0x8006f5 3140c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31410: 60 93 90 02 sts 0x0290, r22 ; 0x800290 31414: 70 93 91 02 sts 0x0291, r23 ; 0x800291 31418: 80 93 92 02 sts 0x0292, r24 ; 0x800292 3141c: 90 93 93 02 sts 0x0293, r25 ; 0x800293 retracted[active_extruder]=true; 31420: 81 e0 ldi r24, 0x01 ; 1 31422: 80 93 3c 07 sts 0x073C, r24 ; 0x80073c prepare_move(); 31426: 90 e0 ldi r25, 0x00 ; 0 31428: 80 e0 ldi r24, 0x00 ; 0 3142a: 0e 94 ce 6c call 0xd99c ; 0xd99c if(cs.retract_zlift) { 3142e: 20 e0 ldi r18, 0x00 ; 0 31430: 30 e0 ldi r19, 0x00 ; 0 31432: a9 01 movw r20, r18 31434: 60 91 f6 06 lds r22, 0x06F6 ; 0x8006f6 31438: 70 91 f7 06 lds r23, 0x06F7 ; 0x8006f7 3143c: 80 91 f8 06 lds r24, 0x06F8 ; 0x8006f8 31440: 90 91 f9 06 lds r25, 0x06F9 ; 0x8006f9 31444: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 31448: 88 23 and r24, r24 3144a: 11 f1 breq .+68 ; 0x31490 st_synchronize(); 3144c: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position[Z_AXIS]-=cs.retract_zlift; 31450: 20 91 f6 06 lds r18, 0x06F6 ; 0x8006f6 31454: 30 91 f7 06 lds r19, 0x06F7 ; 0x8006f7 31458: 40 91 f8 06 lds r20, 0x06F8 ; 0x8006f8 3145c: 50 91 f9 06 lds r21, 0x06F9 ; 0x8006f9 31460: 60 91 48 07 lds r22, 0x0748 ; 0x800748 31464: 70 91 49 07 lds r23, 0x0749 ; 0x800749 31468: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3146c: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 31470: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 31474: 60 93 48 07 sts 0x0748, r22 ; 0x800748 31478: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3147c: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 31480: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_set_position_curposXYZE(); 31484: 0f 94 08 b9 call 0x37210 ; 0x37210 prepare_move(); 31488: 90 e0 ldi r25, 0x00 ; 0 3148a: 80 e0 ldi r24, 0x00 ; 0 3148c: 0e 94 ce 6c call 0xd99c ; 0xd99c } feedrate = oldFeedrate; 31490: c0 92 90 02 sts 0x0290, r12 ; 0x800290 31494: d0 92 91 02 sts 0x0291, r13 ; 0x800291 31498: e0 92 92 02 sts 0x0292, r14 ; 0x800292 3149c: 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 314a0: ff 90 pop r15 314a2: ef 90 pop r14 314a4: df 90 pop r13 314a6: cf 90 pop r12 314a8: bf 90 pop r11 314aa: af 90 pop r10 314ac: 9f 90 pop r9 314ae: 8f 90 pop r8 314b0: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 314b2: 99 23 and r25, r25 314b4: a9 f3 breq .-22 ; 0x314a0 st_synchronize(); 314b6: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 set_destination_to_current(); 314ba: 0e 94 00 69 call 0xd200 ; 0xd200 float oldFeedrate = feedrate; 314be: 80 90 90 02 lds r8, 0x0290 ; 0x800290 314c2: 90 90 91 02 lds r9, 0x0291 ; 0x800291 314c6: a0 90 92 02 lds r10, 0x0292 ; 0x800292 314ca: b0 90 93 02 lds r11, 0x0293 ; 0x800293 feedrate=cs.retract_recover_feedrate*60; 314ce: 20 e0 ldi r18, 0x00 ; 0 314d0: 30 e0 ldi r19, 0x00 ; 0 314d2: 40 e7 ldi r20, 0x70 ; 112 314d4: 52 e4 ldi r21, 0x42 ; 66 314d6: 60 91 fe 06 lds r22, 0x06FE ; 0x8006fe 314da: 70 91 ff 06 lds r23, 0x06FF ; 0x8006ff 314de: 80 91 00 07 lds r24, 0x0700 ; 0x800700 314e2: 90 91 01 07 lds r25, 0x0701 ; 0x800701 314e6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 314ea: 60 93 90 02 sts 0x0290, r22 ; 0x800290 314ee: 70 93 91 02 sts 0x0291, r23 ; 0x800291 314f2: 80 93 92 02 sts 0x0292, r24 ; 0x800292 314f6: 90 93 93 02 sts 0x0293, r25 ; 0x800293 if(cs.retract_zlift) { 314fa: c0 90 f6 06 lds r12, 0x06F6 ; 0x8006f6 314fe: d0 90 f7 06 lds r13, 0x06F7 ; 0x8006f7 31502: e0 90 f8 06 lds r14, 0x06F8 ; 0x8006f8 31506: f0 90 f9 06 lds r15, 0x06F9 ; 0x8006f9 3150a: 20 e0 ldi r18, 0x00 ; 0 3150c: 30 e0 ldi r19, 0x00 ; 0 3150e: a9 01 movw r20, r18 31510: c7 01 movw r24, r14 31512: b6 01 movw r22, r12 31514: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 31518: 88 23 and r24, r24 3151a: e1 f0 breq .+56 ; 0x31554 current_position[Z_AXIS]+=cs.retract_zlift; 3151c: a7 01 movw r20, r14 3151e: 96 01 movw r18, r12 31520: 60 91 48 07 lds r22, 0x0748 ; 0x800748 31524: 70 91 49 07 lds r23, 0x0749 ; 0x800749 31528: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3152c: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 31530: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31534: 60 93 48 07 sts 0x0748, r22 ; 0x800748 31538: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3153c: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 31540: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_set_position_curposXYZE(); 31544: 0f 94 08 b9 call 0x37210 ; 0x37210 prepare_move(); 31548: 90 e0 ldi r25, 0x00 ; 0 3154a: 80 e0 ldi r24, 0x00 ; 0 3154c: 0e 94 ce 6c call 0xd99c ; 0xd99c st_synchronize(); 31550: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 31554: 20 91 fa 06 lds r18, 0x06FA ; 0x8006fa 31558: 30 91 fb 06 lds r19, 0x06FB ; 0x8006fb 3155c: 40 91 fc 06 lds r20, 0x06FC ; 0x8006fc 31560: 50 91 fd 06 lds r21, 0x06FD ; 0x8006fd 31564: 60 91 ee 06 lds r22, 0x06EE ; 0x8006ee 31568: 70 91 ef 06 lds r23, 0x06EF ; 0x8006ef 3156c: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 31570: 90 91 f1 06 lds r25, 0x06F1 ; 0x8006f1 31574: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31578: 6b 01 movw r12, r22 3157a: 7c 01 movw r14, r24 3157c: 60 91 94 02 lds r22, 0x0294 ; 0x800294 31580: 70 91 95 02 lds r23, 0x0295 ; 0x800295 31584: 07 2e mov r0, r23 31586: 00 0c add r0, r0 31588: 88 0b sbc r24, r24 3158a: 99 0b sbc r25, r25 3158c: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 31590: 9b 01 movw r18, r22 31592: ac 01 movw r20, r24 31594: c7 01 movw r24, r14 31596: b6 01 movw r22, r12 31598: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3159c: 2a e0 ldi r18, 0x0A ; 10 3159e: 37 ed ldi r19, 0xD7 ; 215 315a0: 43 e2 ldi r20, 0x23 ; 35 315a2: 5c e3 ldi r21, 0x3C ; 60 315a4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 315a8: 9b 01 movw r18, r22 315aa: ac 01 movw r20, r24 315ac: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 315b0: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 315b4: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 315b8: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 315bc: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 315c0: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 315c4: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 315c8: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 315cc: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_set_e_position(current_position[E_AXIS]); 315d0: 8c e4 ldi r24, 0x4C ; 76 315d2: 97 e0 ldi r25, 0x07 ; 7 315d4: 0f 94 99 aa call 0x35532 ; 0x35532 retracted[active_extruder]=false; 315d8: 10 92 3c 07 sts 0x073C, r1 ; 0x80073c prepare_move(); 315dc: 90 e0 ldi r25, 0x00 ; 0 315de: 80 e0 ldi r24, 0x00 ; 0 315e0: 0e 94 ce 6c call 0xd99c ; 0xd99c feedrate = oldFeedrate; 315e4: 80 92 90 02 sts 0x0290, r8 ; 0x800290 315e8: 90 92 91 02 sts 0x0291, r9 ; 0x800291 315ec: a0 92 92 02 sts 0x0292, r10 ; 0x800292 315f0: b0 92 93 02 sts 0x0293, r11 ; 0x800293 315f4: 55 cf rjmp .-342 ; 0x314a0 000315f6 : 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) 315f6: ef 92 push r14 315f8: ff 92 push r15 315fa: 0f 93 push r16 315fc: 1f 93 push r17 315fe: cf 93 push r28 31600: c8 2f mov r28, r24 31602: 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; 31604: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 31608: c1 30 cpi r28, 0x01 ; 1 3160a: b9 f0 breq .+46 ; 0x3163a 3160c: c2 30 cpi r28, 0x02 ; 2 3160e: c1 f0 breq .+48 ; 0x31640 { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 31610: 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) 31612: 48 17 cp r20, r24 31614: 21 f0 breq .+8 ; 0x3161e tmc2130_set_dir(axis, dir); 31616: 64 2f mov r22, r20 31618: 8c 2f mov r24, r28 3161a: 0f 94 39 39 call 0x27272 ; 0x27272 3161e: 8b e9 ldi r24, 0x9B ; 155 31620: e8 2e mov r14, r24 31622: 8f e0 ldi r24, 0x0F ; 15 31624: f8 2e mov r15, r24 while (steps--) 31626: 01 50 subi r16, 0x01 ; 1 31628: 11 09 sbc r17, r1 3162a: 70 f0 brcs .+28 ; 0x31648 { tmc2130_do_step(axis); 3162c: 8c 2f mov r24, r28 3162e: 0f 94 28 39 call 0x27250 ; 0x27250 31632: c7 01 movw r24, r14 31634: 01 97 sbiw r24, 0x01 ; 1 31636: f1 f7 brne .-4 ; 0x31634 31638: f6 cf rjmp .-20 ; 0x31626 uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 3163a: 86 95 lsr r24 3163c: 8c 27 eor r24, r28 3163e: e8 cf rjmp .-48 ; 0x31610 case Z_AXIS: return _GET_DIR_Z; 31640: 82 fb bst r24, 2 31642: 88 27 eor r24, r24 31644: 80 f9 bld r24, 0 31646: e5 cf rjmp .-54 ; 0x31612 while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 31648: cf 91 pop r28 3164a: 1f 91 pop r17 3164c: 0f 91 pop r16 3164e: ff 90 pop r15 31650: ef 90 pop r14 31652: 08 95 ret 00031654 : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 31654: 8f 92 push r8 31656: 9f 92 push r9 31658: af 92 push r10 3165a: bf 92 push r11 3165c: cf 92 push r12 3165e: df 92 push r13 31660: ef 92 push r14 31662: ff 92 push r15 31664: 0f 93 push r16 31666: 1f 93 push r17 31668: cf 93 push r28 3166a: c8 2f mov r28, r24 3166c: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 3166e: c6 2e mov r12, r22 31670: d1 2c mov r13, r1 31672: 1f 93 push r17 31674: 4f 93 push r20 31676: 83 e0 ldi r24, 0x03 ; 3 31678: 8f 93 push r24 3167a: 88 ee ldi r24, 0xE8 ; 232 3167c: 8f 93 push r24 3167e: 1f 92 push r1 31680: 82 e0 ldi r24, 0x02 ; 2 31682: 8f 93 push r24 31684: 1f 92 push r1 31686: 6f 93 push r22 31688: 1f 92 push r1 3168a: cf 93 push r28 3168c: 86 e8 ldi r24, 0x86 ; 134 3168e: 95 ea ldi r25, 0xA5 ; 165 31690: 9f 93 push r25 31692: 8f 93 push r24 31694: 0f 94 08 dc call 0x3b810 ; 0x3b810 31698: 8d b7 in r24, 0x3d ; 61 3169a: 9e b7 in r25, 0x3e ; 62 3169c: 0c 96 adiw r24, 0x0c ; 12 3169e: 0f b6 in r0, 0x3f ; 63 316a0: f8 94 cli 316a2: 9e bf out 0x3e, r25 ; 62 316a4: 0f be out 0x3f, r0 ; 63 316a6: 8d bf out 0x3d, r24 ; 61 316a8: 90 e0 ldi r25, 0x00 ; 0 316aa: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 316ac: 40 e0 ldi r20, 0x00 ; 0 316ae: 51 e0 ldi r21, 0x01 ; 1 316b0: 28 2f mov r18, r24 316b2: ba 01 movw r22, r20 316b4: 08 2e mov r0, r24 316b6: 02 c0 rjmp .+4 ; 0x316bc 316b8: 76 95 lsr r23 316ba: 67 95 ror r22 316bc: 0a 94 dec r0 316be: e2 f7 brpl .-8 ; 0x316b8 316c0: 06 17 cp r16, r22 316c2: 17 07 cpc r17, r23 316c4: 29 f0 breq .+10 ; 0x316d0 316c6: 01 96 adiw r24, 0x01 ; 1 316c8: 88 30 cpi r24, 0x08 ; 8 316ca: 91 05 cpc r25, r1 316cc: 89 f7 brne .-30 ; 0x316b0 316ce: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 316d0: e2 2e mov r14, r18 316d2: f1 2c mov r15, r1 316d4: 88 e0 ldi r24, 0x08 ; 8 316d6: 90 e0 ldi r25, 0x00 ; 0 316d8: 8e 19 sub r24, r14 316da: 9f 09 sbc r25, r15 316dc: 24 e0 ldi r18, 0x04 ; 4 316de: 30 e0 ldi r19, 0x00 ; 0 316e0: 59 01 movw r10, r18 316e2: 02 c0 rjmp .+4 ; 0x316e8 316e4: aa 0c add r10, r10 316e6: bb 1c adc r11, r11 316e8: 8a 95 dec r24 316ea: e2 f7 brpl .-8 ; 0x316e4 uint16_t mscnt = tmc2130_rd_MSCNT(axis); 316ec: 8c 2f mov r24, r28 316ee: 0f 94 00 3a call 0x27400 ; 0x27400 316f2: 9c 01 movw r18, r24 316f4: 90 e0 ldi r25, 0x00 ; 0 316f6: c4 30 cpi r28, 0x04 ; 4 316f8: 28 f4 brcc .+10 ; 0x31704 316fa: ec 2f mov r30, r28 316fc: f0 e0 ldi r31, 0x00 ; 0 316fe: e2 5e subi r30, 0xE2 ; 226 31700: fc 4f sbci r31, 0xFC ; 252 31702: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 31704: 0e 2c mov r0, r14 31706: 02 c0 rjmp .+4 ; 0x3170c 31708: 36 95 lsr r19 3170a: 27 95 ror r18 3170c: 0a 94 dec r0 3170e: e2 f7 brpl .-8 ; 0x31708 31710: 86 01 movw r16, r12 31712: 02 1b sub r16, r18 31714: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 31716: 95 01 movw r18, r10 31718: 36 95 lsr r19 3171a: 27 95 ror r18 { dir ^= 1; 3171c: 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)) 3171e: 20 17 cp r18, r16 31720: 31 07 cpc r19, r17 31722: 74 f1 brlt .+92 ; 0x31780 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; 31724: 91 11 cpse r25, r1 31726: 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) 31728: 17 ff sbrs r17, 7 3172a: 05 c0 rjmp .+10 ; 0x31736 { dir ^= 1; 3172c: 81 e0 ldi r24, 0x01 ; 1 3172e: 68 27 eor r22, r24 steps = -steps; 31730: 11 95 neg r17 31732: 01 95 neg r16 31734: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 31736: 8c 2f mov r24, r28 31738: 0f 94 39 39 call 0x27272 ; 0x27272 mscnt = tmc2130_rd_MSCNT(axis); 3173c: 8c 2f mov r24, r28 3173e: 0f 94 00 3a call 0x27400 ; 0x27400 31742: b1 2c mov r11, r1 31744: a1 2c mov r10, r1 31746: 2b e9 ldi r18, 0x9B ; 155 31748: 82 2e mov r8, r18 3174a: 2f e0 ldi r18, 0x0F ; 15 3174c: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 3174e: 0a 15 cp r16, r10 31750: 1b 05 cpc r17, r11 31752: f1 f0 breq .+60 ; 0x31790 31754: 2f ef ldi r18, 0xFF ; 255 31756: a2 1a sub r10, r18 31758: b2 0a sbc r11, r18 3175a: 0e 2c mov r0, r14 3175c: 02 c0 rjmp .+4 ; 0x31762 3175e: 96 95 lsr r25 31760: 87 95 ror r24 31762: 0a 94 dec r0 31764: e2 f7 brpl .-8 ; 0x3175e 31766: 8c 15 cp r24, r12 31768: 9d 05 cpc r25, r13 3176a: 91 f0 breq .+36 ; 0x31790 { tmc2130_do_step(axis); 3176c: 8c 2f mov r24, r28 3176e: 0f 94 28 39 call 0x27250 ; 0x27250 31772: c4 01 movw r24, r8 31774: 01 97 sbiw r24, 0x01 ; 1 31776: f1 f7 brne .-4 ; 0x31774 delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 31778: 8c 2f mov r24, r28 3177a: 0f 94 00 3a call 0x27400 ; 0x27400 3177e: e7 cf rjmp .-50 ; 0x3174e { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 31780: 91 11 cpse r25, r1 31782: 01 c0 rjmp .+2 ; 0x31786 31784: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 31786: c5 01 movw r24, r10 31788: 80 1b sub r24, r16 3178a: 91 0b sbc r25, r17 3178c: 8c 01 movw r16, r24 3178e: cc cf rjmp .-104 ; 0x31728 { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 31790: cf 91 pop r28 31792: 1f 91 pop r17 31794: 0f 91 pop r16 31796: ff 90 pop r15 31798: ef 90 pop r14 3179a: df 90 pop r13 3179c: cf 90 pop r12 3179e: bf 90 pop r11 317a0: af 90 pop r10 317a2: 9f 90 pop r9 317a4: 8f 90 pop r8 317a6: 08 95 ret 000317a8 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 317a8: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d memset(z_values, 0, sizeof(z_values)); 317ac: ee e9 ldi r30, 0x9E ; 158 317ae: f3 e1 ldi r31, 0x13 ; 19 317b0: 84 ec ldi r24, 0xC4 ; 196 317b2: df 01 movw r26, r30 317b4: 1d 92 st X+, r1 317b6: 8a 95 dec r24 317b8: e9 f7 brne .-6 ; 0x317b4 } 317ba: 08 95 ret 000317bc : 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 317bc: 2f 92 push r2 317be: 3f 92 push r3 317c0: 4f 92 push r4 317c2: 5f 92 push r5 317c4: 6f 92 push r6 317c6: 7f 92 push r7 317c8: 8f 92 push r8 317ca: 9f 92 push r9 317cc: af 92 push r10 317ce: bf 92 push r11 317d0: cf 92 push r12 317d2: df 92 push r13 317d4: ef 92 push r14 317d6: ff 92 push r15 317d8: 0f 93 push r16 317da: 1f 93 push r17 317dc: cf 93 push r28 317de: df 93 push r29 317e0: 00 d0 rcall .+0 ; 0x317e2 317e2: 1f 92 push r1 317e4: cd b7 in r28, 0x3d ; 61 317e6: de b7 in r29, 0x3e ; 62 317e8: 4b 01 movw r8, r22 317ea: 5c 01 movw r10, r24 317ec: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 317ee: 81 e0 ldi r24, 0x01 ; 1 317f0: 80 93 6a 06 sts 0x066A, r24 ; 0x80066a #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 317f4: 80 91 69 06 lds r24, 0x0669 ; 0x800669 ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 317f8: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 317fa: 81 30 cpi r24, 0x01 ; 1 317fc: 19 f4 brne .+6 ; 0x31804 { FORCE_HIGH_POWER_START; 317fe: 0e 94 76 67 call 0xceec ; 0xceec bHighPowerForced = true; 31802: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 31804: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 31808: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 3180a: 81 e0 ldi r24, 0x01 ; 1 3180c: 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); 31810: 80 e0 ldi r24, 0x00 ; 0 31812: 0f 94 0f 64 call 0x2c81e ; 0x2c81e 31816: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 31818: 0f 94 1d 64 call 0x2c83a ; 0x2c83a // move down until you find the bed current_position[Z_AXIS] = minimum_z; 3181c: 80 92 48 07 sts 0x0748, r8 ; 0x800748 31820: 90 92 49 07 sts 0x0749, r9 ; 0x800749 31824: a0 92 4a 07 sts 0x074A, r10 ; 0x80074a 31828: b0 92 4b 07 sts 0x074B, r11 ; 0x80074b go_to_current(homing_feedrate[Z_AXIS]/60); 3182c: 65 e5 ldi r22, 0x55 ; 85 3182e: 75 e5 ldi r23, 0x55 ; 85 31830: 85 e5 ldi r24, 0x55 ; 85 31832: 91 e4 ldi r25, 0x41 ; 65 31834: 0f 94 05 c3 call 0x3860a ; 0x3860a // 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(); 31838: 0f 94 59 c9 call 0x392b2 ; 0x392b2 if (! endstop_z_hit_on_purpose()) 3183c: 0f 94 1d 64 call 0x2c83a ; 0x2c83a 31840: 8c 83 std Y+4, r24 ; 0x04 31842: 88 23 and r24, r24 31844: 09 f4 brne .+2 ; 0x31848 31846: f9 c0 rjmp .+498 ; 0x31a3a { //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)) 31848: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 3184c: 86 ff sbrs r24, 6 3184e: f5 c0 rjmp .+490 ; 0x31a3a { //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) 31850: 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; 31852: c1 2c mov r12, r1 31854: d1 2c mov r13, r1 31856: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 31858: 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) 3185a: 8b 81 ldd r24, Y+3 ; 0x03 3185c: 80 17 cp r24, r16 3185e: 08 f0 brcs .+2 ; 0x31862 31860: a8 c0 rjmp .+336 ; 0x319b2 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 31862: 60 91 48 07 lds r22, 0x0748 ; 0x800748 31866: 70 91 49 07 lds r23, 0x0749 ; 0x800749 3186a: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3186e: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 31872: 20 e0 ldi r18, 0x00 ; 0 31874: 30 e0 ldi r19, 0x00 ; 0 31876: 40 e0 ldi r20, 0x00 ; 0 31878: 5f e3 ldi r21, 0x3F ; 63 3187a: 31 10 cpse r3, r1 3187c: 04 c0 rjmp .+8 ; 0x31886 3187e: 2d ec ldi r18, 0xCD ; 205 31880: 3c ec ldi r19, 0xCC ; 204 31882: 4c e4 ldi r20, 0x4C ; 76 31884: 5e e3 ldi r21, 0x3E ; 62 31886: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3188a: 2b 01 movw r4, r22 3188c: 3c 01 movw r6, r24 3188e: 40 92 48 07 sts 0x0748, r4 ; 0x800748 31892: 50 92 49 07 sts 0x0749, r5 ; 0x800749 31896: 60 92 4a 07 sts 0x074A, r6 ; 0x80074a 3189a: 70 92 4b 07 sts 0x074B, r7 ; 0x80074b float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 3189e: 65 e5 ldi r22, 0x55 ; 85 318a0: 75 e5 ldi r23, 0x55 ; 85 318a2: 85 e5 ldi r24, 0x55 ; 85 318a4: 91 e4 ldi r25, 0x41 ; 65 318a6: 0f 94 05 c3 call 0x3860a ; 0x3860a // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 318aa: 80 92 48 07 sts 0x0748, r8 ; 0x800748 318ae: 90 92 49 07 sts 0x0749, r9 ; 0x800749 318b2: a0 92 4a 07 sts 0x074A, r10 ; 0x80074a 318b6: b0 92 4b 07 sts 0x074B, r11 ; 0x80074b //printf_P(PSTR("init Z = %f, min_z = %f, i = %d\n"), z_bckp, minimum_z, i); go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 318ba: 65 e5 ldi r22, 0x55 ; 85 318bc: 75 e5 ldi r23, 0x55 ; 85 318be: 85 e5 ldi r24, 0x55 ; 85 318c0: 90 e4 ldi r25, 0x40 ; 64 318c2: 0f 94 05 c3 call 0x3860a ; 0x3860a // 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(); 318c6: 0f 94 59 c9 call 0x392b2 ; 0x392b2 //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) { 318ca: a3 01 movw r20, r6 318cc: 92 01 movw r18, r4 318ce: 60 91 48 07 lds r22, 0x0748 ; 0x800748 318d2: 70 91 49 07 lds r23, 0x0749 ; 0x800749 318d6: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 318da: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 318de: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 318e2: 9f 77 andi r25, 0x7F ; 127 318e4: 2d ec ldi r18, 0xCD ; 205 318e6: 3c ec ldi r19, 0xCC ; 204 318e8: 4c ec ldi r20, 0xCC ; 204 318ea: 5c e3 ldi r21, 0x3C ; 60 318ec: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 318f0: 87 ff sbrs r24, 7 318f2: 16 c0 rjmp .+44 ; 0x31920 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 318f4: 60 e0 ldi r22, 0x00 ; 0 318f6: 70 e0 ldi r23, 0x00 ; 0 318f8: 80 e0 ldi r24, 0x00 ; 0 318fa: 9f e3 ldi r25, 0x3F ; 63 318fc: 0e 94 a7 6e call 0xdd4e ; 0xdd4e current_position[Z_AXIS] = minimum_z; 31900: 80 92 48 07 sts 0x0748, r8 ; 0x800748 31904: 90 92 49 07 sts 0x0749, r9 ; 0x800749 31908: a0 92 4a 07 sts 0x074A, r10 ; 0x80074a 3190c: b0 92 4b 07 sts 0x074B, r11 ; 0x80074b go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 31910: 65 e5 ldi r22, 0x55 ; 85 31912: 75 e5 ldi r23, 0x55 ; 85 31914: 85 e5 ldi r24, 0x55 ; 85 31916: 90 e4 ldi r25, 0x40 ; 64 31918: 0f 94 05 c3 call 0x3860a ; 0x3860a // 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(); 3191c: 0f 94 59 c9 call 0x392b2 ; 0x392b2 } if (!endstop_z_hit_on_purpose()) 31920: 0f 94 1d 64 call 0x2c83a ; 0x2c83a 31924: 28 2e mov r2, r24 31926: 88 23 and r24, r24 31928: 09 f4 brne .+2 ; 0x3192c 3192a: 87 c0 rjmp .+270 ; 0x31a3a { //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)) { 3192c: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 31930: 86 ff sbrs r24, 6 31932: 83 c0 rjmp .+262 ; 0x31a3a 31934: 40 90 48 07 lds r4, 0x0748 ; 0x800748 31938: 50 90 49 07 lds r5, 0x0749 ; 0x800749 3193c: 60 90 4a 07 lds r6, 0x074A ; 0x80074a 31940: 70 90 4b 07 lds r7, 0x074B ; 0x80074b } #endif //TMC2130 // SERIAL_ECHOPGM("Bed find_bed_induction_sensor_point_z low, height: "); // MYSERIAL.print(current_position[Z_AXIS], 5); // SERIAL_ECHOLNPGM(""); float dz = i?fabs(current_position[Z_AXIS] - (z / i)):0; 31944: 2b 81 ldd r18, Y+3 ; 0x03 31946: 22 23 and r18, r18 31948: d9 f0 breq .+54 ; 0x31980 3194a: 62 2f mov r22, r18 3194c: 70 e0 ldi r23, 0x00 ; 0 3194e: 90 e0 ldi r25, 0x00 ; 0 31950: 80 e0 ldi r24, 0x00 ; 0 31952: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 31956: 9b 01 movw r18, r22 31958: ac 01 movw r20, r24 3195a: c7 01 movw r24, r14 3195c: b6 01 movw r22, r12 3195e: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 31962: 9b 01 movw r18, r22 31964: ac 01 movw r20, r24 31966: c3 01 movw r24, r6 31968: b2 01 movw r22, r4 3196a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 3196e: 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 31970: 2d ec ldi r18, 0xCD ; 205 31972: 3c ec ldi r19, 0xCC ; 204 31974: 4c e4 ldi r20, 0x4C ; 76 31976: 5d e3 ldi r21, 0x3D ; 61 31978: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 3197c: 18 16 cp r1, r24 3197e: 64 f0 brlt .+24 ; 0x31998 #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]; 31980: a3 01 movw r20, r6 31982: 92 01 movw r18, r4 31984: c7 01 movw r24, r14 31986: b6 01 movw r22, r12 31988: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3198c: 6b 01 movw r12, r22 3198e: 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) 31990: 2b 81 ldd r18, Y+3 ; 0x03 31992: 2f 5f subi r18, 0xFF ; 255 31994: 2b 83 std Y+3, r18 ; 0x03 31996: 61 cf rjmp .-318 ; 0x3185a 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 31998: 31 10 cpse r3, r1 3199a: 4f c0 rjmp .+158 ; 0x31a3a //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 3199c: 84 ef ldi r24, 0xF4 ; 244 3199e: 91 e0 ldi r25, 0x01 ; 1 319a0: 0e 94 98 8e call 0x11d30 ; 0x11d30 //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; 319a4: 32 2c mov r3, r2 i = -1; 319a6: 8f ef ldi r24, 0xFF ; 255 319a8: 8b 83 std Y+3, r24 ; 0x03 z = 0; 319aa: c1 2c mov r12, r1 319ac: d1 2c mov r13, r1 319ae: 76 01 movw r14, r12 319b0: ef cf rjmp .-34 ; 0x31990 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 319b2: 02 30 cpi r16, 0x02 ; 2 319b4: 68 f5 brcc .+90 ; 0x31a10 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 319b6: c0 92 48 07 sts 0x0748, r12 ; 0x800748 319ba: d0 92 49 07 sts 0x0749, r13 ; 0x800749 319be: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 319c2: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b 319c6: 8a 81 ldd r24, Y+2 ; 0x02 319c8: 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); 319cc: 89 81 ldd r24, Y+1 ; 0x01 319ce: 0f 94 0f 64 call 0x2c81e ; 0x2c81e // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 319d2: 11 23 and r17, r17 319d4: 19 f0 breq .+6 ; 0x319dc 319d6: 80 e0 ldi r24, 0x00 ; 0 319d8: 0e 94 76 67 call 0xceec ; 0xceec #endif bedPWMDisabled = 0; 319dc: 10 92 6a 06 sts 0x066A, r1 ; 0x80066a #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 319e0: 8c 81 ldd r24, Y+4 ; 0x04 319e2: 0f 90 pop r0 319e4: 0f 90 pop r0 319e6: 0f 90 pop r0 319e8: 0f 90 pop r0 319ea: df 91 pop r29 319ec: cf 91 pop r28 319ee: 1f 91 pop r17 319f0: 0f 91 pop r16 319f2: ff 90 pop r15 319f4: ef 90 pop r14 319f6: df 90 pop r13 319f8: cf 90 pop r12 319fa: bf 90 pop r11 319fc: af 90 pop r10 319fe: 9f 90 pop r9 31a00: 8f 90 pop r8 31a02: 7f 90 pop r7 31a04: 6f 90 pop r6 31a06: 5f 90 pop r5 31a08: 4f 90 pop r4 31a0a: 3f 90 pop r3 31a0c: 2f 90 pop r2 31a0e: 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); 31a10: 60 2f mov r22, r16 31a12: 70 e0 ldi r23, 0x00 ; 0 31a14: 90 e0 ldi r25, 0x00 ; 0 31a16: 80 e0 ldi r24, 0x00 ; 0 31a18: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 31a1c: 9b 01 movw r18, r22 31a1e: ac 01 movw r20, r24 31a20: c7 01 movw r24, r14 31a22: b6 01 movw r22, r12 31a24: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 31a28: 60 93 48 07 sts 0x0748, r22 ; 0x800748 31a2c: 70 93 49 07 sts 0x0749, r23 ; 0x800749 31a30: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 31a34: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b 31a38: c6 cf rjmp .-116 ; 0x319c6 31a3a: 2a 81 ldd r18, Y+2 ; 0x02 31a3c: 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); 31a40: 89 81 ldd r24, Y+1 ; 0x01 31a42: 0f 94 0f 64 call 0x2c81e ; 0x2c81e #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31a46: 11 23 and r17, r17 31a48: 19 f0 breq .+6 ; 0x31a50 31a4a: 80 e0 ldi r24, 0x00 ; 0 31a4c: 0e 94 76 67 call 0xceec ; 0xceec #endif bedPWMDisabled = 0; 31a50: 10 92 6a 06 sts 0x066A, r1 ; 0x80066a return false; 31a54: 1c 82 std Y+4, r1 ; 0x04 31a56: c4 cf rjmp .-120 ; 0x319e0 00031a58 : /// 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){ 31a58: 2f 92 push r2 31a5a: 3f 92 push r3 31a5c: 4f 92 push r4 31a5e: 5f 92 push r5 31a60: 6f 92 push r6 31a62: 7f 92 push r7 31a64: 8f 92 push r8 31a66: 9f 92 push r9 31a68: af 92 push r10 31a6a: bf 92 push r11 31a6c: cf 92 push r12 31a6e: df 92 push r13 31a70: ef 92 push r14 31a72: ff 92 push r15 31a74: 0f 93 push r16 31a76: 1f 93 push r17 31a78: cf 93 push r28 31a7a: df 93 push r29 31a7c: cd b7 in r28, 0x3d ; 61 31a7e: de b7 in r29, 0x3e ; 62 31a80: cd 5b subi r28, 0xBD ; 189 31a82: d1 40 sbci r29, 0x01 ; 1 31a84: 0f b6 in r0, 0x3f ; 63 31a86: f8 94 cli 31a88: de bf out 0x3e, r29 ; 62 31a8a: 0f be out 0x3f, r0 ; 63 31a8c: cd bf out 0x3d, r28 ; 61 31a8e: c3 57 subi r28, 0x73 ; 115 31a90: de 4f sbci r29, 0xFE ; 254 31a92: 99 83 std Y+1, r25 ; 0x01 31a94: 88 83 st Y, r24 31a96: cd 58 subi r28, 0x8D ; 141 31a98: d1 40 sbci r29, 0x01 ; 1 31a9a: c1 57 subi r28, 0x71 ; 113 31a9c: de 4f sbci r29, 0xFE ; 254 31a9e: 79 83 std Y+1, r23 ; 0x01 31aa0: 68 83 st Y, r22 31aa2: cf 58 subi r28, 0x8F ; 143 31aa4: d1 40 sbci r29, 0x01 ; 1 31aa6: ce 56 subi r28, 0x6E ; 110 31aa8: de 4f sbci r29, 0xFE ; 254 31aaa: 59 83 std Y+1, r21 ; 0x01 31aac: 48 83 st Y, r20 31aae: c2 59 subi r28, 0x92 ; 146 31ab0: d1 40 sbci r29, 0x01 ; 1 31ab2: 84 e1 ldi r24, 0x14 ; 20 31ab4: cf 56 subi r28, 0x6F ; 111 31ab6: de 4f sbci r29, 0xFE ; 254 31ab8: 88 83 st Y, r24 31aba: c1 59 subi r28, 0x91 ; 145 31abc: 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; 31abe: ce 56 subi r28, 0x6E ; 110 31ac0: de 4f sbci r29, 0xFE ; 254 31ac2: a8 81 ld r26, Y 31ac4: b9 81 ldd r27, Y+1 ; 0x01 31ac6: c2 59 subi r28, 0x92 ; 146 31ac8: d1 40 sbci r29, 0x01 ; 1 31aca: 8d 91 ld r24, X+ 31acc: 9d 91 ld r25, X+ 31ace: 0d 90 ld r0, X+ 31ad0: bc 91 ld r27, X 31ad2: a0 2d mov r26, r0 31ad4: c6 56 subi r28, 0x66 ; 102 31ad6: de 4f sbci r29, 0xFE ; 254 31ad8: 88 83 st Y, r24 31ada: 99 83 std Y+1, r25 ; 0x01 31adc: aa 83 std Y+2, r26 ; 0x02 31ade: bb 83 std Y+3, r27 ; 0x03 31ae0: ca 59 subi r28, 0x9A ; 154 31ae2: d1 40 sbci r29, 0x01 ; 1 31ae4: c1 57 subi r28, 0x71 ; 113 31ae6: de 4f sbci r29, 0xFE ; 254 31ae8: a8 81 ld r26, Y 31aea: b9 81 ldd r27, Y+1 ; 0x01 31aec: cf 58 subi r28, 0x8F ; 143 31aee: d1 40 sbci r29, 0x01 ; 1 31af0: 8d 91 ld r24, X+ 31af2: 9d 91 ld r25, X+ 31af4: 0d 90 ld r0, X+ 31af6: bc 91 ld r27, X 31af8: a0 2d mov r26, r0 31afa: ca 54 subi r28, 0x4A ; 74 31afc: de 4f sbci r29, 0xFE ; 254 31afe: 88 83 st Y, r24 31b00: 99 83 std Y+1, r25 ; 0x01 31b02: aa 83 std Y+2, r26 ; 0x02 31b04: bb 83 std Y+3, r27 ; 0x03 31b06: c6 5b subi r28, 0xB6 ; 182 31b08: d1 40 sbci r29, 0x01 ; 1 31b0a: c3 57 subi r28, 0x73 ; 115 31b0c: de 4f sbci r29, 0xFE ; 254 31b0e: a8 81 ld r26, Y 31b10: b9 81 ldd r27, Y+1 ; 0x01 31b12: cd 58 subi r28, 0x8D ; 141 31b14: d1 40 sbci r29, 0x01 ; 1 31b16: 8d 91 ld r24, X+ 31b18: 9d 91 ld r25, X+ 31b1a: 0d 90 ld r0, X+ 31b1c: bc 91 ld r27, X 31b1e: a0 2d mov r26, r0 31b20: c6 54 subi r28, 0x46 ; 70 31b22: de 4f sbci r29, 0xFE ; 254 31b24: 88 83 st Y, r24 31b26: 99 83 std Y+1, r25 ; 0x01 31b28: aa 83 std Y+2, r26 ; 0x02 31b2a: bb 83 std Y+3, r27 ; 0x03 31b2c: ca 5b subi r28, 0xBA ; 186 31b2e: d1 40 sbci r29, 0x01 ; 1 31b30: fe 01 movw r30, r28 31b32: e7 5f subi r30, 0xF7 ; 247 31b34: fe 4f sbci r31, 0xFE ; 254 31b36: c8 55 subi r28, 0x58 ; 88 31b38: de 4f sbci r29, 0xFE ; 254 31b3a: f9 83 std Y+1, r31 ; 0x01 31b3c: e8 83 st Y, r30 31b3e: c8 5a subi r28, 0xA8 ; 168 31b40: d1 40 sbci r29, 0x01 ; 1 31b42: ce 01 movw r24, r28 31b44: 8b 57 subi r24, 0x7B ; 123 31b46: 9f 4f sbci r25, 0xFF ; 255 31b48: ca 55 subi r28, 0x5A ; 90 31b4a: de 4f sbci r29, 0xFE ; 254 31b4c: 99 83 std Y+1, r25 ; 0x01 31b4e: 88 83 st Y, r24 31b50: c6 5a subi r28, 0xA6 ; 166 31b52: d1 40 sbci r29, 0x01 ; 1 31b54: de 01 movw r26, r28 31b56: 11 96 adiw r26, 0x01 ; 1 31b58: c8 56 subi r28, 0x68 ; 104 31b5a: de 4f sbci r29, 0xFE ; 254 31b5c: b9 83 std Y+1, r27 ; 0x01 31b5e: a8 83 st Y, r26 31b60: c8 59 subi r28, 0x98 ; 152 31b62: d1 40 sbci r29, 0x01 ; 1 31b64: 31 2c mov r3, r1 31b66: 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; 31b68: b1 01 movw r22, r2 31b6a: 03 2c mov r0, r3 31b6c: 00 0c add r0, r0 31b6e: 88 0b sbc r24, r24 31b70: 99 0b sbc r25, r25 31b72: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 31b76: 2a e1 ldi r18, 0x1A ; 26 31b78: 38 ef ldi r19, 0xF8 ; 248 31b7a: 42 e4 ldi r20, 0x42 ; 66 31b7c: 5e e3 ldi r21, 0x3E ; 62 31b7e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31b82: 6b 01 movw r12, r22 31b84: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 31b86: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 31b8a: c2 56 subi r28, 0x62 ; 98 31b8c: de 4f sbci r29, 0xFE ; 254 31b8e: 68 83 st Y, r22 31b90: 79 83 std Y+1, r23 ; 0x01 31b92: 8a 83 std Y+2, r24 ; 0x02 31b94: 9b 83 std Y+3, r25 ; 0x03 31b96: ce 59 subi r28, 0x9E ; 158 31b98: d1 40 sbci r29, 0x01 ; 1 31b9a: c7 01 movw r24, r14 31b9c: b6 01 movw r22, r12 31b9e: 0f 94 68 df call 0x3bed0 ; 0x3bed0 31ba2: ce 55 subi r28, 0x5E ; 94 31ba4: de 4f sbci r29, 0xFE ; 254 31ba6: 68 83 st Y, r22 31ba8: 79 83 std Y+1, r23 ; 0x01 31baa: 8a 83 std Y+2, r24 ; 0x02 31bac: 9b 83 std Y+3, r25 ; 0x03 31bae: c2 5a subi r28, 0xA2 ; 162 31bb0: d1 40 sbci r29, 0x01 ; 1 31bb2: 9b 01 movw r18, r22 31bb4: ac 01 movw r20, r24 31bb6: c6 56 subi r28, 0x66 ; 102 31bb8: de 4f sbci r29, 0xFE ; 254 31bba: 68 81 ld r22, Y 31bbc: 79 81 ldd r23, Y+1 ; 0x01 31bbe: 8a 81 ldd r24, Y+2 ; 0x02 31bc0: 9b 81 ldd r25, Y+3 ; 0x03 31bc2: ca 59 subi r28, 0x9A ; 154 31bc4: d1 40 sbci r29, 0x01 ; 1 31bc6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31bca: c6 54 subi r28, 0x46 ; 70 31bcc: de 4f sbci r29, 0xFE ; 254 31bce: 28 81 ld r18, Y 31bd0: 39 81 ldd r19, Y+1 ; 0x01 31bd2: 4a 81 ldd r20, Y+2 ; 0x02 31bd4: 5b 81 ldd r21, Y+3 ; 0x03 31bd6: ca 5b subi r28, 0xBA ; 186 31bd8: d1 40 sbci r29, 0x01 ; 1 31bda: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31bde: 6b 01 movw r12, r22 31be0: 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) 31be2: 20 e0 ldi r18, 0x00 ; 0 31be4: 30 e0 ldi r19, 0x00 ; 0 31be6: a9 01 movw r20, r18 31be8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 31bec: 18 16 cp r1, r24 31bee: 0c f0 brlt .+2 ; 0x31bf2 31bf0: 7a c2 rjmp .+1268 ; 0x320e6 // 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; 31bf2: c2 56 subi r28, 0x62 ; 98 31bf4: de 4f sbci r29, 0xFE ; 254 31bf6: 28 81 ld r18, Y 31bf8: 39 81 ldd r19, Y+1 ; 0x01 31bfa: 4a 81 ldd r20, Y+2 ; 0x02 31bfc: 5b 81 ldd r21, Y+3 ; 0x03 31bfe: ce 59 subi r28, 0x9E ; 158 31c00: d1 40 sbci r29, 0x01 ; 1 31c02: c6 56 subi r28, 0x66 ; 102 31c04: de 4f sbci r29, 0xFE ; 254 31c06: 68 81 ld r22, Y 31c08: 79 81 ldd r23, Y+1 ; 0x01 31c0a: 8a 81 ldd r24, Y+2 ; 0x02 31c0c: 9b 81 ldd r25, Y+3 ; 0x03 31c0e: ca 59 subi r28, 0x9A ; 154 31c10: d1 40 sbci r29, 0x01 ; 1 31c12: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31c16: ca 54 subi r28, 0x4A ; 74 31c18: de 4f sbci r29, 0xFE ; 254 31c1a: 28 81 ld r18, Y 31c1c: 39 81 ldd r19, Y+1 ; 0x01 31c1e: 4a 81 ldd r20, Y+2 ; 0x02 31c20: 5b 81 ldd r21, Y+3 ; 0x03 31c22: c6 5b subi r28, 0xB6 ; 182 31c24: d1 40 sbci r29, 0x01 ; 1 31c26: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31c2a: 4b 01 movw r8, r22 31c2c: 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) 31c2e: 20 e0 ldi r18, 0x00 ; 0 31c30: 30 e0 ldi r19, 0x00 ; 0 31c32: a9 01 movw r20, r18 31c34: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 31c38: 18 16 cp r1, r24 31c3a: 0c f0 brlt .+2 ; 0x31c3e 31c3c: 54 c2 rjmp .+1192 ; 0x320e6 31c3e: 20 e0 ldi r18, 0x00 ; 0 31c40: 30 e0 ldi r19, 0x00 ; 0 31c42: 48 ef ldi r20, 0xF8 ; 248 31c44: 51 e4 ldi r21, 0x41 ; 65 31c46: c7 01 movw r24, r14 31c48: b6 01 movw r22, r12 31c4a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 31c4e: 87 ff sbrs r24, 7 31c50: 4a c2 rjmp .+1172 ; 0x320e6 31c52: 20 e0 ldi r18, 0x00 ; 0 31c54: 30 e0 ldi r19, 0x00 ; 0 31c56: 48 ef ldi r20, 0xF8 ; 248 31c58: 51 e4 ldi r21, 0x41 ; 65 31c5a: c5 01 movw r24, r10 31c5c: b4 01 movw r22, r8 31c5e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 31c62: 87 ff sbrs r24, 7 31c64: 40 c2 rjmp .+1152 ; 0x320e6 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 31c66: c7 01 movw r24, r14 31c68: b6 01 movw r22, r12 31c6a: 0f 94 15 e0 call 0x3c02a ; 0x3c02a 31c6e: 9b 01 movw r18, r22 31c70: ac 01 movw r20, r24 31c72: c7 01 movw r24, r14 31c74: b6 01 movw r22, r12 31c76: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 31c7a: 2b 01 movw r4, r22 31c7c: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 31c7e: c5 01 movw r24, r10 31c80: b4 01 movw r22, r8 31c82: 0f 94 15 e0 call 0x3c02a ; 0x3c02a 31c86: 9b 01 movw r18, r22 31c88: ac 01 movw r20, r24 31c8a: c5 01 movw r24, r10 31c8c: b4 01 movw r22, r8 31c8e: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 31c92: cc 56 subi r28, 0x6C ; 108 31c94: de 4f sbci r29, 0xFE ; 254 31c96: 68 83 st Y, r22 31c98: 79 83 std Y+1, r23 ; 0x01 31c9a: 8a 83 std Y+2, r24 ; 0x02 31c9c: 9b 83 std Y+3, r25 ; 0x03 31c9e: c4 59 subi r28, 0x94 ; 148 31ca0: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 31ca2: a3 01 movw r20, r6 31ca4: 92 01 movw r18, r4 31ca6: 60 e0 ldi r22, 0x00 ; 0 31ca8: 70 e0 ldi r23, 0x00 ; 0 31caa: 80 e8 ldi r24, 0x80 ; 128 31cac: 9f e3 ldi r25, 0x3F ; 63 31cae: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 31cb2: c2 55 subi r28, 0x52 ; 82 31cb4: de 4f sbci r29, 0xFE ; 254 31cb6: 68 83 st Y, r22 31cb8: 79 83 std Y+1, r23 ; 0x01 31cba: 8a 83 std Y+2, r24 ; 0x02 31cbc: 9b 83 std Y+3, r25 ; 0x03 31cbe: ce 5a subi r28, 0xAE ; 174 31cc0: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 31cc2: cc 56 subi r28, 0x6C ; 108 31cc4: de 4f sbci r29, 0xFE ; 254 31cc6: 28 81 ld r18, Y 31cc8: 39 81 ldd r19, Y+1 ; 0x01 31cca: 4a 81 ldd r20, Y+2 ; 0x02 31ccc: 5b 81 ldd r21, Y+3 ; 0x03 31cce: c4 59 subi r28, 0x94 ; 148 31cd0: d1 40 sbci r29, 0x01 ; 1 31cd2: 60 e0 ldi r22, 0x00 ; 0 31cd4: 70 e0 ldi r23, 0x00 ; 0 31cd6: 80 e8 ldi r24, 0x80 ; 128 31cd8: 9f e3 ldi r25, 0x3F ; 63 31cda: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 31cde: ce 54 subi r28, 0x4E ; 78 31ce0: de 4f sbci r29, 0xFE ; 254 31ce2: 68 83 st Y, r22 31ce4: 79 83 std Y+1, r23 ; 0x01 31ce6: 8a 83 std Y+2, r24 ; 0x02 31ce8: 9b 83 std Y+3, r25 ; 0x03 31cea: c2 5b subi r28, 0xB2 ; 178 31cec: 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; 31cee: c7 01 movw r24, r14 31cf0: b6 01 movw r22, r12 31cf2: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 31cf6: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 31cf8: fb 01 movw r30, r22 31cfa: 31 96 adiw r30, 0x01 ; 1 31cfc: c6 55 subi r28, 0x56 ; 86 31cfe: de 4f sbci r29, 0xFE ; 254 31d00: f9 83 std Y+1, r31 ; 0x01 31d02: e8 83 st Y, r30 31d04: ca 5a subi r28, 0xAA ; 170 31d06: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 31d08: c5 01 movw r24, r10 31d0a: b4 01 movw r22, r8 31d0c: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 31d10: 8b 01 movw r16, r22 31d12: 95 e0 ldi r25, 0x05 ; 5 31d14: 00 0f add r16, r16 31d16: 11 1f adc r17, r17 31d18: 9a 95 dec r25 31d1a: e1 f7 brne .-8 ; 0x31d14 const uint16_t idx01 = c0 + 32 * r1; 31d1c: c8 01 movw r24, r16 31d1e: 80 96 adiw r24, 0x20 ; 32 31d20: c4 55 subi r28, 0x54 ; 84 31d22: de 4f sbci r29, 0xFE ; 254 31d24: 99 83 std Y+1, r25 ; 0x01 31d26: 88 83 st Y, r24 31d28: cc 5a subi r28, 0xAC ; 172 31d2a: 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]; 31d2c: f8 01 movw r30, r16 31d2e: ec 0d add r30, r12 31d30: fd 1d adc r31, r13 31d32: ed 58 subi r30, 0x8D ; 141 31d34: f8 4f sbci r31, 0xF8 ; 248 31d36: 60 81 ld r22, Z 31d38: 70 e0 ldi r23, 0x00 ; 0 31d3a: 90 e0 ldi r25, 0x00 ; 0 31d3c: 80 e0 ldi r24, 0x00 ; 0 31d3e: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 31d42: 4b 01 movw r8, r22 31d44: 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; 31d46: ce 54 subi r28, 0x4E ; 78 31d48: de 4f sbci r29, 0xFE ; 254 31d4a: 28 81 ld r18, Y 31d4c: 39 81 ldd r19, Y+1 ; 0x01 31d4e: 4a 81 ldd r20, Y+2 ; 0x02 31d50: 5b 81 ldd r21, Y+3 ; 0x03 31d52: c2 5b subi r28, 0xB2 ; 178 31d54: d1 40 sbci r29, 0x01 ; 1 31d56: c2 55 subi r28, 0x52 ; 82 31d58: de 4f sbci r29, 0xFE ; 254 31d5a: 68 81 ld r22, Y 31d5c: 79 81 ldd r23, Y+1 ; 0x01 31d5e: 8a 81 ldd r24, Y+2 ; 0x02 31d60: 9b 81 ldd r25, Y+3 ; 0x03 31d62: ce 5a subi r28, 0xAE ; 174 31d64: d1 40 sbci r29, 0x01 ; 1 31d66: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31d6a: 9b 01 movw r18, r22 31d6c: 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]; 31d6e: c5 01 movw r24, r10 31d70: b4 01 movw r22, r8 31d72: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31d76: 4b 01 movw r8, r22 31d78: 5c 01 movw r10, r24 31d7a: c4 55 subi r28, 0x54 ; 84 31d7c: de 4f sbci r29, 0xFE ; 254 31d7e: e8 81 ld r30, Y 31d80: f9 81 ldd r31, Y+1 ; 0x01 31d82: cc 5a subi r28, 0xAC ; 172 31d84: d1 40 sbci r29, 0x01 ; 1 31d86: ec 0d add r30, r12 31d88: fd 1d adc r31, r13 31d8a: ed 58 subi r30, 0x8D ; 141 31d8c: f8 4f sbci r31, 0xF8 ; 248 31d8e: 60 81 ld r22, Z 31d90: 70 e0 ldi r23, 0x00 ; 0 31d92: 90 e0 ldi r25, 0x00 ; 0 31d94: 80 e0 ldi r24, 0x00 ; 0 31d96: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 31d9a: 6b 01 movw r12, r22 31d9c: 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; 31d9e: c2 55 subi r28, 0x52 ; 82 31da0: de 4f sbci r29, 0xFE ; 254 31da2: 28 81 ld r18, Y 31da4: 39 81 ldd r19, Y+1 ; 0x01 31da6: 4a 81 ldd r20, Y+2 ; 0x02 31da8: 5b 81 ldd r21, Y+3 ; 0x03 31daa: ce 5a subi r28, 0xAE ; 174 31dac: d1 40 sbci r29, 0x01 ; 1 31dae: cc 56 subi r28, 0x6C ; 108 31db0: de 4f sbci r29, 0xFE ; 254 31db2: 68 81 ld r22, Y 31db4: 79 81 ldd r23, Y+1 ; 0x01 31db6: 8a 81 ldd r24, Y+2 ; 0x02 31db8: 9b 81 ldd r25, Y+3 ; 0x03 31dba: c4 59 subi r28, 0x94 ; 148 31dbc: d1 40 sbci r29, 0x01 ; 1 31dbe: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31dc2: 9b 01 movw r18, r22 31dc4: 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]; 31dc6: c7 01 movw r24, r14 31dc8: b6 01 movw r22, r12 31dca: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31dce: 9b 01 movw r18, r22 31dd0: ac 01 movw r20, r24 31dd2: c5 01 movw r24, r10 31dd4: b4 01 movw r22, r8 31dd6: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31dda: 6b 01 movw r12, r22 31ddc: 7c 01 movw r14, r24 31dde: c6 55 subi r28, 0x56 ; 86 31de0: de 4f sbci r29, 0xFE ; 254 31de2: a8 81 ld r26, Y 31de4: b9 81 ldd r27, Y+1 ; 0x01 31de6: ca 5a subi r28, 0xAA ; 170 31de8: d1 40 sbci r29, 0x01 ; 1 31dea: 0a 0f add r16, r26 31dec: 1b 1f adc r17, r27 31dee: f8 01 movw r30, r16 31df0: ed 58 subi r30, 0x8D ; 141 31df2: f8 4f sbci r31, 0xF8 ; 248 31df4: 60 81 ld r22, Z 31df6: 70 e0 ldi r23, 0x00 ; 0 31df8: 90 e0 ldi r25, 0x00 ; 0 31dfa: 80 e0 ldi r24, 0x00 ; 0 31dfc: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 31e00: 4b 01 movw r8, r22 31e02: 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; 31e04: ce 54 subi r28, 0x4E ; 78 31e06: de 4f sbci r29, 0xFE ; 254 31e08: 28 81 ld r18, Y 31e0a: 39 81 ldd r19, Y+1 ; 0x01 31e0c: 4a 81 ldd r20, Y+2 ; 0x02 31e0e: 5b 81 ldd r21, Y+3 ; 0x03 31e10: c2 5b subi r28, 0xB2 ; 178 31e12: d1 40 sbci r29, 0x01 ; 1 31e14: c3 01 movw r24, r6 31e16: b2 01 movw r22, r4 31e18: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31e1c: 9b 01 movw r18, r22 31e1e: 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]; 31e20: c5 01 movw r24, r10 31e22: b4 01 movw r22, r8 31e24: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31e28: 9b 01 movw r18, r22 31e2a: ac 01 movw r20, r24 31e2c: c7 01 movw r24, r14 31e2e: b6 01 movw r22, r12 31e30: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31e34: 6b 01 movw r12, r22 31e36: 7c 01 movw r14, r24 31e38: c6 55 subi r28, 0x56 ; 86 31e3a: de 4f sbci r29, 0xFE ; 254 31e3c: e8 81 ld r30, Y 31e3e: f9 81 ldd r31, Y+1 ; 0x01 31e40: ca 5a subi r28, 0xAA ; 170 31e42: d1 40 sbci r29, 0x01 ; 1 31e44: c4 55 subi r28, 0x54 ; 84 31e46: de 4f sbci r29, 0xFE ; 254 31e48: 88 81 ld r24, Y 31e4a: 99 81 ldd r25, Y+1 ; 0x01 31e4c: cc 5a subi r28, 0xAC ; 172 31e4e: d1 40 sbci r29, 0x01 ; 1 31e50: e8 0f add r30, r24 31e52: f9 1f adc r31, r25 31e54: ed 58 subi r30, 0x8D ; 141 31e56: f8 4f sbci r31, 0xF8 ; 248 31e58: 60 81 ld r22, Z 31e5a: 70 e0 ldi r23, 0x00 ; 0 31e5c: 90 e0 ldi r25, 0x00 ; 0 31e5e: 80 e0 ldi r24, 0x00 ; 0 31e60: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 31e64: 4b 01 movw r8, r22 31e66: 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; 31e68: cc 56 subi r28, 0x6C ; 108 31e6a: de 4f sbci r29, 0xFE ; 254 31e6c: 28 81 ld r18, Y 31e6e: 39 81 ldd r19, Y+1 ; 0x01 31e70: 4a 81 ldd r20, Y+2 ; 0x02 31e72: 5b 81 ldd r21, Y+3 ; 0x03 31e74: c4 59 subi r28, 0x94 ; 148 31e76: d1 40 sbci r29, 0x01 ; 1 31e78: c3 01 movw r24, r6 31e7a: b2 01 movw r22, r4 31e7c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31e80: 9b 01 movw r18, r22 31e82: 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]; 31e84: c5 01 movw r24, r10 31e86: b4 01 movw r22, r8 31e88: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31e8c: 9b 01 movw r18, r22 31e8e: ac 01 movw r20, r24 31e90: c7 01 movw r24, r14 31e92: b6 01 movw r22, r12 31e94: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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; 31e98: 20 e0 ldi r18, 0x00 ; 0 31e9a: 30 e0 ldi r19, 0x00 ; 0 31e9c: 40 e0 ldi r20, 0x00 ; 0 31e9e: 52 e4 ldi r21, 0x42 ; 66 31ea0: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 31ea4: 6b 01 movw r12, r22 31ea6: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 31ea8: ac 01 movw r20, r24 31eaa: 9b 01 movw r18, r22 31eac: ce 55 subi r28, 0x5E ; 94 31eae: de 4f sbci r29, 0xFE ; 254 31eb0: 68 81 ld r22, Y 31eb2: 79 81 ldd r23, Y+1 ; 0x01 31eb4: 8a 81 ldd r24, Y+2 ; 0x02 31eb6: 9b 81 ldd r25, Y+3 ; 0x03 31eb8: c2 5a subi r28, 0xA2 ; 162 31eba: d1 40 sbci r29, 0x01 ; 1 31ebc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31ec0: c8 55 subi r28, 0x58 ; 88 31ec2: de 4f sbci r29, 0xFE ; 254 31ec4: a8 81 ld r26, Y 31ec6: b9 81 ldd r27, Y+1 ; 0x01 31ec8: c8 5a subi r28, 0xA8 ; 168 31eca: d1 40 sbci r29, 0x01 ; 1 31ecc: 6d 93 st X+, r22 31ece: 7d 93 st X+, r23 31ed0: 8d 93 st X+, r24 31ed2: 9d 93 st X+, r25 31ed4: c8 55 subi r28, 0x58 ; 88 31ed6: de 4f sbci r29, 0xFE ; 254 31ed8: b9 83 std Y+1, r27 ; 0x01 31eda: a8 83 st Y, r26 31edc: c8 5a subi r28, 0xA8 ; 168 31ede: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 31ee0: a7 01 movw r20, r14 31ee2: 96 01 movw r18, r12 31ee4: c2 56 subi r28, 0x62 ; 98 31ee6: de 4f sbci r29, 0xFE ; 254 31ee8: 68 81 ld r22, Y 31eea: 79 81 ldd r23, Y+1 ; 0x01 31eec: 8a 81 ldd r24, Y+2 ; 0x02 31eee: 9b 81 ldd r25, Y+3 ; 0x03 31ef0: ce 59 subi r28, 0x9E ; 158 31ef2: d1 40 sbci r29, 0x01 ; 1 31ef4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 31ef8: ca 55 subi r28, 0x5A ; 90 31efa: de 4f sbci r29, 0xFE ; 254 31efc: e8 81 ld r30, Y 31efe: f9 81 ldd r31, Y+1 ; 0x01 31f00: c6 5a subi r28, 0xA6 ; 166 31f02: d1 40 sbci r29, 0x01 ; 1 31f04: 61 93 st Z+, r22 31f06: 71 93 st Z+, r23 31f08: 81 93 st Z+, r24 31f0a: 91 93 st Z+, r25 31f0c: ca 55 subi r28, 0x5A ; 90 31f0e: de 4f sbci r29, 0xFE ; 254 31f10: f9 83 std Y+1, r31 ; 0x01 31f12: e8 83 st Y, r30 31f14: c6 5a subi r28, 0xA6 ; 166 31f16: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 31f18: c8 56 subi r28, 0x68 ; 104 31f1a: de 4f sbci r29, 0xFE ; 254 31f1c: a8 81 ld r26, Y 31f1e: b9 81 ldd r27, Y+1 ; 0x01 31f20: c8 59 subi r28, 0x98 ; 152 31f22: d1 40 sbci r29, 0x01 ; 1 31f24: cd 92 st X+, r12 31f26: dd 92 st X+, r13 31f28: ed 92 st X+, r14 31f2a: fd 92 st X+, r15 31f2c: c8 56 subi r28, 0x68 ; 104 31f2e: de 4f sbci r29, 0xFE ; 254 31f30: b9 83 std Y+1, r27 ; 0x01 31f32: a8 83 st Y, r26 31f34: c8 59 subi r28, 0x98 ; 152 31f36: d1 40 sbci r29, 0x01 ; 1 31f38: bf ef ldi r27, 0xFF ; 255 31f3a: 2b 1a sub r2, r27 31f3c: 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){ 31f3e: e1 e2 ldi r30, 0x21 ; 33 31f40: 2e 16 cp r2, r30 31f42: 31 04 cpc r3, r1 31f44: 09 f0 breq .+2 ; 0x31f48 31f46: 10 ce rjmp .-992 ; 0x31b68 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); 31f48: 40 e0 ldi r20, 0x00 ; 0 31f4a: 50 e0 ldi r21, 0x00 ; 0 31f4c: 60 e0 ldi r22, 0x00 ; 0 31f4e: 7d e3 ldi r23, 0x3D ; 61 31f50: ce 01 movw r24, r28 31f52: 87 5f subi r24, 0xF7 ; 247 31f54: 9e 4f sbci r25, 0xFE ; 254 31f56: 0f 94 a9 6f call 0x2df52 ; 0x2df52 31f5a: 9b 01 movw r18, r22 31f5c: ac 01 movw r20, r24 31f5e: c3 57 subi r28, 0x73 ; 115 31f60: de 4f sbci r29, 0xFE ; 254 31f62: a8 81 ld r26, Y 31f64: b9 81 ldd r27, Y+1 ; 0x01 31f66: cd 58 subi r28, 0x8D ; 141 31f68: d1 40 sbci r29, 0x01 ; 1 31f6a: 6d 91 ld r22, X+ 31f6c: 7d 91 ld r23, X+ 31f6e: 8d 91 ld r24, X+ 31f70: 9c 91 ld r25, X 31f72: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31f76: c3 57 subi r28, 0x73 ; 115 31f78: de 4f sbci r29, 0xFE ; 254 31f7a: e8 81 ld r30, Y 31f7c: f9 81 ldd r31, Y+1 ; 0x01 31f7e: cd 58 subi r28, 0x8D ; 141 31f80: d1 40 sbci r29, 0x01 ; 1 31f82: 60 83 st Z, r22 31f84: 71 83 std Z+1, r23 ; 0x01 31f86: 82 83 std Z+2, r24 ; 0x02 31f88: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 31f8a: 40 e0 ldi r20, 0x00 ; 0 31f8c: 50 e0 ldi r21, 0x00 ; 0 31f8e: 60 e0 ldi r22, 0x00 ; 0 31f90: 7d e3 ldi r23, 0x3D ; 61 31f92: ce 01 movw r24, r28 31f94: 8b 57 subi r24, 0x7B ; 123 31f96: 9f 4f sbci r25, 0xFF ; 255 31f98: 0f 94 a9 6f call 0x2df52 ; 0x2df52 31f9c: 9b 01 movw r18, r22 31f9e: ac 01 movw r20, r24 31fa0: c1 57 subi r28, 0x71 ; 113 31fa2: de 4f sbci r29, 0xFE ; 254 31fa4: a8 81 ld r26, Y 31fa6: b9 81 ldd r27, Y+1 ; 0x01 31fa8: cf 58 subi r28, 0x8F ; 143 31faa: d1 40 sbci r29, 0x01 ; 1 31fac: 6d 91 ld r22, X+ 31fae: 7d 91 ld r23, X+ 31fb0: 8d 91 ld r24, X+ 31fb2: 9c 91 ld r25, X 31fb4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31fb8: c1 57 subi r28, 0x71 ; 113 31fba: de 4f sbci r29, 0xFE ; 254 31fbc: e8 81 ld r30, Y 31fbe: f9 81 ldd r31, Y+1 ; 0x01 31fc0: cf 58 subi r28, 0x8F ; 143 31fc2: d1 40 sbci r29, 0x01 ; 1 31fc4: 60 83 st Z, r22 31fc6: 71 83 std Z+1, r23 ; 0x01 31fc8: 82 83 std Z+2, r24 ; 0x02 31fca: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 31fcc: 40 e0 ldi r20, 0x00 ; 0 31fce: 50 e0 ldi r21, 0x00 ; 0 31fd0: 60 e8 ldi r22, 0x80 ; 128 31fd2: 7c e3 ldi r23, 0x3C ; 60 31fd4: ce 01 movw r24, r28 31fd6: 01 96 adiw r24, 0x01 ; 1 31fd8: 0f 94 a9 6f call 0x2df52 ; 0x2df52 31fdc: ce 56 subi r28, 0x6E ; 110 31fde: de 4f sbci r29, 0xFE ; 254 31fe0: a8 81 ld r26, Y 31fe2: b9 81 ldd r27, Y+1 ; 0x01 31fe4: c2 59 subi r28, 0x92 ; 146 31fe6: d1 40 sbci r29, 0x01 ; 1 31fe8: 2d 91 ld r18, X+ 31fea: 3d 91 ld r19, X+ 31fec: 4d 91 ld r20, X+ 31fee: 5c 91 ld r21, X 31ff0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 31ff4: 16 2f mov r17, r22 31ff6: 07 2f mov r16, r23 31ff8: f8 2e mov r15, r24 31ffa: e9 2e mov r14, r25 r = MAX(2, r); 31ffc: 20 e0 ldi r18, 0x00 ; 0 31ffe: 30 e0 ldi r19, 0x00 ; 0 32000: 40 e0 ldi r20, 0x00 ; 0 32002: 50 e4 ldi r21, 0x40 ; 64 32004: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 32008: 18 16 cp r1, r24 3200a: 2c f0 brlt .+10 ; 0x32016 3200c: 10 e0 ldi r17, 0x00 ; 0 3200e: 00 e0 ldi r16, 0x00 ; 0 32010: f1 2c mov r15, r1 32012: 80 e4 ldi r24, 0x40 ; 64 32014: e8 2e mov r14, r24 32016: a8 01 movw r20, r16 32018: 97 01 movw r18, r14 3201a: 85 2f mov r24, r21 3201c: 90 2f mov r25, r16 3201e: a3 2f mov r26, r19 32020: be 2d mov r27, r14 32022: ce 56 subi r28, 0x6E ; 110 32024: de 4f sbci r29, 0xFE ; 254 32026: e8 81 ld r30, Y 32028: f9 81 ldd r31, Y+1 ; 0x01 3202a: c2 59 subi r28, 0x92 ; 146 3202c: d1 40 sbci r29, 0x01 ; 1 3202e: 80 83 st Z, r24 32030: 91 83 std Z+1, r25 ; 0x01 32032: a2 83 std Z+2, r26 ; 0x02 32034: b3 83 std Z+3, r27 ; 0x03 32036: cf 56 subi r28, 0x6F ; 111 32038: de 4f sbci r29, 0xFE ; 254 3203a: f8 81 ld r31, Y 3203c: c1 59 subi r28, 0x91 ; 145 3203e: d1 40 sbci r29, 0x01 ; 1 32040: f1 50 subi r31, 0x01 ; 1 32042: cf 56 subi r28, 0x6F ; 111 32044: de 4f sbci r29, 0xFE ; 254 32046: f8 83 st Y, r31 32048: c1 59 subi r28, 0x91 ; 145 3204a: 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){ 3204c: f1 11 cpse r31, r1 3204e: 37 cd rjmp .-1426 ; 0x31abe r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 32050: ef 92 push r14 32052: ff 92 push r15 32054: 0f 93 push r16 32056: 1f 93 push r17 32058: c1 57 subi r28, 0x71 ; 113 3205a: de 4f sbci r29, 0xFE ; 254 3205c: a8 81 ld r26, Y 3205e: b9 81 ldd r27, Y+1 ; 0x01 32060: cf 58 subi r28, 0x8F ; 143 32062: d1 40 sbci r29, 0x01 ; 1 32064: 13 96 adiw r26, 0x03 ; 3 32066: 8c 91 ld r24, X 32068: 13 97 sbiw r26, 0x03 ; 3 3206a: 8f 93 push r24 3206c: 12 96 adiw r26, 0x02 ; 2 3206e: 8c 91 ld r24, X 32070: 12 97 sbiw r26, 0x02 ; 2 32072: 8f 93 push r24 32074: 11 96 adiw r26, 0x01 ; 1 32076: 8c 91 ld r24, X 32078: 11 97 sbiw r26, 0x01 ; 1 3207a: 8f 93 push r24 3207c: 8c 91 ld r24, X 3207e: 8f 93 push r24 32080: c3 57 subi r28, 0x73 ; 115 32082: de 4f sbci r29, 0xFE ; 254 32084: e8 81 ld r30, Y 32086: f9 81 ldd r31, Y+1 ; 0x01 32088: cd 58 subi r28, 0x8D ; 141 3208a: d1 40 sbci r29, 0x01 ; 1 3208c: 83 81 ldd r24, Z+3 ; 0x03 3208e: 8f 93 push r24 32090: 82 81 ldd r24, Z+2 ; 0x02 32092: 8f 93 push r24 32094: 81 81 ldd r24, Z+1 ; 0x01 32096: 8f 93 push r24 32098: 80 81 ld r24, Z 3209a: 8f 93 push r24 3209c: 8a e6 ldi r24, 0x6A ; 106 3209e: 95 ea ldi r25, 0xA5 ; 165 320a0: 9f 93 push r25 320a2: 8f 93 push r24 320a4: 0f 94 08 dc call 0x3b810 ; 0x3b810 320a8: 0f b6 in r0, 0x3f ; 63 320aa: f8 94 cli 320ac: de bf out 0x3e, r29 ; 62 320ae: 0f be out 0x3f, r0 ; 63 320b0: cd bf out 0x3d, r28 ; 61 } 320b2: c3 54 subi r28, 0x43 ; 67 320b4: de 4f sbci r29, 0xFE ; 254 320b6: 0f b6 in r0, 0x3f ; 63 320b8: f8 94 cli 320ba: de bf out 0x3e, r29 ; 62 320bc: 0f be out 0x3f, r0 ; 63 320be: cd bf out 0x3d, r28 ; 61 320c0: df 91 pop r29 320c2: cf 91 pop r28 320c4: 1f 91 pop r17 320c6: 0f 91 pop r16 320c8: ff 90 pop r15 320ca: ef 90 pop r14 320cc: df 90 pop r13 320ce: cf 90 pop r12 320d0: bf 90 pop r11 320d2: af 90 pop r10 320d4: 9f 90 pop r9 320d6: 8f 90 pop r8 320d8: 7f 90 pop r7 320da: 6f 90 pop r6 320dc: 5f 90 pop r5 320de: 4f 90 pop r4 320e0: 3f 90 pop r3 320e2: 2f 90 pop r2 320e4: 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; 320e6: 60 e0 ldi r22, 0x00 ; 0 320e8: 70 e0 ldi r23, 0x00 ; 0 320ea: cb 01 movw r24, r22 320ec: d5 ce rjmp .-598 ; 0x31e98 000320ee : } /// 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){ 320ee: 2f 92 push r2 320f0: 3f 92 push r3 320f2: 4f 92 push r4 320f4: 5f 92 push r5 320f6: 6f 92 push r6 320f8: 7f 92 push r7 320fa: 8f 92 push r8 320fc: 9f 92 push r9 320fe: af 92 push r10 32100: bf 92 push r11 32102: cf 92 push r12 32104: df 92 push r13 32106: ef 92 push r14 32108: ff 92 push r15 3210a: 0f 93 push r16 3210c: 1f 93 push r17 3210e: cf 93 push r28 32110: df 93 push r29 32112: 00 d0 rcall .+0 ; 0x32114 32114: 1f 92 push r1 32116: 1f 92 push r1 32118: cd b7 in r28, 0x3d ; 61 3211a: de b7 in r29, 0x3e ; 62 3211c: 2b 01 movw r4, r22 3211e: 1a 01 movw r2, r20 32120: f1 2c mov r15, r1 32122: 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; 32124: 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; 32126: 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; 32128: 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){ 3212a: 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); 3212c: 66 24 eor r6, r6 3212e: 63 94 inc r6 32130: 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){ 32132: 70 e0 ldi r23, 0x00 ; 0 32134: 60 e0 ldi r22, 0x00 ; 0 32136: 97 01 movw r18, r14 32138: 2d 58 subi r18, 0x8D ; 141 3213a: 38 4f sbci r19, 0xF8 ; 248 3213c: 3a 83 std Y+2, r19 ; 0x02 3213e: 29 83 std Y+1, r18 ; 0x01 32140: 86 2e mov r8, r22 32142: c9 80 ldd r12, Y+1 ; 0x01 32144: da 80 ldd r13, Y+2 ; 0x02 32146: c6 0e add r12, r22 32148: d7 1e adc r13, r23 3214a: 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; 3214c: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 3214e: 40 e0 ldi r20, 0x00 ; 0 32150: 30 e0 ldi r19, 0x00 ; 0 32152: 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; 32154: ae ef ldi r26, 0xFE ; 254 32156: a4 0f add r26, r20 32158: 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; 3215a: 44 23 and r20, r20 3215c: 19 f0 breq .+6 ; 0x32164 3215e: 4b 30 cpi r20, 0x0B ; 11 32160: 09 f0 breq .+2 ; 0x32164 32162: 7d c0 rjmp .+250 ; 0x3225e 32164: ae ef ldi r26, 0xFE ; 254 32166: a2 0f add r26, r18 32168: a8 30 cpi r26, 0x08 ; 8 3216a: 08 f4 brcc .+2 ; 0x3216e 3216c: 7a c0 rjmp .+244 ; 0x32262 3216e: 2f 5f subi r18, 0xFF ; 255 32170: 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){ 32172: 2c 30 cpi r18, 0x0C ; 12 32174: 31 05 cpc r19, r1 32176: 89 f7 brne .-30 ; 0x3215a /// 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){ 32178: 4f 5f subi r20, 0xFF ; 255 3217a: 20 e2 ldi r18, 0x20 ; 32 3217c: c2 0e add r12, r18 3217e: d1 1c adc r13, r1 32180: 32 96 adiw r30, 0x02 ; 2 32182: 4c 30 cpi r20, 0x0C ; 12 32184: 29 f7 brne .-54 ; 0x32150 // 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){ 32186: 3c 81 ldd r19, Y+4 ; 0x04 32188: 30 17 cp r19, r16 3218a: 18 f4 brcc .+6 ; 0x32192 3218c: 0c 83 std Y+4, r16 ; 0x04 3218e: 5d 83 std Y+5, r21 ; 0x05 32190: 18 2d mov r17, r8 32192: 6f 5f subi r22, 0xFF ; 255 32194: 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){ 32196: 64 31 cpi r22, 0x14 ; 20 32198: 71 05 cpc r23, r1 3219a: 91 f6 brne .-92 ; 0x32140 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){ 3219c: 5f 5f subi r21, 0xFF ; 255 3219e: a0 e2 ldi r26, 0x20 ; 32 321a0: ea 0e add r14, r26 321a2: f1 1c adc r15, r1 321a4: 54 31 cpi r21, 0x14 ; 20 321a6: 29 f6 brne .-118 ; 0x32132 // 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); 321a8: ec 81 ldd r30, Y+4 ; 0x04 321aa: 6e 2f mov r22, r30 321ac: 70 e0 ldi r23, 0x00 ; 0 321ae: 90 e0 ldi r25, 0x00 ; 0 321b0: 80 e0 ldi r24, 0x00 ; 0 321b2: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 321b6: 23 ec ldi r18, 0xC3 ; 195 321b8: 35 ef ldi r19, 0xF5 ; 245 321ba: 48 ea ldi r20, 0xA8 ; 168 321bc: 5f e3 ldi r21, 0x3F ; 63 321be: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 321c2: 9f 93 push r25 321c4: 8f 93 push r24 321c6: 7f 93 push r23 321c8: 6f 93 push r22 321ca: fd 81 ldd r31, Y+5 ; 0x05 321cc: 6f 2f mov r22, r31 321ce: 70 e0 ldi r23, 0x00 ; 0 321d0: 90 e0 ldi r25, 0x00 ; 0 321d2: 80 e0 ldi r24, 0x00 ; 0 321d4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 321d8: 20 e0 ldi r18, 0x00 ; 0 321da: 30 e0 ldi r19, 0x00 ; 0 321dc: 40 eb ldi r20, 0xB0 ; 176 321de: 50 e4 ldi r21, 0x40 ; 64 321e0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 321e4: 9f 93 push r25 321e6: 8f 93 push r24 321e8: 7f 93 push r23 321ea: 6f 93 push r22 321ec: 61 2f mov r22, r17 321ee: 70 e0 ldi r23, 0x00 ; 0 321f0: 90 e0 ldi r25, 0x00 ; 0 321f2: 80 e0 ldi r24, 0x00 ; 0 321f4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 321f8: 20 e0 ldi r18, 0x00 ; 0 321fa: 30 e0 ldi r19, 0x00 ; 0 321fc: 40 eb ldi r20, 0xB0 ; 176 321fe: 50 e4 ldi r21, 0x40 ; 64 32200: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 32204: 9f 93 push r25 32206: 8f 93 push r24 32208: 7f 93 push r23 3220a: 6f 93 push r22 3220c: 86 e4 ldi r24, 0x46 ; 70 3220e: 95 ea ldi r25, 0xA5 ; 165 32210: 9f 93 push r25 32212: 8f 93 push r24 32214: 0f 94 08 dc call 0x3b810 ; 0x3b810 *pc = max_c; 32218: f2 01 movw r30, r4 3221a: 10 83 st Z, r17 *pr = max_r; 3221c: 2d 81 ldd r18, Y+5 ; 0x05 3221e: f1 01 movw r30, r2 32220: 20 83 st Z, r18 32222: 0f b6 in r0, 0x3f ; 63 32224: f8 94 cli 32226: de bf out 0x3e, r29 ; 62 32228: 0f be out 0x3f, r0 ; 63 3222a: cd bf out 0x3d, r28 ; 61 return max_match; } 3222c: 8c 81 ldd r24, Y+4 ; 0x04 3222e: 0f 90 pop r0 32230: 0f 90 pop r0 32232: 0f 90 pop r0 32234: 0f 90 pop r0 32236: 0f 90 pop r0 32238: df 91 pop r29 3223a: cf 91 pop r28 3223c: 1f 91 pop r17 3223e: 0f 91 pop r16 32240: ff 90 pop r15 32242: ef 90 pop r14 32244: df 90 pop r13 32246: cf 90 pop r12 32248: bf 90 pop r11 3224a: af 90 pop r10 3224c: 9f 90 pop r9 3224e: 8f 90 pop r8 32250: 7f 90 pop r7 32252: 6f 90 pop r6 32254: 5f 90 pop r5 32256: 4f 90 pop r4 32258: 3f 90 pop r3 3225a: 2f 90 pop r2 3225c: 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; 3225e: 22 23 and r18, r18 32260: 11 f0 breq .+4 ; 0x32266 32262: 2b 30 cpi r18, 0x0B ; 11 32264: 21 f4 brne .+8 ; 0x3226e 32266: ab 81 ldd r26, Y+3 ; 0x03 32268: a8 30 cpi r26, 0x08 ; 8 3226a: 08 f0 brcs .+2 ; 0x3226e 3226c: 80 cf rjmp .-256 ; 0x3216e const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 3226e: 99 24 eor r9, r9 32270: 93 94 inc r9 32272: d6 01 movw r26, r12 32274: a2 0f add r26, r18 32276: b3 1f adc r27, r19 32278: ac 91 ld r26, X 3227a: a1 31 cpi r26, 0x11 ; 17 3227c: 08 f4 brcc .+2 ; 0x32280 3227e: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 32280: a0 80 ld r10, Z 32282: b1 80 ldd r11, Z+1 ; 0x01 32284: d3 01 movw r26, r6 32286: 02 2e mov r0, r18 32288: 02 c0 rjmp .+4 ; 0x3228e 3228a: aa 0f add r26, r26 3228c: bb 1f adc r27, r27 3228e: 0a 94 dec r0 32290: e2 f7 brpl .-8 ; 0x3228a 32292: aa 21 and r26, r10 32294: bb 21 and r27, r11 32296: bb 24 eor r11, r11 32298: b3 94 inc r11 3229a: ab 2b or r26, r27 3229c: 09 f4 brne .+2 ; 0x322a0 3229e: b1 2c mov r11, r1 if (high_pix == high_pat) 322a0: 9b 10 cpse r9, r11 322a2: 65 cf rjmp .-310 ; 0x3216e match++; 322a4: 0f 5f subi r16, 0xFF ; 255 322a6: 63 cf rjmp .-314 ; 0x3216e 000322a8 : 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){ 322a8: 2f 92 push r2 322aa: 3f 92 push r3 322ac: 4f 92 push r4 322ae: 5f 92 push r5 322b0: 6f 92 push r6 322b2: 7f 92 push r7 322b4: 8f 92 push r8 322b6: 9f 92 push r9 322b8: af 92 push r10 322ba: bf 92 push r11 322bc: cf 92 push r12 322be: df 92 push r13 322c0: ef 92 push r14 322c2: ff 92 push r15 322c4: 0f 93 push r16 322c6: 1f 93 push r17 322c8: cf 93 push r28 322ca: df 93 push r29 322cc: cd b7 in r28, 0x3d ; 61 322ce: de b7 in r29, 0x3e ; 62 322d0: ca 55 subi r28, 0x5A ; 90 322d2: d1 09 sbc r29, r1 322d4: 0f b6 in r0, 0x3f ; 63 322d6: f8 94 cli 322d8: de bf out 0x3e, r29 ; 62 322da: 0f be out 0x3f, r0 ; 63 322dc: cd bf out 0x3d, r28 ; 61 322de: 63 96 adiw r28, 0x13 ; 19 322e0: 9f af std Y+63, r25 ; 0x3f 322e2: 8e af std Y+62, r24 ; 0x3e 322e4: 63 97 sbiw r28, 0x13 ; 19 322e6: 8b 01 movw r16, r22 322e8: 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 322ea: 7e 01 movw r14, r28 322ec: 25 e4 ldi r18, 0x45 ; 69 322ee: e2 0e add r14, r18 322f0: f1 1c adc r15, r1 322f2: 80 e1 ldi r24, 0x10 ; 16 322f4: 97 e2 ldi r25, 0x27 ; 39 322f6: f7 01 movw r30, r14 322f8: 91 83 std Z+1, r25 ; 0x01 322fa: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 322fc: 85 e3 ldi r24, 0x35 ; 53 322fe: 95 ea ldi r25, 0xA5 ; 165 32300: 9f 93 push r25 32302: 8f 93 push r24 32304: 0f 94 08 dc call 0x3b810 ; 0x3b810 32308: 23 e7 ldi r18, 0x73 ; 115 3230a: 37 e0 ldi r19, 0x07 ; 7 3230c: 61 96 adiw r28, 0x11 ; 17 3230e: 3f af std Y+63, r19 ; 0x3f 32310: 2e af std Y+62, r18 ; 0x3e 32312: 61 97 sbiw r28, 0x11 ; 17 32314: c8 01 movw r24, r16 32316: 80 5e subi r24, 0xE0 ; 224 32318: 93 40 sbci r25, 0x03 ; 3 3231a: 2b 96 adiw r28, 0x0b ; 11 3231c: 9f af std Y+63, r25 ; 0x3f 3231e: 8e af std Y+62, r24 ; 0x3e 32320: 2b 97 sbiw r28, 0x0b ; 11 32322: 0f 90 pop r0 32324: 0f 90 pop r0 32326: e0 e4 ldi r30, 0x40 ; 64 32328: f0 e0 ldi r31, 0x00 ; 0 3232a: 29 96 adiw r28, 0x09 ; 9 3232c: ff af std Y+63, r31 ; 0x3f 3232e: ee af std Y+62, r30 ; 0x3e 32330: 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); 32332: 63 96 adiw r28, 0x13 ; 19 32334: 2e ad ldd r18, Y+62 ; 0x3e 32336: 3f ad ldd r19, Y+63 ; 0x3f 32338: 63 97 sbiw r28, 0x13 ; 19 3233a: 20 5e subi r18, 0xE0 ; 224 3233c: 33 40 sbci r19, 0x03 ; 3 3233e: 69 96 adiw r28, 0x19 ; 25 32340: 3f af std Y+63, r19 ; 0x3f 32342: 2e af std Y+62, r18 ; 0x3e 32344: 69 97 sbiw r28, 0x19 ; 25 32346: 29 96 adiw r28, 0x09 ; 9 32348: 4e ac ldd r4, Y+62 ; 0x3e 3234a: 5f ac ldd r5, Y+63 ; 0x3f 3234c: 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){ 3234e: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 32350: 63 96 adiw r28, 0x13 ; 19 32352: 8e ad ldd r24, Y+62 ; 0x3e 32354: 9f ad ldd r25, Y+63 ; 0x3f 32356: 63 97 sbiw r28, 0x13 ; 19 32358: 80 52 subi r24, 0x20 ; 32 3235a: 9c 4f sbci r25, 0xFC ; 252 3235c: 6b 96 adiw r28, 0x1b ; 27 3235e: 9f af std Y+63, r25 ; 0x3f 32360: 8e af std Y+62, r24 ; 0x3e 32362: 6b 97 sbiw r28, 0x1b ; 27 32364: 60 90 69 07 lds r6, 0x0769 ; 0x800769 32368: 70 90 6a 07 lds r7, 0x076A ; 0x80076a 3236c: 80 90 6b 07 lds r8, 0x076B ; 0x80076b 32370: 90 90 6c 07 lds r9, 0x076C ; 0x80076c 32374: 6b 96 adiw r28, 0x1b ; 27 32376: ae ac ldd r10, Y+62 ; 0x3e 32378: bf ac ldd r11, Y+63 ; 0x3f 3237a: 6b 97 sbiw r28, 0x1b ; 27 3237c: 31 10 cpse r3, r1 3237e: 04 c0 rjmp .+8 ; 0x32388 32380: 69 96 adiw r28, 0x19 ; 25 32382: ae ac ldd r10, Y+62 ; 0x3e 32384: bf ac ldd r11, Y+63 ; 0x3f 32386: 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; 32388: 80 91 61 07 lds r24, 0x0761 ; 0x800761 3238c: 90 91 62 07 lds r25, 0x0762 ; 0x800762 32390: a0 91 63 07 lds r26, 0x0763 ; 0x800763 32394: b0 91 64 07 lds r27, 0x0764 ; 0x800764 32398: f5 01 movw r30, r10 3239a: e8 1b sub r30, r24 3239c: f9 0b sbc r31, r25 3239e: 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) 323a0: 71 f0 breq .+28 ; 0x323be 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)); 323a2: af 01 movw r20, r30 323a4: f7 ff sbrs r31, 7 323a6: 04 c0 rjmp .+8 ; 0x323b0 323a8: 44 27 eor r20, r20 323aa: 55 27 eor r21, r21 323ac: 4e 1b sub r20, r30 323ae: 5f 0b sbc r21, r31 323b0: 69 2f mov r22, r25 323b2: 66 1f adc r22, r22 323b4: 66 27 eor r22, r22 323b6: 66 1f adc r22, r22 323b8: 81 e0 ldi r24, 0x01 ; 1 323ba: 0f 94 d0 74 call 0x2e9a0 ; 0x2e9a0 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 323be: 80 91 65 07 lds r24, 0x0765 ; 0x800765 323c2: 90 91 66 07 lds r25, 0x0766 ; 0x800766 323c6: a0 91 67 07 lds r26, 0x0767 ; 0x800767 323ca: b0 91 68 07 lds r27, 0x0768 ; 0x800768 323ce: 2b 96 adiw r28, 0x0b ; 11 323d0: 4e ad ldd r20, Y+62 ; 0x3e 323d2: 5f ad ldd r21, Y+63 ; 0x3f 323d4: 2b 97 sbiw r28, 0x0b ; 11 323d6: 48 1b sub r20, r24 323d8: 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)); 323da: 57 fd sbrc r21, 7 323dc: b2 c0 rjmp .+356 ; 0x32542 323de: 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) 323e0: 41 15 cp r20, r1 323e2: 51 05 cpc r21, r1 323e4: 09 f0 breq .+2 ; 0x323e8 323e6: ae c0 rjmp .+348 ; 0x32544 // 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; 323e8: 80 91 69 07 lds r24, 0x0769 ; 0x800769 323ec: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 323f0: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 323f4: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 323f8: 68 1a sub r6, r24 323fa: 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)); 323fc: 77 fc sbrc r7, 7 323fe: ab c0 rjmp .+342 ; 0x32556 32400: 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) 32402: 61 14 cp r6, r1 32404: 71 04 cpc r7, r1 32406: 09 f0 breq .+2 ; 0x3240a 32408: a7 c0 rjmp .+334 ; 0x32558 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); 3240a: 40 91 69 07 lds r20, 0x0769 ; 0x800769 3240e: 50 91 6a 07 lds r21, 0x076A ; 0x80076a 32412: 60 91 6b 07 lds r22, 0x076B ; 0x80076b 32416: 70 91 6c 07 lds r23, 0x076C ; 0x80076c 3241a: 00 e0 ldi r16, 0x00 ; 0 3241c: 28 ec ldi r18, 0xC8 ; 200 3241e: 30 e0 ldi r19, 0x00 ; 0 32420: 2b 96 adiw r28, 0x0b ; 11 32422: 6e ad ldd r22, Y+62 ; 0x3e 32424: 7f ad ldd r23, Y+63 ; 0x3f 32426: 2b 97 sbiw r28, 0x0b ; 11 32428: c5 01 movw r24, r10 3242a: 0e 94 04 e2 call 0x1c408 ; 0x1c408 sm4_set_dir(X_AXIS, d); 3242e: 63 2d mov r22, r3 32430: 80 e0 ldi r24, 0x00 ; 0 32432: 0f 94 2c 6b call 0x2d658 ; 0x2d658 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 32436: 5f 92 push r5 32438: 4f 92 push r4 3243a: 81 e3 ldi r24, 0x31 ; 49 3243c: 95 ea ldi r25, 0xA5 ; 165 3243e: 9f 93 push r25 32440: 8f 93 push r24 32442: 0f 94 08 dc call 0x3b810 ; 0x3b810 lcd_set_cursor(4,3); 32446: 63 e0 ldi r22, 0x03 ; 3 32448: 84 e0 ldi r24, 0x04 ; 4 3244a: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 3244e: 5f 92 push r5 32450: 4f 92 push r4 32452: 82 e2 ldi r24, 0x22 ; 34 32454: 95 ea ldi r25, 0xA5 ; 165 32456: 9f 93 push r25 32458: 8f 93 push r24 3245a: 0e 94 7f 6f call 0xdefe ; 0xdefe 3245e: 0f b6 in r0, 0x3f ; 63 32460: f8 94 cli 32462: de bf out 0x3e, r29 ; 62 32464: 0f be out 0x3f, r0 ; 63 32466: cd bf out 0x3d, r28 ; 61 32468: 21 e0 ldi r18, 0x01 ; 1 3246a: 30 e0 ldi r19, 0x00 ; 0 3246c: 31 10 cpse r3, r1 3246e: 02 c0 rjmp .+4 ; 0x32474 32470: 2f ef ldi r18, 0xFF ; 255 32472: 3f ef ldi r19, 0xFF ; 255 32474: 40 ec ldi r20, 0xC0 ; 192 32476: 42 03 mulsu r20, r18 32478: c0 01 movw r24, r0 3247a: 43 9f mul r20, r19 3247c: 90 0d add r25, r0 3247e: 11 24 eor r1, r1 32480: 67 96 adiw r28, 0x17 ; 23 32482: 9f af std Y+63, r25 ; 0x3f 32484: 8e af std Y+62, r24 ; 0x3e 32486: 67 97 sbiw r28, 0x17 ; 23 32488: 40 ee ldi r20, 0xE0 ; 224 3248a: 53 e0 ldi r21, 0x03 ; 3 3248c: 24 9f mul r18, r20 3248e: 40 01 movw r8, r0 32490: 25 9f mul r18, r21 32492: 90 0c add r9, r0 32494: 34 9f mul r19, r20 32496: 90 0c add r9, r0 32498: 11 24 eor r1, r1 3249a: 63 96 adiw r28, 0x13 ; 19 3249c: ee ad ldd r30, Y+62 ; 0x3e 3249e: ff ad ldd r31, Y+63 ; 0x3f 324a0: 63 97 sbiw r28, 0x13 ; 19 324a2: 8e 0e add r8, r30 324a4: 9f 1e adc r9, r31 324a6: 9e 01 movw r18, r28 324a8: 2f 5f subi r18, 0xFF ; 255 324aa: 3f 4f sbci r19, 0xFF ; 255 324ac: 2d 96 adiw r28, 0x0d ; 13 324ae: 3f af std Y+63, r19 ; 0x3f 324b0: 2e af std Y+62, r18 ; 0x3e 324b2: 2d 97 sbiw r28, 0x0d ; 13 324b4: 61 96 adiw r28, 0x11 ; 17 324b6: 8e ad ldd r24, Y+62 ; 0x3e 324b8: 9f ad ldd r25, Y+63 ; 0x3f 324ba: 61 97 sbiw r28, 0x11 ; 17 324bc: 2f 96 adiw r28, 0x0f ; 15 324be: 9f af std Y+63, r25 ; 0x3f 324c0: 8e af std Y+62, r24 ; 0x3e 324c2: 2f 97 sbiw r28, 0x0f ; 15 324c4: 71 2c mov r7, r1 324c6: 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; 324c8: e0 e1 ldi r30, 0x10 ; 16 324ca: f7 e2 ldi r31, 0x27 ; 39 324cc: 27 96 adiw r28, 0x07 ; 7 324ce: ff af std Y+63, r31 ; 0x3f 324d0: ee af std Y+62, r30 ; 0x3e 324d2: 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); 324d4: 80 91 61 07 lds r24, 0x0761 ; 0x800761 324d8: 90 91 62 07 lds r25, 0x0762 ; 0x800762 324dc: a0 91 63 07 lds r26, 0x0763 ; 0x800763 324e0: b0 91 64 07 lds r27, 0x0764 ; 0x800764 324e4: 84 01 movw r16, r8 324e6: 08 1b sub r16, r24 324e8: 19 0b sbc r17, r25 324ea: 17 ff sbrs r17, 7 324ec: 03 c0 rjmp .+6 ; 0x324f4 324ee: 11 95 neg r17 324f0: 01 95 neg r16 324f2: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 324f4: 98 01 movw r18, r16 324f6: 35 95 asr r19 324f8: 27 95 ror r18 324fa: 65 96 adiw r28, 0x15 ; 21 324fc: 3f af std Y+63, r19 ; 0x3f 324fe: 2e af std Y+62, r18 ; 0x3e 32500: 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; 32502: 1c 9b sbis 0x03, 4 ; 3 32504: 33 c0 rjmp .+102 ; 0x3256c 32506: 45 e0 ldi r20, 0x05 ; 5 32508: 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); 3250a: 65 96 adiw r28, 0x15 ; 21 3250c: ae ac ldd r10, Y+62 ; 0x3e 3250e: bf ac ldd r11, Y+63 ; 0x3f 32510: 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); 32512: 63 2d mov r22, r3 32514: 82 2d mov r24, r2 32516: 0e 94 ab e1 call 0x1c356 ; 0x1c356 while (steps--){ 3251a: 31 e0 ldi r19, 0x01 ; 1 3251c: a3 1a sub r10, r19 3251e: b1 08 sbc r11, r1 32520: 40 f1 brcs .+80 ; 0x32572 accelerate_1_step(axes, acc, delay_us, min_delay_us); 32522: 28 ec ldi r18, 0xC8 ; 200 32524: 30 e0 ldi r19, 0x00 ; 0 32526: a7 01 movw r20, r14 32528: 68 ee ldi r22, 0xE8 ; 232 3252a: 73 e0 ldi r23, 0x03 ; 3 3252c: 82 2d mov r24, r2 3252e: 0e 94 7c e0 call 0x1c0f8 ; 0x1c0f8 update_position_1_step(axes, dir); 32532: 63 2d mov r22, r3 32534: 82 2d mov r24, r2 32536: 0e 94 c4 e1 call 0x1c388 ; 0x1c388 3253a: ef cf rjmp .-34 ; 0x3251a 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){ 3253c: 33 24 eor r3, r3 3253e: 33 94 inc r3 32540: 11 cf rjmp .-478 ; 0x32364 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)); 32542: 62 e0 ldi r22, 0x02 ; 2 32544: 57 ff sbrs r21, 7 32546: 03 c0 rjmp .+6 ; 0x3254e 32548: 51 95 neg r21 3254a: 41 95 neg r20 3254c: 51 09 sbc r21, r1 3254e: 82 e0 ldi r24, 0x02 ; 2 32550: 0f 94 d0 74 call 0x2e9a0 ; 0x2e9a0 32554: 49 cf rjmp .-366 ; 0x323e8 // 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)); 32556: 64 e0 ldi r22, 0x04 ; 4 32558: a3 01 movw r20, r6 3255a: 77 fe sbrs r7, 7 3255c: 03 c0 rjmp .+6 ; 0x32564 3255e: 51 95 neg r21 32560: 41 95 neg r20 32562: 51 09 sbc r21, r1 32564: 84 e0 ldi r24, 0x04 ; 4 32566: 0f 94 d0 74 call 0x2e9a0 ; 0x2e9a0 3256a: 4f cf rjmp .-354 ; 0x3240a 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; 3256c: 22 24 eor r2, r2 3256e: 23 94 inc r2 32570: cc cf rjmp .-104 ; 0x3250a 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); 32572: 65 96 adiw r28, 0x15 ; 21 32574: ee ad ldd r30, Y+62 ; 0x3e 32576: ff ad ldd r31, Y+63 ; 0x3f 32578: 65 97 sbiw r28, 0x15 ; 21 3257a: 0e 1b sub r16, r30 3257c: 1f 0b sbc r17, r31 3257e: 23 96 adiw r28, 0x03 ; 3 32580: 1f af std Y+63, r17 ; 0x3f 32582: 0e af std Y+62, r16 ; 0x3e 32584: 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); 32586: 63 2d mov r22, r3 32588: 82 2d mov r24, r2 3258a: 0e 94 ab e1 call 0x1c356 ; 0x1c356 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 3258e: 9e 01 movw r18, r28 32590: 2f 5b subi r18, 0xBF ; 191 32592: 3f 4f sbci r19, 0xFF ; 255 32594: a7 01 movw r20, r14 32596: 68 ee ldi r22, 0xE8 ; 232 32598: 73 e0 ldi r23, 0x03 ; 3 3259a: 82 2d mov r24, r2 3259c: 0e 94 22 e1 call 0x1c244 ; 0x1c244 325a0: 88 23 and r24, r24 325a2: 29 f0 breq .+10 ; 0x325ae update_position_1_step(axes, dir); 325a4: 63 2d mov r22, r3 325a6: 82 2d mov r24, r2 325a8: 0e 94 c4 e1 call 0x1c388 ; 0x1c388 325ac: f0 cf rjmp .-32 ; 0x3258e z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 325ae: 60 e0 ldi r22, 0x00 ; 0 325b0: 82 e0 ldi r24, 0x02 ; 2 325b2: 0f 94 2c 6b call 0x2d658 ; 0x2d658 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 325b6: 20 e1 ldi r18, 0x10 ; 16 325b8: 37 e2 ldi r19, 0x27 ; 39 325ba: 27 96 adiw r28, 0x07 ; 7 325bc: 3f af std Y+63, r19 ; 0x3f 325be: 2e af std Y+62, r18 ; 0x3e 325c0: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 325c2: 00 91 69 07 lds r16, 0x0769 ; 0x800769 325c6: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 325ca: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 325ce: 30 91 6c 07 lds r19, 0x076C ; 0x80076c 325d2: 00 5a subi r16, 0xA0 ; 160 325d4: 16 4f sbci r17, 0xF6 ; 246 325d6: 17 ff sbrs r17, 7 325d8: 02 c0 rjmp .+4 ; 0x325de 325da: 0f 5f subi r16, 0xFF ; 255 325dc: 1f 4f sbci r17, 0xFF ; 255 325de: 15 95 asr r17 325e0: 07 95 ror r16 325e2: 80 91 69 07 lds r24, 0x0769 ; 0x800769 325e6: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 325ea: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 325ee: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 325f2: 80 17 cp r24, r16 325f4: 91 07 cpc r25, r17 325f6: f4 f4 brge .+60 ; 0x32634 if (!_PINDA){ 325f8: 1c 9b sbis 0x03, 4 ; 3 325fa: 1c c0 rjmp .+56 ; 0x32634 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 325fc: 28 ec ldi r18, 0xC8 ; 200 325fe: 30 e0 ldi r19, 0x00 ; 0 32600: a7 01 movw r20, r14 32602: 68 ee ldi r22, 0xE8 ; 232 32604: 73 e0 ldi r23, 0x03 ; 3 32606: 84 e0 ldi r24, 0x04 ; 4 32608: 0e 94 7c e0 call 0x1c0f8 ; 0x1c0f8 /// 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_){ 3260c: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32610: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32614: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32618: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 3261c: 01 96 adiw r24, 0x01 ; 1 3261e: a1 1d adc r26, r1 32620: b1 1d adc r27, r1 32622: 80 93 69 07 sts 0x0769, r24 ; 0x800769 32626: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 3262a: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 3262e: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 32632: d7 cf rjmp .-82 ; 0x325e2 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 32634: 1c 9b sbis 0x03, 4 ; 3 32636: 3f c0 rjmp .+126 ; 0x326b6 steps_to_go = MAX(0, max_z - _Z); 32638: 80 91 69 07 lds r24, 0x0769 ; 0x800769 3263c: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32640: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32644: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32648: e0 e6 ldi r30, 0x60 ; 96 3264a: f9 e0 ldi r31, 0x09 ; 9 3264c: e8 1b sub r30, r24 3264e: f9 0b sbc r31, r25 32650: cf 01 movw r24, r30 32652: f7 ff sbrs r31, 7 32654: 02 c0 rjmp .+4 ; 0x3265a 32656: 90 e0 ldi r25, 0x00 ; 0 32658: 80 e0 ldi r24, 0x00 ; 0 3265a: 25 96 adiw r28, 0x05 ; 5 3265c: 9f af std Y+63, r25 ; 0x3f 3265e: 8e af std Y+62, r24 ; 0x3e 32660: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 32662: 1c 9b sbis 0x03, 4 ; 3 32664: 28 c0 rjmp .+80 ; 0x326b6 32666: 80 91 69 07 lds r24, 0x0769 ; 0x800769 3266a: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 3266e: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32672: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32676: 80 36 cpi r24, 0x60 ; 96 32678: 99 40 sbci r25, 0x09 ; 9 3267a: ec f4 brge .+58 ; 0x326b6 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 3267c: 9e 01 movw r18, r28 3267e: 2d 5b subi r18, 0xBD ; 189 32680: 3f 4f sbci r19, 0xFF ; 255 32682: a7 01 movw r20, r14 32684: 68 ee ldi r22, 0xE8 ; 232 32686: 73 e0 ldi r23, 0x03 ; 3 32688: 84 e0 ldi r24, 0x04 ; 4 3268a: 0e 94 22 e1 call 0x1c244 ; 0x1c244 ++_Z_; 3268e: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32692: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32696: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 3269a: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 3269e: 01 96 adiw r24, 0x01 ; 1 326a0: a1 1d adc r26, r1 326a2: b1 1d adc r27, r1 326a4: 80 93 69 07 sts 0x0769, r24 ; 0x800769 326a8: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 326ac: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 326b0: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 326b4: d6 cf rjmp .-84 ; 0x32662 /// \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); 326b6: 60 e0 ldi r22, 0x00 ; 0 326b8: 84 e0 ldi r24, 0x04 ; 4 326ba: 0e 94 ab e1 call 0x1c356 ; 0x1c356 while (delay_us < MAX_DELAY){ 326be: f7 01 movw r30, r14 326c0: 20 81 ld r18, Z 326c2: 31 81 ldd r19, Z+1 ; 0x01 326c4: 20 31 cpi r18, 0x10 ; 16 326c6: f7 e2 ldi r31, 0x27 ; 39 326c8: 3f 07 cpc r19, r31 326ca: 58 f4 brcc .+22 ; 0x326e2 accelerate_1_step(axes, -dec, delay_us, delay_us); 326cc: a7 01 movw r20, r14 326ce: 68 e1 ldi r22, 0x18 ; 24 326d0: 7c ef ldi r23, 0xFC ; 252 326d2: 84 e0 ldi r24, 0x04 ; 4 326d4: 0e 94 7c e0 call 0x1c0f8 ; 0x1c0f8 update_position_1_step(axes, dir); 326d8: 60 e0 ldi r22, 0x00 ; 0 326da: 84 e0 ldi r24, 0x04 ; 4 326dc: 0e 94 c4 e1 call 0x1c388 ; 0x1c388 326e0: ee cf rjmp .-36 ; 0x326be } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 326e2: 61 e0 ldi r22, 0x01 ; 1 326e4: 82 e0 ldi r24, 0x02 ; 2 326e6: 0f 94 2c 6b call 0x2d658 ; 0x2d658 /// speed up current_delay_us = MAX_DELAY; 326ea: 20 e1 ldi r18, 0x10 ; 16 326ec: 37 e2 ldi r19, 0x27 ; 39 326ee: f7 01 movw r30, r14 326f0: 31 83 std Z+1, r19 ; 0x01 326f2: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 326f4: 00 91 69 07 lds r16, 0x0769 ; 0x800769 326f8: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 326fc: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 32700: 30 91 6c 07 lds r19, 0x076C ; 0x80076c 32704: 0c 0d add r16, r12 32706: 1d 1d adc r17, r13 32708: 17 ff sbrs r17, 7 3270a: 02 c0 rjmp .+4 ; 0x32710 3270c: 0f 5f subi r16, 0xFF ; 255 3270e: 1f 4f sbci r17, 0xFF ; 255 32710: 15 95 asr r17 32712: 07 95 ror r16 32714: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32718: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 3271c: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32720: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32724: 08 17 cp r16, r24 32726: 19 07 cpc r17, r25 32728: 0c f0 brlt .+2 ; 0x3272c 3272a: d9 c0 rjmp .+434 ; 0x328de if (_PINDA){ 3272c: 1c 9b sbis 0x03, 4 ; 3 3272e: bb c0 rjmp .+374 ; 0x328a6 z_trig = _Z; 32730: 00 91 69 07 lds r16, 0x0769 ; 0x800769 32734: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 32738: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 3273c: 30 91 6c 07 lds r19, 0x076C ; 0x80076c break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 32740: 1c 99 sbic 0x03, 4 ; 3 32742: 28 c0 rjmp .+80 ; 0x32794 steps_to_go = MAX(0, _Z - min_z); 32744: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32748: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 3274c: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32750: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32754: 8c 19 sub r24, r12 32756: 9d 09 sbc r25, r13 32758: 97 ff sbrs r25, 7 3275a: 02 c0 rjmp .+4 ; 0x32760 3275c: 90 e0 ldi r25, 0x00 ; 0 3275e: 80 e0 ldi r24, 0x00 ; 0 32760: 25 96 adiw r28, 0x05 ; 5 32762: 9f af std Y+63, r25 ; 0x3f 32764: 8e af std Y+62, r24 ; 0x3e 32766: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 32768: 1c 99 sbic 0x03, 4 ; 3 3276a: 0c c0 rjmp .+24 ; 0x32784 3276c: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32770: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32774: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32778: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 3277c: c8 16 cp r12, r24 3277e: d9 06 cpc r13, r25 32780: 0c f4 brge .+2 ; 0x32784 32782: af c0 rjmp .+350 ; 0x328e2 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 32784: 00 91 69 07 lds r16, 0x0769 ; 0x800769 32788: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 3278c: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 32790: 30 91 6c 07 lds r19, 0x076C ; 0x80076c } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 32794: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32798: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 3279c: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 327a0: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 327a4: c8 16 cp r12, r24 327a6: d9 06 cpc r13, r25 327a8: 3c f4 brge .+14 ; 0x327b8 327aa: f7 01 movw r30, r14 327ac: 80 81 ld r24, Z 327ae: 91 81 ldd r25, Z+1 ; 0x01 327b0: 80 31 cpi r24, 0x10 ; 16 327b2: 97 42 sbci r25, 0x27 ; 39 327b4: 08 f4 brcc .+2 ; 0x327b8 327b6: b2 c0 rjmp .+356 ; 0x3291c 327b8: 0c 19 sub r16, r12 327ba: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 327bc: 31 10 cpse r3, r1 327be: ca c0 rjmp .+404 ; 0x32954 line_buffer[c] = (uint16_t)(z_trig - min_z); 327c0: f3 01 movw r30, r6 327c2: ee 0f add r30, r30 327c4: ff 1f adc r31, r31 327c6: 21 e0 ldi r18, 0x01 ; 1 327c8: 30 e0 ldi r19, 0x00 ; 0 327ca: 2c 0f add r18, r28 327cc: 3d 1f adc r19, r29 327ce: e2 0f add r30, r18 327d0: f3 1f adc r31, r19 327d2: 11 83 std Z+1, r17 ; 0x01 327d4: 00 83 st Z, r16 327d6: ff ef ldi r31, 0xFF ; 255 327d8: 6f 1a sub r6, r31 327da: 7f 0a sbc r7, r31 327dc: 67 96 adiw r28, 0x17 ; 23 327de: 2e ad ldd r18, Y+62 ; 0x3e 327e0: 3f ad ldd r19, Y+63 ; 0x3f 327e2: 67 97 sbiw r28, 0x17 ; 23 327e4: 82 0e add r8, r18 327e6: 93 1e adc r9, r19 327e8: 2d 96 adiw r28, 0x0d ; 13 327ea: 8e ad ldd r24, Y+62 ; 0x3e 327ec: 9f ad ldd r25, Y+63 ; 0x3f 327ee: 2d 97 sbiw r28, 0x0d ; 13 327f0: 02 97 sbiw r24, 0x02 ; 2 327f2: 2d 96 adiw r28, 0x0d ; 13 327f4: 9f af std Y+63, r25 ; 0x3f 327f6: 8e af std Y+62, r24 ; 0x3e 327f8: 2d 97 sbiw r28, 0x0d ; 13 327fa: 2f 96 adiw r28, 0x0f ; 15 327fc: ee ad ldd r30, Y+62 ; 0x3e 327fe: ff ad ldd r31, Y+63 ; 0x3f 32800: 2f 97 sbiw r28, 0x0f ; 15 32802: 31 97 sbiw r30, 0x01 ; 1 32804: 2f 96 adiw r28, 0x0f ; 15 32806: ff af std Y+63, r31 ; 0x3f 32808: ee af std Y+62, r30 ; 0x3e 3280a: 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 3280c: f0 e2 ldi r31, 0x20 ; 32 3280e: 6f 16 cp r6, r31 32810: 71 04 cpc r7, r1 32812: 09 f0 breq .+2 ; 0x32816 32814: 59 ce rjmp .-846 ; 0x324c8 32816: 21 e0 ldi r18, 0x01 ; 1 32818: 42 1a sub r4, r18 3281a: 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){ 3281c: 31 e0 ldi r19, 0x01 ; 1 3281e: 33 12 cpse r3, r19 32820: 8d ce rjmp .-742 ; 0x3253c 32822: 61 96 adiw r28, 0x11 ; 17 32824: 8e ad ldd r24, Y+62 ; 0x3e 32826: 9f ad ldd r25, Y+63 ; 0x3f 32828: 61 97 sbiw r28, 0x11 ; 17 3282a: 80 96 adiw r24, 0x20 ; 32 3282c: 61 96 adiw r28, 0x11 ; 17 3282e: 9f af std Y+63, r25 ; 0x3f 32830: 8e af std Y+62, r24 ; 0x3e 32832: 61 97 sbiw r28, 0x11 ; 17 32834: 2b 96 adiw r28, 0x0b ; 11 32836: ee ad ldd r30, Y+62 ; 0x3e 32838: ff ad ldd r31, Y+63 ; 0x3f 3283a: 2b 97 sbiw r28, 0x0b ; 11 3283c: e0 5c subi r30, 0xC0 ; 192 3283e: ff 4f sbci r31, 0xFF ; 255 32840: 2b 96 adiw r28, 0x0b ; 11 32842: ff af std Y+63, r31 ; 0x3f 32844: ee af std Y+62, r30 ; 0x3e 32846: 2b 97 sbiw r28, 0x0b ; 11 32848: 29 96 adiw r28, 0x09 ; 9 3284a: 2e ad ldd r18, Y+62 ; 0x3e 3284c: 3f ad ldd r19, Y+63 ; 0x3f 3284e: 29 97 sbiw r28, 0x09 ; 9 32850: 22 50 subi r18, 0x02 ; 2 32852: 31 09 sbc r19, r1 32854: 29 96 adiw r28, 0x09 ; 9 32856: 3f af std Y+63, r19 ; 0x3f 32858: 2e af std Y+62, r18 ; 0x3e 3285a: 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 3285c: 23 2b or r18, r19 3285e: 09 f0 breq .+2 ; 0x32862 32860: 72 cd rjmp .-1308 ; 0x32346 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); 32862: 80 e2 ldi r24, 0x20 ; 32 32864: 95 ea ldi r25, 0xA5 ; 165 32866: 9f 93 push r25 32868: 8f 93 push r24 3286a: 0f 94 08 dc call 0x3b810 ; 0x3b810 3286e: 0f 90 pop r0 32870: 0f 90 pop r0 } 32872: c6 5a subi r28, 0xA6 ; 166 32874: df 4f sbci r29, 0xFF ; 255 32876: 0f b6 in r0, 0x3f ; 63 32878: f8 94 cli 3287a: de bf out 0x3e, r29 ; 62 3287c: 0f be out 0x3f, r0 ; 63 3287e: cd bf out 0x3d, r28 ; 61 32880: df 91 pop r29 32882: cf 91 pop r28 32884: 1f 91 pop r17 32886: 0f 91 pop r16 32888: ff 90 pop r15 3288a: ef 90 pop r14 3288c: df 90 pop r13 3288e: cf 90 pop r12 32890: bf 90 pop r11 32892: af 90 pop r10 32894: 9f 90 pop r9 32896: 8f 90 pop r8 32898: 7f 90 pop r7 3289a: 6f 90 pop r6 3289c: 5f 90 pop r5 3289e: 4f 90 pop r4 328a0: 3f 90 pop r3 328a2: 2f 90 pop r2 328a4: 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); 328a6: 28 ec ldi r18, 0xC8 ; 200 328a8: 30 e0 ldi r19, 0x00 ; 0 328aa: a7 01 movw r20, r14 328ac: 68 ee ldi r22, 0xE8 ; 232 328ae: 73 e0 ldi r23, 0x03 ; 3 328b0: 84 e0 ldi r24, 0x04 ; 4 328b2: 0e 94 7c e0 call 0x1c0f8 ; 0x1c0f8 /// 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_){ 328b6: 80 91 69 07 lds r24, 0x0769 ; 0x800769 328ba: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 328be: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 328c2: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 328c6: 01 97 sbiw r24, 0x01 ; 1 328c8: a1 09 sbc r26, r1 328ca: b1 09 sbc r27, r1 328cc: 80 93 69 07 sts 0x0769, r24 ; 0x800769 328d0: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 328d4: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 328d8: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 328dc: 1b cf rjmp .-458 ; 0x32714 328de: 86 01 movw r16, r12 328e0: 2f cf rjmp .-418 ; 0x32740 } /// 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); 328e2: 9e 01 movw r18, r28 328e4: 2d 5b subi r18, 0xBD ; 189 328e6: 3f 4f sbci r19, 0xFF ; 255 328e8: a7 01 movw r20, r14 328ea: 68 ee ldi r22, 0xE8 ; 232 328ec: 73 e0 ldi r23, 0x03 ; 3 328ee: 84 e0 ldi r24, 0x04 ; 4 328f0: 0e 94 22 e1 call 0x1c244 ; 0x1c244 --_Z_; 328f4: 80 91 69 07 lds r24, 0x0769 ; 0x800769 328f8: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 328fc: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32900: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32904: 01 97 sbiw r24, 0x01 ; 1 32906: a1 09 sbc r26, r1 32908: b1 09 sbc r27, r1 3290a: 80 93 69 07 sts 0x0769, r24 ; 0x800769 3290e: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 32912: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 32916: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 3291a: 26 cf rjmp .-436 ; 0x32768 } 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); 3291c: 28 ec ldi r18, 0xC8 ; 200 3291e: 30 e0 ldi r19, 0x00 ; 0 32920: a7 01 movw r20, r14 32922: 68 e1 ldi r22, 0x18 ; 24 32924: 7c ef ldi r23, 0xFC ; 252 32926: 84 e0 ldi r24, 0x04 ; 4 32928: 0e 94 7c e0 call 0x1c0f8 ; 0x1c0f8 --_Z_; 3292c: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32930: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32934: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32938: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 3293c: 01 97 sbiw r24, 0x01 ; 1 3293e: a1 09 sbc r26, r1 32940: b1 09 sbc r27, r1 32942: 80 93 69 07 sts 0x0769, r24 ; 0x800769 32946: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 3294a: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 3294e: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 32952: 20 cf rjmp .-448 ; 0x32794 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); 32954: 2d 96 adiw r28, 0x0d ; 13 32956: ee ad ldd r30, Y+62 ; 0x3e 32958: ff ad ldd r31, Y+63 ; 0x3f 3295a: 2d 97 sbiw r28, 0x0d ; 13 3295c: 86 ad ldd r24, Z+62 ; 0x3e 3295e: 97 ad ldd r25, Z+63 ; 0x3f 32960: 01 2e mov r0, r17 32962: 00 0c add r0, r0 32964: 22 0b sbc r18, r18 32966: 33 0b sbc r19, r19 32968: 08 0f add r16, r24 3296a: 19 1f adc r17, r25 3296c: 21 1d adc r18, r1 3296e: 31 1d adc r19, r1 32970: 36 95 lsr r19 32972: 27 95 ror r18 32974: 17 95 ror r17 32976: 07 95 ror r16 32978: 0f 3f cpi r16, 0xFF ; 255 3297a: 11 05 cpc r17, r1 3297c: 21 05 cpc r18, r1 3297e: 31 05 cpc r19, r1 32980: 29 f0 breq .+10 ; 0x3298c 32982: 20 f0 brcs .+8 ; 0x3298c 32984: 0f ef ldi r16, 0xFF ; 255 32986: 10 e0 ldi r17, 0x00 ; 0 32988: 20 e0 ldi r18, 0x00 ; 0 3298a: 30 e0 ldi r19, 0x00 ; 0 3298c: 2f 96 adiw r28, 0x0f ; 15 3298e: ee ad ldd r30, Y+62 ; 0x3e 32990: ff ad ldd r31, Y+63 ; 0x3f 32992: 2f 97 sbiw r28, 0x0f ; 15 32994: 07 8f std Z+31, r16 ; 0x1f 32996: 1f cf rjmp .-450 ; 0x327d6 00032998 : /// 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) 32998: 2f 92 push r2 3299a: 3f 92 push r3 3299c: 4f 92 push r4 3299e: 5f 92 push r5 329a0: 6f 92 push r6 329a2: 7f 92 push r7 329a4: 8f 92 push r8 329a6: 9f 92 push r9 329a8: af 92 push r10 329aa: bf 92 push r11 329ac: cf 92 push r12 329ae: df 92 push r13 329b0: ef 92 push r14 329b2: ff 92 push r15 329b4: 0f 93 push r16 329b6: 1f 93 push r17 329b8: cf 93 push r28 329ba: df 93 push r29 329bc: cd b7 in r28, 0x3d ; 61 329be: de b7 in r29, 0x3e ; 62 329c0: 6c 97 sbiw r28, 0x1c ; 28 329c2: 0f b6 in r0, 0x3f ; 63 329c4: f8 94 cli 329c6: de bf out 0x3e, r29 ; 62 329c8: 0f be out 0x3f, r0 ; 63 329ca: cd bf out 0x3d, r28 ; 61 329cc: 6c 01 movw r12, r24 329ce: 5b 01 movw r10, r22 329d0: 4a 01 movw r8, r20 329d2: 19 01 movw r2, r18 329d4: 18 87 std Y+8, r17 ; 0x08 329d6: 0f 83 std Y+7, r16 ; 0x07 329d8: fa 82 std Y+2, r15 ; 0x02 329da: 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; 329dc: d7 01 movw r26, r14 329de: 8d 91 ld r24, X+ 329e0: 9c 91 ld r25, X 329e2: 60 ed ldi r22, 0xD0 ; 208 329e4: 72 e0 ldi r23, 0x02 ; 2 329e6: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 329ea: 9c 8f std Y+28, r25 ; 0x1c 329ec: 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); 329ee: 9f 93 push r25 329f0: 8f 93 push r24 329f2: 3f 92 push r3 329f4: 2f 93 push r18 329f6: 1f 92 push r1 329f8: 84 e6 ldi r24, 0x64 ; 100 329fa: 8f 93 push r24 329fc: 9f 92 push r9 329fe: 8f 92 push r8 32a00: bf 92 push r11 32a02: af 92 push r10 32a04: df 92 push r13 32a06: cf 92 push r12 32a08: 88 ee ldi r24, 0xE8 ; 232 32a0a: 94 ea ldi r25, 0xA4 ; 164 32a0c: 9f 93 push r25 32a0e: 8f 93 push r24 32a10: 0f 94 08 dc call 0x3b810 ; 0x3b810 32a14: 0f b6 in r0, 0x3f ; 63 32a16: f8 94 cli 32a18: de bf out 0x3e, r29 ; 62 32a1a: 0f be out 0x3f, r0 ; 63 32a1c: 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; 32a1e: 22 27 eor r18, r18 32a20: 33 27 eor r19, r19 32a22: 22 19 sub r18, r2 32a24: 33 09 sbc r19, r3 32a26: 3a 8f std Y+26, r19 ; 0x1a 32a28: 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)); 32a2a: c4 01 movw r24, r8 32a2c: 99 0c add r9, r9 32a2e: aa 0b sbc r26, r26 32a30: bb 0b sbc r27, r27 32a32: 89 87 std Y+9, r24 ; 0x09 32a34: 9a 87 std Y+10, r25 ; 0x0a 32a36: ab 87 std Y+11, r26 ; 0x0b 32a38: 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)); 32a3a: 95 01 movw r18, r10 32a3c: bb 0c add r11, r11 32a3e: 44 0b sbc r20, r20 32a40: 55 0b sbc r21, r21 32a42: 29 8b std Y+17, r18 ; 0x11 32a44: 3a 8b std Y+18, r19 ; 0x12 32a46: 4b 8b std Y+19, r20 ; 0x13 32a48: 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)); 32a4a: c6 01 movw r24, r12 32a4c: dd 0c add r13, r13 32a4e: aa 0b sbc r26, r26 32a50: bb 0b sbc r27, r27 32a52: 8d 8b std Y+21, r24 ; 0x15 32a54: 9e 8b std Y+22, r25 ; 0x16 32a56: af 8b std Y+23, r26 ; 0x17 32a58: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 32a5a: 12 14 cp r1, r2 32a5c: 13 04 cpc r1, r3 32a5e: 0c f0 brlt .+2 ; 0x32a62 32a60: ba c0 rjmp .+372 ; 0x32bd6 { dad = dad_max - (ad / k); 32a62: 8b 8d ldd r24, Y+27 ; 0x1b 32a64: 9c 8d ldd r25, Y+28 ; 0x1c 32a66: 6c e3 ldi r22, 0x3C ; 60 32a68: 70 e0 ldi r23, 0x00 ; 0 32a6a: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 32a6e: 10 e1 ldi r17, 0x10 ; 16 32a70: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 32a72: 2b 8d ldd r18, Y+27 ; 0x1b 32a74: 3c 8d ldd r19, Y+28 ; 0x1c 32a76: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32a78: 0f 94 66 de call 0x3bccc ; 0x3bccc <__usmulhisi3> 32a7c: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 32a80: 20 e0 ldi r18, 0x00 ; 0 32a82: 30 e0 ldi r19, 0x00 ; 0 32a84: 44 e3 ldi r20, 0x34 ; 52 32a86: 54 e4 ldi r21, 0x44 ; 68 32a88: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 32a8c: 6b 01 movw r12, r22 32a8e: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 32a90: 6f 81 ldd r22, Y+7 ; 0x07 32a92: 78 85 ldd r23, Y+8 ; 0x08 32a94: eb 8d ldd r30, Y+27 ; 0x1b 32a96: fc 8d ldd r31, Y+28 ; 0x1c 32a98: 6e 0f add r22, r30 32a9a: 7f 1f adc r23, r31 32a9c: 90 e0 ldi r25, 0x00 ; 0 32a9e: 80 e0 ldi r24, 0x00 ; 0 32aa0: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 32aa4: 25 e3 ldi r18, 0x35 ; 53 32aa6: 3a ef ldi r19, 0xFA ; 250 32aa8: 4e e8 ldi r20, 0x8E ; 142 32aaa: 5c e3 ldi r21, 0x3C ; 60 32aac: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32ab0: 4b 01 movw r8, r22 32ab2: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 32ab4: 0f 94 68 df call 0x3bed0 ; 0x3bed0 32ab8: 6b 83 std Y+3, r22 ; 0x03 32aba: 7c 83 std Y+4, r23 ; 0x04 32abc: 8d 83 std Y+5, r24 ; 0x05 32abe: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 32ac0: c5 01 movw r24, r10 32ac2: b4 01 movw r22, r8 32ac4: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 32ac8: 2b 01 movw r4, r22 32aca: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 32acc: 69 85 ldd r22, Y+9 ; 0x09 32ace: 7a 85 ldd r23, Y+10 ; 0x0a 32ad0: 8b 85 ldd r24, Y+11 ; 0x0b 32ad2: 9c 85 ldd r25, Y+12 ; 0x0c 32ad4: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 32ad8: 4b 01 movw r8, r22 32ada: 5c 01 movw r10, r24 32adc: 2b 8d ldd r18, Y+27 ; 0x1b 32ade: 3c 8d ldd r19, Y+28 ; 0x1c 32ae0: a4 e6 ldi r26, 0x64 ; 100 32ae2: b0 e0 ldi r27, 0x00 ; 0 32ae4: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 32ae8: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 32aec: 20 e0 ldi r18, 0x00 ; 0 32aee: 30 e0 ldi r19, 0x00 ; 0 32af0: 44 e3 ldi r20, 0x34 ; 52 32af2: 54 e4 ldi r21, 0x44 ; 68 32af4: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 32af8: 9b 01 movw r18, r22 32afa: ac 01 movw r20, r24 32afc: c5 01 movw r24, r10 32afe: b4 01 movw r22, r8 32b00: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 32b04: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 32b08: 6d 87 std Y+13, r22 ; 0x0d 32b0a: 7e 87 std Y+14, r23 ; 0x0e 32b0c: 8f 87 std Y+15, r24 ; 0x0f 32b0e: 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)); 32b10: 69 89 ldd r22, Y+17 ; 0x11 32b12: 7a 89 ldd r23, Y+18 ; 0x12 32b14: 8b 89 ldd r24, Y+19 ; 0x13 32b16: 9c 89 ldd r25, Y+20 ; 0x14 32b18: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 32b1c: 4b 01 movw r8, r22 32b1e: 5c 01 movw r10, r24 32b20: a3 01 movw r20, r6 32b22: 92 01 movw r18, r4 32b24: c7 01 movw r24, r14 32b26: b6 01 movw r22, r12 32b28: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32b2c: 9b 01 movw r18, r22 32b2e: ac 01 movw r20, r24 32b30: c5 01 movw r24, r10 32b32: b4 01 movw r22, r8 32b34: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 32b38: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 32b3c: 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)); 32b3e: 6d 89 ldd r22, Y+21 ; 0x15 32b40: 7e 89 ldd r23, Y+22 ; 0x16 32b42: 8f 89 ldd r24, Y+23 ; 0x17 32b44: 98 8d ldd r25, Y+24 ; 0x18 32b46: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 32b4a: 2b 01 movw r4, r22 32b4c: 3c 01 movw r6, r24 32b4e: a7 01 movw r20, r14 32b50: 96 01 movw r18, r12 32b52: 6b 81 ldd r22, Y+3 ; 0x03 32b54: 7c 81 ldd r23, Y+4 ; 0x04 32b56: 8d 81 ldd r24, Y+5 ; 0x05 32b58: 9e 81 ldd r25, Y+6 ; 0x06 32b5a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32b5e: 9b 01 movw r18, r22 32b60: ac 01 movw r20, r24 32b62: c3 01 movw r24, r6 32b64: b2 01 movw r22, r4 32b66: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 32b6a: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 32b6e: 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)) 32b70: 01 e0 ldi r16, 0x01 ; 1 32b72: 20 e4 ldi r18, 0x40 ; 64 32b74: 31 e0 ldi r19, 0x01 ; 1 32b76: 4d 85 ldd r20, Y+13 ; 0x0d 32b78: 5e 85 ldd r21, Y+14 ; 0x0e 32b7a: b4 01 movw r22, r8 32b7c: 0e 94 04 e2 call 0x1c408 ; 0x1c408 32b80: 21 2f mov r18, r17 32b82: 30 e0 ldi r19, 0x00 ; 0 32b84: 88 23 and r24, r24 32b86: b9 f1 breq .+110 ; 0x32bf6 32b88: 4b 8d ldd r20, Y+27 ; 0x1b 32b8a: 5c 8d ldd r21, Y+28 ; 0x1c 32b8c: 42 0f add r20, r18 32b8e: 53 1f adc r21, r19 { ad += dad + 1; 32b90: 4f 5f subi r20, 0xFF ; 255 32b92: 5f 4f sbci r21, 0xFF ; 255 32b94: 5c 8f std Y+28, r21 ; 0x1c 32b96: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 32b98: eb 8d ldd r30, Y+27 ; 0x1b 32b9a: fc 8d ldd r31, Y+28 ; 0x1c 32b9c: a9 81 ldd r26, Y+1 ; 0x01 32b9e: ba 81 ldd r27, Y+2 ; 0x02 32ba0: ed 93 st X+, r30 32ba2: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 32ba4: 6c 96 adiw r28, 0x1c ; 28 32ba6: 0f b6 in r0, 0x3f ; 63 32ba8: f8 94 cli 32baa: de bf out 0x3e, r29 ; 62 32bac: 0f be out 0x3f, r0 ; 63 32bae: cd bf out 0x3d, r28 ; 61 32bb0: df 91 pop r29 32bb2: cf 91 pop r28 32bb4: 1f 91 pop r17 32bb6: 0f 91 pop r16 32bb8: ff 90 pop r15 32bba: ef 90 pop r14 32bbc: df 90 pop r13 32bbe: cf 90 pop r12 32bc0: bf 90 pop r11 32bc2: af 90 pop r10 32bc4: 9f 90 pop r9 32bc6: 8f 90 pop r8 32bc8: 7f 90 pop r7 32bca: 6f 90 pop r6 32bcc: 5f 90 pop r5 32bce: 4f 90 pop r4 32bd0: 3f 90 pop r3 32bd2: 2f 90 pop r2 32bd4: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 32bd6: 2f ec ldi r18, 0xCF ; 207 32bd8: 32 e0 ldi r19, 0x02 ; 2 32bda: ab 8d ldd r26, Y+27 ; 0x1b 32bdc: bc 8d ldd r27, Y+28 ; 0x1c 32bde: 2a 1b sub r18, r26 32be0: 3b 0b sbc r19, r27 32be2: c9 01 movw r24, r18 32be4: 6c e3 ldi r22, 0x3C ; 60 32be6: 70 e0 ldi r23, 0x00 ; 0 32be8: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 32bec: 10 e1 ldi r17, 0x10 ; 16 32bee: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32bf0: a9 8d ldd r26, Y+25 ; 0x19 32bf2: ba 8d ldd r27, Y+26 ; 0x1a 32bf4: 41 cf rjmp .-382 ; 0x32a78 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 32bf6: 2f 5f subi r18, 0xFF ; 255 32bf8: 3f 4f sbci r19, 0xFF ; 255 32bfa: ab 8d ldd r26, Y+27 ; 0x1b 32bfc: bc 8d ldd r27, Y+28 ; 0x1c 32bfe: a2 0f add r26, r18 32c00: b3 1f adc r27, r19 32c02: bc 8f std Y+28, r27 ; 0x1c 32c04: ab 8f std Y+27, r26 ; 0x1b 32c06: a0 3d cpi r26, 0xD0 ; 208 32c08: b2 40 sbci r27, 0x02 ; 2 32c0a: 08 f4 brcc .+2 ; 0x32c0e 32c0c: 26 cf rjmp .-436 ; 0x32a5a 32c0e: c4 cf rjmp .-120 ; 0x32b98 00032c10 : float mesh_bed_leveling::get_z(float x, float y) { 32c10: 2f 92 push r2 32c12: 3f 92 push r3 32c14: 4f 92 push r4 32c16: 5f 92 push r5 32c18: 6f 92 push r6 32c1a: 7f 92 push r7 32c1c: 8f 92 push r8 32c1e: 9f 92 push r9 32c20: af 92 push r10 32c22: bf 92 push r11 32c24: cf 92 push r12 32c26: df 92 push r13 32c28: ef 92 push r14 32c2a: ff 92 push r15 32c2c: 0f 93 push r16 32c2e: 1f 93 push r17 32c30: cf 93 push r28 32c32: df 93 push r29 32c34: 00 d0 rcall .+0 ; 0x32c36 32c36: 00 d0 rcall .+0 ; 0x32c38 32c38: 00 d0 rcall .+0 ; 0x32c3a 32c3a: 1f 92 push r1 32c3c: cd b7 in r28, 0x3d ; 61 32c3e: de b7 in r29, 0x3e ; 62 32c40: 2b 01 movw r4, r22 32c42: 3c 01 movw r6, r24 32c44: 49 01 movw r8, r18 32c46: 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)); 32c48: 20 e0 ldi r18, 0x00 ; 0 32c4a: 30 e0 ldi r19, 0x00 ; 0 32c4c: 40 ec ldi r20, 0xC0 ; 192 32c4e: 51 e4 ldi r21, 0x41 ; 65 32c50: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 32c54: 20 e0 ldi r18, 0x00 ; 0 32c56: 30 e0 ldi r19, 0x00 ; 0 32c58: 48 e0 ldi r20, 0x08 ; 8 32c5a: 52 e4 ldi r21, 0x42 ; 66 32c5c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 32c60: 6b 01 movw r12, r22 32c62: 7c 01 movw r14, r24 32c64: 0f 94 15 e0 call 0x3c02a ; 0x3c02a 32c68: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> if (i < 0) { i = 0; 32c6c: 31 2c mov r3, r1 32c6e: 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) { 32c70: 77 fd sbrc r23, 7 32c72: 1e c0 rjmp .+60 ; 0x32cb0 32c74: 1b 01 movw r2, r22 32c76: 66 30 cpi r22, 0x06 ; 6 32c78: 71 05 cpc r23, r1 32c7a: 1c f0 brlt .+6 ; 0x32c82 32c7c: 45 e0 ldi r20, 0x05 ; 5 32c7e: 24 2e mov r2, r20 32c80: 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; } 32c82: 82 2d mov r24, r2 32c84: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 32c88: 20 e0 ldi r18, 0x00 ; 0 32c8a: 30 e0 ldi r19, 0x00 ; 0 32c8c: 48 eb ldi r20, 0xB8 ; 184 32c8e: 51 e4 ldi r21, 0x41 ; 65 32c90: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 32c94: 9b 01 movw r18, r22 32c96: 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; 32c98: c3 01 movw r24, r6 32c9a: b2 01 movw r22, r4 32c9c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 32ca0: 20 e0 ldi r18, 0x00 ; 0 32ca2: 30 e0 ldi r19, 0x00 ; 0 32ca4: 48 e0 ldi r20, 0x08 ; 8 32ca6: 52 e4 ldi r21, 0x42 ; 66 32ca8: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 32cac: 6b 01 movw r12, r22 32cae: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 32cb0: 20 e0 ldi r18, 0x00 ; 0 32cb2: 30 e0 ldi r19, 0x00 ; 0 32cb4: 40 ec ldi r20, 0xC0 ; 192 32cb6: 50 e4 ldi r21, 0x40 ; 64 32cb8: c5 01 movw r24, r10 32cba: b4 01 movw r22, r8 32cbc: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 32cc0: 20 e0 ldi r18, 0x00 ; 0 32cc2: 30 e0 ldi r19, 0x00 ; 0 32cc4: 48 e0 ldi r20, 0x08 ; 8 32cc6: 52 e4 ldi r21, 0x42 ; 66 32cc8: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 32ccc: 69 83 std Y+1, r22 ; 0x01 32cce: 7a 83 std Y+2, r23 ; 0x02 32cd0: 8b 83 std Y+3, r24 ; 0x03 32cd2: 9c 83 std Y+4, r25 ; 0x04 32cd4: 0f 94 15 e0 call 0x3c02a ; 0x3c02a 32cd8: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> if (j < 0) { 32cdc: 77 fd sbrc r23, 7 32cde: da c0 rjmp .+436 ; 0x32e94 32ce0: 7a 87 std Y+10, r23 ; 0x0a 32ce2: 69 87 std Y+9, r22 ; 0x09 32ce4: 66 30 cpi r22, 0x06 ; 6 32ce6: 71 05 cpc r23, r1 32ce8: 24 f0 brlt .+8 ; 0x32cf2 32cea: e5 e0 ldi r30, 0x05 ; 5 32cec: f0 e0 ldi r31, 0x00 ; 0 32cee: fa 87 std Y+10, r31 ; 0x0a 32cf0: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 32cf2: 89 85 ldd r24, Y+9 ; 0x09 32cf4: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 32cf8: 20 e0 ldi r18, 0x00 ; 0 32cfa: 30 e0 ldi r19, 0x00 ; 0 32cfc: 40 ea ldi r20, 0xA0 ; 160 32cfe: 50 e4 ldi r21, 0x40 ; 64 32d00: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 32d04: 9b 01 movw r18, r22 32d06: 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; 32d08: c5 01 movw r24, r10 32d0a: b4 01 movw r22, r8 32d0c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 32d10: 20 e0 ldi r18, 0x00 ; 0 32d12: 30 e0 ldi r19, 0x00 ; 0 32d14: 48 e0 ldi r20, 0x08 ; 8 32d16: 52 e4 ldi r21, 0x42 ; 66 32d18: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 32d1c: 69 83 std Y+1, r22 ; 0x01 32d1e: 7a 83 std Y+2, r23 ; 0x02 32d20: 8b 83 std Y+3, r24 ; 0x03 32d22: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 32d24: a7 01 movw r20, r14 32d26: 96 01 movw r18, r12 32d28: 60 e0 ldi r22, 0x00 ; 0 32d2a: 70 e0 ldi r23, 0x00 ; 0 32d2c: 80 e8 ldi r24, 0x80 ; 128 32d2e: 9f e3 ldi r25, 0x3F ; 63 32d30: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 32d34: 2b 01 movw r4, r22 32d36: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 32d38: 91 01 movw r18, r2 32d3a: 2f 5f subi r18, 0xFF ; 255 32d3c: 3f 4f sbci r19, 0xFF ; 255 32d3e: 3e 83 std Y+6, r19 ; 0x06 32d40: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 32d42: 89 85 ldd r24, Y+9 ; 0x09 32d44: 9a 85 ldd r25, Y+10 ; 0x0a 32d46: 01 96 adiw r24, 0x01 ; 1 32d48: 98 87 std Y+8, r25 ; 0x08 32d4a: 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]; 32d4c: 27 e0 ldi r18, 0x07 ; 7 32d4e: e9 85 ldd r30, Y+9 ; 0x09 32d50: fa 85 ldd r31, Y+10 ; 0x0a 32d52: 2e 9f mul r18, r30 32d54: 80 01 movw r16, r0 32d56: 2f 9f mul r18, r31 32d58: 10 0d add r17, r0 32d5a: 11 24 eor r1, r1 32d5c: f8 01 movw r30, r16 32d5e: e2 0d add r30, r2 32d60: f3 1d adc r31, r3 32d62: ee 0f add r30, r30 32d64: ff 1f adc r31, r31 32d66: ee 0f add r30, r30 32d68: ff 1f adc r31, r31 32d6a: e3 56 subi r30, 0x63 ; 99 32d6c: fc 4e sbci r31, 0xEC ; 236 32d6e: 21 81 ldd r18, Z+1 ; 0x01 32d70: 32 81 ldd r19, Z+2 ; 0x02 32d72: 43 81 ldd r20, Z+3 ; 0x03 32d74: 54 81 ldd r21, Z+4 ; 0x04 32d76: c3 01 movw r24, r6 32d78: b2 01 movw r22, r4 32d7a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32d7e: 4b 01 movw r8, r22 32d80: 5c 01 movw r10, r24 32d82: ed 81 ldd r30, Y+5 ; 0x05 32d84: fe 81 ldd r31, Y+6 ; 0x06 32d86: e0 0f add r30, r16 32d88: f1 1f adc r31, r17 32d8a: ee 0f add r30, r30 32d8c: ff 1f adc r31, r31 32d8e: ee 0f add r30, r30 32d90: ff 1f adc r31, r31 32d92: e3 56 subi r30, 0x63 ; 99 32d94: fc 4e sbci r31, 0xEC ; 236 32d96: 21 81 ldd r18, Z+1 ; 0x01 32d98: 32 81 ldd r19, Z+2 ; 0x02 32d9a: 43 81 ldd r20, Z+3 ; 0x03 32d9c: 54 81 ldd r21, Z+4 ; 0x04 32d9e: c7 01 movw r24, r14 32da0: b6 01 movw r22, r12 32da2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32da6: 9b 01 movw r18, r22 32da8: ac 01 movw r20, r24 32daa: c5 01 movw r24, r10 32dac: b4 01 movw r22, r8 32dae: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 32db2: 4b 01 movw r8, r22 32db4: 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; 32db6: 29 81 ldd r18, Y+1 ; 0x01 32db8: 3a 81 ldd r19, Y+2 ; 0x02 32dba: 4b 81 ldd r20, Y+3 ; 0x03 32dbc: 5c 81 ldd r21, Y+4 ; 0x04 32dbe: 60 e0 ldi r22, 0x00 ; 0 32dc0: 70 e0 ldi r23, 0x00 ; 0 32dc2: 80 e8 ldi r24, 0x80 ; 128 32dc4: 9f e3 ldi r25, 0x3F ; 63 32dc6: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 32dca: 9b 01 movw r18, r22 32dcc: ac 01 movw r20, r24 32dce: c5 01 movw r24, r10 32dd0: b4 01 movw r22, r8 32dd2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32dd6: 4b 01 movw r8, r22 32dd8: 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]; 32dda: 27 e0 ldi r18, 0x07 ; 7 32ddc: ef 81 ldd r30, Y+7 ; 0x07 32dde: f8 85 ldd r31, Y+8 ; 0x08 32de0: 2e 9f mul r18, r30 32de2: c0 01 movw r24, r0 32de4: 2f 9f mul r18, r31 32de6: 90 0d add r25, r0 32de8: 11 24 eor r1, r1 32dea: 9a 87 std Y+10, r25 ; 0x0a 32dec: 89 87 std Y+9, r24 ; 0x09 32dee: fc 01 movw r30, r24 32df0: e2 0d add r30, r2 32df2: f3 1d adc r31, r3 32df4: ee 0f add r30, r30 32df6: ff 1f adc r31, r31 32df8: ee 0f add r30, r30 32dfa: ff 1f adc r31, r31 32dfc: e3 56 subi r30, 0x63 ; 99 32dfe: fc 4e sbci r31, 0xEC ; 236 32e00: 21 81 ldd r18, Z+1 ; 0x01 32e02: 32 81 ldd r19, Z+2 ; 0x02 32e04: 43 81 ldd r20, Z+3 ; 0x03 32e06: 54 81 ldd r21, Z+4 ; 0x04 32e08: c3 01 movw r24, r6 32e0a: b2 01 movw r22, r4 32e0c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32e10: 2b 01 movw r4, r22 32e12: 3c 01 movw r6, r24 32e14: 89 85 ldd r24, Y+9 ; 0x09 32e16: 9a 85 ldd r25, Y+10 ; 0x0a 32e18: ed 81 ldd r30, Y+5 ; 0x05 32e1a: fe 81 ldd r31, Y+6 ; 0x06 32e1c: 8e 0f add r24, r30 32e1e: 9f 1f adc r25, r31 32e20: 88 0f add r24, r24 32e22: 99 1f adc r25, r25 32e24: 88 0f add r24, r24 32e26: 99 1f adc r25, r25 32e28: 83 56 subi r24, 0x63 ; 99 32e2a: 9c 4e sbci r25, 0xEC ; 236 32e2c: fc 01 movw r30, r24 32e2e: 21 81 ldd r18, Z+1 ; 0x01 32e30: 32 81 ldd r19, Z+2 ; 0x02 32e32: 43 81 ldd r20, Z+3 ; 0x03 32e34: 54 81 ldd r21, Z+4 ; 0x04 32e36: c7 01 movw r24, r14 32e38: b6 01 movw r22, r12 32e3a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32e3e: 9b 01 movw r18, r22 32e40: ac 01 movw r20, r24 32e42: c3 01 movw r24, r6 32e44: b2 01 movw r22, r4 32e46: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> return (1.f-t) * z0 + t * z1; 32e4a: 29 81 ldd r18, Y+1 ; 0x01 32e4c: 3a 81 ldd r19, Y+2 ; 0x02 32e4e: 4b 81 ldd r20, Y+3 ; 0x03 32e50: 5c 81 ldd r21, Y+4 ; 0x04 32e52: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 32e56: 9b 01 movw r18, r22 32e58: ac 01 movw r20, r24 32e5a: c5 01 movw r24, r10 32e5c: b4 01 movw r22, r8 32e5e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> } 32e62: 2a 96 adiw r28, 0x0a ; 10 32e64: 0f b6 in r0, 0x3f ; 63 32e66: f8 94 cli 32e68: de bf out 0x3e, r29 ; 62 32e6a: 0f be out 0x3f, r0 ; 63 32e6c: cd bf out 0x3d, r28 ; 61 32e6e: df 91 pop r29 32e70: cf 91 pop r28 32e72: 1f 91 pop r17 32e74: 0f 91 pop r16 32e76: ff 90 pop r15 32e78: ef 90 pop r14 32e7a: df 90 pop r13 32e7c: cf 90 pop r12 32e7e: bf 90 pop r11 32e80: af 90 pop r10 32e82: 9f 90 pop r9 32e84: 8f 90 pop r8 32e86: 7f 90 pop r7 32e88: 6f 90 pop r6 32e8a: 5f 90 pop r5 32e8c: 4f 90 pop r4 32e8e: 3f 90 pop r3 32e90: 2f 90 pop r2 32e92: 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; 32e94: 1a 86 std Y+10, r1 ; 0x0a 32e96: 19 86 std Y+9, r1 ; 0x09 32e98: 45 cf rjmp .-374 ; 0x32d24 00032e9a : 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) { 32e9a: 1f 93 push r17 32e9c: cf 93 push r28 32e9e: df 93 push r29 32ea0: 00 d0 rcall .+0 ; 0x32ea2 32ea2: 1f 92 push r1 32ea4: 1f 92 push r1 32ea6: cd b7 in r28, 0x3d ; 61 32ea8: de b7 in r29, 0x3e ; 62 32eaa: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 32eac: 48 2f mov r20, r24 32eae: 62 e5 ldi r22, 0x52 ; 82 32eb0: ce 01 movw r24, r28 32eb2: 01 96 adiw r24, 0x01 ; 1 32eb4: 0f 94 c1 c2 call 0x38582 ; 0x38582 32eb8: 49 81 ldd r20, Y+1 ; 0x01 32eba: 5a 81 ldd r21, Y+2 ; 0x02 32ebc: 6b 81 ldd r22, Y+3 ; 0x03 32ebe: 7c 81 ldd r23, Y+4 ; 0x04 32ec0: 8d 81 ldd r24, Y+5 ; 0x05 32ec2: 0f 94 4e 71 call 0x2e29c ; 0x2e29c scopeState = nextState; 32ec6: 10 93 29 13 sts 0x1329, r17 ; 0x801329 } 32eca: 0f 90 pop r0 32ecc: 0f 90 pop r0 32ece: 0f 90 pop r0 32ed0: 0f 90 pop r0 32ed2: 0f 90 pop r0 32ed4: df 91 pop r29 32ed6: cf 91 pop r28 32ed8: 1f 91 pop r17 32eda: 08 95 ret 00032edc : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 32edc: 10 92 74 13 sts 0x1374, r1 ; 0x801374 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 32ee0: e2 eb ldi r30, 0xB2 ; 178 32ee2: f9 ea ldi r31, 0xA9 ; 169 32ee4: 84 91 lpm r24, Z 32ee6: 67 e0 ldi r22, 0x07 ; 7 32ee8: 0d 94 4d 97 jmp 0x32e9a ; 0x32e9a 00032eec : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 32eec: e0 91 74 13 lds r30, 0x1374 ; 0x801374 32ef0: ae 2f mov r26, r30 32ef2: b0 e0 ldi r27, 0x00 ; 0 32ef4: aa 0f add r26, r26 32ef6: bb 1f adc r27, r27 32ef8: a2 59 subi r26, 0x92 ; 146 32efa: bc 4e sbci r27, 0xEC ; 236 32efc: 20 91 41 13 lds r18, 0x1341 ; 0x801341 32f00: 30 91 42 13 lds r19, 0x1342 ; 0x801342 32f04: 2d 93 st X+, r18 32f06: 3c 93 st X, r19 ++regIndex; 32f08: ef 5f subi r30, 0xFF ; 255 32f0a: e0 93 74 13 sts 0x1374, r30 ; 0x801374 if (regIndex >= regs16Count) { 32f0e: e2 30 cpi r30, 0x02 ; 2 32f10: 40 f4 brcc .+16 ; 0x32f22 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32f12: f0 e0 ldi r31, 0x00 ; 0 32f14: e7 56 subi r30, 0x67 ; 103 32f16: f6 45 sbci r31, 0x56 ; 86 32f18: 84 91 lpm r24, Z 32f1a: 68 e0 ldi r22, 0x08 ; 8 32f1c: 0f 94 4d 97 call 0x32e9a ; 0x32e9a } return ScopeState::Reading16bitRegisters; 32f20: 88 e0 ldi r24, 0x08 ; 8 } 32f22: 08 95 ret 00032f24 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 32f24: e0 91 74 13 lds r30, 0x1374 ; 0x801374 32f28: ae 2f mov r26, r30 32f2a: b0 e0 ldi r27, 0x00 ; 0 32f2c: a5 59 subi r26, 0x95 ; 149 32f2e: bc 4e sbci r27, 0xEC ; 236 32f30: 80 91 41 13 lds r24, 0x1341 ; 0x801341 32f34: 8c 93 st X, r24 ++regIndex; 32f36: ef 5f subi r30, 0xFF ; 255 32f38: e0 93 74 13 sts 0x1374, r30 ; 0x801374 if (regIndex >= regs8Count) { 32f3c: e3 30 cpi r30, 0x03 ; 3 32f3e: 40 f0 brcs .+16 ; 0x32f50 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 32f40: 10 92 74 13 sts 0x1374, r1 ; 0x801374 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32f44: e9 e9 ldi r30, 0x99 ; 153 32f46: f9 ea ldi r31, 0xA9 ; 169 32f48: 84 91 lpm r24, Z 32f4a: 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); 32f4c: 0d 94 4d 97 jmp 0x32e9a ; 0x32e9a 32f50: f0 e0 ldi r31, 0x00 ; 0 32f52: ee 54 subi r30, 0x4E ; 78 32f54: f6 45 sbci r31, 0x56 ; 86 32f56: 84 91 lpm r24, Z 32f58: 67 e0 ldi r22, 0x07 ; 7 32f5a: f8 cf rjmp .-16 ; 0x32f4c 00032f5c : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 32f5c: cf 93 push r28 32f5e: df 93 push r29 32f60: 00 d0 rcall .+0 ; 0x32f62 32f62: 00 d0 rcall .+0 ; 0x32f64 32f64: 00 d0 rcall .+0 ; 0x32f66 32f66: 1f 92 push r1 32f68: cd b7 in r28, 0x3d ; 61 32f6a: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 32f6c: 80 91 30 13 lds r24, 0x1330 ; 0x801330 32f70: 82 34 cpi r24, 0x42 ; 66 32f72: 09 f4 brne .+2 ; 0x32f76 32f74: 46 c0 rjmp .+140 ; 0x33002 32f76: b8 f5 brcc .+110 ; 0x32fe6 32f78: 88 23 and r24, r24 32f7a: 09 f4 brne .+2 ; 0x32f7e 32f7c: 72 c0 rjmp .+228 ; 0x33062 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 32f7e: 84 e0 ldi r24, 0x04 ; 4 32f80: 80 93 28 13 sts 0x1328, r24 ; 0x801328 32f84: 85 e0 ldi r24, 0x05 ; 5 32f86: e0 e3 ldi r30, 0x30 ; 48 32f88: f3 e1 ldi r31, 0x13 ; 19 32f8a: de 01 movw r26, r28 32f8c: 16 96 adiw r26, 0x06 ; 6 32f8e: 01 90 ld r0, Z+ 32f90: 0d 92 st X+, r0 32f92: 8a 95 dec r24 32f94: e1 f7 brne .-8 ; 0x32f8e StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 32f96: 85 e0 ldi r24, 0x05 ; 5 32f98: fe 01 movw r30, r28 32f9a: 36 96 adiw r30, 0x06 ; 6 32f9c: ab e2 ldi r26, 0x2B ; 43 32f9e: b3 e1 ldi r27, 0x13 ; 19 32fa0: 01 90 ld r0, Z+ 32fa2: 0d 92 st X+, r0 32fa4: 8a 95 dec r24 32fa6: e1 f7 brne .-8 ; 0x32fa0 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 32fa8: 40 e0 ldi r20, 0x00 ; 0 32faa: 60 e0 ldi r22, 0x00 ; 0 32fac: ce 01 movw r24, r28 32fae: 01 96 adiw r24, 0x01 ; 1 32fb0: 0f 94 c1 c2 call 0x38582 ; 0x38582 32fb4: 85 e0 ldi r24, 0x05 ; 5 32fb6: fe 01 movw r30, r28 32fb8: 31 96 adiw r30, 0x01 ; 1 32fba: a0 e3 ldi r26, 0x30 ; 48 32fbc: b3 e1 ldi r27, 0x13 ; 19 32fbe: 01 90 ld r0, Z+ 32fc0: 0d 92 st X+, r0 32fc2: 8a 95 dec r24 32fc4: e1 f7 brne .-8 ; 0x32fbe void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 32fc6: 85 e0 ldi r24, 0x05 ; 5 32fc8: 80 93 29 13 sts 0x1329, r24 ; 0x801329 SendMsg(rq); 32fcc: 40 91 2b 13 lds r20, 0x132B ; 0x80132b 32fd0: 50 91 2c 13 lds r21, 0x132C ; 0x80132c 32fd4: 60 91 2d 13 lds r22, 0x132D ; 0x80132d 32fd8: 70 91 2e 13 lds r23, 0x132E ; 0x80132e 32fdc: 80 91 2f 13 lds r24, 0x132F ; 0x80132f 32fe0: 0f 94 4e 71 call 0x2e29c ; 0x2e29c 32fe4: 2e c0 rjmp .+92 ; 0x33042 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 32fe6: 82 35 cpi r24, 0x52 ; 82 32fe8: b1 f1 breq .+108 ; 0x33056 32fea: 87 35 cpi r24, 0x57 ; 87 32fec: 41 f6 brne .-112 ; 0x32f7e 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); 32fee: 60 91 32 13 lds r22, 0x1332 ; 0x801332 32ff2: 70 91 33 13 lds r23, 0x1333 ; 0x801333 32ff6: 4c e0 ldi r20, 0x0C ; 12 32ff8: 80 91 31 13 lds r24, 0x1331 ; 0x801331 32ffc: 0f 94 b9 71 call 0x2e372 ; 0x2e372 33000: 11 c0 rjmp .+34 ; 0x33024 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 33002: 40 91 31 13 lds r20, 0x1331 ; 0x801331 33006: 62 e4 ldi r22, 0x42 ; 66 33008: ce 01 movw r24, r28 3300a: 01 96 adiw r24, 0x01 ; 1 3300c: 0f 94 c1 c2 call 0x38582 ; 0x38582 33010: 49 81 ldd r20, Y+1 ; 0x01 33012: 5a 81 ldd r21, Y+2 ; 0x02 33014: 6b 81 ldd r22, Y+3 ; 0x03 33016: 7c 81 ldd r23, Y+4 ; 0x04 33018: 8d 81 ldd r24, Y+5 ; 0x05 3301a: 0f 94 4e 71 call 0x2e29c ; 0x2e29c scopeState = ScopeState::ButtonSent; 3301e: 8a e0 ldi r24, 0x0A ; 10 33020: 80 93 29 13 sts 0x1329, r24 ; 0x801329 SendReadRegister(plannedRq.value, ScopeState::ReadRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 33024: 40 e0 ldi r20, 0x00 ; 0 33026: 60 e0 ldi r22, 0x00 ; 0 33028: ce 01 movw r24, r28 3302a: 01 96 adiw r24, 0x01 ; 1 3302c: 0f 94 c1 c2 call 0x38582 ; 0x38582 33030: 85 e0 ldi r24, 0x05 ; 5 33032: fe 01 movw r30, r28 33034: 31 96 adiw r30, 0x01 ; 1 33036: a0 e3 ldi r26, 0x30 ; 48 33038: b3 e1 ldi r27, 0x13 ; 19 3303a: 01 90 ld r0, Z+ 3303c: 0d 92 st X+, r0 3303e: 8a 95 dec r24 33040: e1 f7 brne .-8 ; 0x3303a default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 33042: 81 e0 ldi r24, 0x01 ; 1 } } 33044: 2a 96 adiw r28, 0x0a ; 10 33046: 0f b6 in r0, 0x3f ; 63 33048: f8 94 cli 3304a: de bf out 0x3e, r29 ; 62 3304c: 0f be out 0x3f, r0 ; 63 3304e: cd bf out 0x3d, r28 ; 61 33050: df 91 pop r29 33052: cf 91 pop r28 33054: 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); 33056: 6b e0 ldi r22, 0x0B ; 11 33058: 80 91 31 13 lds r24, 0x1331 ; 0x801331 3305c: 0f 94 4d 97 call 0x32e9a ; 0x32e9a 33060: e1 cf rjmp .-62 ; 0x33024 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 33062: 80 e0 ldi r24, 0x00 ; 0 33064: ef cf rjmp .-34 ; 0x33044 00033066 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 33066: cf 93 push r28 33068: df 93 push r29 3306a: 00 d0 rcall .+0 ; 0x3306c 3306c: 1f 92 push r1 3306e: 1f 92 push r1 33070: cd b7 in r28, 0x3d ; 61 33072: de b7 in r29, 0x3e ; 62 33074: 49 83 std Y+1, r20 ; 0x01 33076: 5a 83 std Y+2, r21 ; 0x02 33078: 6b 83 std Y+3, r22 ; 0x03 3307a: 7c 83 std Y+4, r23 ; 0x04 3307c: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 3307e: 85 e0 ldi r24, 0x05 ; 5 33080: fe 01 movw r30, r28 33082: 31 96 adiw r30, 0x01 ; 1 33084: a0 e3 ldi r26, 0x30 ; 48 33086: b3 e1 ldi r27, 0x13 ; 19 33088: 01 90 ld r0, Z+ 3308a: 0d 92 st X+, r0 3308c: 8a 95 dec r24 3308e: e1 f7 brne .-8 ; 0x33088 if (!ExpectsResponse()) { 33090: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33094: 87 ff sbrs r24, 7 33096: 09 c0 rjmp .+18 ; 0x330aa ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 33098: 0f 90 pop r0 3309a: 0f 90 pop r0 3309c: 0f 90 pop r0 3309e: 0f 90 pop r0 330a0: 0f 90 pop r0 330a2: df 91 pop r29 330a4: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 330a6: 0d 94 ae 97 jmp 0x32f5c ; 0x32f5c } // otherwise wait for an empty window to activate the request } 330aa: 0f 90 pop r0 330ac: 0f 90 pop r0 330ae: 0f 90 pop r0 330b0: 0f 90 pop r0 330b2: 0f 90 pop r0 330b4: df 91 pop r29 330b6: cf 91 pop r28 330b8: 08 95 ret 000330ba : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 330ba: 1f 93 push r17 330bc: cf 93 push r28 330be: df 93 push r29 330c0: 00 d0 rcall .+0 ; 0x330c2 330c2: 1f 92 push r1 330c4: 1f 92 push r1 330c6: cd b7 in r28, 0x3d ; 61 330c8: de b7 in r29, 0x3e ; 62 330ca: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 330cc: 48 2f mov r20, r24 330ce: 63 e5 ldi r22, 0x53 ; 83 330d0: ce 01 movw r24, r28 330d2: 01 96 adiw r24, 0x01 ; 1 330d4: 0f 94 c1 c2 call 0x38582 ; 0x38582 330d8: 49 81 ldd r20, Y+1 ; 0x01 330da: 5a 81 ldd r21, Y+2 ; 0x02 330dc: 6b 81 ldd r22, Y+3 ; 0x03 330de: 7c 81 ldd r23, Y+4 ; 0x04 330e0: 8d 81 ldd r24, Y+5 ; 0x05 330e2: 0f 94 4e 71 call 0x2e29c ; 0x2e29c scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 330e6: 10 93 29 13 sts 0x1329, r17 ; 0x801329 } 330ea: 0f 90 pop r0 330ec: 0f 90 pop r0 330ee: 0f 90 pop r0 330f0: 0f 90 pop r0 330f2: 0f 90 pop r0 330f4: df 91 pop r29 330f6: cf 91 pop r28 330f8: 1f 91 pop r17 330fa: 08 95 ret 000330fc : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 330fc: cf 93 push r28 330fe: df 93 push r29 33100: 00 d0 rcall .+0 ; 0x33102 33102: 1f 92 push r1 33104: 1f 92 push r1 33106: cd b7 in r28, 0x3d ; 61 33108: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 3310a: 40 e0 ldi r20, 0x00 ; 0 3310c: 61 e5 ldi r22, 0x51 ; 81 3310e: ce 01 movw r24, r28 33110: 01 96 adiw r24, 0x01 ; 1 33112: 0f 94 c1 c2 call 0x38582 ; 0x38582 33116: 49 81 ldd r20, Y+1 ; 0x01 33118: 5a 81 ldd r21, Y+2 ; 0x02 3311a: 6b 81 ldd r22, Y+3 ; 0x03 3311c: 7c 81 ldd r23, Y+4 ; 0x04 3311e: 8d 81 ldd r24, Y+5 ; 0x05 33120: 0f 94 4e 71 call 0x2e29c ; 0x2e29c scopeState = ScopeState::QuerySent; 33124: 84 e0 ldi r24, 0x04 ; 4 33126: 80 93 29 13 sts 0x1329, r24 ; 0x801329 } 3312a: 0f 90 pop r0 3312c: 0f 90 pop r0 3312e: 0f 90 pop r0 33130: 0f 90 pop r0 33132: 0f 90 pop r0 33134: df 91 pop r29 33136: cf 91 pop r28 33138: 08 95 ret 0003313a : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 3313a: cf 93 push r28 3313c: df 93 push r29 3313e: 00 d0 rcall .+0 ; 0x33140 33140: 1f 92 push r1 33142: 1f 92 push r1 33144: cd b7 in r28, 0x3d ; 61 33146: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 33148: 0f 94 19 c3 call 0x38632 ; 0x38632 3314c: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 33150: 48 2f mov r20, r24 33152: 66 e6 ldi r22, 0x66 ; 102 33154: ce 01 movw r24, r28 33156: 01 96 adiw r24, 0x01 ; 1 33158: 0f 94 c1 c2 call 0x38582 ; 0x38582 3315c: 49 81 ldd r20, Y+1 ; 0x01 3315e: 5a 81 ldd r21, Y+2 ; 0x02 33160: 6b 81 ldd r22, Y+3 ; 0x03 33162: 7c 81 ldd r23, Y+4 ; 0x04 33164: 8d 81 ldd r24, Y+5 ; 0x05 33166: 0f 94 4e 71 call 0x2e29c ; 0x2e29c scopeState = ScopeState::FilamentSensorStateSent; 3316a: 86 e0 ldi r24, 0x06 ; 6 3316c: 80 93 29 13 sts 0x1329, r24 ; 0x801329 } 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: 08 95 ret 00033180 : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 33180: cf 93 push r28 33182: df 93 push r29 33184: 00 d0 rcall .+0 ; 0x33186 33186: 1f 92 push r1 33188: 1f 92 push r1 3318a: cd b7 in r28, 0x3d ; 61 3318c: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 3318e: 80 91 40 13 lds r24, 0x1340 ; 0x801340 33192: 85 34 cpi r24, 0x45 ; 69 33194: f1 f0 breq .+60 ; 0x331d2 33196: 20 f4 brcc .+8 ; 0x331a0 33198: 82 34 cpi r24, 0x42 ; 66 3319a: 51 f1 breq .+84 ; 0x331f0 } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 3319c: 85 e0 ldi r24, 0x05 ; 5 3319e: 11 c0 rjmp .+34 ; 0x331c2 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 331a0: 86 34 cpi r24, 0x46 ; 70 331a2: 71 f1 breq .+92 ; 0x33200 331a4: 80 35 cpi r24, 0x50 ; 80 331a6: d1 f7 brne .-12 ; 0x3319c case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 331a8: 80 91 41 13 lds r24, 0x1341 ; 0x801341 331ac: 80 93 68 13 sts 0x1368, r24 ; 0x801368 errorCode = ErrorCode::OK; 331b0: 81 e0 ldi r24, 0x01 ; 1 331b2: 90 e0 ldi r25, 0x00 ; 0 331b4: 90 93 67 13 sts 0x1367, r25 ; 0x801367 331b8: 80 93 66 13 sts 0x1366, r24 ; 0x801366 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 331bc: 0f 94 9d 98 call 0x3313a ; 0x3313a return Processing; 331c0: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 331c2: 0f 90 pop r0 331c4: 0f 90 pop r0 331c6: 0f 90 pop r0 331c8: 0f 90 pop r0 331ca: 0f 90 pop r0 331cc: df 91 pop r29 331ce: cf 91 pop r28 331d0: 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; 331d2: 8c e0 ldi r24, 0x0C ; 12 331d4: 80 93 68 13 sts 0x1368, r24 ; 0x801368 errorCode = static_cast(rsp.paramValue); 331d8: 80 91 41 13 lds r24, 0x1341 ; 0x801341 331dc: 90 91 42 13 lds r25, 0x1342 ; 0x801342 331e0: 90 93 67 13 sts 0x1367, r25 ; 0x801367 331e4: 80 93 66 13 sts 0x1366, r24 ; 0x801366 // keep on reporting the state of fsensor regularly even in command error state // - the MMU checks FINDA and fsensor even while recovering from errors SendAndUpdateFilamentSensor(); 331e8: 0f 94 9d 98 call 0x3313a ; 0x3313a return CommandError; 331ec: 87 e0 ldi r24, 0x07 ; 7 331ee: e9 cf rjmp .-46 ; 0x331c2 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); 331f0: 80 91 41 13 lds r24, 0x1341 ; 0x801341 331f4: 80 93 69 13 sts 0x1369, r24 ; 0x801369 SendAndUpdateFilamentSensor(); 331f8: 0f 94 9d 98 call 0x3313a ; 0x3313a return ButtonPushed; 331fc: 8b e0 ldi r24, 0x0B ; 11 331fe: e1 cf rjmp .-62 ; 0x331c2 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) { 33200: 90 91 2b 13 lds r25, 0x132B ; 0x80132b 33204: 80 91 3b 13 lds r24, 0x133B ; 0x80133b 33208: 98 13 cpse r25, r24 3320a: 22 c0 rjmp .+68 ; 0x33250 3320c: 90 91 2c 13 lds r25, 0x132C ; 0x80132c 33210: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 33214: 98 13 cpse r25, r24 33216: 1c c0 rjmp .+56 ; 0x33250 progressCode = ProgressCode::OK; 33218: 10 92 68 13 sts 0x1368, r1 ; 0x801368 errorCode = ErrorCode::OK; 3321c: 81 e0 ldi r24, 0x01 ; 1 3321e: 90 e0 ldi r25, 0x00 ; 0 33220: 90 93 67 13 sts 0x1367, r25 ; 0x801367 33224: 80 93 66 13 sts 0x1366, r24 ; 0x801366 scopeState = ScopeState::Ready; 33228: 82 e8 ldi r24, 0x82 ; 130 3322a: 80 93 29 13 sts 0x1329, r24 ; 0x801329 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 3322e: 40 e0 ldi r20, 0x00 ; 0 33230: 60 e0 ldi r22, 0x00 ; 0 33232: ce 01 movw r24, r28 33234: 01 96 adiw r24, 0x01 ; 1 33236: 0f 94 c1 c2 call 0x38582 ; 0x38582 3323a: 85 e0 ldi r24, 0x05 ; 5 3323c: fe 01 movw r30, r28 3323e: 31 96 adiw r30, 0x01 ; 1 33240: ab e2 ldi r26, 0x2B ; 43 33242: b3 e1 ldi r27, 0x13 ; 19 33244: 01 90 ld r0, Z+ 33246: 0d 92 st X+, r0 33248: 8a 95 dec r24 3324a: e1 f7 brne .-8 ; 0x33244 3324c: 82 e0 ldi r24, 0x02 ; 2 3324e: b9 cf rjmp .-142 ; 0x331c2 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 33250: 83 e0 ldi r24, 0x03 ; 3 33252: b7 cf rjmp .-146 ; 0x331c2 00033254 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 33254: 1f 93 push r17 33256: cf 93 push r28 33258: df 93 push r29 3325a: 00 d0 rcall .+0 ; 0x3325c 3325c: 1f 92 push r1 3325e: 1f 92 push r1 33260: cd b7 in r28, 0x3d ; 61 33262: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 33264: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 33268: 81 11 cpse r24, r1 3326a: 2a c0 rjmp .+84 ; 0x332c0 auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 3326c: 10 91 90 13 lds r17, 0x1390 ; 0x801390 33270: 1f 3f cpi r17, 0xFF ; 255 33272: 91 f5 brne .+100 ; 0x332d8 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 33274: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 33278: 81 11 cpse r24, r1 3327a: 60 c0 rjmp .+192 ; 0x3333c 3327c: 1f 3f cpi r17, 0xFF ; 255 3327e: b9 f0 breq .+46 ; 0x332ae inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 33280: 81 e0 ldi r24, 0x01 ; 1 33282: 90 e0 ldi r25, 0x00 ; 0 33284: 90 93 27 13 sts 0x1327, r25 ; 0x801327 33288: 80 93 26 13 sts 0x1326, r24 ; 0x801326 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 3328c: 90 93 8e 13 sts 0x138E, r25 ; 0x80138e 33290: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d lastErrorSource = ErrorSource::ErrorSourceNone; 33294: 8f ef ldi r24, 0xFF ; 255 33296: 80 93 8f 13 sts 0x138F, r24 ; 0x80138f // Moreover - if the MMU is currently doing something (like the LoadFilament - see comment above) // we'll actually wait for it automagically in manage_response and after it finishes correctly, // we'll issue another command (like toolchange) } switch (btn) { 3329a: 13 30 cpi r17, 0x03 ; 3 3329c: 09 f4 brne .+2 ; 0x332a0 3329e: 82 c0 rjmp .+260 ; 0x333a4 332a0: f8 f0 brcs .+62 ; 0x332e0 332a2: 16 30 cpi r17, 0x06 ; 6 332a4: 08 f4 brcc .+2 ; 0x332a8 332a6: 7b c0 rjmp .+246 ; 0x3339e 332a8: 17 30 cpi r17, 0x07 ; 7 332aa: 09 f4 brne .+2 ; 0x332ae 332ac: 7e c0 rjmp .+252 ; 0x333aa // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 332ae: 0f 90 pop r0 332b0: 0f 90 pop r0 332b2: 0f 90 pop r0 332b4: 0f 90 pop r0 332b6: 0f 90 pop r0 332b8: df 91 pop r29 332ba: cf 91 pop r28 332bc: 1f 91 pop r17 332be: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 332c0: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 332c4: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 332c8: 0f 94 a6 c5 call 0x38b4c ; 0x38b4c 332cc: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 332ce: 10 92 5c 0e sts 0x0E5C, r1 ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 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) { 332d2: 8f 3f cpi r24, 0xFF ; 255 332d4: 79 f6 brne .-98 ; 0x33274 332d6: ca cf rjmp .-108 ; 0x3326c btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 332d8: 8f ef ldi r24, 0xFF ; 255 332da: 80 93 90 13 sts 0x1390, r24 ; 0x801390 332de: ca cf rjmp .-108 ; 0x33274 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 332e0: 8e e2 ldi r24, 0x2E ; 46 332e2: 98 ea ldi r25, 0xA8 ; 168 332e4: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 332e8: 81 2f mov r24, r17 332ea: 90 e0 ldi r25, 0x00 ; 0 332ec: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 332f0: 0f 94 f5 9e call 0x33dea ; 0x33dea if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 332f4: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 332f8: 81 30 cpi r24, 0x01 ; 1 332fa: 89 f4 brne .+34 ; 0x3331e ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 332fc: 87 e2 ldi r24, 0x27 ; 39 332fe: 98 ea ldi r25, 0xA8 ; 168 33300: 0f 94 09 c3 call 0x38612 ; 0x38612 void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 33304: 41 2f mov r20, r17 33306: 62 e4 ldi r22, 0x42 ; 66 33308: ce 01 movw r24, r28 3330a: 01 96 adiw r24, 0x01 ; 1 3330c: 0f 94 c1 c2 call 0x38582 ; 0x38582 33310: 49 81 ldd r20, Y+1 ; 0x01 33312: 5a 81 ldd r21, Y+2 ; 0x02 33314: 6b 81 ldd r22, Y+3 ; 0x03 33316: 7c 81 ldd r23, Y+4 ; 0x04 33318: 8d 81 ldd r24, Y+5 ; 0x05 3331a: 0f 94 33 98 call 0x33066 ; 0x33066 } // 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) { 3331e: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33322: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33326: 84 30 cpi r24, 0x04 ; 4 33328: 20 e8 ldi r18, 0x80 ; 128 3332a: 92 07 cpc r25, r18 3332c: 21 f0 breq .+8 ; 0x33336 3332e: 89 30 cpi r24, 0x09 ; 9 33330: 90 48 sbci r25, 0x80 ; 128 33332: 09 f0 breq .+2 ; 0x33336 33334: bc cf rjmp .-136 ; 0x332ae case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 33336: 0f 94 e1 73 call 0x2e7c2 ; 0x2e7c2 3333a: b9 cf rjmp .-142 ; 0x332ae // 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) { 3333c: 19 30 cpi r17, 0x09 ; 9 3333e: 08 f0 brcs .+2 ; 0x33342 33340: b6 cf rjmp .-148 ; 0x332ae 33342: e1 2f mov r30, r17 33344: f0 e0 ldi r31, 0x00 ; 0 33346: 88 27 eor r24, r24 33348: e7 55 subi r30, 0x57 ; 87 3334a: f6 46 sbci r31, 0x66 ; 102 3334c: 8e 4f sbci r24, 0xFE ; 254 3334e: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 33352: 42 3b cpi r20, 0xB2 ; 178 33354: 42 3b cpi r20, 0xB2 ; 178 33356: 42 3b cpi r20, 0xB2 ; 178 33358: fa 3a cpi r31, 0xAA ; 170 3335a: 84 39 cpi r24, 0x94 ; 148 3335c: 84 39 cpi r24, 0x94 ; 148 3335e: 26 3a cpi r18, 0xA6 ; 166 33360: a2 3a cpi r26, 0xA2 ; 162 33362: 84 3a cpi r24, 0xA4 ; 164 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 33364: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33368: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 3336c: 87 38 cpi r24, 0x87 ; 135 3336e: 20 e8 ldi r18, 0x80 ; 128 33370: 92 07 cpc r25, r18 33372: 21 f0 breq .+8 ; 0x3337c 33374: 87 30 cpi r24, 0x07 ; 7 33376: 91 48 sbci r25, 0x81 ; 129 33378: 09 f0 breq .+2 ; 0x3337c 3337a: 99 cf rjmp .-206 ; 0x332ae // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 3337c: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33380: 84 30 cpi r24, 0x04 ; 4 33382: 21 f4 brne .+8 ; 0x3338c ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 33384: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33388: 81 11 cpse r24, r1 3338a: 91 cf rjmp .-222 ; 0x332ae // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 3338c: 81 e0 ldi r24, 0x01 ; 1 3338e: 80 93 5b 0e sts 0x0E5B, r24 ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.514> menu_submenu(tuneIdlerStallguardThresholdMenu); 33392: 60 e0 ldi r22, 0x00 ; 0 33394: 86 e9 ldi r24, 0x96 ; 150 33396: 99 e3 ldi r25, 0x39 ; 57 33398: 0f 94 32 d0 call 0x3a064 ; 0x3a064 3339c: 88 cf rjmp .-240 ; 0x332ae } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 3339e: 10 93 93 13 sts 0x1393, r17 ; 0x801393 333a2: 85 cf rjmp .-246 ; 0x332ae void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 333a4: 0f 94 ce c2 call 0x3859c ; 0x3859c 333a8: 82 cf rjmp .-252 ; 0x332ae StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 333aa: 10 92 95 13 sts 0x1395, r1 ; 0x801395 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 333ae: 10 92 43 13 sts 0x1343, r1 ; 0x801343 currentScope = Scope::Stopped; 333b2: 10 92 28 13 sts 0x1328, r1 ; 0x801328 333b6: 60 e0 ldi r22, 0x00 ; 0 333b8: 8c ea ldi r24, 0xAC ; 172 333ba: 9c e0 ldi r25, 0x0C ; 12 333bc: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 333c0: 0f 94 bc 76 call 0x2ed78 ; 0x2ed78 333c4: 74 cf rjmp .-280 ; 0x332ae 000333c6 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 333c6: 4f 92 push r4 333c8: 5f 92 push r5 333ca: 6f 92 push r6 333cc: 7f 92 push r7 333ce: 8f 92 push r8 333d0: 9f 92 push r9 333d2: af 92 push r10 333d4: bf 92 push r11 333d6: cf 92 push r12 333d8: df 92 push r13 333da: ef 92 push r14 333dc: ff 92 push r15 333de: 0f 93 push r16 333e0: 1f 93 push r17 333e2: cf 93 push r28 333e4: df 93 push r29 333e6: cd b7 in r28, 0x3d ; 61 333e8: de b7 in r29, 0x3e ; 62 333ea: a0 97 sbiw r28, 0x20 ; 32 333ec: 0f b6 in r0, 0x3f ; 63 333ee: f8 94 cli 333f0: de bf out 0x3e, r29 ; 62 333f2: 0f be out 0x3f, r0 ; 63 333f4: cd bf out 0x3d, r28 ; 61 333f6: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 333f8: 0f 94 2a 99 call 0x33254 ; 0x33254 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 333fc: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33400: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 33402: 0f 94 ae 97 call 0x32f5c ; 0x32f5c 33406: 90 91 29 13 lds r25, 0x1329 ; 0x801329 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 3340a: 97 ff sbrs r25, 7 3340c: 7d c0 rjmp .+250 ; 0x33508 // we are waiting for something switch (currentScope) { 3340e: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33412: 82 30 cpi r24, 0x02 ; 2 33414: b1 f0 breq .+44 ; 0x33442 33416: 08 f4 brcc .+2 ; 0x3341a 33418: 75 c0 rjmp .+234 ; 0x33504 3341a: 83 30 cpi r24, 0x03 ; 3 3341c: e1 f1 breq .+120 ; 0x33496 3341e: 84 30 cpi r24, 0x04 ; 4 33420: 09 f4 brne .+2 ; 0x33424 33422: 54 c0 rjmp .+168 ; 0x334cc 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 33424: 0f 94 ae 97 call 0x32f5c ; 0x32f5c 33428: 81 11 cpse r24, r1 3342a: 6b c3 rjmp .+1750 ; 0x33b02 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 3342c: 82 e0 ldi r24, 0x02 ; 2 3342e: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::Idle; 33432: 83 e0 ldi r24, 0x03 ; 3 33434: 80 93 28 13 sts 0x1328, r24 ; 0x801328 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33438: 82 e8 ldi r24, 0x82 ; 130 3343a: 80 93 29 13 sts 0x1329, r24 ; 0x801329 // We are ok, switching to Idle if there is no potential next request planned. // But the trouble is we must report a finished command if the previous command has just been finished // i.e. only try to find some planned command if we just finished the Idle cycle if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle SwitchToIdle(); } else if (ExpectsResponse()) { 3343e: 12 e0 ldi r17, 0x02 ; 2 33440: db c2 rjmp .+1462 ; 0x339f8 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33442: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 33446: ab 01 movw r20, r22 33448: bc 01 movw r22, r24 3344a: 80 91 35 13 lds r24, 0x1335 ; 0x801335 3344e: 90 91 36 13 lds r25, 0x1336 ; 0x801336 33452: a0 91 37 13 lds r26, 0x1337 ; 0x801337 33456: b0 91 38 13 lds r27, 0x1338 ; 0x801338 3345a: 88 51 subi r24, 0x18 ; 24 3345c: 9c 4f sbci r25, 0xFC ; 252 3345e: af 4f sbci r26, 0xFF ; 255 33460: 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 33462: 48 17 cp r20, r24 33464: 59 07 cpc r21, r25 33466: 6a 07 cpc r22, r26 33468: 7b 07 cpc r23, r27 3346a: 08 f4 brcc .+2 ; 0x3346e 3346c: 4b c0 rjmp .+150 ; 0x33504 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 3346e: 8f e6 ldi r24, 0x6F ; 111 33470: 92 e1 ldi r25, 0x12 ; 18 33472: 0f 94 72 db call 0x3b6e4 ; 0x3b6e4 while (uart->read() != -1) 33476: 01 96 adiw r24, 0x01 ; 1 33478: d1 f7 brne .-12 ; 0x3346e initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 3347a: 81 e0 ldi r24, 0x01 ; 1 3347c: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::StartSeq; 33480: 80 93 28 13 sts 0x1328, r24 ; 0x801328 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 33484: 10 92 4a 13 sts 0x134A, r1 ; 0x80134a LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 33488: 86 e0 ldi r24, 0x06 ; 6 3348a: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a SendVersion(0); 3348e: 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); 33490: 0f 94 5d 98 call 0x330ba ; 0x330ba 33494: 37 c0 rjmp .+110 ; 0x33504 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 33496: 92 38 cpi r25, 0x82 ; 130 33498: 29 f6 brne .-118 ; 0x33424 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3349a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 3349e: ab 01 movw r20, r22 334a0: bc 01 movw r22, r24 334a2: 80 91 35 13 lds r24, 0x1335 ; 0x801335 334a6: 90 91 36 13 lds r25, 0x1336 ; 0x801336 334aa: a0 91 37 13 lds r26, 0x1337 ; 0x801337 334ae: b0 91 38 13 lds r27, 0x1338 ; 0x801338 334b2: 88 51 subi r24, 0x18 ; 24 334b4: 9c 4f sbci r25, 0xFC ; 252 334b6: af 4f sbci r26, 0xFF ; 255 334b8: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 334ba: 48 17 cp r20, r24 334bc: 59 07 cpc r21, r25 334be: 6a 07 cpc r22, r26 334c0: 7b 07 cpc r23, r27 334c2: 08 f4 brcc .+2 ; 0x334c6 334c4: af cf rjmp .-162 ; 0x33424 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 334c6: 0f 94 7e 98 call 0x330fc ; 0x330fc 334ca: 1c c0 rjmp .+56 ; 0x33504 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 334cc: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 334d0: ab 01 movw r20, r22 334d2: bc 01 movw r22, r24 334d4: 80 91 35 13 lds r24, 0x1335 ; 0x801335 334d8: 90 91 36 13 lds r25, 0x1336 ; 0x801336 334dc: a0 91 37 13 lds r26, 0x1337 ; 0x801337 334e0: b0 91 38 13 lds r27, 0x1338 ; 0x801338 334e4: 88 51 subi r24, 0x18 ; 24 334e6: 9c 4f sbci r25, 0xFC ; 252 334e8: af 4f sbci r26, 0xFF ; 255 334ea: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 334ec: 48 17 cp r20, r24 334ee: 59 07 cpc r21, r25 334f0: 6a 07 cpc r22, r26 334f2: 7b 07 cpc r23, r27 334f4: 40 f7 brcc .-48 ; 0x334c6 }; 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(); 334f6: 0f 94 19 c3 call 0x38632 ; 0x38632 if (fs != lastFSensor) { 334fa: 90 91 6a 13 lds r25, 0x136A ; 0x80136a 334fe: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 33500: 0f 94 9d 98 call 0x3313a ; 0x3313a // 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; 33504: 10 e0 ldi r17, 0x00 ; 0 33506: 78 c2 rjmp .+1264 ; 0x339f8 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 33508: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 3350a: d1 2c mov r13, r1 3350c: 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; 3350e: 99 24 eor r9, r9 33510: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 33512: 55 e0 ldi r21, 0x05 ; 5 33514: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 33516: 63 e0 ldi r22, 0x03 ; 3 33518: 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; 3351a: 74 e0 ldi r23, 0x04 ; 4 3351c: 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; 3351e: e2 e0 ldi r30, 0x02 ; 2 33520: 6e 2e mov r6, r30 33522: 66 c0 rjmp .+204 ; 0x335f0 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 33524: 23 30 cpi r18, 0x03 ; 3 33526: 09 f4 brne .+2 ; 0x3352a 33528: e0 c0 rjmp .+448 ; 0x336ea 3352a: 24 30 cpi r18, 0x04 ; 4 3352c: 09 f0 breq .+2 ; 0x33530 3352e: 83 c0 rjmp .+262 ; 0x33636 } 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'); 33530: 20 ed ldi r18, 0xD0 ; 208 33532: 28 0f add r18, r24 33534: 2a 30 cpi r18, 0x0A ; 10 33536: 08 f4 brcc .+2 ; 0x3353a 33538: f8 c0 rjmp .+496 ; 0x3372a 3353a: 2f e9 ldi r18, 0x9F ; 159 3353c: 28 0f add r18, r24 3353e: 26 30 cpi r18, 0x06 ; 6 33540: 08 f4 brcc .+2 ; 0x33544 33542: f3 c0 rjmp .+486 ; 0x3372a ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 33544: 8a 30 cpi r24, 0x0A ; 10 33546: 09 f0 breq .+2 ; 0x3354a 33548: fa c0 rjmp .+500 ; 0x3373e 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()) { 3354a: 40 90 4f 13 lds r4, 0x134F ; 0x80134f 3354e: 8b e4 ldi r24, 0x4B ; 75 33550: 93 e1 ldi r25, 0x13 ; 19 33552: 0f 94 b0 c2 call 0x38560 ; 0x38560 33556: 48 12 cpse r4, r24 33558: b8 c0 rjmp .+368 ; 0x336ca // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 3355a: 10 92 4a 13 sts 0x134A, r1 ; 0x80134a /// @returns the most recently lexed request message inline const RequestMsg GetRequestMsg() const { return requestMsg; } /// @returns the most recently lexed response message inline const ResponseMsg GetResponseMsg() const { return responseMsg; } 3355e: 88 e0 ldi r24, 0x08 ; 8 33560: eb e4 ldi r30, 0x4B ; 75 33562: f3 e1 ldi r31, 0x13 ; 19 33564: de 01 movw r26, r28 33566: 51 96 adiw r26, 0x11 ; 17 33568: 01 90 ld r0, Z+ 3356a: 0d 92 st X+, r0 3356c: 8a 95 dec r24 3356e: e1 f7 brne .-8 ; 0x33568 33570: 88 e0 ldi r24, 0x08 ; 8 33572: fe 01 movw r30, r28 33574: 71 96 adiw r30, 0x11 ; 17 33576: de 01 movw r26, r28 33578: 59 96 adiw r26, 0x19 ; 25 3357a: 01 90 ld r0, Z+ 3357c: 0d 92 st X+, r0 3357e: 8a 95 dec r24 33580: e1 f7 brne .-8 ; 0x3357a while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 33582: 88 e0 ldi r24, 0x08 ; 8 33584: fe 01 movw r30, r28 33586: 79 96 adiw r30, 0x19 ; 25 33588: ab e3 ldi r26, 0x3B ; 59 3358a: b3 e1 ldi r27, 0x13 ; 19 3358c: 01 90 ld r0, Z+ 3358e: 0d 92 st X+, r0 33590: 8a 95 dec r24 33592: e1 f7 brne .-8 ; 0x3358c } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 33594: 8c e3 ldi r24, 0x3C ; 60 33596: 89 83 std Y+1, r24 ; 0x01 33598: fe 01 movw r30, r28 3359a: 32 96 adiw r30, 0x02 ; 2 3359c: a3 e5 ldi r26, 0x53 ; 83 3359e: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 335a0: 20 e0 ldi r18, 0x00 ; 0 335a2: cf 01 movw r24, r30 335a4: 52 16 cp r5, r18 335a6: 09 f4 brne .+2 ; 0x335aa 335a8: cd c0 rjmp .+410 ; 0x33744 uint8_t b = lastReceivedBytes[i]; 335aa: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 335ac: 40 ee ldi r20, 0xE0 ; 224 335ae: 43 0f add r20, r19 335b0: 40 36 cpi r20, 0x60 ; 96 335b2: 08 f0 brcs .+2 ; 0x335b6 b = '.'; 335b4: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 335b6: 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) { 335b8: 2f 5f subi r18, 0xFF ; 255 335ba: f4 cf rjmp .-24 ; 0x335a4 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 335bc: 8e 34 cpi r24, 0x4E ; 78 335be: 08 f0 brcs .+2 ; 0x335c2 335c0: 56 c0 rjmp .+172 ; 0x3366e 335c2: 8b 34 cpi r24, 0x4B ; 75 335c4: 08 f0 brcs .+2 ; 0x335c8 335c6: 46 c0 rjmp .+140 ; 0x33654 335c8: 82 34 cpi r24, 0x42 ; 66 335ca: 09 f4 brne .+2 ; 0x335ce 335cc: 43 c0 rjmp .+134 ; 0x33654 335ce: e0 f5 brcc .+120 ; 0x33648 335d0: 8a 30 cpi r24, 0x0A ; 10 335d2: 59 f0 breq .+22 ; 0x335ea 335d4: 8d 30 cpi r24, 0x0D ; 13 335d6: 49 f0 breq .+18 ; 0x335ea } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 335d8: b0 92 4a 13 sts 0x134A, r11 ; 0x80134a Matched }; /// @returns true when "ok\n" gets detected State Detect(uint8_t c) { // consume old MMU FW's data if any -> avoid confusion of protocol decoder if (ok == 0 && c == 'o') { 335dc: a1 10 cpse r10, r1 335de: 05 c1 rjmp .+522 ; 0x337ea 335e0: 1f 36 cpi r17, 0x6F ; 111 335e2: 09 f0 breq .+2 ; 0x335e6 335e4: fc c3 rjmp .+2040 ; 0x33dde ++ok; 335e6: aa 24 eor r10, r10 335e8: 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; 335ea: 4f ef ldi r20, 0xFF ; 255 335ec: c4 1a sub r12, r20 335ee: d4 0a sbc r13, r20 335f0: 8f e6 ldi r24, 0x6F ; 111 335f2: 92 e1 ldi r25, 0x12 ; 18 335f4: 0f 94 72 db call 0x3b6e4 ; 0x3b6e4 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) { 335f8: 97 fd sbrc r25, 7 335fa: 00 c1 rjmp .+512 ; 0x337fc ++bytesConsumed; RecordReceivedByte(c); 335fc: 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]; 335fe: 20 91 63 13 lds r18, 0x1363 ; 0x801363 33602: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 33604: f9 01 movw r30, r18 33606: ea 5d subi r30, 0xDA ; 218 33608: fc 4e sbci r31, 0xEC ; 236 3360a: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 3360c: 79 01 movw r14, r18 3360e: ef ef ldi r30, 0xFF ; 255 33610: ee 1a sub r14, r30 33612: fe 0a sbc r15, r30 33614: ff e0 ldi r31, 0x0F ; 15 33616: ef 22 and r14, r31 33618: ff 24 eor r15, r15 3361a: 5e 2c mov r5, r14 3361c: e0 92 63 13 sts 0x1363, r14 ; 0x801363 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 33620: 20 91 4a 13 lds r18, 0x134A ; 0x80134a 33624: 22 30 cpi r18, 0x02 ; 2 33626: 09 f4 brne .+2 ; 0x3362a 33628: 48 c0 rjmp .+144 ; 0x336ba 3362a: 08 f0 brcs .+2 ; 0x3362e 3362c: 7b cf rjmp .-266 ; 0x33524 3362e: 22 23 and r18, r18 33630: 29 f2 breq .-118 ; 0x335bc 33632: 21 30 cpi r18, 0x01 ; 1 33634: 51 f1 breq .+84 ; 0x3368a ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 33636: 1a 30 cpi r17, 0x0A ; 10 33638: 09 f4 brne .+2 ; 0x3363c 3363a: 8f cf rjmp .-226 ; 0x3355a 3363c: 1d 30 cpi r17, 0x0D ; 13 3363e: 09 f4 brne .+2 ; 0x33642 33640: 8c cf rjmp .-232 ; 0x3355a default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 33642: 10 92 50 13 sts 0x1350, r1 ; 0x801350 33646: ca cf rjmp .-108 ; 0x335dc } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33648: 85 34 cpi r24, 0x45 ; 69 3364a: 30 f2 brcs .-116 ; 0x335d8 3364c: 87 34 cpi r24, 0x47 ; 71 3364e: 10 f0 brcs .+4 ; 0x33654 33650: 88 34 cpi r24, 0x48 ; 72 33652: 11 f6 brne .-124 ; 0x335d8 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 33654: 80 93 4b 13 sts 0x134B, r24 ; 0x80134b responseMsg.request.value = 0; 33658: 10 92 4c 13 sts 0x134C, r1 ; 0x80134c responseMsg.request.value2 = 0; 3365c: 10 92 4e 13 sts 0x134E, r1 ; 0x80134e 33660: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d responseMsg.request.crc8 = 0; 33664: 10 92 4f 13 sts 0x134F, r1 ; 0x80134f rspState = ResponseStates::RequestValue; 33668: 90 92 4a 13 sts 0x134A, r9 ; 0x80134a 3366c: be cf rjmp .-132 ; 0x335ea } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 3366e: 89 35 cpi r24, 0x59 ; 89 33670: 40 f4 brcc .+16 ; 0x33682 33672: 87 35 cpi r24, 0x57 ; 87 33674: 78 f7 brcc .-34 ; 0x33654 33676: 20 eb ldi r18, 0xB0 ; 176 33678: 28 0f add r18, r24 3367a: 26 30 cpi r18, 0x06 ; 6 3367c: 08 f0 brcs .+2 ; 0x33680 3367e: ac cf rjmp .-168 ; 0x335d8 33680: e9 cf rjmp .-46 ; 0x33654 33682: 86 36 cpi r24, 0x66 ; 102 33684: 09 f0 breq .+2 ; 0x33688 33686: a8 cf rjmp .-176 ; 0x335d8 33688: e5 cf rjmp .-54 ; 0x33654 } 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'); 3368a: 20 ed ldi r18, 0xD0 ; 208 3368c: 28 0f add r18, r24 3368e: 2a 30 cpi r18, 0x0A ; 10 33690: 50 f0 brcs .+20 ; 0x336a6 33692: 2f e9 ldi r18, 0x9F ; 159 33694: 28 0f add r18, r24 33696: 26 30 cpi r18, 0x06 ; 6 33698: 30 f0 brcs .+12 ; 0x336a6 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 3369a: 80 32 cpi r24, 0x20 ; 32 3369c: 09 f0 breq .+2 ; 0x336a0 3369e: 9c cf rjmp .-200 ; 0x335d8 rspState = ResponseStates::ParamCode; 336a0: 60 92 4a 13 sts 0x134A, r6 ; 0x80134a 336a4: a2 cf rjmp .-188 ; 0x335ea return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 336a6: 0f 94 8f c2 call 0x3851e ; 0x3851e rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 336aa: 90 91 4c 13 lds r25, 0x134C ; 0x80134c 336ae: 92 95 swap r25 336b0: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 336b2: 89 0f add r24, r25 336b4: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c 336b8: 98 cf rjmp .-208 ; 0x335ea } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 336ba: 87 34 cpi r24, 0x47 ; 71 336bc: 48 f4 brcc .+18 ; 0x336d0 336be: 85 34 cpi r24, 0x45 ; 69 336c0: 58 f4 brcc .+22 ; 0x336d8 336c2: 2f eb ldi r18, 0xBF ; 191 336c4: 28 0f add r18, r24 336c6: 22 30 cpi r18, 0x02 ; 2 336c8: 38 f0 brcs .+14 ; 0x336d8 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 336ca: 10 92 50 13 sts 0x1350, r1 ; 0x801350 336ce: 84 cf rjmp .-248 ; 0x335d8 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 336d0: 80 35 cpi r24, 0x50 ; 80 336d2: 11 f0 breq .+4 ; 0x336d8 336d4: 82 35 cpi r24, 0x52 ; 82 336d6: c9 f7 brne .-14 ; 0x336ca case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 336d8: 80 92 4a 13 sts 0x134A, r8 ; 0x80134a responseMsg.paramCode = (ResponseMsgParamCodes)c; 336dc: 80 93 50 13 sts 0x1350, r24 ; 0x801350 responseMsg.paramValue = 0; 336e0: 10 92 52 13 sts 0x1352, r1 ; 0x801352 336e4: 10 92 51 13 sts 0x1351, r1 ; 0x801351 336e8: 80 cf rjmp .-256 ; 0x335ea 336ea: 20 ed ldi r18, 0xD0 ; 208 336ec: 28 0f add r18, r24 336ee: 2a 30 cpi r18, 0x0A ; 10 336f0: 48 f0 brcs .+18 ; 0x33704 336f2: 2f e9 ldi r18, 0x9F ; 159 336f4: 28 0f add r18, r24 336f6: 26 30 cpi r18, 0x06 ; 6 336f8: 28 f0 brcs .+10 ; 0x33704 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 336fa: 8a 32 cpi r24, 0x2A ; 42 336fc: 31 f7 brne .-52 ; 0x336ca rspState = ResponseStates::CRC; 336fe: 70 92 4a 13 sts 0x134A, r7 ; 0x80134a 33702: 73 cf rjmp .-282 ; 0x335ea return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 33704: 0f 94 8f c2 call 0x3851e ; 0x3851e rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 33708: 20 91 51 13 lds r18, 0x1351 ; 0x801351 3370c: 30 91 52 13 lds r19, 0x1352 ; 0x801352 33710: 44 e0 ldi r20, 0x04 ; 4 33712: 22 0f add r18, r18 33714: 33 1f adc r19, r19 33716: 4a 95 dec r20 33718: e1 f7 brne .-8 ; 0x33712 responseMsg.paramValue += Char2Nibble(c); 3371a: 82 0f add r24, r18 3371c: 93 2f mov r25, r19 3371e: 91 1d adc r25, r1 33720: 90 93 52 13 sts 0x1352, r25 ; 0x801352 33724: 80 93 51 13 sts 0x1351, r24 ; 0x801351 33728: 60 cf rjmp .-320 ; 0x335ea return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 3372a: 0f 94 8f c2 call 0x3851e ; 0x3851e rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 3372e: 90 91 4f 13 lds r25, 0x134F ; 0x80134f 33732: 92 95 swap r25 33734: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 33736: 89 0f add r24, r25 33738: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f 3373c: 56 cf rjmp .-340 ; 0x335ea ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 3373e: 8d 30 cpi r24, 0x0D ; 13 33740: 21 f6 brne .-120 ; 0x336ca 33742: 03 cf rjmp .-506 ; 0x3354a if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 33744: e8 0e add r14, r24 33746: f9 1e adc r15, r25 33748: f7 01 movw r30, r14 3374a: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 3374c: 10 92 63 13 sts 0x1363, r1 ; 0x801363 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 33750: 84 e1 ldi r24, 0x14 ; 20 33752: 9a ea ldi r25, 0xAA ; 170 33754: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 33758: 8e e0 ldi r24, 0x0E ; 14 3375a: 9a ea ldi r25, 0xAA ; 170 3375c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 33760: ce 01 movw r24, r28 33762: 01 96 adiw r24, 0x01 ; 1 33764: 0f 94 4b d6 call 0x3ac96 ; 0x3ac96 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 33768: 0f 94 48 70 call 0x2e090 ; 0x2e090 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 3376c: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33770: 81 30 cpi r24, 0x01 ; 1 33772: 09 f4 brne .+2 ; 0x33776 33774: 74 c0 rjmp .+232 ; 0x3385e 33776: 08 f4 brcc .+2 ; 0x3377a 33778: c5 ce rjmp .-630 ; 0x33504 3377a: 83 30 cpi r24, 0x03 ; 3 3377c: 09 f4 brne .+2 ; 0x33780 3377e: d1 c0 rjmp .+418 ; 0x33922 33780: 84 30 cpi r24, 0x04 ; 4 33782: 09 f0 breq .+2 ; 0x33786 33784: 4f ce rjmp .-866 ; 0x33424 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33786: 80 91 29 13 lds r24, 0x1329 ; 0x801329 3378a: 86 30 cpi r24, 0x06 ; 6 3378c: 09 f4 brne .+2 ; 0x33790 3378e: 6c c1 rjmp .+728 ; 0x33a68 33790: 08 f0 brcs .+2 ; 0x33794 33792: 93 c1 rjmp .+806 ; 0x33aba 33794: 84 30 cpi r24, 0x04 ; 4 33796: 09 f4 brne .+2 ; 0x3379a 33798: 09 c1 rjmp .+530 ; 0x339ac 3379a: 85 30 cpi r24, 0x05 ; 5 3379c: 09 f0 breq .+2 ; 0x337a0 3379e: cc c0 rjmp .+408 ; 0x33938 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 337a0: 80 91 40 13 lds r24, 0x1340 ; 0x801340 337a4: 81 34 cpi r24, 0x41 ; 65 337a6: 09 f4 brne .+2 ; 0x337aa 337a8: 96 c1 rjmp .+812 ; 0x33ad6 337aa: 82 35 cpi r24, 0x52 ; 82 337ac: 09 f0 breq .+2 ; 0x337b0 337ae: c4 c0 rjmp .+392 ; 0x33938 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 337b0: 10 92 68 13 sts 0x1368, r1 ; 0x801368 errorCode = ErrorCode::PROTOCOL_ERROR; 337b4: 8d e2 ldi r24, 0x2D ; 45 337b6: 90 e8 ldi r25, 0x80 ; 128 337b8: 90 93 67 13 sts 0x1367, r25 ; 0x801367 337bc: 80 93 66 13 sts 0x1366, r24 ; 0x801366 } break; case CommandRejected: // we have to repeat it - that's the only thing we can do // no change in state // @@TODO wait until Q0 returns command in progress finished, then we can send this one LogError(PSTR("Command rejected")); 337c0: 87 e9 ldi r24, 0x97 ; 151 337c2: 97 ea ldi r25, 0xA7 ; 167 337c4: 0f 94 65 70 call 0x2e0ca ; 0x2e0ca void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 337c8: 85 e0 ldi r24, 0x05 ; 5 337ca: 80 93 29 13 sts 0x1329, r24 ; 0x801329 SendMsg(rq); 337ce: 40 91 2b 13 lds r20, 0x132B ; 0x80132b 337d2: 50 91 2c 13 lds r21, 0x132C ; 0x80132c 337d6: 60 91 2d 13 lds r22, 0x132D ; 0x80132d 337da: 70 91 2e 13 lds r23, 0x132E ; 0x80132e 337de: 80 91 2f 13 lds r24, 0x132F ; 0x80132f 337e2: 0f 94 4e 71 call 0x2e29c ; 0x2e29c 337e6: 16 e0 ldi r17, 0x06 ; 6 337e8: 07 c1 rjmp .+526 ; 0x339f8 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') { 337ea: 1b 36 cpi r17, 0x6B ; 107 337ec: 09 f0 breq .+2 ; 0x337f0 337ee: f7 c2 rjmp .+1518 ; 0x33dde 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")); 337f0: 88 e7 ldi r24, 0x78 ; 120 337f2: 97 ea ldi r25, 0xA7 ; 167 337f4: 0f 94 65 70 call 0x2e0ca ; 0x2e0ca 337f8: 18 e0 ldi r17, 0x08 ; 8 337fa: fe c0 rjmp .+508 ; 0x339f8 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 337fc: cd 28 or r12, r13 337fe: 19 f0 breq .+6 ; 0x33806 RecordUARTActivity(); // something has happened on the UART, update the timeout record 33800: 0f 94 48 70 call 0x2e090 ; 0x2e090 33804: 7f ce rjmp .-770 ; 0x33504 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33806: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 3380a: ab 01 movw r20, r22 3380c: bc 01 movw r22, r24 3380e: 80 91 35 13 lds r24, 0x1335 ; 0x801335 33812: 90 91 36 13 lds r25, 0x1336 ; 0x801336 33816: a0 91 37 13 lds r26, 0x1337 ; 0x801337 3381a: b0 91 38 13 lds r27, 0x1338 ; 0x801338 3381e: 80 53 subi r24, 0x30 ; 48 33820: 98 4f sbci r25, 0xF8 ; 248 33822: af 4f sbci r26, 0xFF ; 255 33824: 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) { 33826: 48 17 cp r20, r24 33828: 59 07 cpc r21, r25 3382a: 6a 07 cpc r22, r26 3382c: 7b 07 cpc r23, r27 3382e: 08 f4 brcc .+2 ; 0x33832 33830: 69 ce rjmp .-814 ; 0x33504 33832: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33836: 88 23 and r24, r24 33838: 09 f4 brne .+2 ; 0x3383c 3383a: 64 ce rjmp .-824 ; 0x33504 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 3383c: 10 92 4a 13 sts 0x134A, r1 ; 0x80134a initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 33840: 81 e0 ldi r24, 0x01 ; 1 33842: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::StartSeq; 33846: 80 93 28 13 sts 0x1328, r24 ; 0x801328 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 3384a: 86 e0 ldi r24, 0x06 ; 6 3384c: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a SendVersion(0); 33850: 80 e0 ldi r24, 0x00 ; 0 33852: 0f 94 5d 98 call 0x330ba ; 0x330ba StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 33856: 64 e0 ldi r22, 0x04 ; 4 33858: 80 e5 ldi r24, 0x50 ; 80 3385a: 97 ea ldi r25, 0xA7 ; 167 3385c: 79 c0 rjmp .+242 ; 0x33950 return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 3385e: 10 91 29 13 lds r17, 0x1329 ; 0x801329 33862: 13 30 cpi r17, 0x03 ; 3 33864: b1 f1 breq .+108 ; 0x338d2 33866: 60 f0 brcs .+24 ; 0x33880 33868: 16 30 cpi r17, 0x06 ; 6 3386a: 09 f4 brne .+2 ; 0x3386e 3386c: 50 c0 rjmp .+160 ; 0x3390e 3386e: 19 30 cpi r17, 0x09 ; 9 33870: 09 f0 breq .+2 ; 0x33874 33872: be cf rjmp .-132 ; 0x337f0 // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 33874: 0f 94 78 72 call 0x2e4f0 ; 0x2e4f0 33878: 88 23 and r24, r24 3387a: 09 f4 brne .+2 ; 0x3387e 3387c: 43 ce rjmp .-890 ; 0x33504 3387e: 40 ce rjmp .-896 ; 0x33500 void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 33880: 80 91 3b 13 lds r24, 0x133B ; 0x80133b 33884: 83 35 cpi r24, 0x53 ; 83 33886: 21 f4 brne .+8 ; 0x33890 33888: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 3388c: 18 17 cp r17, r24 3388e: 11 f0 breq .+4 ; 0x33894 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 33890: 81 2f mov r24, r17 33892: fe cd rjmp .-1028 ; 0x33490 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; 33894: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33898: e1 2f mov r30, r17 3389a: f0 e0 ldi r31, 0x00 ; 0 3389c: df 01 movw r26, r30 3389e: ab 58 subi r26, 0x8B ; 139 338a0: bc 4e sbci r27, 0xEC ; 236 338a2: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 338a4: eb 58 subi r30, 0x8B ; 139 338a6: f8 45 sbci r31, 0x58 ; 88 338a8: e4 91 lpm r30, Z 338aa: 8e 17 cp r24, r30 338ac: 41 f0 breq .+16 ; 0x338be if (--retries == 0) { 338ae: 80 91 2a 13 lds r24, 0x132A ; 0x80132a 338b2: 81 50 subi r24, 0x01 ; 1 338b4: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a 338b8: 81 11 cpse r24, r1 338ba: ea cf rjmp .-44 ; 0x33890 338bc: 99 cf rjmp .-206 ; 0x337f0 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 338be: 87 eb ldi r24, 0xB7 ; 183 338c0: 99 ea ldi r25, 0xA9 ; 169 338c2: 0e 94 17 7b call 0xf62e ; 0xf62e /// @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; } 338c6: 8a e0 ldi r24, 0x0A ; 10 338c8: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 338cc: 81 e0 ldi r24, 0x01 ; 1 338ce: 81 0f add r24, r17 338d0: df cd rjmp .-1090 ; 0x33490 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) { 338d2: 80 91 3b 13 lds r24, 0x133B ; 0x80133b 338d6: 83 35 cpi r24, 0x53 ; 83 338d8: 21 f4 brne .+8 ; 0x338e2 338da: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 338de: 83 30 cpi r24, 0x03 ; 3 338e0: 11 f0 breq .+4 ; 0x338e6 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 338e2: 83 e0 ldi r24, 0x03 ; 3 338e4: d5 cd rjmp .-1110 ; 0x33490 } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 338e6: 80 91 41 13 lds r24, 0x1341 ; 0x801341 338ea: 90 91 42 13 lds r25, 0x1342 ; 0x801342 338ee: 90 93 79 13 sts 0x1379, r25 ; 0x801379 338f2: 80 93 78 13 sts 0x1378, r24 ; 0x801378 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 338f6: 10 92 74 13 sts 0x1374, r1 ; 0x801374 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 338fa: e5 eb ldi r30, 0xB5 ; 181 338fc: f9 ea ldi r31, 0xA9 ; 169 338fe: 84 91 lpm r24, Z 33900: 60 91 72 13 lds r22, 0x1372 ; 0x801372 33904: 70 e0 ldi r23, 0x00 ; 0 33906: 49 e0 ldi r20, 0x09 ; 9 33908: 0f 94 b9 71 call 0x2e372 ; 0x2e372 3390c: fb cd rjmp .-1034 ; 0x33504 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 3390e: 82 e0 ldi r24, 0x02 ; 2 33910: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::Idle; 33914: 83 e0 ldi r24, 0x03 ; 3 33916: 80 93 28 13 sts 0x1328, r24 ; 0x801328 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 3391a: 82 e8 ldi r24, 0x82 ; 130 3391c: 80 93 29 13 sts 0x1329, r24 ; 0x801329 33920: d2 cd rjmp .-1116 ; 0x334c6 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 33922: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33926: 88 30 cpi r24, 0x08 ; 8 33928: 09 f4 brne .+2 ; 0x3392c 3392a: b7 c0 rjmp .+366 ; 0x33a9a 3392c: a8 f4 brcc .+42 ; 0x33958 3392e: 84 30 cpi r24, 0x04 ; 4 33930: d9 f0 breq .+54 ; 0x33968 33932: 87 30 cpi r24, 0x07 ; 7 33934: 09 f4 brne .+2 ; 0x33938 33936: ae c0 rjmp .+348 ; 0x33a94 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 33938: 81 e0 ldi r24, 0x01 ; 1 3393a: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::DelayedRestart; 3393e: 82 e0 ldi r24, 0x02 ; 2 33940: 80 93 28 13 sts 0x1328, r24 ; 0x801328 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 33944: 83 e8 ldi r24, 0x83 ; 131 33946: 80 93 29 13 sts 0x1329, r24 ; 0x801329 StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 3394a: 65 e0 ldi r22, 0x05 ; 5 3394c: 86 e6 ldi r24, 0x66 ; 102 3394e: 97 ea ldi r25, 0xA7 ; 167 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 33950: 0f 94 d6 70 call 0x2e1ac ; 0x2e1ac 33954: 18 2f mov r17, r24 33956: 50 c0 rjmp .+160 ; 0x339f8 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 33958: 8a 30 cpi r24, 0x0A ; 10 3395a: 09 f4 brne .+2 ; 0x3395e 3395c: a7 c0 rjmp .+334 ; 0x33aac 3395e: 60 f3 brcs .-40 ; 0x33938 33960: 8d 30 cpi r24, 0x0D ; 13 33962: 08 f4 brcc .+2 ; 0x33966 33964: 5f cd rjmp .-1346 ; 0x33424 33966: e8 cf rjmp .-48 ; 0x33938 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) { 33968: 80 91 3b 13 lds r24, 0x133B ; 0x80133b 3396c: 8e 34 cpi r24, 0x4E ; 78 3396e: 60 f5 brcc .+88 ; 0x339c8 33970: 8b 34 cpi r24, 0x4B ; 75 33972: 10 f4 brcc .+4 ; 0x33978 33974: 85 34 cpi r24, 0x45 ; 69 33976: 01 f7 brne .-64 ; 0x33938 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 33978: 80 91 40 13 lds r24, 0x1340 ; 0x801340 3397c: 86 34 cpi r24, 0x46 ; 70 3397e: 09 f4 brne .+2 ; 0x33982 33980: 73 c0 rjmp .+230 ; 0x33a68 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 33982: 84 e0 ldi r24, 0x04 ; 4 33984: 80 93 28 13 sts 0x1328, r24 ; 0x801328 33988: 85 e0 ldi r24, 0x05 ; 5 3398a: eb e3 ldi r30, 0x3B ; 59 3398c: f3 e1 ldi r31, 0x13 ; 19 3398e: de 01 movw r26, r28 33990: 11 96 adiw r26, 0x01 ; 1 33992: 01 90 ld r0, Z+ 33994: 0d 92 st X+, r0 33996: 8a 95 dec r24 33998: e1 f7 brne .-8 ; 0x33992 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 3399a: 85 e0 ldi r24, 0x05 ; 5 3399c: fe 01 movw r30, r28 3399e: 31 96 adiw r30, 0x01 ; 1 339a0: ab e2 ldi r26, 0x2B ; 43 339a2: b3 e1 ldi r27, 0x13 ; 19 339a4: 01 90 ld r0, Z+ 339a6: 0d 92 st X+, r0 339a8: 8a 95 dec r24 339aa: e1 f7 brne .-8 ; 0x339a4 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 339ac: 0f 94 c0 98 call 0x33180 ; 0x33180 339b0: 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) { 339b2: 85 30 cpi r24, 0x05 ; 5 339b4: 09 f2 breq .-126 ; 0x33938 339b6: 08 f0 brcs .+2 ; 0x339ba 339b8: 9c c0 rjmp .+312 ; 0x33af2 339ba: 82 30 cpi r24, 0x02 ; 2 339bc: 09 f4 brne .+2 ; 0x339c0 339be: 32 cd rjmp .-1436 ; 0x33424 339c0: 84 30 cpi r24, 0x04 ; 4 339c2: 09 f4 brne .+2 ; 0x339c6 339c4: 3b cf rjmp .-394 ; 0x3383c 339c6: 18 c0 rjmp .+48 ; 0x339f8 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) { 339c8: 84 35 cpi r24, 0x54 ; 84 339ca: 08 f4 brcc .+2 ; 0x339ce 339cc: b5 cf rjmp .-150 ; 0x33938 339ce: 86 35 cpi r24, 0x56 ; 86 339d0: 98 f2 brcs .-90 ; 0x33978 339d2: 88 35 cpi r24, 0x58 ; 88 339d4: 09 f0 breq .+2 ; 0x339d8 339d6: b0 cf rjmp .-160 ; 0x33938 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) { 339d8: 80 91 40 13 lds r24, 0x1340 ; 0x801340 339dc: 86 34 cpi r24, 0x46 ; 70 339de: 89 f1 breq .+98 ; 0x33a42 339e0: 80 35 cpi r24, 0x50 ; 80 339e2: c1 f1 breq .+112 ; 0x33a54 339e4: 82 34 cpi r24, 0x42 ; 66 339e6: 09 f0 breq .+2 ; 0x339ea 339e8: 42 c0 rjmp .+132 ; 0x33a6e 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); 339ea: 80 91 41 13 lds r24, 0x1341 ; 0x801341 339ee: 80 93 69 13 sts 0x1369, r24 ; 0x801369 StartReading8bitRegisters(); 339f2: 0f 94 6e 97 call 0x32edc ; 0x32edc return ButtonPushed; 339f6: 1b e0 ldi r17, 0x0B ; 11 339f8: 80 91 26 13 lds r24, 0x1326 ; 0x801326 339fc: 90 91 27 13 lds r25, 0x1327 ; 0x801327 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 33a00: 81 30 cpi r24, 0x01 ; 1 33a02: 91 05 cpc r25, r1 33a04: 09 f0 breq .+2 ; 0x33a08 33a06: ee c1 rjmp .+988 ; 0x33de4 const StepStatus ss = logic.Step(); switch (ss) { 33a08: 12 30 cpi r17, 0x02 ; 2 33a0a: 09 f4 brne .+2 ; 0x33a0e 33a0c: 90 c0 rjmp .+288 ; 0x33b2e 33a0e: 08 f0 brcs .+2 ; 0x33a12 33a10: 7d c0 rjmp .+250 ; 0x33b0c 33a12: 11 23 and r17, r17 33a14: 09 f4 brne .+2 ; 0x33a18 33a16: 18 c1 rjmp .+560 ; 0x33c48 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33a18: 00 23 and r16, r16 33a1a: 09 f4 brne .+2 ; 0x33a1e 33a1c: e4 c0 rjmp .+456 ; 0x33be6 switch (ss) { 33a1e: 17 30 cpi r17, 0x07 ; 7 33a20: 09 f4 brne .+2 ; 0x33a24 33a22: c4 c1 rjmp .+904 ; 0x33dac 33a24: 08 f0 brcs .+2 ; 0x33a28 33a26: b8 c1 rjmp .+880 ; 0x33d98 33a28: 14 30 cpi r17, 0x04 ; 4 33a2a: 09 f4 brne .+2 ; 0x33a2e 33a2c: c7 c1 rjmp .+910 ; 0x33dbc 33a2e: 15 30 cpi r17, 0x05 ; 5 33a30: 09 f0 breq .+2 ; 0x33a34 33a32: d9 c0 rjmp .+434 ; 0x33be6 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 33a34: 82 e0 ldi r24, 0x02 ; 2 33a36: 80 93 95 13 sts 0x1395, r24 ; 0x801395 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 33a3a: 60 e0 ldi r22, 0x00 ; 0 33a3c: 8d e2 ldi r24, 0x2D ; 45 33a3e: 90 e8 ldi r25, 0x80 ; 128 33a40: ba c1 rjmp .+884 ; 0x33db6 // 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) { 33a42: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33a46: 88 23 and r24, r24 33a48: 29 f0 breq .+10 ; 0x33a54 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33a4a: 82 e8 ldi r24, 0x82 ; 130 33a4c: 80 93 29 13 sts 0x1329, r24 ; 0x801329 case ResponseMsgParamCodes::Finished: if (ReqMsg().code != RequestMsgCodes::unknown) { // got reset while doing some other command - the originally issued command was interrupted! // this must be solved by the upper layer, protocol logic doesn't have all the context (like unload before trying again) IdleRestart(); return Interrupted; 33a50: 13 e0 ldi r17, 0x03 ; 3 33a52: d2 cf rjmp .-92 ; 0x339f8 } [[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); 33a54: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33a58: 80 93 68 13 sts 0x1368, r24 ; 0x801368 errorCode = ErrorCode::OK; 33a5c: 81 e0 ldi r24, 0x01 ; 1 33a5e: 90 e0 ldi r25, 0x00 ; 0 33a60: 90 93 67 13 sts 0x1367, r25 ; 0x801367 33a64: 80 93 66 13 sts 0x1366, r24 ; 0x801366 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 33a68: 0f 94 6e 97 call 0x32edc ; 0x32edc 33a6c: 4b cd rjmp .-1386 ; 0x33504 // 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; 33a6e: 8c e0 ldi r24, 0x0C ; 12 33a70: 80 93 68 13 sts 0x1368, r24 ; 0x801368 errorCode = static_cast(rsp.paramValue); 33a74: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33a78: 90 91 42 13 lds r25, 0x1342 ; 0x801342 33a7c: 90 93 67 13 sts 0x1367, r25 ; 0x801367 33a80: 80 93 66 13 sts 0x1366, r24 ; 0x801366 StartReading8bitRegisters(); // continue Idle state without restarting the communication 33a84: 0f 94 6e 97 call 0x32edc ; 0x32edc // @@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")); 33a88: 89 e8 ldi r24, 0x89 ; 137 33a8a: 97 ea ldi r25, 0xA7 ; 167 33a8c: 0f 94 65 70 call 0x2e0ca ; 0x2e0ca 33a90: 17 e0 ldi r17, 0x07 ; 7 33a92: b2 cf rjmp .-156 ; 0x339f8 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 33a94: 0f 94 92 97 call 0x32f24 ; 0x32f24 33a98: 35 cd rjmp .-1430 ; 0x33504 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 33a9a: 82 e8 ldi r24, 0x82 ; 130 33a9c: 0f 94 76 97 call 0x32eec ; 0x32eec 33aa0: 80 93 29 13 sts 0x1329, r24 ; 0x801329 return scopeState == ScopeState::Ready ? Finished : Processing; 33aa4: 82 38 cpi r24, 0x82 ; 130 33aa6: 09 f0 breq .+2 ; 0x33aaa 33aa8: 2d cd rjmp .-1446 ; 0x33504 33aaa: bc cc rjmp .-1672 ; 0x33424 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33aac: 80 91 40 13 lds r24, 0x1340 ; 0x801340 33ab0: 81 34 cpi r24, 0x41 ; 65 33ab2: d1 f6 brne .-76 ; 0x33a68 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33ab4: 0f 94 53 70 call 0x2e0a6 ; 0x2e0a6 33ab8: d7 cf rjmp .-82 ; 0x33a68 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33aba: 88 30 cpi r24, 0x08 ; 8 33abc: b1 f0 breq .+44 ; 0x33aea 33abe: 50 f3 brcs .-44 ; 0x33a94 33ac0: 8a 30 cpi r24, 0x0A ; 10 33ac2: 09 f0 breq .+2 ; 0x33ac6 33ac4: 39 cf rjmp .-398 ; 0x33938 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33ac6: 80 91 40 13 lds r24, 0x1340 ; 0x801340 33aca: 81 34 cpi r24, 0x41 ; 65 33acc: 09 f0 breq .+2 ; 0x33ad0 33ace: 18 cd rjmp .-1488 ; 0x33500 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33ad0: 0f 94 53 70 call 0x2e0a6 ; 0x2e0a6 33ad4: 15 cd rjmp .-1494 ; 0x33500 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; 33ad6: 10 92 68 13 sts 0x1368, r1 ; 0x801368 errorCode = ErrorCode::RUNNING; 33ada: 10 92 67 13 sts 0x1367, r1 ; 0x801367 33ade: 10 92 66 13 sts 0x1366, r1 ; 0x801366 scopeState = ScopeState::Wait; 33ae2: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 33ae4: 80 93 29 13 sts 0x1329, r24 ; 0x801329 33ae8: 0d cd rjmp .-1510 ; 0x33504 33aea: 81 e8 ldi r24, 0x81 ; 129 33aec: 0f 94 76 97 call 0x32eec ; 0x32eec 33af0: f9 cf rjmp .-14 ; 0x33ae4 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 33af2: 87 30 cpi r24, 0x07 ; 7 33af4: 49 f2 breq .-110 ; 0x33a88 33af6: 08 f4 brcc .+2 ; 0x33afa 33af8: 63 ce rjmp .-826 ; 0x337c0 33afa: 88 30 cpi r24, 0x08 ; 8 33afc: 09 f4 brne .+2 ; 0x33b00 33afe: 78 ce rjmp .-784 ; 0x337f0 33b00: 7b cf rjmp .-266 ; 0x339f8 // 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()) { 33b02: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33b06: 87 fd sbrc r24, 7 33b08: 9a cc rjmp .-1740 ; 0x3343e 33b0a: fc cc rjmp .-1544 ; 0x33504 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 33b0c: 13 30 cpi r17, 0x03 ; 3 33b0e: 09 f4 brne .+2 ; 0x33b12 33b10: 6a c0 rjmp .+212 ; 0x33be6 33b12: 1b 30 cpi r17, 0x0B ; 11 33b14: 09 f0 breq .+2 ; 0x33b18 33b16: 80 cf rjmp .-256 ; 0x33a18 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 33b18: 80 91 69 13 lds r24, 0x1369 ; 0x801369 33b1c: 80 93 90 13 sts 0x1390, r24 ; 0x801390 LogEchoEvent_P(PSTR("MMU Button pushed")); 33b20: 88 ea ldi r24, 0xA8 ; 168 33b22: 97 ea ldi r25, 0xA7 ; 167 33b24: 0f 94 09 c3 call 0x38612 ; 0x38612 CheckUserInput(); // Process the button immediately 33b28: 0f 94 2a 99 call 0x33254 ; 0x33254 33b2c: 5c c0 rjmp .+184 ; 0x33be6 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 33b2e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 33b32: 81 11 cpse r24, r1 33b34: 58 c0 rjmp .+176 ; 0x33be6 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() 33b36: 0e 94 56 68 call 0xd0ac ; 0xd0ac && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 33b3a: 88 23 and r24, r24 33b3c: 09 f4 brne .+2 ; 0x33b40 33b3e: 53 c0 rjmp .+166 ; 0x33be6 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 33b40: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 <_ZL17mcode_in_progress.lto_priv.550> 33b44: 90 91 59 0e lds r25, 0x0E59 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.550+0x1> 33b48: 88 35 cpi r24, 0x58 ; 88 33b4a: 92 40 sbci r25, 0x02 ; 2 33b4c: 09 f4 brne .+2 ; 0x33b50 33b4e: 4b c0 rjmp .+150 ; 0x33be6 && !saved_printing 33b50: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 33b54: 81 11 cpse r24, r1 33b56: 47 c0 rjmp .+142 ; 0x33be6 && !mesh_bed_leveling_flag 33b58: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 33b5c: 81 11 cpse r24, r1 33b5e: 43 c0 rjmp .+134 ; 0x33be6 && !homing_flag 33b60: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 33b64: 81 11 cpse r24, r1 33b66: 3f c0 rjmp .+126 ; 0x33be6 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 33b68: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 33b6c: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 33b70: 98 17 cp r25, r24 33b72: c9 f1 breq .+114 ; 0x33be6 { uint8_t block_index = block_buffer_tail; 33b74: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 } #endif bool e_active() { unsigned char e_active = 0; 33b78: 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++; 33b7a: 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) 33b7c: 30 91 53 0e lds r19, 0x0E53 ; 0x800e53 33b80: 38 17 cp r19, r24 33b82: 89 f0 breq .+34 ; 0x33ba6 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 33b84: 28 9f mul r18, r24 33b86: f0 01 movw r30, r0 33b88: 11 24 eor r1, r1 33b8a: ed 58 subi r30, 0x8D ; 141 33b8c: f8 4f sbci r31, 0xF8 ; 248 33b8e: 44 85 ldd r20, Z+12 ; 0x0c 33b90: 55 85 ldd r21, Z+13 ; 0x0d 33b92: 66 85 ldd r22, Z+14 ; 0x0e 33b94: 77 85 ldd r23, Z+15 ; 0x0f 33b96: 45 2b or r20, r21 33b98: 46 2b or r20, r22 33b9a: 47 2b or r20, r23 33b9c: 09 f0 breq .+2 ; 0x33ba0 33b9e: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 33ba0: 8f 5f subi r24, 0xFF ; 255 33ba2: 8f 70 andi r24, 0x0F ; 15 33ba4: eb cf rjmp .-42 ; 0x33b7c && e_active(); 33ba6: 99 23 and r25, r25 33ba8: f1 f0 breq .+60 ; 0x33be6 SERIAL_ECHOLNPGM("FINDA filament runout!"); 33baa: 89 e3 ldi r24, 0x39 ; 57 33bac: 97 ea ldi r25, 0xA7 ; 167 33bae: 0e 94 17 7b call 0xf62e ; 0xf62e 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); 33bb2: 20 e0 ldi r18, 0x00 ; 0 33bb4: 30 e0 ldi r19, 0x00 ; 0 33bb6: a9 01 movw r20, r18 33bb8: ca 01 movw r24, r20 33bba: b9 01 movw r22, r18 33bbc: 0e 94 7b 8a call 0x114f6 ; 0x114f6 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 33bc0: 60 e0 ldi r22, 0x00 ; 0 33bc2: 70 e0 ldi r23, 0x00 ; 0 33bc4: cb 01 movw r24, r22 33bc6: 0e 94 0a 69 call 0xd214 ; 0xd214 33bca: 86 ed ldi r24, 0xD6 ; 214 33bcc: 9e e0 ldi r25, 0x0E ; 14 33bce: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 33bd2: 81 30 cpi r24, 0x01 ; 1 33bd4: 21 f4 brne .+8 ; 0x33bde if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 33bd6: 0f 94 92 76 call 0x2ed24 ; 0x2ed24 33bda: 8f 3f cpi r24, 0xFF ; 255 33bdc: 91 f5 brne .+100 ; 0x33c42 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 33bde: 8f eb ldi r24, 0xBF ; 191 33be0: 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 33be2: 0f 94 d6 76 call 0x2edac ; 0x2edac break; } } } if (logic.Running()) { 33be6: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33bea: 82 30 cpi r24, 0x02 ; 2 33bec: 19 f4 brne .+6 ; 0x33bf4 state = xState::Active; 33bee: 81 e0 ldi r24, 0x01 ; 1 33bf0: 80 93 95 13 sts 0x1395, r24 ; 0x801395 mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { logicStepLastStatus = LogicStep(reportErrors); // it looks like the mmu_loop doesn't need to be a blocking call 33bf4: 10 93 94 13 sts 0x1394, r17 ; 0x801394 // UI to resolve the error screen, for example tuning Idler Stallguard Threshold // Set to false to allow the error screen to render again. static bool putErrorScreenToSleep; void CheckErrorScreenUserInput() { if (is_mmu_error_monitor_active) { 33bf8: 80 91 71 07 lds r24, 0x0771 ; 0x800771 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.508> 33bfc: 88 23 and r24, r24 33bfe: 51 f0 breq .+20 ; 0x33c14 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 33c00: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.514> 33c04: 81 11 cpse r24, r1 33c06: 06 c0 rjmp .+12 ; 0x33c14 33c08: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33c0c: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33c10: 0f 94 6c c4 call 0x388d8 ; 0x388d8 CheckErrorScreenUserInput(); } 33c14: a0 96 adiw r28, 0x20 ; 32 33c16: 0f b6 in r0, 0x3f ; 63 33c18: f8 94 cli 33c1a: de bf out 0x3e, r29 ; 62 33c1c: 0f be out 0x3f, r0 ; 63 33c1e: cd bf out 0x3d, r28 ; 61 33c20: df 91 pop r29 33c22: cf 91 pop r28 33c24: 1f 91 pop r17 33c26: 0f 91 pop r16 33c28: ff 90 pop r15 33c2a: ef 90 pop r14 33c2c: df 90 pop r13 33c2e: cf 90 pop r12 33c30: bf 90 pop r11 33c32: af 90 pop r10 33c34: 9f 90 pop r9 33c36: 8f 90 pop r8 33c38: 7f 90 pop r7 33c3a: 6f 90 pop r6 33c3c: 5f 90 pop r5 33c3e: 4f 90 pop r4 33c40: 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 33c42: 8f e2 ldi r24, 0x2F ; 47 33c44: 97 ea ldi r25, 0xA7 ; 167 33c46: cd cf rjmp .-102 ; 0x33be2 33c48: 00 91 68 13 lds r16, 0x1368 ; 0x801368 ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 33c4c: 80 91 8c 13 lds r24, 0x138C ; 0x80138c 33c50: 08 17 cp r16, r24 33c52: 09 f4 brne .+2 ; 0x33c56 33c54: 49 c0 rjmp .+146 ; 0x33ce8 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 33c56: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33c5a: 84 30 cpi r24, 0x04 ; 4 33c5c: b9 f4 brne .+46 ; 0x33c8c break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 33c5e: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33c62: 88 23 and r24, r24 33c64: 99 f0 breq .+38 ; 0x33c8c custom_message_type = CustomMsg::MMUProgress; 33c66: 89 e0 ldi r24, 0x09 ; 9 33c68: 80 93 72 07 sts 0x0772, r24 ; 0x800772 : static_cast(pgm_read_ptr(&progressTexts[0])); 33c6c: e5 ef ldi r30, 0xF5 ; 245 33c6e: 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])) 33c70: 0e 31 cpi r16, 0x1E ; 30 33c72: 30 f4 brcc .+12 ; 0x33c80 33c74: e0 2f mov r30, r16 33c76: f0 e0 ldi r31, 0x00 ; 0 33c78: ee 0f add r30, r30 33c7a: ff 1f adc r31, r31 33c7c: eb 50 subi r30, 0x0B ; 11 33c7e: f9 45 sbci r31, 0x59 ; 89 : static_cast(pgm_read_ptr(&progressTexts[0])); 33c80: 85 91 lpm r24, Z+ 33c82: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 33c84: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 33c88: 0f 94 be 0b call 0x2177c ; 0x2177c 33c8c: e5 ef ldi r30, 0xF5 ; 245 33c8e: 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])) 33c90: 0e 31 cpi r16, 0x1E ; 30 33c92: 30 f4 brcc .+12 ; 0x33ca0 33c94: e0 2f mov r30, r16 33c96: f0 e0 ldi r31, 0x00 ; 0 33c98: ee 0f add r30, r30 33c9a: ff 1f adc r31, r31 33c9c: eb 50 subi r30, 0x0B ; 11 33c9e: f9 45 sbci r31, 0x59 ; 89 : static_cast(pgm_read_ptr(&progressTexts[0])); 33ca0: 85 91 lpm r24, Z+ 33ca2: 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))); 33ca4: 02 96 adiw r24, 0x02 ; 2 33ca6: 0f 94 09 c3 call 0x38612 ; 0x38612 } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 33caa: 00 93 8c 13 sts 0x138C, r16 ; 0x80138c switch (pc) { 33cae: 03 30 cpi r16, 0x03 ; 3 33cb0: 49 f0 breq .+18 ; 0x33cc4 33cb2: 0c 31 cpi r16, 0x1C ; 28 33cb4: 09 f0 breq .+2 ; 0x33cb8 33cb6: 97 cf rjmp .-210 ; 0x33be6 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33cb8: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 33cbc: 81 e0 ldi r24, 0x01 ; 1 33cbe: 80 93 97 13 sts 0x1397, r24 ; 0x801397 33cc2: 91 cf rjmp .-222 ; 0x33be6 33cc4: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33cc8: 84 30 cpi r24, 0x04 ; 4 33cca: 31 f4 brne .+12 ; 0x33cd8 ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 33ccc: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33cd0: 84 55 subi r24, 0x54 ; 84 33cd2: 82 30 cpi r24, 0x02 ; 2 33cd4: 08 f4 brcc .+2 ; 0x33cd8 33cd6: 87 cf rjmp .-242 ; 0x33be6 33cd8: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 // 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; 33cdc: 81 e0 ldi r24, 0x01 ; 1 33cde: 80 93 98 13 sts 0x1398, r24 ; 0x801398 if (unloadFilamentStarted && !planner_any_moves()) { // Only plan a move if there is no move ongoing switch (WhereIsFilament()) { case FilamentState::AT_FSENSOR: case FilamentState::IN_NOZZLE: case FilamentState::UNAVAILABLE: // actually Unavailable makes sense as well to start the E-move to release the filament from the gears HelpUnloadToFinda(); 33ce2: 0f 94 e1 73 call 0x2e7c2 ; 0x2e7c2 33ce6: 7f cf rjmp .-258 ; 0x33be6 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) { 33ce8: 03 30 cpi r16, 0x03 ; 3 33cea: 71 f1 breq .+92 ; 0x33d48 33cec: 0c 31 cpi r16, 0x1C ; 28 33cee: 09 f0 breq .+2 ; 0x33cf2 33cf0: 7a cf rjmp .-268 ; 0x33be6 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 33cf2: 80 91 97 13 lds r24, 0x1397 ; 0x801397 33cf6: 88 23 and r24, r24 33cf8: 09 f4 brne .+2 ; 0x33cfc 33cfa: 75 cf rjmp .-278 ; 0x33be6 switch (WhereIsFilament()) { 33cfc: 0f 94 19 c3 call 0x38632 ; 0x38632 33d00: 88 23 and r24, r24 33d02: b1 f1 breq .+108 ; 0x33d70 33d04: 81 30 cpi r24, 0x01 ; 1 33d06: 09 f0 breq .+2 ; 0x33d0a 33d08: 6e cf rjmp .-292 ; 0x33be6 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 33d0a: 10 92 97 13 sts 0x1397, r1 ; 0x801397 float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 33d0e: 0f 94 c2 bb call 0x37784 ; 0x37784 // 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; 33d12: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 33d16: 60 91 73 13 lds r22, 0x1373 ; 0x801373 33d1a: 70 e0 ldi r23, 0x00 ; 0 33d1c: 90 e0 ldi r25, 0x00 ; 0 33d1e: 80 e0 ldi r24, 0x00 ; 0 33d20: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 33d24: 6b 01 movw r12, r22 33d26: 7c 01 movw r14, r24 33d28: 60 91 72 13 lds r22, 0x1372 ; 0x801372 33d2c: 70 e0 ldi r23, 0x00 ; 0 33d2e: 6e 5f subi r22, 0xFE ; 254 33d30: 7f 4f sbci r23, 0xFF ; 255 33d32: 07 2e mov r0, r23 33d34: 00 0c add r0, r0 33d36: 88 0b sbc r24, r24 33d38: 99 0b sbc r25, r25 33d3a: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 33d3e: a7 01 movw r20, r14 33d40: 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()); 33d42: 0f 94 e5 c2 call 0x385ca ; 0x385ca 33d46: 4f cf rjmp .-354 ; 0x33be6 } 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 33d48: 80 91 98 13 lds r24, 0x1398 ; 0x801398 33d4c: 88 23 and r24, r24 33d4e: 09 f4 brne .+2 ; 0x33d52 33d50: 4a cf rjmp .-364 ; 0x33be6 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); 33d52: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 33d56: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 33d5a: 98 13 cpse r25, r24 33d5c: 44 cf rjmp .-376 ; 0x33be6 switch (WhereIsFilament()) { 33d5e: 0f 94 19 c3 call 0x38632 ; 0x38632 33d62: 81 50 subi r24, 0x01 ; 1 33d64: 83 30 cpi r24, 0x03 ; 3 33d66: 08 f4 brcc .+2 ; 0x33d6a 33d68: bc cf rjmp .-136 ; 0x33ce2 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; 33d6a: 10 92 98 13 sts 0x1398, r1 ; 0x801398 33d6e: 3b cf rjmp .-394 ; 0x33be6 33d70: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 33d74: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); } break; case FilamentState::NOT_PRESENT: // fsensor not triggered, continue moving extruder if (!planner_any_moves()) { // Only plan a move if there is no move ongoing 33d78: 98 13 cpse r25, r24 33d7a: 35 cf rjmp .-406 ; 0x33be6 // 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()); 33d7c: 60 91 73 13 lds r22, 0x1373 ; 0x801373 33d80: 70 e0 ldi r23, 0x00 ; 0 33d82: 90 e0 ldi r25, 0x00 ; 0 33d84: 80 e0 ldi r24, 0x00 ; 0 33d86: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 33d8a: 9b 01 movw r18, r22 33d8c: ac 01 movw r20, r24 33d8e: 60 e0 ldi r22, 0x00 ; 0 33d90: 70 e0 ldi r23, 0x00 ; 0 33d92: 8f ea ldi r24, 0xAF ; 175 33d94: 93 e4 ldi r25, 0x43 ; 67 33d96: d5 cf rjmp .-86 ; 0x33d42 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 33d98: 18 30 cpi r17, 0x08 ; 8 33d9a: b9 f0 breq .+46 ; 0x33dca 33d9c: 19 30 cpi r17, 0x09 ; 9 33d9e: 09 f0 breq .+2 ; 0x33da2 33da0: 22 cf rjmp .-444 ; 0x33be6 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 33da2: 60 e0 ldi r22, 0x00 ; 0 33da4: 0f 94 59 83 call 0x306b2 ; 0x306b2 33da8: 19 e0 ldi r17, 0x09 ; 9 33daa: 1d cf rjmp .-454 ; 0x33be6 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 33dac: 61 e0 ldi r22, 0x01 ; 1 33dae: 80 91 66 13 lds r24, 0x1366 ; 0x801366 33db2: 90 91 67 13 lds r25, 0x1367 ; 0x801367 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33db6: 0f 94 59 83 call 0x306b2 ; 0x306b2 33dba: 15 cf rjmp .-470 ; 0x33be6 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 33dbc: 82 e0 ldi r24, 0x02 ; 2 33dbe: 80 93 95 13 sts 0x1395, r24 ; 0x801395 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 33dc2: 60 e0 ldi r22, 0x00 ; 0 33dc4: 8e e2 ldi r24, 0x2E ; 46 33dc6: 90 e8 ldi r25, 0x80 ; 128 33dc8: f6 cf rjmp .-20 ; 0x33db6 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 33dca: 10 92 95 13 sts 0x1395, r1 ; 0x801395 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33dce: 10 92 43 13 sts 0x1343, r1 ; 0x801343 currentScope = Scope::Stopped; 33dd2: 10 92 28 13 sts 0x1328, r1 ; 0x801328 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33dd6: 60 e0 ldi r22, 0x00 ; 0 33dd8: 8c e2 ldi r24, 0x2C ; 44 33dda: 90 e8 ldi r25, 0x80 ; 128 33ddc: ec cf rjmp .-40 ; 0x33db6 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 33dde: 0f 94 48 70 call 0x2e090 ; 0x2e090 33de2: aa cd rjmp .-1196 ; 0x33938 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33de4: 00 23 and r16, r16 33de6: 01 f3 breq .-64 ; 0x33da8 33de8: dc cf rjmp .-72 ; 0x33da2 00033dea : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 33dea: 80 91 96 13 lds r24, 0x1396 ; 0x801396 33dee: 82 ff sbrs r24, 2 33df0: 07 c0 rjmp .+14 ; 0x33e00 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 33df2: 8b 7f andi r24, 0xFB ; 251 33df4: 80 93 96 13 sts 0x1396, r24 ; 0x801396 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 33df8: 83 e8 ldi r24, 0x83 ; 131 33dfa: 98 ea ldi r25, 0xA8 ; 168 33dfc: 0f 94 09 c3 call 0x38612 ; 0x38612 } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 33e00: 80 91 96 13 lds r24, 0x1396 ; 0x801396 33e04: 81 ff sbrs r24, 1 33e06: 52 c0 rjmp .+164 ; 0x33eac 33e08: 80 91 8a 13 lds r24, 0x138A ; 0x80138a 33e0c: 90 91 8b 13 lds r25, 0x138B ; 0x80138b 33e10: 89 2b or r24, r25 33e12: 09 f4 brne .+2 ; 0x33e16 33e14: 4b c0 rjmp .+150 ; 0x33eac LogEchoEvent_P(PSTR("Resuming Temp")); 33e16: 85 e7 ldi r24, 0x75 ; 117 33e18: 98 ea ldi r25, 0xA8 ; 168 33e1a: 0f 94 09 c3 call 0x38612 ; 0x38612 // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 33e1e: 80 91 8a 13 lds r24, 0x138A ; 0x80138a 33e22: 90 91 8b 13 lds r25, 0x138B ; 0x80138b 33e26: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c mmu_print_saved &= ~(SavedState::Cooldown); 33e2a: 80 91 96 13 lds r24, 0x1396 ; 0x801396 33e2e: 8d 7f andi r24, 0xFD ; 253 33e30: 80 93 96 13 sts 0x1396, r24 ; 0x801396 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 33e34: 80 91 8a 13 lds r24, 0x138A ; 0x80138a 33e38: 90 91 8b 13 lds r25, 0x138B ; 0x80138b 33e3c: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 33e40: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 33e44: 83 ec ldi r24, 0xC3 ; 195 33e46: 9c e5 ldi r25, 0x5C ; 92 33e48: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 33e4c: 0f 94 55 35 call 0x26aaa ; 0x26aaa 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)); 33e50: 45 e4 ldi r20, 0x45 ; 69 33e52: 58 ea ldi r21, 0xA8 ; 168 33e54: 62 e0 ldi r22, 0x02 ; 2 33e56: 80 e0 ldi r24, 0x00 ; 0 33e58: 0e 94 ba 6f call 0xdf74 ; 0xdf74 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 33e5c: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 33e60: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 33e64: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 33e68: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 33e6c: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 33e70: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 33e74: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 33e78: c9 01 movw r24, r18 33e7a: 86 1b sub r24, r22 33e7c: 97 0b sbc r25, r23 33e7e: 06 97 sbiw r24, 0x06 ; 6 33e80: 6c f0 brlt .+26 ; 0x33e9c void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 33e82: 81 e0 ldi r24, 0x01 ; 1 33e84: 0e 94 f3 8b call 0x117e6 ; 0x117e6 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); 33e88: 80 e0 ldi r24, 0x00 ; 0 33e8a: 0f 94 e3 99 call 0x333c6 ; 0x333c6 ReportErrorHookDynamicRender(); 33e8e: 0f 94 2d c2 call 0x3845a ; 0x3845a void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 33e92: 84 e6 ldi r24, 0x64 ; 100 33e94: 90 e0 ldi r25, 0x00 ; 0 33e96: 0e 94 98 8e call 0x11d30 ; 0x11d30 33e9a: e0 cf rjmp .-64 ; 0x33e5c }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 33e9c: 0f 94 03 c2 call 0x38406 ; 0x38406 LogEchoEvent_P(PSTR("Hotend temperature reached")); 33ea0: 8a e5 ldi r24, 0x5A ; 90 33ea2: 98 ea ldi r25, 0xA8 ; 168 33ea4: 0f 94 09 c3 call 0x38612 ; 0x38612 void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 33ea8: 0c 94 d9 6f jmp 0xdfb2 ; 0xdfb2 ScreenClear(); } } 33eac: 08 95 ret 00033eae : /// 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) { 33eae: 0f 93 push r16 33eb0: 1f 93 push r17 33eb2: cf 93 push r28 33eb4: df 93 push r29 33eb6: 00 d0 rcall .+0 ; 0x33eb8 33eb8: 1f 92 push r1 33eba: 1f 92 push r1 33ebc: cd b7 in r28, 0x3d ; 61 33ebe: de b7 in r29, 0x3e ; 62 33ec0: 18 2f mov r17, r24 33ec2: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 33ec4: 10 92 96 13 sts 0x1396, r1 ; 0x801396 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 33ec8: 83 e0 ldi r24, 0x03 ; 3 33eca: 80 93 96 02 sts 0x0296, r24 ; 0x800296 LongTimer nozzleTimeout; 33ece: 19 82 std Y+1, r1 ; 0x01 33ed0: 1a 82 std Y+2, r1 ; 0x02 33ed2: 1b 82 std Y+3, r1 ; 0x03 33ed4: 1c 82 std Y+4, r1 ; 0x04 33ed6: 1d 82 std Y+5, r1 ; 0x05 33ed8: 90 e0 ldi r25, 0x00 ; 0 33eda: 80 e0 ldi r24, 0x00 ; 0 33edc: 0e 94 98 8e call 0x11d30 ; 0x11d30 // - 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) { 33ee0: 90 91 96 13 lds r25, 0x1396 ; 0x801396 33ee4: 89 81 ldd r24, Y+1 ; 0x01 33ee6: 92 ff sbrs r25, 2 33ee8: 37 c0 rjmp .+110 ; 0x33f58 if (!nozzleTimeout.running()) { 33eea: 81 11 cpse r24, r1 33eec: 1e c0 rjmp .+60 ; 0x33f2a nozzleTimeout.start(); 33eee: ce 01 movw r24, r28 33ef0: 01 96 adiw r24, 0x01 ; 1 33ef2: 0f 94 fe 41 call 0x283fc ; 0x283fc ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 33ef6: 8f e6 ldi r24, 0x6F ; 111 33ef8: 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")); 33efa: 0f 94 09 c3 call 0x38612 ; 0x38612 } switch (logicStepLastStatus) { 33efe: e0 91 94 13 lds r30, 0x1394 ; 0x801394 33f02: e2 50 subi r30, 0x02 ; 2 33f04: ea 30 cpi r30, 0x0A ; 10 33f06: 40 f7 brcc .-48 ; 0x33ed8 33f08: f0 e0 ldi r31, 0x00 ; 0 33f0a: 88 27 eor r24, r24 33f0c: e5 57 subi r30, 0x75 ; 117 33f0e: f0 46 sbci r31, 0x60 ; 96 33f10: 8e 4f sbci r24, 0xFE ; 254 33f12: 0d 94 56 de jmp 0x3bcac ; 0x3bcac <__tablejump2__> 33f16: 04 3b cpi r16, 0xB4 ; 180 33f18: 50 3a cpi r21, 0xA0 ; 160 33f1a: f6 39 cpi r31, 0x96 ; 150 33f1c: f6 39 cpi r31, 0x96 ; 150 33f1e: 36 3b cpi r19, 0xB6 ; 182 33f20: f6 39 cpi r31, 0x96 ; 150 33f22: c0 39 cpi r28, 0x90 ; 144 33f24: f8 3a cpi r31, 0xA8 ; 168 33f26: 26 3b cpi r18, 0xB6 ; 182 33f28: f6 39 cpi r31, 0x96 ; 150 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. 33f2a: 40 e4 ldi r20, 0x40 ; 64 33f2c: 57 e7 ldi r21, 0x77 ; 119 33f2e: 6b e1 ldi r22, 0x1B ; 27 33f30: 70 e0 ldi r23, 0x00 ; 0 33f32: ce 01 movw r24, r28 33f34: 01 96 adiw r24, 0x01 ; 1 33f36: 0f 94 3f 40 call 0x2807e ; 0x2807e ::expired(unsigned long)> 33f3a: 88 23 and r24, r24 33f3c: 01 f3 breq .-64 ; 0x33efe mmu_print_saved &= ~(SavedState::CooldownPending); 33f3e: 80 91 96 13 lds r24, 0x1396 ; 0x801396 33f42: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 33f44: 82 60 ori r24, 0x02 ; 2 33f46: 80 93 96 13 sts 0x1396, r24 ; 0x801396 33f4a: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 33f4e: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 33f52: 8f e5 ldi r24, 0x5F ; 95 33f54: 96 ea ldi r25, 0xA6 ; 166 33f56: d1 cf rjmp .-94 ; 0x33efa } } else if (nozzleTimeout.running()) { 33f58: 88 23 and r24, r24 33f5a: 89 f2 breq .-94 ; 0x33efe 33f5c: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33f5e: 89 e4 ldi r24, 0x49 ; 73 33f60: 96 ea ldi r25, 0xA6 ; 166 33f62: cb cf rjmp .-106 ; 0x33efa 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(); 33f64: 0f 94 f5 9e call 0x33dea ; 0x33dea ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 33f68: 0f 94 07 74 call 0x2e80e ; 0x2e80e if (!TuneMenuEntered()) { 33f6c: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.514> 33f70: 81 11 cpse r24, r1 33f72: 07 c0 rjmp .+14 ; 0x33f82 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 33f74: 86 e3 ldi r24, 0x36 ; 54 33f76: 96 ea ldi r25, 0xA6 ; 166 33f78: 0e 94 17 7b call 0xf62e ; 0xf62e retryAttempts = MAX_RETRIES; 33f7c: 83 e0 ldi r24, 0x03 ; 3 33f7e: 80 93 7a 13 sts 0x137A, r24 ; 0x80137a bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33f82: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 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; 33f86: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 33f88: 0f 90 pop r0 33f8a: 0f 90 pop r0 33f8c: 0f 90 pop r0 33f8e: 0f 90 pop r0 33f90: 0f 90 pop r0 33f92: df 91 pop r29 33f94: cf 91 pop r28 33f96: 1f 91 pop r17 33f98: 0f 91 pop r16 33f9a: 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(); 33f9c: 0f 94 2a 99 call 0x33254 ; 0x33254 33fa0: f2 cf rjmp .-28 ; 0x33f86 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 33fa2: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 33fa6: 81 11 cpse r24, r1 33fa8: 97 cf rjmp .-210 ; 0x33ed8 // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 33faa: 81 2f mov r24, r17 33fac: 0f 94 53 74 call 0x2e8a6 ; 0x2e8a6 SaveHotendTemp(turn_off_nozzle); 33fb0: 80 2f mov r24, r16 33fb2: 0f 94 eb 73 call 0x2e7d6 ; 0x2e7d6 CheckUserInput(); 33fb6: 0f 94 2a 99 call 0x33254 ; 0x33254 33fba: 8e cf rjmp .-228 ; 0x33ed8 } 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(); 33fbc: 0f 94 f5 9e call 0x33dea ; 0x33dea ResumeUnpark(); 33fc0: 0f 94 07 74 call 0x2e80e ; 0x2e80e 33fc4: 89 cf rjmp .-238 ; 0x33ed8 } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 33fc6: 80 e0 ldi r24, 0x00 ; 0 33fc8: df cf rjmp .-66 ; 0x33f88 00033fca : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 33fca: cf 93 push r28 33fcc: df 93 push r29 33fce: 00 d0 rcall .+0 ; 0x33fd0 33fd0: 1f 92 push r1 33fd2: 1f 92 push r1 33fd4: cd b7 in r28, 0x3d ; 61 33fd6: 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; 33fd8: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 33fdc: 10 92 86 17 sts 0x1786, r1 ; 0x801786 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 33fe0: 62 e1 ldi r22, 0x12 ; 18 33fe2: 86 ea ldi r24, 0xA6 ; 166 33fe4: 95 ea ldi r25, 0xA5 ; 165 33fe6: 0f 94 e2 87 call 0x30fc4 ; 0x30fc4 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(); 33fea: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 33fee: 40 e0 ldi r20, 0x00 ; 0 33ff0: 65 e5 ldi r22, 0x55 ; 85 33ff2: ce 01 movw r24, r28 33ff4: 01 96 adiw r24, 0x01 ; 1 33ff6: 0f 94 c1 c2 call 0x38582 ; 0x38582 33ffa: 49 81 ldd r20, Y+1 ; 0x01 33ffc: 5a 81 ldd r21, Y+2 ; 0x02 33ffe: 6b 81 ldd r22, Y+3 ; 0x03 34000: 7c 81 ldd r23, Y+4 ; 0x04 34002: 8d 81 ldd r24, Y+5 ; 0x05 34004: 0f 94 33 98 call 0x33066 ; 0x33066 logic.UnloadFilament(); if (manage_response(false, true)) { 34008: 61 e0 ldi r22, 0x01 ; 1 3400a: 80 e0 ldi r24, 0x00 ; 0 3400c: 0f 94 57 9f call 0x33eae ; 0x33eae 34010: 81 11 cpse r24, r1 34012: 03 c0 rjmp .+6 ; 0x3401a break; } IncrementMMUFails(); 34014: 0f 94 25 c2 call 0x3844a ; 0x3844a 34018: e8 cf rjmp .-48 ; 0x33fea 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); 3401a: 83 e0 ldi r24, 0x03 ; 3 3401c: 0f 94 34 64 call 0x2c868 ; 0x2c868 } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 34020: 83 e6 ldi r24, 0x63 ; 99 34022: 0f 94 8a 87 call 0x30f14 ; 0x30f14 tool_change_extruder = MMU2_NO_TOOL; 34026: 83 e6 ldi r24, 0x63 ; 99 34028: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 3402c: 85 e8 ldi r24, 0x85 ; 133 3402e: 97 e1 ldi r25, 0x17 ; 23 34030: 0e 94 95 75 call 0xeb2a ; 0xeb2a } 34034: 0f 90 pop r0 34036: 0f 90 pop r0 34038: 0f 90 pop r0 3403a: 0f 90 pop r0 3403c: 0f 90 pop r0 3403e: df 91 pop r29 34040: cf 91 pop r28 34042: 08 95 ret 00034044 : bool MMU2::unload() { 34044: cf 93 push r28 if (!WaitForMMUReady()) { 34046: 0f 94 0b 88 call 0x31016 ; 0x31016 3404a: c8 2f mov r28, r24 3404c: 88 23 and r24, r24 3404e: 79 f0 breq .+30 ; 0x3406e safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 34050: 88 ec ldi r24, 0xC8 ; 200 34052: 90 e0 ldi r25, 0x00 ; 0 34054: 0f 94 62 c6 call 0x38cc4 ; 0x38cc4 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> 34058: 82 e0 ldi r24, 0x02 ; 2 3405a: 0f 94 34 64 call 0x2c868 ; 0x2c868 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 3405e: 0f 94 7f 87 call 0x30efe ; 0x30efe WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 34062: 0f 94 e5 9f call 0x33fca ; 0x33fca explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34066: 0f 94 00 88 call 0x31000 ; 0x31000 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 3406a: 0f 94 03 c2 call 0x38406 ; 0x38406 return true; } 3406e: 8c 2f mov r24, r28 34070: cf 91 pop r28 34072: 08 95 ret 00034074 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 34074: 0f 93 push r16 34076: 1f 93 push r17 34078: cf 93 push r28 3407a: df 93 push r29 3407c: 00 d0 rcall .+0 ; 0x3407e 3407e: 1f 92 push r1 34080: 1f 92 push r1 34082: cd b7 in r28, 0x3d ; 61 34084: de b7 in r29, 0x3e ; 62 34086: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 34088: 0f 94 0b 88 call 0x31016 ; 0x31016 3408c: 18 2f mov r17, r24 3408e: 88 23 and r24, r24 34090: 49 f1 breq .+82 ; 0x340e4 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 34092: 80 eb ldi r24, 0xB0 ; 176 34094: 9c e5 ldi r25, 0x5C ; 92 34096: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 3409a: 60 2f mov r22, r16 3409c: 0f 94 06 c2 call 0x3840c ; 0x3840c struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 340a0: 0f 94 7f 87 call 0x30efe ; 0x30efe FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 340a4: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 340a8: 40 2f mov r20, r16 340aa: 6c e4 ldi r22, 0x4C ; 76 340ac: ce 01 movw r24, r28 340ae: 01 96 adiw r24, 0x01 ; 1 340b0: 0f 94 c1 c2 call 0x38582 ; 0x38582 340b4: 49 81 ldd r20, Y+1 ; 0x01 340b6: 5a 81 ldd r21, Y+2 ; 0x02 340b8: 6b 81 ldd r22, Y+3 ; 0x03 340ba: 7c 81 ldd r23, Y+4 ; 0x04 340bc: 8d 81 ldd r24, Y+5 ; 0x05 340be: 0f 94 33 98 call 0x33066 ; 0x33066 logic.LoadFilament(slot); if (manage_response(false, false)) { 340c2: 60 e0 ldi r22, 0x00 ; 0 340c4: 80 e0 ldi r24, 0x00 ; 0 340c6: 0f 94 57 9f call 0x33eae ; 0x33eae 340ca: 18 2f mov r17, r24 340cc: 81 11 cpse r24, r1 340ce: 03 c0 rjmp .+6 ; 0x340d6 break; } IncrementMMUFails(); 340d0: 0f 94 25 c2 call 0x3844a ; 0x3844a 340d4: e7 cf rjmp .-50 ; 0x340a4 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); 340d6: 83 e0 ldi r24, 0x03 ; 3 340d8: 0f 94 34 64 call 0x2c868 ; 0x2c868 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 340dc: 0f 94 00 88 call 0x31000 ; 0x31000 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 340e0: 0f 94 03 c2 call 0x38406 ; 0x38406 return true; } 340e4: 81 2f mov r24, r17 340e6: 0f 90 pop r0 340e8: 0f 90 pop r0 340ea: 0f 90 pop r0 340ec: 0f 90 pop r0 340ee: 0f 90 pop r0 340f0: df 91 pop r29 340f2: cf 91 pop r28 340f4: 1f 91 pop r17 340f6: 0f 91 pop r16 340f8: 08 95 ret 000340fa : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 340fa: ff 92 push r15 340fc: 0f 93 push r16 340fe: 1f 93 push r17 34100: cf 93 push r28 34102: df 93 push r29 34104: 00 d0 rcall .+0 ; 0x34106 34106: 1f 92 push r1 34108: 1f 92 push r1 3410a: cd b7 in r28, 0x3d ; 61 3410c: de b7 in r29, 0x3e ; 62 3410e: 08 2f mov r16, r24 34110: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 34112: 0f 94 0b 88 call 0x31016 ; 0x31016 34116: 18 2f mov r17, r24 34118: 88 23 and r24, r24 3411a: b1 f1 breq .+108 ; 0x34188 return false; } if (enableFullScreenMsg) { 3411c: ff 20 and r15, r15 3411e: 39 f0 breq .+14 ; 0x3412e void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 34120: 8f e9 ldi r24, 0x9F ; 159 34122: 9c e5 ldi r25, 0x5C ; 92 34124: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 34128: 60 2f mov r22, r16 3412a: 0f 94 06 c2 call 0x3840c ; 0x3840c FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 3412e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 34132: 81 11 cpse r24, r1 unload(); 34134: 0f 94 22 a0 call 0x34044 ; 0x34044 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 34138: 0f 94 7f 87 call 0x30efe ; 0x30efe unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 3413c: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 34140: 40 2f mov r20, r16 34142: 65 e4 ldi r22, 0x45 ; 69 34144: ce 01 movw r24, r28 34146: 01 96 adiw r24, 0x01 ; 1 34148: 0f 94 c1 c2 call 0x38582 ; 0x38582 3414c: 49 81 ldd r20, Y+1 ; 0x01 3414e: 5a 81 ldd r21, Y+2 ; 0x02 34150: 6b 81 ldd r22, Y+3 ; 0x03 34152: 7c 81 ldd r23, Y+4 ; 0x04 34154: 8d 81 ldd r24, Y+5 ; 0x05 34156: 0f 94 33 98 call 0x33066 ; 0x33066 logic.EjectFilament(slot); if (manage_response(false, true)) { 3415a: 61 e0 ldi r22, 0x01 ; 1 3415c: 80 e0 ldi r24, 0x00 ; 0 3415e: 0f 94 57 9f call 0x33eae ; 0x33eae 34162: 18 2f mov r17, r24 34164: 81 11 cpse r24, r1 34166: 03 c0 rjmp .+6 ; 0x3416e break; } IncrementMMUFails(); 34168: 0f 94 25 c2 call 0x3844a ; 0x3844a 3416c: e7 cf rjmp .-50 ; 0x3413c } SetCurrentTool(MMU2_NO_TOOL); 3416e: 83 e6 ldi r24, 0x63 ; 99 34170: 0f 94 8a 87 call 0x30f14 ; 0x30f14 tool_change_extruder = MMU2_NO_TOOL; 34174: 83 e6 ldi r24, 0x63 ; 99 34176: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 3417a: 83 e0 ldi r24, 0x03 ; 3 3417c: 0f 94 34 64 call 0x2c868 ; 0x2c868 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34180: 0f 94 00 88 call 0x31000 ; 0x31000 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 34184: 0f 94 03 c2 call 0x38406 ; 0x38406 return true; } 34188: 81 2f mov r24, r17 3418a: 0f 90 pop r0 3418c: 0f 90 pop r0 3418e: 0f 90 pop r0 34190: 0f 90 pop r0 34192: 0f 90 pop r0 34194: df 91 pop r29 34196: cf 91 pop r28 34198: 1f 91 pop r17 3419a: 0f 91 pop r16 3419c: ff 90 pop r15 3419e: 08 95 ret 000341a0 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 341a0: 1f 93 push r17 341a2: cf 93 push r28 341a4: df 93 push r29 341a6: 00 d0 rcall .+0 ; 0x341a8 341a8: 1f 92 push r1 341aa: 1f 92 push r1 341ac: cd b7 in r28, 0x3d ; 61 341ae: de b7 in r29, 0x3e ; 62 341b0: 18 2f mov r17, r24 for (;;) { Disable_E0(); 341b2: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 341b6: 41 2f mov r20, r17 341b8: 6b e4 ldi r22, 0x4B ; 75 341ba: ce 01 movw r24, r28 341bc: 01 96 adiw r24, 0x01 ; 1 341be: 0f 94 c1 c2 call 0x38582 ; 0x38582 341c2: 49 81 ldd r20, Y+1 ; 0x01 341c4: 5a 81 ldd r21, Y+2 ; 0x02 341c6: 6b 81 ldd r22, Y+3 ; 0x03 341c8: 7c 81 ldd r23, Y+4 ; 0x04 341ca: 8d 81 ldd r24, Y+5 ; 0x05 341cc: 0f 94 33 98 call 0x33066 ; 0x33066 logic.CutFilament(slot); if (manage_response(false, true)) { 341d0: 61 e0 ldi r22, 0x01 ; 1 341d2: 80 e0 ldi r24, 0x00 ; 0 341d4: 0f 94 57 9f call 0x33eae ; 0x33eae 341d8: 81 11 cpse r24, r1 341da: 03 c0 rjmp .+6 ; 0x341e2 break; } IncrementMMUFails(); 341dc: 0f 94 25 c2 call 0x3844a ; 0x3844a 341e0: e8 cf rjmp .-48 ; 0x341b2 } } 341e2: 0f 90 pop r0 341e4: 0f 90 pop r0 341e6: 0f 90 pop r0 341e8: 0f 90 pop r0 341ea: 0f 90 pop r0 341ec: df 91 pop r29 341ee: cf 91 pop r28 341f0: 1f 91 pop r17 341f2: 08 95 ret 000341f4 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 341f4: cf 93 push r28 341f6: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 341f8: 80 e9 ldi r24, 0x90 ; 144 341fa: 9c e5 ldi r25, 0x5C ; 92 341fc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 34200: 6c 2f mov r22, r28 34202: 0f 94 06 c2 call 0x3840c ; 0x3840c if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 34206: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 3420a: 81 11 cpse r24, r1 unload(); 3420c: 0f 94 22 a0 call 0x34044 ; 0x34044 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 34210: 0f 94 7f 87 call 0x30efe ; 0x30efe if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 34214: 8c 2f mov r24, r28 34216: 0f 94 d0 a0 call 0x341a0 ; 0x341a0 SetCurrentTool(MMU2_NO_TOOL); 3421a: 83 e6 ldi r24, 0x63 ; 99 3421c: 0f 94 8a 87 call 0x30f14 ; 0x30f14 tool_change_extruder = MMU2_NO_TOOL; 34220: 83 e6 ldi r24, 0x63 ; 99 34222: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 34226: 83 e0 ldi r24, 0x03 ; 3 34228: 0f 94 34 64 call 0x2c868 ; 0x2c868 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 3422c: 0f 94 00 88 call 0x31000 ; 0x31000 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 34230: 0f 94 03 c2 call 0x38406 ; 0x38406 return true; } 34234: 81 e0 ldi r24, 0x01 ; 1 34236: cf 91 pop r28 34238: 08 95 ret 0003423a : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 3423a: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 3423e: 95 ff sbrs r25, 5 34240: fc cf rjmp .-8 ; 0x3423a UDR0 = ch; 34242: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 34246: 08 95 ret 00034248 : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 34248: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 3424c: 87 ff sbrs r24, 7 3424e: fc cf rjmp .-8 ; 0x34248 if (!(UCSR0A & _BV(FE0))) { 34250: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 34254: 84 fd sbrc r24, 4 34256: 01 c0 rjmp .+2 ; 0x3425a * 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(); 34258: a8 95 wdr } ch = UDR0; 3425a: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 3425e: 08 95 ret 00034260 : /// 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; 34260: 86 27 eor r24, r22 34262: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 34264: 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) { 34266: 38 2f mov r19, r24 34268: 88 0f add r24, r24 3426a: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 3426c: 82 27 eor r24, r18 3426e: 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++) { 34270: d1 f7 brne .-12 ; 0x34266 } else { data <<= 1U; } } return data; } 34272: 08 95 ret 00034274 : // 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) { 34274: 2f 92 push r2 34276: 3f 92 push r3 34278: 4f 92 push r4 3427a: 5f 92 push r5 3427c: 6f 92 push r6 3427e: 7f 92 push r7 34280: 8f 92 push r8 34282: 9f 92 push r9 34284: af 92 push r10 34286: bf 92 push r11 34288: cf 92 push r12 3428a: df 92 push r13 3428c: ef 92 push r14 3428e: ff 92 push r15 34290: 0f 93 push r16 34292: 1f 93 push r17 34294: cf 93 push r28 34296: df 93 push r29 34298: cd b7 in r28, 0x3d ; 61 3429a: de b7 in r29, 0x3e ; 62 3429c: a1 97 sbiw r28, 0x21 ; 33 3429e: 0f b6 in r0, 0x3f ; 63 342a0: f8 94 cli 342a2: de bf out 0x3e, r29 ; 62 342a4: 0f be out 0x3f, r0 ; 63 342a6: cd bf out 0x3d, r28 ; 61 342a8: 1c 01 movw r2, r24 342aa: 48 01 movw r8, r16 342ac: 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) 342ae: fc 01 movw r30, r24 342b0: e8 5b subi r30, 0xB8 ; 184 342b2: ff 4f sbci r31, 0xFF ; 255 342b4: c0 80 ld r12, Z 342b6: d1 80 ldd r13, Z+1 ; 0x01 342b8: e2 80 ldd r14, Z+2 ; 0x02 342ba: f3 80 ldd r15, Z+3 ; 0x03 342bc: 9a 01 movw r18, r20 342be: ab 01 movw r20, r22 342c0: c7 01 movw r24, r14 342c2: b6 01 movw r22, r12 342c4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 342c8: 0f 94 4c df call 0x3be98 ; 0x3be98 342cc: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 342d0: 8b 01 movw r16, r22 342d2: 8d 83 std Y+5, r24 ; 0x05 342d4: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 342d6: a5 01 movw r20, r10 342d8: 94 01 movw r18, r8 342da: c7 01 movw r24, r14 342dc: b6 01 movw r22, r12 342de: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 342e2: 0f 94 4c df call 0x3be98 ; 0x3be98 342e6: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 342ea: 36 2f mov r19, r22 342ec: 27 2f mov r18, r23 342ee: a8 01 movw r20, r16 342f0: 6d 81 ldd r22, Y+5 ; 0x05 342f2: 79 81 ldd r23, Y+1 ; 0x01 342f4: 48 37 cpi r20, 0x78 ; 120 342f6: 51 05 cpc r21, r1 342f8: 61 05 cpc r22, r1 342fa: 71 05 cpc r23, r1 342fc: 20 f4 brcc .+8 ; 0x34306 342fe: 48 e7 ldi r20, 0x78 ; 120 34300: 50 e0 ldi r21, 0x00 ; 0 34302: 60 e0 ldi r22, 0x00 ; 0 34304: 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) 34306: d1 01 movw r26, r2 34308: d6 96 adiw r26, 0x36 ; 54 3430a: 8d 90 ld r8, X+ 3430c: 9d 90 ld r9, X+ 3430e: ad 90 ld r10, X+ 34310: bc 90 ld r11, X 34312: d9 97 sbiw r26, 0x39 ; 57 34314: 8f 8a std Y+23, r8 ; 0x17 34316: 98 8e std Y+24, r9 ; 0x18 34318: a9 8e std Y+25, r10 ; 0x19 3431a: ba 8e std Y+26, r11 ; 0x1a 3431c: 48 15 cp r20, r8 3431e: 59 05 cpc r21, r9 34320: 6a 05 cpc r22, r10 34322: 7b 05 cpc r23, r11 34324: 20 f4 brcc .+8 ; 0x3432e 34326: 4f 8b std Y+23, r20 ; 0x17 34328: 58 8f std Y+24, r21 ; 0x18 3432a: 69 8f std Y+25, r22 ; 0x19 3432c: 7a 8f std Y+26, r23 ; 0x1a 3432e: 43 2f mov r20, r19 34330: 52 2f mov r21, r18 34332: bc 01 movw r22, r24 34334: 48 37 cpi r20, 0x78 ; 120 34336: 51 05 cpc r21, r1 34338: 61 05 cpc r22, r1 3433a: 71 05 cpc r23, r1 3433c: 20 f4 brcc .+8 ; 0x34346 3433e: 48 e7 ldi r20, 0x78 ; 120 34340: 50 e0 ldi r21, 0x00 ; 0 34342: 60 e0 ldi r22, 0x00 ; 0 34344: 70 e0 ldi r23, 0x00 ; 0 34346: 18 2d mov r17, r8 34348: 09 2d mov r16, r9 3434a: a9 a2 std Y+33, r10 ; 0x21 3434c: b8 a2 std Y+32, r11 ; 0x20 3434e: 48 15 cp r20, r8 34350: 59 05 cpc r21, r9 34352: 6a 05 cpc r22, r10 34354: 7b 05 cpc r23, r11 34356: 20 f4 brcc .+8 ; 0x34360 34358: 14 2f mov r17, r20 3435a: 05 2f mov r16, r21 3435c: 69 a3 std Y+33, r22 ; 0x21 3435e: 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; 34360: f1 01 movw r30, r2 34362: ee 5b subi r30, 0xBE ; 190 34364: ff 4f sbci r31, 0xFF ; 255 34366: c0 80 ld r12, Z 34368: d1 80 ldd r13, Z+1 ; 0x01 3436a: e2 80 ldd r14, Z+2 ; 0x02 3436c: f3 80 ldd r15, Z+3 ; 0x03 3436e: cd 82 std Y+5, r12 ; 0x05 34370: de 82 std Y+6, r13 ; 0x06 34372: ef 82 std Y+7, r14 ; 0x07 34374: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 34376: cd 28 or r12, r13 34378: ce 28 or r12, r14 3437a: cf 28 or r12, r15 3437c: 41 f4 brne .+16 ; 0x3438e // Don't allow zero acceleration. acceleration = 1; 3437e: c1 2c mov r12, r1 34380: d1 2c mov r13, r1 34382: 76 01 movw r14, r12 34384: c3 94 inc r12 34386: cd 82 std Y+5, r12 ; 0x05 34388: de 82 std Y+6, r13 ; 0x06 3438a: ef 82 std Y+7, r14 ; 0x07 3438c: 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; 3438e: 2f 89 ldd r18, Y+23 ; 0x17 34390: 38 8d ldd r19, Y+24 ; 0x18 34392: 49 8d ldd r20, Y+25 ; 0x19 34394: 5a 8d ldd r21, Y+26 ; 0x1a 34396: b9 01 movw r22, r18 34398: ca 01 movw r24, r20 3439a: 0f 94 a9 dd call 0x3bb52 ; 0x3bb52 <__mulsi3> 3439e: 6d 87 std Y+13, r22 ; 0x0d 343a0: 7e 87 std Y+14, r23 ; 0x0e 343a2: 8f 87 std Y+15, r24 ; 0x0f 343a4: 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; 343a6: a5 01 movw r20, r10 343a8: 94 01 movw r18, r8 343aa: c5 01 movw r24, r10 343ac: b4 01 movw r22, r8 343ae: 0f 94 a9 dd call 0x3bb52 ; 0x3bb52 <__mulsi3> 343b2: 2b 01 movw r4, r22 343b4: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 343b6: 21 2f mov r18, r17 343b8: 30 2f mov r19, r16 343ba: 49 a1 ldd r20, Y+33 ; 0x21 343bc: 58 a1 ldd r21, Y+32 ; 0x20 343be: 61 2f mov r22, r17 343c0: 70 2f mov r23, r16 343c2: ca 01 movw r24, r20 343c4: 0f 94 a9 dd call 0x3bb52 ; 0x3bb52 <__mulsi3> 343c8: 69 8b std Y+17, r22 ; 0x11 343ca: 7a 8b std Y+18, r23 ; 0x12 343cc: 8b 8b std Y+19, r24 ; 0x13 343ce: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 343d0: cd 80 ldd r12, Y+5 ; 0x05 343d2: de 80 ldd r13, Y+6 ; 0x06 343d4: ef 80 ldd r14, Y+7 ; 0x07 343d6: f8 84 ldd r15, Y+8 ; 0x08 343d8: cc 0c add r12, r12 343da: dd 1c adc r13, r13 343dc: ee 1c adc r14, r14 343de: ff 1c adc r15, r15 343e0: c9 86 std Y+9, r12 ; 0x09 343e2: da 86 std Y+10, r13 ; 0x0a 343e4: eb 86 std Y+11, r14 ; 0x0b 343e6: 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; 343e8: c3 01 movw r24, r6 343ea: b2 01 movw r22, r4 343ec: 61 50 subi r22, 0x01 ; 1 343ee: 71 09 sbc r23, r1 343f0: 81 09 sbc r24, r1 343f2: 91 09 sbc r25, r1 343f4: cd 84 ldd r12, Y+13 ; 0x0d 343f6: de 84 ldd r13, Y+14 ; 0x0e 343f8: ef 84 ldd r14, Y+15 ; 0x0f 343fa: f8 88 ldd r15, Y+16 ; 0x10 343fc: 6c 19 sub r22, r12 343fe: 7d 09 sbc r23, r13 34400: 8e 09 sbc r24, r14 34402: 9f 09 sbc r25, r15 34404: c9 84 ldd r12, Y+9 ; 0x09 34406: da 84 ldd r13, Y+10 ; 0x0a 34408: eb 84 ldd r14, Y+11 ; 0x0b 3440a: fc 84 ldd r15, Y+12 ; 0x0c 3440c: 6c 0d add r22, r12 3440e: 7d 1d adc r23, r13 34410: 8e 1d adc r24, r14 34412: 9f 1d adc r25, r15 34414: a7 01 movw r20, r14 34416: 96 01 movw r18, r12 34418: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 3441c: 69 01 movw r12, r18 3441e: 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; 34420: c3 01 movw r24, r6 34422: b2 01 movw r22, r4 34424: 29 89 ldd r18, Y+17 ; 0x11 34426: 3a 89 ldd r19, Y+18 ; 0x12 34428: 4b 89 ldd r20, Y+19 ; 0x13 3442a: 5c 89 ldd r21, Y+20 ; 0x14 3442c: 62 1b sub r22, r18 3442e: 73 0b sbc r23, r19 34430: 84 0b sbc r24, r20 34432: 95 0b sbc r25, r21 34434: 29 85 ldd r18, Y+9 ; 0x09 34436: 3a 85 ldd r19, Y+10 ; 0x0a 34438: 4b 85 ldd r20, Y+11 ; 0x0b 3443a: 5c 85 ldd r21, Y+12 ; 0x0c 3443c: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 34440: 29 01 movw r4, r18 34442: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 34444: d7 01 movw r26, r14 34446: c6 01 movw r24, r12 34448: 84 0d add r24, r4 3444a: 95 1d adc r25, r5 3444c: a6 1d adc r26, r6 3444e: b7 1d adc r27, r7 34450: 8c 8f std Y+28, r24 ; 0x1c 34452: 9d 8f std Y+29, r25 ; 0x1d 34454: ae 8f std Y+30, r26 ; 0x1e 34456: 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) { 34458: f1 01 movw r30, r2 3445a: e4 5b subi r30, 0xB4 ; 180 3445c: ff 4f sbci r31, 0xFF ; 255 3445e: 90 81 ld r25, Z 34460: 9b 8f std Y+27, r25 ; 0x1b 34462: 99 23 and r25, r25 34464: 09 f4 brne .+2 ; 0x34468 34466: 8d c0 rjmp .+282 ; 0x34582 final_adv_steps = final_rate * block->adv_comp; 34468: 61 2f mov r22, r17 3446a: 70 2f mov r23, r16 3446c: 89 a1 ldd r24, Y+33 ; 0x21 3446e: 98 a1 ldd r25, Y+32 ; 0x20 34470: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 34474: f1 01 movw r30, r2 34476: ec 5a subi r30, 0xAC ; 172 34478: ff 4f sbci r31, 0xFF ; 255 3447a: 20 81 ld r18, Z 3447c: 31 81 ldd r19, Z+1 ; 0x01 3447e: 42 81 ldd r20, Z+2 ; 0x02 34480: 53 81 ldd r21, Z+3 ; 0x03 34482: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 34486: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 3448a: 6d 8b std Y+21, r22 ; 0x15 3448c: 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) { 3448e: d1 01 movw r26, r2 34490: 50 96 adiw r26, 0x10 ; 16 34492: 2d 91 ld r18, X+ 34494: 3d 91 ld r19, X+ 34496: 4d 91 ld r20, X+ 34498: 5c 91 ld r21, X 3449a: 53 97 sbiw r26, 0x13 ; 19 3449c: 29 83 std Y+1, r18 ; 0x01 3449e: 3a 83 std Y+2, r19 ; 0x02 344a0: 4b 83 std Y+3, r20 ; 0x03 344a2: 5c 83 std Y+4, r21 ; 0x04 344a4: 8c 8d ldd r24, Y+28 ; 0x1c 344a6: 9d 8d ldd r25, Y+29 ; 0x1d 344a8: ae 8d ldd r26, Y+30 ; 0x1e 344aa: bf 8d ldd r27, Y+31 ; 0x1f 344ac: 82 17 cp r24, r18 344ae: 93 07 cpc r25, r19 344b0: a4 07 cpc r26, r20 344b2: b5 07 cpc r27, r21 344b4: 08 f0 brcs .+2 ; 0x344b8 344b6: 68 c0 rjmp .+208 ; 0x34588 plateau_steps = block->step_event_count.wide - accel_decel_steps; 344b8: 29 01 movw r4, r18 344ba: 3a 01 movw r6, r20 344bc: 48 1a sub r4, r24 344be: 59 0a sbc r5, r25 344c0: 6a 0a sbc r6, r26 344c2: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 344c4: 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; 344c6: 40 e0 ldi r20, 0x00 ; 0 344c8: 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) 344ca: 99 23 and r25, r25 344cc: 89 f0 breq .+34 ; 0x344f0 max_adv_steps = block->nominal_rate * block->adv_comp; 344ce: c5 01 movw r24, r10 344d0: b4 01 movw r22, r8 344d2: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 344d6: f1 01 movw r30, r2 344d8: ec 5a subi r30, 0xAC ; 172 344da: ff 4f sbci r31, 0xFF ; 255 344dc: 20 81 ld r18, Z 344de: 31 81 ldd r19, Z+1 ; 0x01 344e0: 42 81 ldd r20, Z+2 ; 0x02 344e2: 53 81 ldd r21, Z+3 ; 0x03 344e4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 344e8: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 344ec: 46 2f mov r20, r22 344ee: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 344f0: 3f b7 in r19, 0x3f ; 63 344f2: 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. 344f4: f1 01 movw r30, r2 344f6: e9 5b subi r30, 0xB9 ; 185 344f8: ff 4f sbci r31, 0xFF ; 255 344fa: 20 81 ld r18, Z 344fc: 21 11 cpse r18, r1 344fe: 27 c0 rjmp .+78 ; 0x3454e block->accelerate_until = accelerate_steps; 34500: d1 01 movw r26, r2 34502: 59 96 adiw r26, 0x19 ; 25 34504: cd 92 st X+, r12 34506: dd 92 st X+, r13 34508: ed 92 st X+, r14 3450a: fc 92 st X, r15 3450c: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 3450e: c4 0c add r12, r4 34510: d5 1c adc r13, r5 34512: e6 1c adc r14, r6 34514: f7 1c adc r15, r7 34516: f1 01 movw r30, r2 34518: c5 8e std Z+29, r12 ; 0x1d 3451a: d6 8e std Z+30, r13 ; 0x1e 3451c: e7 8e std Z+31, r14 ; 0x1f 3451e: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 34520: cf 88 ldd r12, Y+23 ; 0x17 34522: c2 ae std Z+58, r12 ; 0x3a 34524: d8 8c ldd r13, Y+24 ; 0x18 34526: d3 ae std Z+59, r13 ; 0x3b 34528: e9 8c ldd r14, Y+25 ; 0x19 3452a: e4 ae std Z+60, r14 ; 0x3c 3452c: fa 8c ldd r15, Y+26 ; 0x1a 3452e: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 34530: fe 96 adiw r30, 0x3e ; 62 34532: 10 83 st Z, r17 34534: 01 83 std Z+1, r16 ; 0x01 34536: c9 a0 ldd r12, Y+33 ; 0x21 34538: c2 82 std Z+2, r12 ; 0x02 3453a: d8 a0 ldd r13, Y+32 ; 0x20 3453c: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 3453e: 73 96 adiw r30, 0x13 ; 19 34540: ed 88 ldd r14, Y+21 ; 0x15 34542: e0 82 st Z, r14 34544: fe 88 ldd r15, Y+22 ; 0x16 34546: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 34548: 32 97 sbiw r30, 0x02 ; 2 3454a: 40 83 st Z, r20 3454c: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 3454e: 3f bf out 0x3f, r19 ; 63 } 34550: a1 96 adiw r28, 0x21 ; 33 34552: 0f b6 in r0, 0x3f ; 63 34554: f8 94 cli 34556: de bf out 0x3e, r29 ; 62 34558: 0f be out 0x3f, r0 ; 63 3455a: cd bf out 0x3d, r28 ; 61 3455c: df 91 pop r29 3455e: cf 91 pop r28 34560: 1f 91 pop r17 34562: 0f 91 pop r16 34564: ff 90 pop r15 34566: ef 90 pop r14 34568: df 90 pop r13 3456a: cf 90 pop r12 3456c: bf 90 pop r11 3456e: af 90 pop r10 34570: 9f 90 pop r9 34572: 8f 90 pop r8 34574: 7f 90 pop r7 34576: 6f 90 pop r6 34578: 5f 90 pop r5 3457a: 4f 90 pop r4 3457c: 3f 90 pop r3 3457e: 2f 90 pop r2 34580: 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; 34582: 1d 8a std Y+21, r1 ; 0x15 34584: 1e 8a std Y+22, r1 ; 0x16 34586: 83 cf rjmp .-250 ; 0x3448e #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; 34588: 2d 81 ldd r18, Y+5 ; 0x05 3458a: 3e 81 ldd r19, Y+6 ; 0x06 3458c: 4f 81 ldd r20, Y+7 ; 0x07 3458e: 58 85 ldd r21, Y+8 ; 0x08 34590: 82 e0 ldi r24, 0x02 ; 2 34592: 22 0f add r18, r18 34594: 33 1f adc r19, r19 34596: 44 1f adc r20, r20 34598: 55 1f adc r21, r21 3459a: 8a 95 dec r24 3459c: d1 f7 brne .-12 ; 0x34592 3459e: 89 81 ldd r24, Y+1 ; 0x01 345a0: 9a 81 ldd r25, Y+2 ; 0x02 345a2: ab 81 ldd r26, Y+3 ; 0x03 345a4: bc 81 ldd r27, Y+4 ; 0x04 345a6: 81 70 andi r24, 0x01 ; 1 345a8: 99 27 eor r25, r25 345aa: aa 27 eor r26, r26 345ac: bb 27 eor r27, r27 345ae: 8d 83 std Y+5, r24 ; 0x05 345b0: 9e 83 std Y+6, r25 ; 0x06 345b2: af 83 std Y+7, r26 ; 0x07 345b4: b8 87 std Y+8, r27 ; 0x08 345b6: 89 80 ldd r8, Y+1 ; 0x01 345b8: 9a 80 ldd r9, Y+2 ; 0x02 345ba: ab 80 ldd r10, Y+3 ; 0x03 345bc: bc 80 ldd r11, Y+4 ; 0x04 345be: b6 94 lsr r11 345c0: a7 94 ror r10 345c2: 97 94 ror r9 345c4: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 345c6: cd 84 ldd r12, Y+13 ; 0x0d 345c8: de 84 ldd r13, Y+14 ; 0x0e 345ca: ef 84 ldd r14, Y+15 ; 0x0f 345cc: f8 88 ldd r15, Y+16 ; 0x10 345ce: 89 89 ldd r24, Y+17 ; 0x11 345d0: 9a 89 ldd r25, Y+18 ; 0x12 345d2: ab 89 ldd r26, Y+19 ; 0x13 345d4: bc 89 ldd r27, Y+20 ; 0x14 345d6: 8c 15 cp r24, r12 345d8: 9d 05 cpc r25, r13 345da: ae 05 cpc r26, r14 345dc: bf 05 cpc r27, r15 345de: 08 f4 brcc .+2 ; 0x345e2 345e0: 6f c0 rjmp .+222 ; 0x346c0 // 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; 345e2: 6c 01 movw r12, r24 345e4: 7d 01 movw r14, r26 345e6: 91 e0 ldi r25, 0x01 ; 1 345e8: c9 1a sub r12, r25 345ea: d1 08 sbc r13, r1 345ec: e1 08 sbc r14, r1 345ee: f1 08 sbc r15, r1 345f0: 8d 85 ldd r24, Y+13 ; 0x0d 345f2: 9e 85 ldd r25, Y+14 ; 0x0e 345f4: af 85 ldd r26, Y+15 ; 0x0f 345f6: b8 89 ldd r27, Y+16 ; 0x10 345f8: c8 1a sub r12, r24 345fa: d9 0a sbc r13, r25 345fc: ea 0a sbc r14, r26 345fe: fb 0a sbc r15, r27 34600: c7 01 movw r24, r14 34602: b6 01 movw r22, r12 34604: 62 0f add r22, r18 34606: 73 1f adc r23, r19 34608: 84 1f adc r24, r20 3460a: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 3460c: cd 80 ldd r12, Y+5 ; 0x05 3460e: de 80 ldd r13, Y+6 ; 0x06 34610: ef 80 ldd r14, Y+7 ; 0x07 34612: f8 84 ldd r15, Y+8 ; 0x08 34614: cd 28 or r12, r13 34616: ce 28 or r12, r14 34618: cf 28 or r12, r15 3461a: 41 f0 breq .+16 ; 0x3462c accelerate_steps += acceleration_x2; 3461c: c9 84 ldd r12, Y+9 ; 0x09 3461e: da 84 ldd r13, Y+10 ; 0x0a 34620: eb 84 ldd r14, Y+11 ; 0x0b 34622: fc 84 ldd r15, Y+12 ; 0x0c 34624: 6c 0d add r22, r12 34626: 7d 1d adc r23, r13 34628: 8e 1d adc r24, r14 3462a: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 3462c: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 34630: 75 01 movw r14, r10 34632: 64 01 movw r12, r8 34634: c2 0e add r12, r18 34636: d3 1e adc r13, r19 34638: e4 1e adc r14, r20 3463a: f5 1e adc r15, r21 3463c: 29 81 ldd r18, Y+1 ; 0x01 3463e: 3a 81 ldd r19, Y+2 ; 0x02 34640: 4b 81 ldd r20, Y+3 ; 0x03 34642: 5c 81 ldd r21, Y+4 ; 0x04 34644: 2c 15 cp r18, r12 34646: 3d 05 cpc r19, r13 34648: 4e 05 cpc r20, r14 3464a: 5f 05 cpc r21, r15 3464c: 10 f4 brcc .+4 ; 0x34652 3464e: 69 01 movw r12, r18 34650: 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) { 34652: 2b 8d ldd r18, Y+27 ; 0x1b 34654: 22 23 and r18, r18 34656: 09 f4 brne .+2 ; 0x3465a 34658: 69 c0 rjmp .+210 ; 0x3472c if(!accelerate_steps || !decelerate_steps) { 3465a: c1 14 cp r12, r1 3465c: d1 04 cpc r13, r1 3465e: e1 04 cpc r14, r1 34660: f1 04 cpc r15, r1 34662: 09 f4 brne .+2 ; 0x34666 34664: 66 c0 rjmp .+204 ; 0x34732 // 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; 34666: 4d 89 ldd r20, Y+21 ; 0x15 34668: 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) { 3466a: 41 14 cp r4, r1 3466c: 51 04 cpc r5, r1 3466e: 61 04 cpc r6, r1 34670: 71 04 cpc r7, r1 34672: 09 f4 brne .+2 ; 0x34676 34674: 3d cf rjmp .-390 ; 0x344f0 // 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); 34676: a7 01 movw r20, r14 34678: 96 01 movw r18, r12 3467a: 69 85 ldd r22, Y+9 ; 0x09 3467c: 7a 85 ldd r23, Y+10 ; 0x0a 3467e: 8b 85 ldd r24, Y+11 ; 0x0b 34680: 9c 85 ldd r25, Y+12 ; 0x0c 34682: 0f 94 a9 dd call 0x3bb52 ; 0x3bb52 <__mulsi3> 34686: 2d 85 ldd r18, Y+13 ; 0x0d 34688: 3e 85 ldd r19, Y+14 ; 0x0e 3468a: 4f 85 ldd r20, Y+15 ; 0x0f 3468c: 58 89 ldd r21, Y+16 ; 0x10 3468e: 62 0f add r22, r18 34690: 73 1f adc r23, r19 34692: 84 1f adc r24, r20 34694: 95 1f adc r25, r21 34696: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 3469a: 0f 94 3c e2 call 0x3c478 ; 0x3c478 max_adv_steps = max_rate * block->adv_comp; 3469e: f1 01 movw r30, r2 346a0: ec 5a subi r30, 0xAC ; 172 346a2: ff 4f sbci r31, 0xFF ; 255 346a4: 20 81 ld r18, Z 346a6: 31 81 ldd r19, Z+1 ; 0x01 346a8: 42 81 ldd r20, Z+2 ; 0x02 346aa: 53 81 ldd r21, Z+3 ; 0x03 346ac: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 346b0: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 346b4: 46 2f mov r20, r22 346b6: 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; 346b8: 41 2c mov r4, r1 346ba: 51 2c mov r5, r1 346bc: 32 01 movw r6, r4 346be: 18 cf rjmp .-464 ; 0x344f0 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; 346c0: 6d 85 ldd r22, Y+13 ; 0x0d 346c2: 7e 85 ldd r23, Y+14 ; 0x0e 346c4: 8f 85 ldd r24, Y+15 ; 0x0f 346c6: 98 89 ldd r25, Y+16 ; 0x10 346c8: c9 88 ldd r12, Y+17 ; 0x11 346ca: da 88 ldd r13, Y+18 ; 0x12 346cc: eb 88 ldd r14, Y+19 ; 0x13 346ce: fc 88 ldd r15, Y+20 ; 0x14 346d0: 6c 19 sub r22, r12 346d2: 7d 09 sbc r23, r13 346d4: 8e 09 sbc r24, r14 346d6: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 346d8: cd 80 ldd r12, Y+5 ; 0x05 346da: de 80 ldd r13, Y+6 ; 0x06 346dc: ef 80 ldd r14, Y+7 ; 0x07 346de: f8 84 ldd r15, Y+8 ; 0x08 346e0: cd 28 or r12, r13 346e2: ce 28 or r12, r14 346e4: cf 28 or r12, r15 346e6: 41 f0 breq .+16 ; 0x346f8 decelerate_steps += acceleration_x2; 346e8: c9 84 ldd r12, Y+9 ; 0x09 346ea: da 84 ldd r13, Y+10 ; 0x0a 346ec: eb 84 ldd r14, Y+11 ; 0x0b 346ee: fc 84 ldd r15, Y+12 ; 0x0c 346f0: 6c 0d add r22, r12 346f2: 7d 1d adc r23, r13 346f4: 8e 1d adc r24, r14 346f6: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 346f8: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 346fc: 82 0e add r8, r18 346fe: 93 1e adc r9, r19 34700: a4 1e adc r10, r20 34702: b5 1e adc r11, r21 34704: 49 80 ldd r4, Y+1 ; 0x01 34706: 5a 80 ldd r5, Y+2 ; 0x02 34708: 6b 80 ldd r6, Y+3 ; 0x03 3470a: 7c 80 ldd r7, Y+4 ; 0x04 3470c: 84 14 cp r8, r4 3470e: 95 04 cpc r9, r5 34710: a6 04 cpc r10, r6 34712: b7 04 cpc r11, r7 34714: 10 f4 brcc .+4 ; 0x3471a 34716: 24 01 movw r4, r8 34718: 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; 3471a: c9 80 ldd r12, Y+1 ; 0x01 3471c: da 80 ldd r13, Y+2 ; 0x02 3471e: eb 80 ldd r14, Y+3 ; 0x03 34720: fc 80 ldd r15, Y+4 ; 0x04 34722: c4 18 sub r12, r4 34724: d5 08 sbc r13, r5 34726: e6 08 sbc r14, r6 34728: f7 08 sbc r15, r7 3472a: 93 cf rjmp .-218 ; 0x34652 // 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; 3472c: 40 e0 ldi r20, 0x00 ; 0 3472e: 80 e0 ldi r24, 0x00 ; 0 34730: c3 cf rjmp .-122 ; 0x346b8 #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; 34732: 4d 89 ldd r20, Y+21 ; 0x15 34734: 8e 89 ldd r24, Y+22 ; 0x16 34736: c0 cf rjmp .-128 ; 0x346b8 00034738 : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 34738: 0f 94 24 a1 call 0x34248 ; 0x34248 3473c: 80 32 cpi r24, 0x20 ; 32 3473e: 29 f0 breq .+10 ; 0x3474a putch(STK_FAILED); 34740: 81 e1 ldi r24, 0x11 ; 17 34742: 0f 94 1d a1 call 0x3423a ; 0x3423a softReset(); 34746: 0e 94 12 68 call 0xd024 ; 0xd024 } putch(STK_INSYNC); 3474a: 84 e1 ldi r24, 0x14 ; 20 3474c: 0d 94 1d a1 jmp 0x3423a ; 0x3423a 00034750 : } static void getNch(uint8_t count) { 34750: cf 93 push r28 34752: c8 2f mov r28, r24 do getch(); while (--count); 34754: 0f 94 24 a1 call 0x34248 ; 0x34248 34758: c1 50 subi r28, 0x01 ; 1 3475a: e1 f7 brne .-8 ; 0x34754 verifySpace(); } 3475c: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 3475e: 0d 94 9c a3 jmp 0x34738 ; 0x34738 00034762 : /// @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) { 34762: 0f 93 push r16 34764: 1f 93 push r17 34766: cf 93 push r28 34768: df 93 push r29 3476a: eb 01 movw r28, r22 3476c: 14 2f mov r17, r20 3476e: 05 2f mov r16, r21 lcd_putc(chr); 34770: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_puts_P(str); 34774: ce 01 movw r24, r28 34776: 0e 94 91 6f call 0xdf22 ; 0xdf22 lcd_putc(':'); 3477a: 8a e3 ldi r24, 0x3A ; 58 3477c: 0e 94 95 6f call 0xdf2a ; 0xdf2a 34780: ce 01 movw r24, r28 34782: 0f 94 04 db call 0x3b608 ; 0x3b608 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 34786: 9e e0 ldi r25, 0x0E ; 14 34788: 98 1b sub r25, r24 3478a: 89 2f mov r24, r25 3478c: 0e 94 9c 6f call 0xdf38 ; 0xdf38 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 34790: 0f 93 push r16 34792: 1f 93 push r17 34794: 81 e3 ldi r24, 0x31 ; 49 34796: 9a ea ldi r25, 0xAA ; 170 34798: 9f 93 push r25 3479a: 8f 93 push r24 3479c: 0e 94 7f 6f call 0xdefe ; 0xdefe 347a0: 0f 90 pop r0 347a2: 0f 90 pop r0 347a4: 0f 90 pop r0 347a6: 0f 90 pop r0 } 347a8: df 91 pop r29 347aa: cf 91 pop r28 347ac: 1f 91 pop r17 347ae: 0f 91 pop r16 347b0: 08 95 ret 000347b2 : * \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) { 347b2: 0f 93 push r16 347b4: 1f 93 push r17 347b6: cf 93 push r28 347b8: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 347ba: fc 01 movw r30, r24 347bc: 23 81 ldd r18, Z+3 ; 0x03 347be: 22 23 and r18, r18 347c0: 31 f0 breq .+12 ; 0x347ce dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 347c2: 80 e0 ldi r24, 0x00 ; 0 } 347c4: df 91 pop r29 347c6: cf 91 pop r28 347c8: 1f 91 pop r17 347ca: 0f 91 pop r16 347cc: 08 95 ret 347ce: 8b 01 movw r16, r22 347d0: ec 01 movw r28, r24 347d2: fb 01 movw r30, r22 347d4: 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)) { 347d6: 80 31 cpi r24, 0x10 ; 16 347d8: 39 f5 brne .+78 ; 0x34828 type_ = FAT_FILE_TYPE_ROOT_FIXED; 347da: 82 e0 ldi r24, 0x02 ; 2 347dc: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 347de: 1d 8a std Y+21, r1 ; 0x15 347e0: 1e 8a std Y+22, r1 ; 0x16 347e2: 1f 8a std Y+23, r1 ; 0x17 347e4: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 347e6: 80 8d ldd r24, Z+24 ; 0x18 347e8: 91 8d ldd r25, Z+25 ; 0x19 347ea: b0 e0 ldi r27, 0x00 ; 0 347ec: a0 e0 ldi r26, 0x00 ; 0 347ee: 25 e0 ldi r18, 0x05 ; 5 347f0: 88 0f add r24, r24 347f2: 99 1f adc r25, r25 347f4: aa 1f adc r26, r26 347f6: bb 1f adc r27, r27 347f8: 2a 95 dec r18 347fa: d1 f7 brne .-12 ; 0x347f0 347fc: 89 8b std Y+17, r24 ; 0x11 347fe: 9a 8b std Y+18, r25 ; 0x12 34800: ab 8b std Y+19, r26 ; 0x13 34802: 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; 34804: 1a 8f std Y+26, r17 ; 0x1a 34806: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 34808: 81 e0 ldi r24, 0x01 ; 1 3480a: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 3480c: 1c 82 std Y+4, r1 ; 0x04 3480e: 1d 82 std Y+5, r1 ; 0x05 34810: 1e 82 std Y+6, r1 ; 0x06 34812: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 34814: 18 86 std Y+8, r1 ; 0x08 34816: 19 86 std Y+9, r1 ; 0x09 34818: 1a 86 std Y+10, r1 ; 0x0a 3481a: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 3481c: 1c 86 std Y+12, r1 ; 0x0c 3481e: 1d 86 std Y+13, r1 ; 0x0d 34820: 1e 86 std Y+14, r1 ; 0x0e 34822: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 34824: 18 8a std Y+16, r1 ; 0x10 34826: ce cf rjmp .-100 ; 0x347c4 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) { 34828: 80 32 cpi r24, 0x20 ; 32 3482a: 59 f6 brne .-106 ; 0x347c2 type_ = FAT_FILE_TYPE_ROOT32; 3482c: 83 e0 ldi r24, 0x03 ; 3 3482e: 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_;} 34830: 42 8d ldd r20, Z+26 ; 0x1a 34832: 53 8d ldd r21, Z+27 ; 0x1b 34834: 64 8d ldd r22, Z+28 ; 0x1c 34836: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 34838: 4d 8b std Y+21, r20 ; 0x15 3483a: 5e 8b std Y+22, r21 ; 0x16 3483c: 6f 8b std Y+23, r22 ; 0x17 3483e: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 34840: 9e 01 movw r18, r28 34842: 2f 5e subi r18, 0xEF ; 239 34844: 3f 4f sbci r19, 0xFF ; 255 34846: c8 01 movw r24, r16 34848: 0f 94 e6 6c call 0x2d9cc ; 0x2d9cc 3484c: 81 11 cpse r24, r1 3484e: da cf rjmp .-76 ; 0x34804 34850: b8 cf rjmp .-144 ; 0x347c2 00034852 : * * \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() { 34852: cf 93 push r28 34854: df 93 push r29 34856: ec 01 movw r28, r24 bool rtn = sync(); 34858: 0f 94 31 6e call 0x2dc62 ; 0x2dc62 type_ = FAT_FILE_TYPE_CLOSED; 3485c: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 3485e: df 91 pop r29 34860: cf 91 pop r28 34862: 08 95 ret 00034864 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 34864: cf 93 push r28 34866: df 93 push r29 34868: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 3486a: 46 2f mov r20, r22 3486c: 41 70 andi r20, 0x01 ; 1 3486e: 6c 85 ldd r22, Y+12 ; 0x0c 34870: 7d 85 ldd r23, Y+13 ; 0x0d 34872: 8e 85 ldd r24, Y+14 ; 0x0e 34874: 9f 85 ldd r25, Y+15 ; 0x0f 34876: 0f 94 94 6b call 0x2d728 ; 0x2d728 3487a: 88 23 and r24, r24 3487c: 51 f0 breq .+20 ; 0x34892 return vol_->cache()->dir + dirIndex_; 3487e: 88 89 ldd r24, Y+16 ; 0x10 34880: 20 e2 ldi r18, 0x20 ; 32 34882: 82 9f mul r24, r18 34884: c0 01 movw r24, r0 34886: 11 24 eor r1, r1 34888: 88 58 subi r24, 0x88 ; 136 3488a: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 3488c: df 91 pop r29 3488e: cf 91 pop r28 34890: 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; 34892: 90 e0 ldi r25, 0x00 ; 0 34894: 80 e0 ldi r24, 0x00 ; 0 34896: fa cf rjmp .-12 ; 0x3488c 00034898 : * \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) { 34898: cf 93 push r28 3489a: df 93 push r29 3489c: eb 01 movw r28, r22 3489e: fc 01 movw r30, r24 348a0: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 348a2: 21 11 cpse r18, r1 348a4: 04 c0 rjmp .+8 ; 0x348ae 348a6: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 348a8: df 91 pop r29 348aa: cf 91 pop r28 348ac: 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; 348ae: 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()) { 348b0: 22 30 cpi r18, 0x02 ; 2 348b2: 28 f4 brcc .+10 ; 0x348be name[0] = '/'; 348b4: 8f e2 ldi r24, 0x2F ; 47 348b6: 88 83 st Y, r24 name[1] = '\0'; 348b8: 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; 348ba: 81 e0 ldi r24, 0x01 ; 1 348bc: f5 cf rjmp .-22 ; 0x348a8 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 348be: 60 e0 ldi r22, 0x00 ; 0 348c0: 0f 94 32 a4 call 0x34864 ; 0x34864 if (!p) return false; 348c4: 00 97 sbiw r24, 0x00 ; 0 348c6: 79 f3 breq .-34 ; 0x348a6 348c8: 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; 348ca: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 348cc: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 348ce: 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; 348d0: 2d 91 ld r18, X+ 348d2: 20 32 cpi r18, 0x20 ; 32 348d4: 99 f0 breq .+38 ; 0x348fc if (i == 8) name[j++] = '.'; 348d6: 88 30 cpi r24, 0x08 ; 8 348d8: 31 f4 brne .+12 ; 0x348e6 348da: 9e 01 movw r18, r28 348dc: 26 0f add r18, r22 348de: 31 1d adc r19, r1 348e0: f9 01 movw r30, r18 348e2: 90 83 st Z, r25 348e4: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 348e6: 9e 01 movw r18, r28 348e8: 26 0f add r18, r22 348ea: 31 1d adc r19, r1 348ec: ad 01 movw r20, r26 348ee: 41 50 subi r20, 0x01 ; 1 348f0: 51 09 sbc r21, r1 348f2: fa 01 movw r30, r20 348f4: 40 81 ld r20, Z 348f6: f9 01 movw r30, r18 348f8: 40 83 st Z, r20 348fa: 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++) { 348fc: 8f 5f subi r24, 0xFF ; 255 348fe: 8b 30 cpi r24, 0x0B ; 11 34900: 39 f7 brne .-50 ; 0x348d0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 34902: fe 01 movw r30, r28 34904: e6 0f add r30, r22 34906: f1 1d adc r31, r1 34908: 10 82 st Z, r1 3490a: d7 cf rjmp .-82 ; 0x348ba 0003490c : 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() { 3490c: 3f 92 push r3 3490e: 4f 92 push r4 34910: 5f 92 push r5 34912: 6f 92 push r6 34914: 7f 92 push r7 34916: 8f 92 push r8 34918: 9f 92 push r9 3491a: af 92 push r10 3491c: bf 92 push r11 3491e: cf 92 push r12 34920: df 92 push r13 34922: ef 92 push r14 34924: ff 92 push r15 34926: 0f 93 push r16 34928: 1f 93 push r17 3492a: cf 93 push r28 3492c: df 93 push r29 3492e: cd b7 in r28, 0x3d ; 61 34930: de b7 in r29, 0x3e ; 62 34932: 2c 97 sbiw r28, 0x0c ; 12 34934: 0f b6 in r0, 0x3f ; 63 34936: f8 94 cli 34938: de bf out 0x3e, r29 ; 62 3493a: 0f be out 0x3f, r0 ; 63 3493c: cd bf out 0x3d, r28 ; 61 3493e: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 34940: dc 01 movw r26, r24 34942: 59 96 adiw r26, 0x19 ; 25 34944: 8d 90 ld r8, X+ 34946: 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; 34948: f4 01 movw r30, r8 3494a: 81 85 ldd r24, Z+9 ; 0x09 3494c: 92 85 ldd r25, Z+10 ; 0x0a 3494e: a3 85 ldd r26, Z+11 ; 0x0b 34950: b4 85 ldd r27, Z+12 ; 0x0c 34952: 9c 01 movw r18, r24 34954: ad 01 movw r20, r26 34956: 2f 5f subi r18, 0xFF ; 255 34958: 3f 4f sbci r19, 0xFF ; 255 3495a: 4f 4f sbci r20, 0xFF ; 255 3495c: 5f 4f sbci r21, 0xFF ; 255 3495e: 29 87 std Y+9, r18 ; 0x09 34960: 3a 87 std Y+10, r19 ; 0x0a 34962: 4b 87 std Y+11, r20 ; 0x0b 34964: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 34966: d5 01 movw r26, r10 34968: 14 96 adiw r26, 0x04 ; 4 3496a: 4d 90 ld r4, X+ 3496c: 5d 90 ld r5, X+ 3496e: 6d 90 ld r6, X+ 34970: 7c 90 ld r7, X 34972: 17 97 sbiw r26, 0x07 ; 7 34974: 41 14 cp r4, r1 34976: 51 04 cpc r5, r1 34978: 61 04 cpc r6, r1 3497a: 71 04 cpc r7, r1 3497c: 09 f4 brne .+2 ; 0x34980 3497e: 59 c0 rjmp .+178 ; 0x34a32 // try to make file contiguous bgnCluster = *curCluster + 1; 34980: bf ef ldi r27, 0xFF ; 255 34982: 4b 1a sub r4, r27 34984: 5b 0a sbc r5, r27 34986: 6b 0a sbc r6, r27 34988: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 3498a: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 3498c: 73 01 movw r14, r6 3498e: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 34990: 1d 82 std Y+5, r1 ; 0x05 34992: 1e 82 std Y+6, r1 ; 0x06 34994: 1f 82 std Y+7, r1 ; 0x07 34996: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 34998: f4 01 movw r30, r8 3499a: 81 85 ldd r24, Z+9 ; 0x09 3499c: 92 85 ldd r25, Z+10 ; 0x0a 3499e: a3 85 ldd r26, Z+11 ; 0x0b 349a0: b4 85 ldd r27, Z+12 ; 0x0c 349a2: 2d 81 ldd r18, Y+5 ; 0x05 349a4: 3e 81 ldd r19, Y+6 ; 0x06 349a6: 4f 81 ldd r20, Y+7 ; 0x07 349a8: 58 85 ldd r21, Y+8 ; 0x08 349aa: 28 17 cp r18, r24 349ac: 39 07 cpc r19, r25 349ae: 4a 07 cpc r20, r26 349b0: 5b 07 cpc r21, r27 349b2: 08 f0 brcs .+2 ; 0x349b6 349b4: 56 c0 rjmp .+172 ; 0x34a62 // past end - start from beginning of FAT if (endCluster > fatEnd) { 349b6: 89 85 ldd r24, Y+9 ; 0x09 349b8: 9a 85 ldd r25, Y+10 ; 0x0a 349ba: ab 85 ldd r26, Y+11 ; 0x0b 349bc: bc 85 ldd r27, Y+12 ; 0x0c 349be: 8c 15 cp r24, r12 349c0: 9d 05 cpc r25, r13 349c2: ae 05 cpc r26, r14 349c4: bf 05 cpc r27, r15 349c6: 50 f4 brcc .+20 ; 0x349dc bgnCluster = endCluster = 2; 349c8: 82 e0 ldi r24, 0x02 ; 2 349ca: c8 2e mov r12, r24 349cc: d1 2c mov r13, r1 349ce: e1 2c mov r14, r1 349d0: f1 2c mov r15, r1 349d2: 92 e0 ldi r25, 0x02 ; 2 349d4: 49 2e mov r4, r25 349d6: 51 2c mov r5, r1 349d8: 61 2c mov r6, r1 349da: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 349dc: 9e 01 movw r18, r28 349de: 2f 5f subi r18, 0xFF ; 255 349e0: 3f 4f sbci r19, 0xFF ; 255 349e2: b7 01 movw r22, r14 349e4: a6 01 movw r20, r12 349e6: c4 01 movw r24, r8 349e8: 0f 94 63 6c call 0x2d8c6 ; 0x2d8c6 349ec: 88 23 and r24, r24 349ee: c9 f1 breq .+114 ; 0x34a62 if (f != 0) { 349f0: 89 81 ldd r24, Y+1 ; 0x01 349f2: 9a 81 ldd r25, Y+2 ; 0x02 349f4: ab 81 ldd r26, Y+3 ; 0x03 349f6: bc 81 ldd r27, Y+4 ; 0x04 349f8: 89 2b or r24, r25 349fa: 8a 2b or r24, r26 349fc: 8b 2b or r24, r27 349fe: 01 f1 breq .+64 ; 0x34a40 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 34a00: 26 01 movw r4, r12 34a02: 37 01 movw r6, r14 34a04: 9f ef ldi r25, 0xFF ; 255 34a06: 49 1a sub r4, r25 34a08: 59 0a sbc r5, r25 34a0a: 69 0a sbc r6, r25 34a0c: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 34a0e: 2d 81 ldd r18, Y+5 ; 0x05 34a10: 3e 81 ldd r19, Y+6 ; 0x06 34a12: 4f 81 ldd r20, Y+7 ; 0x07 34a14: 58 85 ldd r21, Y+8 ; 0x08 34a16: 2f 5f subi r18, 0xFF ; 255 34a18: 3f 4f sbci r19, 0xFF ; 255 34a1a: 4f 4f sbci r20, 0xFF ; 255 34a1c: 5f 4f sbci r21, 0xFF ; 255 34a1e: 2d 83 std Y+5, r18 ; 0x05 34a20: 3e 83 std Y+6, r19 ; 0x06 34a22: 4f 83 std Y+7, r20 ; 0x07 34a24: 58 87 std Y+8, r21 ; 0x08 34a26: 3f ef ldi r19, 0xFF ; 255 34a28: c3 1a sub r12, r19 34a2a: d3 0a sbc r13, r19 34a2c: e3 0a sbc r14, r19 34a2e: f3 0a sbc r15, r19 34a30: b3 cf rjmp .-154 ; 0x34998 // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 34a32: 40 80 ld r4, Z 34a34: 51 80 ldd r5, Z+1 ; 0x01 34a36: 62 80 ldd r6, Z+2 ; 0x02 34a38: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 34a3a: 33 24 eor r3, r3 34a3c: 33 94 inc r3 34a3e: a6 cf rjmp .-180 ; 0x3498c 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) { 34a40: c4 14 cp r12, r4 34a42: d5 04 cpc r13, r5 34a44: e6 04 cpc r14, r6 34a46: f7 04 cpc r15, r7 34a48: 11 f7 brne .-60 ; 0x34a0e 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); 34a4a: 0f ef ldi r16, 0xFF ; 255 34a4c: 1f ef ldi r17, 0xFF ; 255 34a4e: 2f ef ldi r18, 0xFF ; 255 34a50: 3f e0 ldi r19, 0x0F ; 15 34a52: b7 01 movw r22, r14 34a54: a6 01 movw r20, r12 34a56: c4 01 movw r24, r8 34a58: 0f 94 d1 6b call 0x2d7a2 ; 0x2d7a2 34a5c: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 34a5e: 81 11 cpse r24, r1 34a60: 1a c0 rjmp .+52 ; 0x34a96 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 34a62: 71 2c mov r7, r1 } 34a64: 87 2d mov r24, r7 34a66: 2c 96 adiw r28, 0x0c ; 12 34a68: 0f b6 in r0, 0x3f ; 63 34a6a: f8 94 cli 34a6c: de bf out 0x3e, r29 ; 62 34a6e: 0f be out 0x3f, r0 ; 63 34a70: cd bf out 0x3d, r28 ; 61 34a72: df 91 pop r29 34a74: cf 91 pop r28 34a76: 1f 91 pop r17 34a78: 0f 91 pop r16 34a7a: ff 90 pop r15 34a7c: ef 90 pop r14 34a7e: df 90 pop r13 34a80: cf 90 pop r12 34a82: bf 90 pop r11 34a84: af 90 pop r10 34a86: 9f 90 pop r9 34a88: 8f 90 pop r8 34a8a: 7f 90 pop r7 34a8c: 6f 90 pop r6 34a8e: 5f 90 pop r5 34a90: 4f 90 pop r4 34a92: 3f 90 pop r3 34a94: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 34a96: f5 01 movw r30, r10 34a98: 44 81 ldd r20, Z+4 ; 0x04 34a9a: 55 81 ldd r21, Z+5 ; 0x05 34a9c: 66 81 ldd r22, Z+6 ; 0x06 34a9e: 77 81 ldd r23, Z+7 ; 0x07 34aa0: 41 15 cp r20, r1 34aa2: 51 05 cpc r21, r1 34aa4: 61 05 cpc r22, r1 34aa6: 71 05 cpc r23, r1 34aa8: 39 f0 breq .+14 ; 0x34ab8 // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 34aaa: 97 01 movw r18, r14 34aac: 86 01 movw r16, r12 34aae: c4 01 movw r24, r8 34ab0: 0f 94 d1 6b call 0x2d7a2 ; 0x2d7a2 34ab4: 88 23 and r24, r24 34ab6: a9 f2 breq .-86 ; 0x34a62 } // return first cluster number to caller *curCluster = bgnCluster; 34ab8: d5 01 movw r26, r10 34aba: 14 96 adiw r26, 0x04 ; 4 34abc: cd 92 st X+, r12 34abe: dd 92 st X+, r13 34ac0: ed 92 st X+, r14 34ac2: fc 92 st X, r15 34ac4: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 34ac6: 33 20 and r3, r3 34ac8: 51 f0 breq .+20 ; 0x34ade 34aca: d7 01 movw r26, r14 34acc: c6 01 movw r24, r12 34ace: 01 96 adiw r24, 0x01 ; 1 34ad0: a1 1d adc r26, r1 34ad2: b1 1d adc r27, r1 34ad4: f4 01 movw r30, r8 34ad6: 80 83 st Z, r24 34ad8: 91 83 std Z+1, r25 ; 0x01 34ada: a2 83 std Z+2, r26 ; 0x02 34adc: 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) { 34ade: f5 01 movw r30, r10 34ae0: 85 89 ldd r24, Z+21 ; 0x15 34ae2: 96 89 ldd r25, Z+22 ; 0x16 34ae4: a7 89 ldd r26, Z+23 ; 0x17 34ae6: b0 8d ldd r27, Z+24 ; 0x18 34ae8: 89 2b or r24, r25 34aea: 8a 2b or r24, r26 34aec: 8b 2b or r24, r27 34aee: 09 f0 breq .+2 ; 0x34af2 34af0: b9 cf rjmp .-142 ; 0x34a64 firstCluster_ = curCluster_; 34af2: c5 8a std Z+21, r12 ; 0x15 34af4: d6 8a std Z+22, r13 ; 0x16 34af6: e7 8a std Z+23, r14 ; 0x17 34af8: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 34afa: 81 81 ldd r24, Z+1 ; 0x01 34afc: 80 68 ori r24, 0x80 ; 128 34afe: 81 83 std Z+1, r24 ; 0x01 34b00: b1 cf rjmp .-158 ; 0x34a64 00034b02 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 34b02: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34b04: 0d b4 in r0, 0x2d ; 45 34b06: 07 fe sbrs r0, 7 34b08: fd cf rjmp .-6 ; 0x34b04 } 34b0a: 08 95 ret 00034b0c : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 34b0c: 8f ef ldi r24, 0xFF ; 255 34b0e: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34b10: 0d b4 in r0, 0x2d ; 45 34b12: 07 fe sbrs r0, 7 34b14: fd cf rjmp .-6 ; 0x34b10 return SPDR; 34b16: 8e b5 in r24, 0x2e ; 46 } 34b18: 08 95 ret 00034b1a : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 34b1a: 8f 92 push r8 34b1c: 9f 92 push r9 34b1e: af 92 push r10 34b20: bf 92 push r11 34b22: ef 92 push r14 34b24: ff 92 push r15 34b26: 0f 93 push r16 34b28: 1f 93 push r17 34b2a: cf 93 push r28 34b2c: 7c 01 movw r14, r24 34b2e: c6 2f mov r28, r22 34b30: 49 01 movw r8, r18 34b32: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 34b34: fc 01 movw r30, r24 34b36: 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); 34b38: 89 2f mov r24, r25 34b3a: 80 6a ori r24, 0xA0 ; 160 34b3c: 86 95 lsr r24 34b3e: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 34b40: 90 fd sbrc r25, 0 34b42: 03 c0 rjmp .+6 ; 0x34b4a 34b44: 81 e0 ldi r24, 0x01 ; 1 34b46: 96 30 cpi r25, 0x06 ; 6 34b48: 09 f4 brne .+2 ; 0x34b4c 34b4a: 80 e0 ldi r24, 0x00 ; 0 34b4c: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 34b4e: 9f b7 in r25, 0x3f ; 63 34b50: f8 94 cli 34b52: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34b56: 8f 7b andi r24, 0xBF ; 191 34b58: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34b5c: 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); 34b5e: 8c e2 ldi r24, 0x2C ; 44 34b60: 91 e0 ldi r25, 0x01 ; 1 34b62: 0f 94 a1 76 call 0x2ed42 ; 0x2ed42 // send command spiSend(cmd | 0x40); 34b66: 8c 2f mov r24, r28 34b68: 80 64 ori r24, 0x40 ; 64 34b6a: 0f 94 81 a5 call 0x34b02 ; 0x34b02 34b6e: 08 e1 ldi r16, 0x18 ; 24 34b70: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 34b72: d5 01 movw r26, r10 34b74: c4 01 movw r24, r8 34b76: 00 2e mov r0, r16 34b78: 04 c0 rjmp .+8 ; 0x34b82 34b7a: b6 95 lsr r27 34b7c: a7 95 ror r26 34b7e: 97 95 ror r25 34b80: 87 95 ror r24 34b82: 0a 94 dec r0 34b84: d2 f7 brpl .-12 ; 0x34b7a 34b86: 0f 94 81 a5 call 0x34b02 ; 0x34b02 34b8a: 08 50 subi r16, 0x08 ; 8 34b8c: 11 09 sbc r17, r1 34b8e: 08 3f cpi r16, 0xF8 ; 248 34b90: ff ef ldi r31, 0xFF ; 255 34b92: 1f 07 cpc r17, r31 34b94: 71 f7 brne .-36 ; 0x34b72 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 34b96: 85 e9 ldi r24, 0x95 ; 149 34b98: cc 23 and r28, r28 34b9a: 21 f0 breq .+8 ; 0x34ba4 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 34b9c: 87 e8 ldi r24, 0x87 ; 135 34b9e: c8 30 cpi r28, 0x08 ; 8 34ba0: 09 f0 breq .+2 ; 0x34ba4 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34ba2: 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); 34ba4: 0f 94 81 a5 call 0x34b02 ; 0x34b02 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 34ba8: cc 30 cpi r28, 0x0C ; 12 34baa: 11 f4 brne .+4 ; 0x34bb0 34bac: 0f 94 86 a5 call 0x34b0c ; 0x34b0c // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34bb0: 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 */ } 34bb2: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 34bb6: f7 01 movw r30, r14 34bb8: 82 83 std Z+2, r24 ; 0x02 34bba: 87 ff sbrs r24, 7 34bbc: 04 c0 rjmp .+8 ; 0x34bc6 34bbe: cf 3f cpi r28, 0xFF ; 255 34bc0: 11 f0 breq .+4 ; 0x34bc6 34bc2: cf 5f subi r28, 0xFF ; 255 34bc4: f6 cf rjmp .-20 ; 0x34bb2 return status_; } 34bc6: cf 91 pop r28 34bc8: 1f 91 pop r17 34bca: 0f 91 pop r16 34bcc: ff 90 pop r15 34bce: ef 90 pop r14 34bd0: bf 90 pop r11 34bd2: af 90 pop r10 34bd4: 9f 90 pop r9 34bd6: 8f 90 pop r8 34bd8: 08 95 ret 00034bda : * \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) { 34bda: 0f 93 push r16 34bdc: 1f 93 push r17 34bde: cf 93 push r28 34be0: df 93 push r29 34be2: ec 01 movw r28, r24 34be4: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 34be6: 8b 81 ldd r24, Y+3 ; 0x03 34be8: 83 30 cpi r24, 0x03 ; 3 34bea: 39 f0 breq .+14 ; 0x34bfa 34bec: 89 e0 ldi r24, 0x09 ; 9 34bee: 44 0f add r20, r20 34bf0: 55 1f adc r21, r21 34bf2: 66 1f adc r22, r22 34bf4: 77 1f adc r23, r23 34bf6: 8a 95 dec r24 34bf8: d1 f7 brne .-12 ; 0x34bee if (cardCommand(CMD24, blockNumber)) { 34bfa: 9a 01 movw r18, r20 34bfc: ab 01 movw r20, r22 34bfe: 68 e1 ldi r22, 0x18 ; 24 34c00: ce 01 movw r24, r28 34c02: 0f 94 8d a5 call 0x34b1a ; 0x34b1a 34c06: 88 23 and r24, r24 34c08: 19 f0 breq .+6 ; 0x34c10 34c0a: 86 e0 ldi r24, 0x06 ; 6 34c0c: 88 83 st Y, r24 34c0e: 39 c0 rjmp .+114 ; 0x34c82 } //------------------------------------------------------------------------------ /** 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; 34c10: 8e ef ldi r24, 0xFE ; 254 34c12: 8e bd out 0x2e, r24 ; 46 34c14: f8 01 movw r30, r16 34c16: c8 01 movw r24, r16 34c18: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34c1a: 0d b4 in r0, 0x2d ; 45 34c1c: 07 fe sbrs r0, 7 34c1e: fd cf rjmp .-6 ; 0x34c1a SPDR = buf[i]; 34c20: 20 81 ld r18, Z 34c22: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34c24: 0d b4 in r0, 0x2d ; 45 34c26: 07 fe sbrs r0, 7 34c28: fd cf rjmp .-6 ; 0x34c24 SPDR = buf[i + 1]; 34c2a: 21 81 ldd r18, Z+1 ; 0x01 34c2c: 2e bd out 0x2e, r18 ; 46 34c2e: 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) { 34c30: e8 17 cp r30, r24 34c32: f9 07 cpc r31, r25 34c34: 91 f7 brne .-28 ; 0x34c1a 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 */ } 34c36: 0d b4 in r0, 0x2d ; 45 34c38: 07 fe sbrs r0, 7 34c3a: fd cf rjmp .-6 ; 0x34c36 //------------------------------------------------------------------------------ // 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 34c3c: 8f ef ldi r24, 0xFF ; 255 34c3e: 0f 94 81 a5 call 0x34b02 ; 0x34b02 spiSend(0xff); // dummy crc 34c42: 8f ef ldi r24, 0xFF ; 255 34c44: 0f 94 81 a5 call 0x34b02 ; 0x34b02 status_ = spiRec(); 34c48: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 34c4c: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 34c4e: 8f 71 andi r24, 0x1F ; 31 34c50: 85 30 cpi r24, 0x05 ; 5 34c52: 99 f4 brne .+38 ; 0x34c7a goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 34c54: 88 e5 ldi r24, 0x58 ; 88 34c56: 92 e0 ldi r25, 0x02 ; 2 34c58: 0f 94 a1 76 call 0x2ed42 ; 0x2ed42 34c5c: 18 2f mov r17, r24 34c5e: 87 e1 ldi r24, 0x17 ; 23 34c60: 11 23 and r17, r17 34c62: a1 f2 breq .-88 ; 0x34c0c error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 34c64: 20 e0 ldi r18, 0x00 ; 0 34c66: 30 e0 ldi r19, 0x00 ; 0 34c68: a9 01 movw r20, r18 34c6a: 6d e0 ldi r22, 0x0D ; 13 34c6c: ce 01 movw r24, r28 34c6e: 0f 94 8d a5 call 0x34b1a ; 0x34b1a 34c72: 88 23 and r24, r24 34c74: 51 f0 breq .+20 ; 0x34c8a 34c76: 86 e1 ldi r24, 0x16 ; 22 34c78: c9 cf rjmp .-110 ; 0x34c0c 34c7a: 83 e1 ldi r24, 0x13 ; 19 34c7c: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 34c7e: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 } chipSelectHigh(); return true; fail: chipSelectHigh(); 34c82: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 return false; 34c86: 10 e0 ldi r17, 0x00 ; 0 34c88: 06 c0 rjmp .+12 ; 0x34c96 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()) { 34c8a: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 34c8e: 81 11 cpse r24, r1 34c90: f2 cf rjmp .-28 ; 0x34c76 error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 34c92: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 return true; fail: chipSelectHigh(); return false; } 34c96: 81 2f mov r24, r17 34c98: df 91 pop r29 34c9a: cf 91 pop r28 34c9c: 1f 91 pop r17 34c9e: 0f 91 pop r16 34ca0: 08 95 ret 00034ca2 : * \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) { 34ca2: 2f 92 push r2 34ca4: 3f 92 push r3 34ca6: 4f 92 push r4 34ca8: 5f 92 push r5 34caa: 6f 92 push r6 34cac: 7f 92 push r7 34cae: 8f 92 push r8 34cb0: 9f 92 push r9 34cb2: af 92 push r10 34cb4: bf 92 push r11 34cb6: cf 92 push r12 34cb8: df 92 push r13 34cba: ef 92 push r14 34cbc: ff 92 push r15 34cbe: 0f 93 push r16 34cc0: 1f 93 push r17 34cc2: cf 93 push r28 34cc4: df 93 push r29 34cc6: ec 01 movw r28, r24 34cc8: 2a 01 movw r4, r20 34cca: 3b 01 movw r6, r22 34ccc: 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; 34cce: 8b 81 ldd r24, Y+3 ; 0x03 34cd0: 83 30 cpi r24, 0x03 ; 3 34cd2: 39 f0 breq .+14 ; 0x34ce2 34cd4: 69 e0 ldi r22, 0x09 ; 9 34cd6: 44 0c add r4, r4 34cd8: 55 1c adc r5, r5 34cda: 66 1c adc r6, r6 34cdc: 77 1c adc r7, r7 34cde: 6a 95 dec r22 34ce0: d1 f7 brne .-12 ; 0x34cd6 retry2: 34ce2: 43 e0 ldi r20, 0x03 ; 3 34ce4: 94 2e mov r9, r20 34ce6: 56 01 movw r10, r12 34ce8: 81 e0 ldi r24, 0x01 ; 1 34cea: a8 1a sub r10, r24 34cec: 8e ef ldi r24, 0xFE ; 254 34cee: b8 0a sbc r11, r24 34cf0: 16 01 movw r2, r12 34cf2: ee ef ldi r30, 0xFE ; 254 34cf4: 3e 1a sub r3, r30 34cf6: 54 e0 ldi r21, 0x04 ; 4 34cf8: 85 2e mov r8, r21 retryCnt --; 34cfa: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 34cfc: a3 01 movw r20, r6 34cfe: 92 01 movw r18, r4 34d00: 61 e1 ldi r22, 0x11 ; 17 34d02: ce 01 movw r24, r28 34d04: 0f 94 8d a5 call 0x34b1a ; 0x34b1a 34d08: 88 23 and r24, r24 34d0a: 79 f0 breq .+30 ; 0x34d2a 34d0c: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 34d0e: 99 20 and r9, r9 34d10: 09 f4 brne .+2 ; 0x34d14 34d12: 7a c0 rjmp .+244 ; 0x34e08 if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 34d14: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 34d18: 20 e0 ldi r18, 0x00 ; 0 34d1a: 30 e0 ldi r19, 0x00 ; 0 34d1c: a9 01 movw r20, r18 34d1e: 6c e0 ldi r22, 0x0C ; 12 34d20: ce 01 movw r24, r28 34d22: 0f 94 8d a5 call 0x34b1a ; 0x34b1a errorCode_ = 0; 34d26: 18 82 st Y, r1 34d28: e8 cf rjmp .-48 ; 0x34cfa #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 34d2a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 34d2e: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 34d30: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 34d34: 8a 83 std Y+2, r24 ; 0x02 34d36: 8f 3f cpi r24, 0xFF ; 255 34d38: 91 f4 brne .+36 ; 0x34d5e if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 34d3a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 34d3e: 60 1b sub r22, r16 34d40: 71 0b sbc r23, r17 34d42: 6d 32 cpi r22, 0x2D ; 45 34d44: 71 40 sbci r23, 0x01 ; 1 34d46: a0 f3 brcs .-24 ; 0x34d30 34d48: 81 e1 ldi r24, 0x11 ; 17 34d4a: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 34d4c: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34d50: 8c 81 ldd r24, Y+4 ; 0x04 34d52: 88 23 and r24, r24 34d54: e1 f2 breq .-72 ; 0x34d0e spiSend(0XFF); 34d56: 8f ef ldi r24, 0xFF ; 255 34d58: 0f 94 81 a5 call 0x34b02 ; 0x34b02 34d5c: d8 cf rjmp .-80 ; 0x34d0e if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 34d5e: 8e 3f cpi r24, 0xFE ; 254 34d60: 11 f0 breq .+4 ; 0x34d66 34d62: 8f e0 ldi r24, 0x0F ; 15 34d64: f2 cf rjmp .-28 ; 0x34d4a //------------------------------------------------------------------------------ /** 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; 34d66: 8f ef ldi r24, 0xFF ; 255 34d68: 8e bd out 0x2e, r24 ; 46 34d6a: d6 01 movw r26, r12 34d6c: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34d6e: 0d b4 in r0, 0x2d ; 45 34d70: 07 fe sbrs r0, 7 34d72: fd cf rjmp .-6 ; 0x34d6e buf[i] = SPDR; 34d74: 9e b5 in r25, 0x2e ; 46 34d76: 91 93 st Z+, r25 SPDR = 0XFF; 34d78: 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++) { 34d7a: ea 15 cp r30, r10 34d7c: fb 05 cpc r31, r11 34d7e: b9 f7 brne .-18 ; 0x34d6e while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34d80: 0d b4 in r0, 0x2d ; 45 34d82: 07 fe sbrs r0, 7 34d84: fd cf rjmp .-6 ; 0x34d80 buf[nbyte] = SPDR; 34d86: 8e b5 in r24, 0x2e ; 46 34d88: f5 01 movw r30, r10 34d8a: 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; 34d8c: f1 2c mov r15, r1 34d8e: 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); 34d90: 8d 91 ld r24, X+ 34d92: ef 2d mov r30, r15 34d94: ff 27 eor r31, r31 34d96: e8 27 eor r30, r24 34d98: ee 0f add r30, r30 34d9a: ff 1f adc r31, r31 34d9c: e3 53 subi r30, 0x33 ; 51 34d9e: f3 45 sbci r31, 0x53 ; 83 34da0: 85 91 lpm r24, Z+ 34da2: 94 91 lpm r25, Z 34da4: fe 2c mov r15, r14 34da6: ee 24 eor r14, r14 34da8: e8 26 eor r14, r24 34daa: 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++) { 34dac: 2a 16 cp r2, r26 34dae: 3b 06 cpc r3, r27 34db0: 79 f7 brne .-34 ; 0x34d90 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 34db2: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 34db6: 08 2f mov r16, r24 34db8: 10 e0 ldi r17, 0x00 ; 0 34dba: 10 2f mov r17, r16 34dbc: 00 27 eor r16, r16 recvCrc |= spiRec(); 34dbe: 0f 94 86 a5 call 0x34b0c ; 0x34b0c 34dc2: 08 2b or r16, r24 if (calcCrc != recvCrc) 34dc4: 0e 15 cp r16, r14 34dc6: 1f 05 cpc r17, r15 34dc8: 19 f0 breq .+6 ; 0x34dd0 34dca: f0 e2 ldi r31, 0x20 ; 32 34dcc: f8 83 st Y, r31 34dce: be cf rjmp .-132 ; 0x34d4c #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 34dd0: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34dd4: cc 81 ldd r28, Y+4 ; 0x04 34dd6: cc 23 and r28, r28 34dd8: d9 f0 breq .+54 ; 0x34e10 spiSend(0XFF); 34dda: 8f ef ldi r24, 0xFF ; 255 34ddc: 0f 94 81 a5 call 0x34b02 ; 0x34b02 #endif fail: chipSelectHigh(); return false; } 34de0: 8c 2f mov r24, r28 34de2: df 91 pop r29 34de4: cf 91 pop r28 34de6: 1f 91 pop r17 34de8: 0f 91 pop r16 34dea: ff 90 pop r15 34dec: ef 90 pop r14 34dee: df 90 pop r13 34df0: cf 90 pop r12 34df2: bf 90 pop r11 34df4: af 90 pop r10 34df6: 9f 90 pop r9 34df8: 8f 90 pop r8 34dfa: 7f 90 pop r7 34dfc: 6f 90 pop r6 34dfe: 5f 90 pop r5 34e00: 4f 90 pop r4 34e02: 3f 90 pop r3 34e04: 2f 90 pop r2 34e06: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 34e08: 0f 94 98 76 call 0x2ed30 ; 0x2ed30 return false; 34e0c: c0 e0 ldi r28, 0x00 ; 0 34e0e: e8 cf rjmp .-48 ; 0x34de0 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 34e10: c1 e0 ldi r28, 0x01 ; 1 34e12: e6 cf rjmp .-52 ; 0x34de0 00034e14 : * 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) { 34e14: 2f 92 push r2 34e16: 3f 92 push r3 34e18: 4f 92 push r4 34e1a: 5f 92 push r5 34e1c: 6f 92 push r6 34e1e: 7f 92 push r7 34e20: 8f 92 push r8 34e22: 9f 92 push r9 34e24: af 92 push r10 34e26: bf 92 push r11 34e28: cf 92 push r12 34e2a: df 92 push r13 34e2c: ef 92 push r14 34e2e: ff 92 push r15 34e30: 0f 93 push r16 34e32: 1f 93 push r17 34e34: cf 93 push r28 34e36: df 93 push r29 34e38: 00 d0 rcall .+0 ; 0x34e3a 34e3a: 1f 92 push r1 34e3c: cd b7 in r28, 0x3d ; 61 34e3e: de b7 in r29, 0x3e ; 62 34e40: 9c 83 std Y+4, r25 ; 0x04 34e42: 8b 83 std Y+3, r24 ; 0x03 34e44: 4b 01 movw r8, r22 34e46: 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; 34e48: dc 01 movw r26, r24 34e4a: 13 96 adiw r26, 0x03 ; 3 34e4c: 8c 91 ld r24, X 34e4e: 81 11 cpse r24, r1 34e50: 19 c0 rjmp .+50 ; 0x34e84 toRead -= n; } return nbyte; fail: return -1; 34e52: 8f ef ldi r24, 0xFF ; 255 34e54: 9f ef ldi r25, 0xFF ; 255 } 34e56: 0f 90 pop r0 34e58: 0f 90 pop r0 34e5a: 0f 90 pop r0 34e5c: 0f 90 pop r0 34e5e: df 91 pop r29 34e60: cf 91 pop r28 34e62: 1f 91 pop r17 34e64: 0f 91 pop r16 34e66: ff 90 pop r15 34e68: ef 90 pop r14 34e6a: df 90 pop r13 34e6c: cf 90 pop r12 34e6e: bf 90 pop r11 34e70: af 90 pop r10 34e72: 9f 90 pop r9 34e74: 8f 90 pop r8 34e76: 7f 90 pop r7 34e78: 6f 90 pop r6 34e7a: 5f 90 pop r5 34e7c: 4f 90 pop r4 34e7e: 3f 90 pop r3 34e80: 2f 90 pop r2 34e82: 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; 34e84: eb 81 ldd r30, Y+3 ; 0x03 34e86: fc 81 ldd r31, Y+4 ; 0x04 34e88: 81 81 ldd r24, Z+1 ; 0x01 34e8a: 80 ff sbrs r24, 0 34e8c: e2 cf rjmp .-60 ; 0x34e52 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 34e8e: 01 89 ldd r16, Z+17 ; 0x11 34e90: 12 89 ldd r17, Z+18 ; 0x12 34e92: 23 89 ldd r18, Z+19 ; 0x13 34e94: 34 89 ldd r19, Z+20 ; 0x14 34e96: 40 85 ldd r20, Z+8 ; 0x08 34e98: 51 85 ldd r21, Z+9 ; 0x09 34e9a: 62 85 ldd r22, Z+10 ; 0x0a 34e9c: 73 85 ldd r23, Z+11 ; 0x0b 34e9e: c7 01 movw r24, r14 34ea0: b0 e0 ldi r27, 0x00 ; 0 34ea2: a0 e0 ldi r26, 0x00 ; 0 34ea4: 28 01 movw r4, r16 34ea6: 39 01 movw r6, r18 34ea8: 44 1a sub r4, r20 34eaa: 55 0a sbc r5, r21 34eac: 66 0a sbc r6, r22 34eae: 77 0a sbc r7, r23 34eb0: 84 15 cp r24, r4 34eb2: 95 05 cpc r25, r5 34eb4: a6 05 cpc r26, r6 34eb6: b7 05 cpc r27, r7 34eb8: 18 f0 brcs .+6 ; 0x34ec0 nbyte = fileSize_ - curPosition_; 34eba: 78 01 movw r14, r16 34ebc: e4 1a sub r14, r20 34ebe: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 34ec0: 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; 34ec2: 8b 81 ldd r24, Y+3 ; 0x03 34ec4: 9c 81 ldd r25, Y+4 ; 0x04 34ec6: 04 96 adiw r24, 0x04 ; 4 34ec8: 9a 83 std Y+2, r25 ; 0x02 34eca: 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; 34ecc: 61 2c mov r6, r1 34ece: 32 e0 ldi r19, 0x02 ; 2 34ed0: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 34ed2: c1 14 cp r12, r1 34ed4: d1 04 cpc r13, r1 34ed6: 09 f4 brne .+2 ; 0x34eda 34ed8: b7 c0 rjmp .+366 ; 0x35048 offset = curPosition_ & 0X1FF; // offset in block 34eda: ab 81 ldd r26, Y+3 ; 0x03 34edc: bc 81 ldd r27, Y+4 ; 0x04 34ede: 18 96 adiw r26, 0x08 ; 8 34ee0: 4d 91 ld r20, X+ 34ee2: 5d 91 ld r21, X+ 34ee4: 6d 91 ld r22, X+ 34ee6: 7c 91 ld r23, X 34ee8: 1b 97 sbiw r26, 0x0b ; 11 34eea: 5a 01 movw r10, r20 34eec: b1 e0 ldi r27, 0x01 ; 1 34eee: bb 22 and r11, r27 34ef0: eb 81 ldd r30, Y+3 ; 0x03 34ef2: fc 81 ldd r31, Y+4 ; 0x04 34ef4: 81 8d ldd r24, Z+25 ; 0x19 34ef6: 92 8d ldd r25, Z+26 ; 0x1a 34ef8: 1a 01 movw r2, r20 34efa: 2b 01 movw r4, r22 34efc: 29 e0 ldi r18, 0x09 ; 9 34efe: 56 94 lsr r5 34f00: 47 94 ror r4 34f02: 37 94 ror r3 34f04: 27 94 ror r2 34f06: 2a 95 dec r18 34f08: d1 f7 brne .-12 ; 0x34efe if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 34f0a: 23 81 ldd r18, Z+3 ; 0x03 34f0c: 22 30 cpi r18, 0x02 ; 2 34f0e: 91 f5 brne .+100 ; 0x34f74 block = vol_->rootDirStart() + (curPosition_ >> 9); 34f10: dc 01 movw r26, r24 34f12: 5a 96 adiw r26, 0x1a ; 26 34f14: 6d 91 ld r22, X+ 34f16: 7d 91 ld r23, X+ 34f18: 8d 91 ld r24, X+ 34f1a: 9c 91 ld r25, X 34f1c: 5d 97 sbiw r26, 0x1d ; 29 34f1e: 62 0d add r22, r2 34f20: 73 1d adc r23, r3 34f22: 84 1d adc r24, r4 34f24: 95 1d adc r25, r5 34f26: 83 01 movw r16, r6 34f28: 0a 19 sub r16, r10 34f2a: 1b 09 sbc r17, r11 34f2c: c0 16 cp r12, r16 34f2e: d1 06 cpc r13, r17 34f30: 08 f4 brcc .+2 ; 0x34f34 34f32: 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()) { 34f34: 01 15 cp r16, r1 34f36: b2 e0 ldi r27, 0x02 ; 2 34f38: 1b 07 cpc r17, r27 34f3a: 71 f4 brne .+28 ; 0x34f58 34f3c: 20 91 6c 0e lds r18, 0x0E6C ; 0x800e6c 34f40: 30 91 6d 0e lds r19, 0x0E6D ; 0x800e6d 34f44: 40 91 6e 0e lds r20, 0x0E6E ; 0x800e6e 34f48: 50 91 6f 0e lds r21, 0x0E6F ; 0x800e6f 34f4c: 62 17 cp r22, r18 34f4e: 73 07 cpc r23, r19 34f50: 84 07 cpc r24, r20 34f52: 95 07 cpc r25, r21 34f54: 09 f0 breq .+2 ; 0x34f58 34f56: 59 c0 rjmp .+178 ; 0x3500a 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; 34f58: 40 e0 ldi r20, 0x00 ; 0 34f5a: 0f 94 94 6b call 0x2d728 ; 0x2d728 34f5e: 88 23 and r24, r24 34f60: 09 f4 brne .+2 ; 0x34f64 34f62: 77 cf rjmp .-274 ; 0x34e52 uint8_t* src = vol_->cache()->data + offset; 34f64: b5 01 movw r22, r10 34f66: 68 58 subi r22, 0x88 ; 136 34f68: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 34f6a: a8 01 movw r20, r16 34f6c: c4 01 movw r24, r8 34f6e: 0f 94 6f e3 call 0x3c6de ; 0x3c6de 34f72: 57 c0 rjmp .+174 ; 0x35022 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);} 34f74: fc 01 movw r30, r24 34f76: 14 81 ldd r17, Z+4 ; 0x04 34f78: 11 50 subi r17, 0x01 ; 1 34f7a: 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) { 34f7c: a1 14 cp r10, r1 34f7e: b1 04 cpc r11, r1 34f80: 81 f4 brne .+32 ; 0x34fa2 34f82: 11 11 cpse r17, r1 34f84: 0e c0 rjmp .+28 ; 0x34fa2 // start of new cluster if (curPosition_ == 0) { 34f86: 45 2b or r20, r21 34f88: 46 2b or r20, r22 34f8a: 47 2b or r20, r23 34f8c: 79 f5 brne .+94 ; 0x34fec // use first cluster in file curCluster_ = firstCluster_; 34f8e: eb 81 ldd r30, Y+3 ; 0x03 34f90: fc 81 ldd r31, Y+4 ; 0x04 34f92: 85 89 ldd r24, Z+21 ; 0x15 34f94: 96 89 ldd r25, Z+22 ; 0x16 34f96: a7 89 ldd r26, Z+23 ; 0x17 34f98: b0 8d ldd r27, Z+24 ; 0x18 34f9a: 84 83 std Z+4, r24 ; 0x04 34f9c: 95 83 std Z+5, r25 ; 0x05 34f9e: a6 83 std Z+6, r26 ; 0x06 34fa0: 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; 34fa2: ab 81 ldd r26, Y+3 ; 0x03 34fa4: bc 81 ldd r27, Y+4 ; 0x04 34fa6: 59 96 adiw r26, 0x19 ; 25 34fa8: ed 91 ld r30, X+ 34faa: fc 91 ld r31, X 34fac: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 34fae: 14 96 adiw r26, 0x04 ; 4 34fb0: 6d 91 ld r22, X+ 34fb2: 7d 91 ld r23, X+ 34fb4: 8d 91 ld r24, X+ 34fb6: 9c 91 ld r25, X 34fb8: 17 97 sbiw r26, 0x07 ; 7 34fba: 62 50 subi r22, 0x02 ; 2 34fbc: 71 09 sbc r23, r1 34fbe: 81 09 sbc r24, r1 34fc0: 91 09 sbc r25, r1 34fc2: 25 85 ldd r18, Z+13 ; 0x0d 34fc4: 04 c0 rjmp .+8 ; 0x34fce 34fc6: 66 0f add r22, r22 34fc8: 77 1f adc r23, r23 34fca: 88 1f adc r24, r24 34fcc: 99 1f adc r25, r25 34fce: 2a 95 dec r18 34fd0: d2 f7 brpl .-12 ; 0x34fc6 34fd2: 26 85 ldd r18, Z+14 ; 0x0e 34fd4: 37 85 ldd r19, Z+15 ; 0x0f 34fd6: 40 89 ldd r20, Z+16 ; 0x10 34fd8: 51 89 ldd r21, Z+17 ; 0x11 34fda: 62 0f add r22, r18 34fdc: 73 1f adc r23, r19 34fde: 84 1f adc r24, r20 34fe0: 95 1f adc r25, r21 34fe2: 61 0f add r22, r17 34fe4: 71 1d adc r23, r1 34fe6: 81 1d adc r24, r1 34fe8: 91 1d adc r25, r1 34fea: 9d cf rjmp .-198 ; 0x34f26 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 34fec: ab 81 ldd r26, Y+3 ; 0x03 34fee: bc 81 ldd r27, Y+4 ; 0x04 34ff0: 14 96 adiw r26, 0x04 ; 4 34ff2: 4d 91 ld r20, X+ 34ff4: 5d 91 ld r21, X+ 34ff6: 6d 91 ld r22, X+ 34ff8: 7c 91 ld r23, X 34ffa: 17 97 sbiw r26, 0x07 ; 7 34ffc: 29 81 ldd r18, Y+1 ; 0x01 34ffe: 3a 81 ldd r19, Y+2 ; 0x02 35000: 0f 94 63 6c call 0x2d8c6 ; 0x2d8c6 35004: 81 11 cpse r24, r1 35006: cd cf rjmp .-102 ; 0x34fa2 35008: 24 cf rjmp .-440 ; 0x34e52 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);} 3500a: 94 01 movw r18, r8 3500c: ab 01 movw r20, r22 3500e: bc 01 movw r22, r24 35010: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 35014: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 35018: 0f 94 51 a6 call 0x34ca2 ; 0x34ca2 // 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; 3501c: 88 23 and r24, r24 3501e: 09 f4 brne .+2 ; 0x35022 35020: 18 cf rjmp .-464 ; 0x34e52 // 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; 35022: 80 0e add r8, r16 35024: 91 1e adc r9, r17 curPosition_ += n; 35026: eb 81 ldd r30, Y+3 ; 0x03 35028: fc 81 ldd r31, Y+4 ; 0x04 3502a: 80 85 ldd r24, Z+8 ; 0x08 3502c: 91 85 ldd r25, Z+9 ; 0x09 3502e: a2 85 ldd r26, Z+10 ; 0x0a 35030: b3 85 ldd r27, Z+11 ; 0x0b 35032: 80 0f add r24, r16 35034: 91 1f adc r25, r17 35036: a1 1d adc r26, r1 35038: b1 1d adc r27, r1 3503a: 80 87 std Z+8, r24 ; 0x08 3503c: 91 87 std Z+9, r25 ; 0x09 3503e: a2 87 std Z+10, r26 ; 0x0a 35040: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 35042: c0 1a sub r12, r16 35044: d1 0a sbc r13, r17 35046: 45 cf rjmp .-374 ; 0x34ed2 } return nbyte; 35048: c7 01 movw r24, r14 3504a: 05 cf rjmp .-502 ; 0x34e56 0003504c : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 3504c: 4f 92 push r4 3504e: 5f 92 push r5 35050: 6f 92 push r6 35052: 7f 92 push r7 35054: af 92 push r10 35056: bf 92 push r11 35058: cf 92 push r12 3505a: df 92 push r13 3505c: ef 92 push r14 3505e: ff 92 push r15 35060: 0f 93 push r16 35062: 1f 93 push r17 35064: cf 93 push r28 35066: df 93 push r29 35068: 1f 92 push r1 3506a: cd b7 in r28, 0x3d ; 61 3506c: de b7 in r29, 0x3e ; 62 3506e: 8c 01 movw r16, r24 35070: 7b 01 movw r14, r22 35072: 5a 01 movw r10, r20 35074: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 35076: db 01 movw r26, r22 35078: 59 96 adiw r26, 0x19 ; 25 3507a: 8d 91 ld r24, X+ 3507c: 9c 91 ld r25, X 3507e: f8 01 movw r30, r16 35080: 92 8f std Z+26, r25 ; 0x1a 35082: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 35084: cb 01 movw r24, r22 35086: 0e 94 c8 78 call 0xf190 ; 0xf190 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 3508a: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 3508c: f7 01 movw r30, r14 3508e: 80 85 ldd r24, Z+8 ; 0x08 35090: 91 85 ldd r25, Z+9 ; 0x09 35092: a2 85 ldd r26, Z+10 ; 0x0a 35094: b3 85 ldd r27, Z+11 ; 0x0b 35096: 41 89 ldd r20, Z+17 ; 0x11 35098: 52 89 ldd r21, Z+18 ; 0x12 3509a: 63 89 ldd r22, Z+19 ; 0x13 3509c: 74 89 ldd r23, Z+20 ; 0x14 3509e: 84 17 cp r24, r20 350a0: 95 07 cpc r25, r21 350a2: a6 07 cpc r26, r22 350a4: b7 07 cpc r27, r23 350a6: 08 f0 brcs .+2 ; 0x350aa 350a8: 52 c0 rjmp .+164 ; 0x3514e index = 0XF & (dirFile->curPosition_ >> 5); 350aa: 55 e0 ldi r21, 0x05 ; 5 350ac: b6 95 lsr r27 350ae: a7 95 ror r26 350b0: 97 95 ror r25 350b2: 87 95 ror r24 350b4: 5a 95 dec r21 350b6: d1 f7 brne .-12 ; 0x350ac 350b8: f8 2f mov r31, r24 350ba: ff 70 andi r31, 0x0F ; 15 350bc: 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; 350be: d7 01 movw r26, r14 350c0: 13 96 adiw r26, 0x03 ; 3 350c2: 8c 91 ld r24, X 350c4: 82 30 cpi r24, 0x02 ; 2 350c6: 10 f4 brcc .+4 ; 0x350cc if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 350c8: 80 e0 ldi r24, 0x00 ; 0 350ca: db c0 rjmp .+438 ; 0x35282 * \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; 350cc: 41 e0 ldi r20, 0x01 ; 1 350ce: 50 e0 ldi r21, 0x00 ; 0 350d0: be 01 movw r22, r28 350d2: 6f 5f subi r22, 0xFF ; 255 350d4: 7f 4f sbci r23, 0xFF ; 255 350d6: c7 01 movw r24, r14 350d8: 0f 94 0a a7 call 0x34e14 ; 0x34e14 350dc: 01 97 sbiw r24, 0x01 ; 1 350de: a1 f7 brne .-24 ; 0x350c8 // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 350e0: f7 01 movw r30, r14 350e2: 80 85 ldd r24, Z+8 ; 0x08 350e4: 91 85 ldd r25, Z+9 ; 0x09 350e6: a2 85 ldd r26, Z+10 ; 0x0a 350e8: b3 85 ldd r27, Z+11 ; 0x0b 350ea: 4f 96 adiw r24, 0x1f ; 31 350ec: a1 1d adc r26, r1 350ee: b1 1d adc r27, r1 350f0: 80 87 std Z+8, r24 ; 0x08 350f2: 91 87 std Z+9, r25 ; 0x09 350f4: a2 87 std Z+10, r26 ; 0x0a 350f6: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 350f8: f0 e2 ldi r31, 0x20 ; 32 350fa: df 9e mul r13, r31 350fc: b0 01 movw r22, r0 350fe: 11 24 eor r1, r1 35100: 68 58 subi r22, 0x88 ; 136 35102: 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; 35104: 61 15 cp r22, r1 35106: 71 05 cpc r23, r1 35108: f9 f2 breq .-66 ; 0x350c8 if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 3510a: db 01 movw r26, r22 3510c: 8c 91 ld r24, X 3510e: 88 23 and r24, r24 35110: 41 f0 breq .+16 ; 0x35122 35112: 85 3e cpi r24, 0xE5 ; 229 35114: 09 f0 breq .+2 ; 0x35118 35116: 4c c0 rjmp .+152 ; 0x351b0 // remember first empty slot if (!emptyFound) { 35118: 77 20 and r7, r7 3511a: 29 f0 breq .+10 ; 0x35126 return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 3511c: 77 24 eor r7, r7 3511e: 73 94 inc r7 35120: b5 cf rjmp .-150 ; 0x3508c 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) { 35122: 71 10 cpse r7, r1 35124: 0e c0 rjmp .+28 ; 0x35142 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 35126: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 3512a: 90 91 6d 0e lds r25, 0x0E6D ; 0x800e6d 3512e: a0 91 6e 0e lds r26, 0x0E6E ; 0x800e6e 35132: b0 91 6f 0e lds r27, 0x0E6F ; 0x800e6f 35136: f8 01 movw r30, r16 35138: 84 87 std Z+12, r24 ; 0x0c 3513a: 95 87 std Z+13, r25 ; 0x0d 3513c: a6 87 std Z+14, r26 ; 0x0e 3513e: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 35140: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 35142: db 01 movw r26, r22 35144: 8c 91 ld r24, X 35146: 81 11 cpse r24, r1 35148: e9 cf rjmp .-46 ; 0x3511c 3514a: 77 24 eor r7, r7 3514c: 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; 3514e: 8c 2d mov r24, r12 35150: 82 74 andi r24, 0x42 ; 66 35152: 82 34 cpi r24, 0x42 ; 66 35154: 09 f0 breq .+2 ; 0x35158 35156: b8 cf rjmp .-144 ; 0x350c8 if (emptyFound) { 35158: 77 20 and r7, r7 3515a: 09 f4 brne .+2 ; 0x3515e 3515c: a2 c0 rjmp .+324 ; 0x352a2 index = dirIndex_; 3515e: f8 01 movw r30, r16 35160: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 35162: 61 e0 ldi r22, 0x01 ; 1 35164: c8 01 movw r24, r16 35166: 0f 94 32 a4 call 0x34864 ; 0x34864 if (!p) goto fail; 3516a: 00 97 sbiw r24, 0x00 ; 0 3516c: 09 f4 brne .+2 ; 0x35170 3516e: ac cf rjmp .-168 ; 0x350c8 // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 35170: 20 e2 ldi r18, 0x20 ; 32 35172: dc 01 movw r26, r24 35174: 1d 92 st X+, r1 35176: 2a 95 dec r18 35178: e9 f7 brne .-6 ; 0x35174 memcpy(p->name, dname, 11); 3517a: 2b e0 ldi r18, 0x0B ; 11 3517c: f5 01 movw r30, r10 3517e: dc 01 movw r26, r24 35180: 01 90 ld r0, Z+ 35182: 0d 92 st X+, r0 35184: 2a 95 dec r18 35186: e1 f7 brne .-8 ; 0x35180 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 35188: 21 e2 ldi r18, 0x21 ; 33 3518a: 38 e2 ldi r19, 0x28 ; 40 3518c: fc 01 movw r30, r24 3518e: 31 8b std Z+17, r19 ; 0x11 35190: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 35192: 40 e0 ldi r20, 0x00 ; 0 35194: 58 e0 ldi r21, 0x08 ; 8 35196: 57 87 std Z+15, r21 ; 0x0f 35198: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 3519a: 33 8b std Z+19, r19 ; 0x13 3519c: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 3519e: 31 8f std Z+25, r19 ; 0x19 351a0: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 351a2: 57 8b std Z+23, r21 ; 0x17 351a4: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 351a6: 0f 94 55 6b call 0x2d6aa ; 0x2d6aa 351aa: 81 11 cpse r24, r1 351ac: 09 c0 rjmp .+18 ; 0x351c0 351ae: 8c cf rjmp .-232 ; 0x350c8 dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 351b0: 4b e0 ldi r20, 0x0B ; 11 351b2: 50 e0 ldi r21, 0x00 ; 0 351b4: c5 01 movw r24, r10 351b6: 0f 94 62 e3 call 0x3c6c4 ; 0x3c6c4 351ba: 89 2b or r24, r25 351bc: 09 f0 breq .+2 ; 0x351c0 351be: 66 cf rjmp .-308 ; 0x3508c } //------------------------------------------------------------------------------ // 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]; 351c0: f0 e2 ldi r31, 0x20 ; 32 351c2: df 9e mul r13, r31 351c4: d0 01 movw r26, r0 351c6: 11 24 eor r1, r1 351c8: 9d 01 movw r18, r26 351ca: 28 58 subi r18, 0x88 ; 136 351cc: 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)) { 351ce: f9 01 movw r30, r18 351d0: 83 85 ldd r24, Z+11 ; 0x0b 351d2: 81 71 andi r24, 0x11 ; 17 351d4: 21 f0 breq .+8 ; 0x351de if (oflag & (O_WRITE | O_TRUNC)) goto fail; 351d6: 8c 2d mov r24, r12 351d8: 82 71 andi r24, 0x12 ; 18 351da: 09 f0 breq .+2 ; 0x351de 351dc: fc c0 rjmp .+504 ; 0x353d6 } //------------------------------------------------------------------------------ // 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]; 351de: f8 01 movw r30, r16 351e0: 81 8d ldd r24, Z+25 ; 0x19 351e2: 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(); 351e4: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 351e8: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 351ec: 60 91 6e 0e lds r22, 0x0E6E ; 0x800e6e 351f0: 70 91 6f 0e lds r23, 0x0E6F ; 0x800e6f 351f4: 44 87 std Z+12, r20 ; 0x0c 351f6: 55 87 std Z+13, r21 ; 0x0d 351f8: 66 87 std Z+14, r22 ; 0x0e 351fa: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 351fc: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 351fe: fd 01 movw r30, r26 35200: e8 58 subi r30, 0x88 ; 136 35202: f1 4f sbci r31, 0xF1 ; 241 35204: 44 88 ldd r4, Z+20 ; 0x14 35206: 55 88 ldd r5, Z+21 ; 0x15 35208: 71 2c mov r7, r1 3520a: 61 2c mov r6, r1 3520c: 32 01 movw r6, r4 3520e: 55 24 eor r5, r5 35210: 44 24 eor r4, r4 35212: d8 01 movw r26, r16 35214: 55 96 adiw r26, 0x15 ; 21 35216: 4d 92 st X+, r4 35218: 5d 92 st X+, r5 3521a: 6d 92 st X+, r6 3521c: 7c 92 st X, r7 3521e: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 35220: 42 8d ldd r20, Z+26 ; 0x1a 35222: 53 8d ldd r21, Z+27 ; 0x1b 35224: 70 e0 ldi r23, 0x00 ; 0 35226: 60 e0 ldi r22, 0x00 ; 0 35228: 44 29 or r20, r4 3522a: 55 29 or r21, r5 3522c: 66 29 or r22, r6 3522e: 77 29 or r23, r7 35230: 55 96 adiw r26, 0x15 ; 21 35232: 4d 93 st X+, r20 35234: 5d 93 st X+, r21 35236: 6d 93 st X+, r22 35238: 7c 93 st X, r23 3523a: 58 97 sbiw r26, 0x18 ; 24 3523c: d9 01 movw r26, r18 3523e: 1b 96 adiw r26, 0x0b ; 11 35240: 2c 91 ld r18, X 35242: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 35244: 09 f0 breq .+2 ; 0x35248 35246: b9 c0 rjmp .+370 ; 0x353ba fileSize_ = p->fileSize; 35248: 84 8d ldd r24, Z+28 ; 0x1c 3524a: 95 8d ldd r25, Z+29 ; 0x1d 3524c: a6 8d ldd r26, Z+30 ; 0x1e 3524e: b7 8d ldd r27, Z+31 ; 0x1f 35250: f8 01 movw r30, r16 35252: 81 8b std Z+17, r24 ; 0x11 35254: 92 8b std Z+18, r25 ; 0x12 35256: a3 8b std Z+19, r26 ; 0x13 35258: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 3525a: 81 e0 ldi r24, 0x01 ; 1 3525c: 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; 3525e: 8c 2d mov r24, r12 35260: 8f 70 andi r24, 0x0F ; 15 35262: f8 01 movw r30, r16 35264: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 35266: 14 82 std Z+4, r1 ; 0x04 35268: 15 82 std Z+5, r1 ; 0x05 3526a: 16 82 std Z+6, r1 ; 0x06 3526c: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 3526e: 10 86 std Z+8, r1 ; 0x08 35270: 11 86 std Z+9, r1 ; 0x09 35272: 12 86 std Z+10, r1 ; 0x0a 35274: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 35276: 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; 35278: c4 fe sbrs r12, 4 3527a: 03 c0 rjmp .+6 ; 0x35282 3527c: c8 01 movw r24, r16 3527e: 0f 94 56 78 call 0x2f0ac ; 0x2f0ac // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 35282: 0f 90 pop r0 35284: df 91 pop r29 35286: cf 91 pop r28 35288: 1f 91 pop r17 3528a: 0f 91 pop r16 3528c: ff 90 pop r15 3528e: ef 90 pop r14 35290: df 90 pop r13 35292: cf 90 pop r12 35294: bf 90 pop r11 35296: af 90 pop r10 35298: 7f 90 pop r7 3529a: 6f 90 pop r6 3529c: 5f 90 pop r5 3529e: 4f 90 pop r4 352a0: 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; 352a2: d7 01 movw r26, r14 352a4: 13 96 adiw r26, 0x03 ; 3 352a6: 8c 91 ld r24, X 352a8: 13 97 sbiw r26, 0x03 ; 3 352aa: 82 30 cpi r24, 0x02 ; 2 352ac: 09 f4 brne .+2 ; 0x352b0 352ae: 0c cf rjmp .-488 ; 0x350c8 // 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; 352b0: 51 96 adiw r26, 0x11 ; 17 352b2: 8d 91 ld r24, X+ 352b4: 9d 91 ld r25, X+ 352b6: 0d 90 ld r0, X+ 352b8: bc 91 ld r27, X 352ba: a0 2d mov r26, r0 352bc: 80 3e cpi r24, 0xE0 ; 224 352be: 9f 4f sbci r25, 0xFF ; 255 352c0: af 41 sbci r26, 0x1F ; 31 352c2: b1 05 cpc r27, r1 352c4: 08 f0 brcs .+2 ; 0x352c8 352c6: 00 cf rjmp .-512 ; 0x350c8 if (!addCluster()) goto fail; 352c8: c7 01 movw r24, r14 352ca: 0f 94 86 a4 call 0x3490c ; 0x3490c 352ce: 88 23 and r24, r24 352d0: 09 f4 brne .+2 ; 0x352d4 352d2: fa ce rjmp .-524 ; 0x350c8 if (!vol_->cacheFlush()) goto fail; 352d4: 0f 94 55 6b call 0x2d6aa ; 0x2d6aa 352d8: 88 23 and r24, r24 352da: 09 f4 brne .+2 ; 0x352de 352dc: f5 ce rjmp .-534 ; 0x350c8 block = vol_->clusterStartBlock(curCluster_); 352de: d7 01 movw r26, r14 352e0: 59 96 adiw r26, 0x19 ; 25 352e2: ed 91 ld r30, X+ 352e4: fc 91 ld r31, X 352e6: 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_);} 352e8: 14 96 adiw r26, 0x04 ; 4 352ea: 4d 90 ld r4, X+ 352ec: 5d 90 ld r5, X+ 352ee: 6d 90 ld r6, X+ 352f0: 7c 90 ld r7, X 352f2: 17 97 sbiw r26, 0x07 ; 7 352f4: b2 e0 ldi r27, 0x02 ; 2 352f6: 4b 1a sub r4, r27 352f8: 51 08 sbc r5, r1 352fa: 61 08 sbc r6, r1 352fc: 71 08 sbc r7, r1 352fe: 85 85 ldd r24, Z+13 ; 0x0d 35300: 04 c0 rjmp .+8 ; 0x3530a 35302: 44 0c add r4, r4 35304: 55 1c adc r5, r5 35306: 66 1c adc r6, r6 35308: 77 1c adc r7, r7 3530a: 8a 95 dec r24 3530c: d2 f7 brpl .-12 ; 0x35302 3530e: 86 85 ldd r24, Z+14 ; 0x0e 35310: 97 85 ldd r25, Z+15 ; 0x0f 35312: a0 89 ldd r26, Z+16 ; 0x10 35314: b1 89 ldd r27, Z+17 ; 0x11 35316: 48 0e add r4, r24 35318: 59 1e adc r5, r25 3531a: 6a 1e adc r6, r26 3531c: 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; 3531e: 81 e0 ldi r24, 0x01 ; 1 35320: 80 93 74 0e sts 0x0E74, r24 ; 0x800e74 cacheBlockNumber_ = blockNumber; 35324: 40 92 6c 0e sts 0x0E6C, r4 ; 0x800e6c 35328: 50 92 6d 0e sts 0x0E6D, r5 ; 0x800e6d 3532c: 60 92 6e 0e sts 0x0E6E, r6 ; 0x800e6e 35330: 70 92 6f 0e sts 0x0E6F, r7 ; 0x800e6f // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 35334: e8 e7 ldi r30, 0x78 ; 120 35336: fe e0 ldi r31, 0x0E ; 14 35338: 80 e0 ldi r24, 0x00 ; 0 3533a: 92 e0 ldi r25, 0x02 ; 2 3533c: df 01 movw r26, r30 3533e: 9c 01 movw r18, r24 35340: 1d 92 st X+, r1 35342: 21 50 subi r18, 0x01 ; 1 35344: 30 40 sbci r19, 0x00 ; 0 35346: e1 f7 brne .-8 ; 0x35340 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 35348: dd 24 eor r13, r13 3534a: d3 94 inc r13 3534c: d7 01 movw r26, r14 3534e: 59 96 adiw r26, 0x19 ; 25 35350: ed 91 ld r30, X+ 35352: fc 91 ld r31, X 35354: 84 81 ldd r24, Z+4 ; 0x04 35356: d8 16 cp r13, r24 35358: 98 f4 brcc .+38 ; 0x35380 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); 3535a: 28 e7 ldi r18, 0x78 ; 120 3535c: 3e e0 ldi r19, 0x0E ; 14 3535e: b3 01 movw r22, r6 35360: a2 01 movw r20, r4 35362: 4d 0d add r20, r13 35364: 51 1d adc r21, r1 35366: 61 1d adc r22, r1 35368: 71 1d adc r23, r1 3536a: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 3536e: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 35372: 0f 94 ed a5 call 0x34bda ; 0x34bda if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 35376: 88 23 and r24, r24 35378: 09 f4 brne .+2 ; 0x3537c 3537a: a6 ce rjmp .-692 ; 0x350c8 // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 3537c: d3 94 inc r13 3537e: e6 cf rjmp .-52 ; 0x3534c if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 35380: 25 85 ldd r18, Z+13 ; 0x0d 35382: 80 e0 ldi r24, 0x00 ; 0 35384: 92 e0 ldi r25, 0x02 ; 2 35386: a0 e0 ldi r26, 0x00 ; 0 35388: b0 e0 ldi r27, 0x00 ; 0 3538a: 04 c0 rjmp .+8 ; 0x35394 3538c: 88 0f add r24, r24 3538e: 99 1f adc r25, r25 35390: aa 1f adc r26, r26 35392: bb 1f adc r27, r27 35394: 2a 95 dec r18 35396: d2 f7 brpl .-12 ; 0x3538c 35398: f7 01 movw r30, r14 3539a: 41 89 ldd r20, Z+17 ; 0x11 3539c: 52 89 ldd r21, Z+18 ; 0x12 3539e: 63 89 ldd r22, Z+19 ; 0x13 353a0: 74 89 ldd r23, Z+20 ; 0x14 353a2: 84 0f add r24, r20 353a4: 95 1f adc r25, r21 353a6: a6 1f adc r26, r22 353a8: b7 1f adc r27, r23 353aa: 81 8b std Z+17, r24 ; 0x11 353ac: 92 8b std Z+18, r25 ; 0x12 353ae: a3 8b std Z+19, r26 ; 0x13 353b0: 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; 353b2: 88 e7 ldi r24, 0x78 ; 120 353b4: 9e e0 ldi r25, 0x0E ; 14 index = 0; 353b6: d1 2c mov r13, r1 353b8: db ce rjmp .-586 ; 0x35170 // 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)) { 353ba: 20 31 cpi r18, 0x10 ; 16 353bc: 61 f4 brne .+24 ; 0x353d6 if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 353be: 98 01 movw r18, r16 353c0: 2f 5e subi r18, 0xEF ; 239 353c2: 3f 4f sbci r19, 0xFF ; 255 353c4: 0f 94 e6 6c call 0x2d9cc ; 0x2d9cc 353c8: 88 23 and r24, r24 353ca: 29 f0 breq .+10 ; 0x353d6 type_ = FAT_FILE_TYPE_SUBDIR; 353cc: 84 e0 ldi r24, 0x04 ; 4 353ce: d8 01 movw r26, r16 353d0: 13 96 adiw r26, 0x03 ; 3 353d2: 8c 93 st X, r24 353d4: 44 cf rjmp .-376 ; 0x3525e curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 353d6: d8 01 movw r26, r16 353d8: 13 96 adiw r26, 0x03 ; 3 353da: 1c 92 st X, r1 353dc: 75 ce rjmp .-790 ; 0x350c8 000353de : 353de: 88 e1 ldi r24, 0x18 ; 24 353e0: 9e e0 ldi r25, 0x0E ; 14 353e2: 0f b6 in r0, 0x3f ; 63 353e4: f8 94 cli 353e6: a8 95 wdr 353e8: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 353ec: 0f be out 0x3f, r0 ; 63 353ee: 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); 353f2: 9f b7 in r25, 0x3f ; 63 353f4: f8 94 cli 353f6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 353fa: 84 60 ori r24, 0x04 ; 4 353fc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 35400: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 35402: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 35406: 4f e7 ldi r20, 0x7F ; 127 35408: 51 e7 ldi r21, 0x71 ; 113 3540a: 61 e0 ldi r22, 0x01 ; 1 3540c: 80 e0 ldi r24, 0x00 ; 0 3540e: 0e 94 ba 6f call 0xdf74 ; 0xdf74 35412: ff cf rjmp .-2 ; 0x35412 00035414 : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 35414: 60 91 53 0e lds r22, 0x0E53 ; 0x800e53 uint8_t _block_buffer_tail = block_buffer_tail; 35418: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 uint16_t sdlen = 0; 3541c: 30 e0 ldi r19, 0x00 ; 0 3541e: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 35420: 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) 35422: 96 17 cp r25, r22 35424: 61 f0 breq .+24 ; 0x3543e { sdlen += block_buffer[_block_buffer_tail].sdlen; 35426: 89 9f mul r24, r25 35428: f0 01 movw r30, r0 3542a: 11 24 eor r1, r1 3542c: e1 52 subi r30, 0x21 ; 33 3542e: f8 4f sbci r31, 0xF8 ; 248 35430: 40 81 ld r20, Z 35432: 51 81 ldd r21, Z+1 ; 0x01 35434: 24 0f add r18, r20 35436: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 35438: 9f 5f subi r25, 0xFF ; 255 3543a: 9f 70 andi r25, 0x0F ; 15 3543c: f2 cf rjmp .-28 ; 0x35422 } return sdlen; } 3543e: c9 01 movw r24, r18 35440: 08 95 ret 00035442 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 35442: 30 91 53 0e lds r19, 0x0E53 ; 0x800e53 35446: 20 91 54 0e lds r18, 0x0E54 ; 0x800e54 3544a: 32 17 cp r19, r18 3544c: 91 f0 breq .+36 ; 0x35472 // 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; 3544e: e0 91 53 0e lds r30, 0x0E53 ; 0x800e53 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 35452: e1 11 cpse r30, r1 35454: 01 c0 rjmp .+2 ; 0x35458 block_index = BLOCK_BUFFER_SIZE; 35456: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 35458: 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; 3545a: 2e e6 ldi r18, 0x6E ; 110 3545c: e2 9f mul r30, r18 3545e: f0 01 movw r30, r0 35460: 11 24 eor r1, r1 35462: e1 52 subi r30, 0x21 ; 33 35464: f8 4f sbci r31, 0xF8 ; 248 35466: 20 81 ld r18, Z 35468: 31 81 ldd r19, Z+1 ; 0x01 3546a: 82 0f add r24, r18 3546c: 93 1f adc r25, r19 3546e: 91 83 std Z+1, r25 ; 0x01 35470: 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. } } 35472: 08 95 ret 00035474 : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 35474: 8f 92 push r8 35476: 9f 92 push r9 35478: af 92 push r10 3547a: bf 92 push r11 3547c: cf 92 push r12 3547e: df 92 push r13 35480: ef 92 push r14 35482: ff 92 push r15 35484: 0f 93 push r16 35486: 1f 93 push r17 35488: cf 93 push r28 3548a: df 93 push r29 3548c: c0 91 97 02 lds r28, 0x0297 ; 0x800297 35490: d0 91 98 02 lds r29, 0x0298 ; 0x800298 35494: 8f e6 ldi r24, 0x6F ; 111 35496: e8 2e mov r14, r24 35498: 86 e0 ldi r24, 0x06 ; 6 3549a: f8 2e mov r15, r24 3549c: 0d ee ldi r16, 0xED ; 237 3549e: 17 e1 ldi r17, 0x17 ; 23 354a0: 6e 01 movw r12, r28 354a2: 80 e1 ldi r24, 0x10 ; 16 354a4: c8 0e add r12, r24 354a6: 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]; 354a8: 69 91 ld r22, Y+ 354aa: 79 91 ld r23, Y+ 354ac: 89 91 ld r24, Y+ 354ae: 99 91 ld r25, Y+ 354b0: f7 01 movw r30, r14 354b2: 81 90 ld r8, Z+ 354b4: 91 90 ld r9, Z+ 354b6: a1 90 ld r10, Z+ 354b8: b1 90 ld r11, Z+ 354ba: 7f 01 movw r14, r30 354bc: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 354c0: a5 01 movw r20, r10 354c2: 94 01 movw r18, r8 354c4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 354c8: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 354cc: f8 01 movw r30, r16 354ce: 61 93 st Z+, r22 354d0: 71 93 st Z+, r23 354d2: 81 93 st Z+, r24 354d4: 91 93 st Z+, r25 354d6: 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++) 354d8: cc 15 cp r28, r12 354da: dd 05 cpc r29, r13 354dc: 29 f7 brne .-54 ; 0x354a8 max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 354de: df 91 pop r29 354e0: cf 91 pop r28 354e2: 1f 91 pop r17 354e4: 0f 91 pop r16 354e6: ff 90 pop r15 354e8: ef 90 pop r14 354ea: df 90 pop r13 354ec: cf 90 pop r12 354ee: bf 90 pop r11 354f0: af 90 pop r10 354f2: 9f 90 pop r9 354f4: 8f 90 pop r8 354f6: 08 95 ret 000354f8 : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 354f8: 80 91 69 06 lds r24, 0x0669 ; 0x800669 354fc: 81 11 cpse r24, r1 354fe: 0e c0 rjmp .+28 ; 0x3551c { max_feedrate = cs.max_feedrate_normal; 35500: 8f e7 ldi r24, 0x7F ; 127 35502: 96 e0 ldi r25, 0x06 ; 6 35504: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 35508: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 3550c: 8f e8 ldi r24, 0x8F ; 143 3550e: 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; 35510: 90 93 98 02 sts 0x0298, r25 ; 0x800298 35514: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } reset_acceleration_rates(); 35518: 0d 94 3a aa jmp 0x35474 ; 0x35474 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) 3551c: 81 30 cpi r24, 0x01 ; 1 3551e: e1 f7 brne .-8 ; 0x35518 { max_feedrate = cs.max_feedrate_silent; 35520: 87 e0 ldi r24, 0x07 ; 7 35522: 97 e0 ldi r25, 0x07 ; 7 35524: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 35528: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 3552c: 87 e1 ldi r24, 0x17 ; 23 3552e: 97 e0 ldi r25, 0x07 ; 7 35530: ef cf rjmp .-34 ; 0x35510 00035532 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35532: fc 01 movw r30, r24 35534: 40 81 ld r20, Z 35536: 51 81 ldd r21, Z+1 ; 0x01 35538: 62 81 ldd r22, Z+2 ; 0x02 3553a: 73 81 ldd r23, Z+3 ; 0x03 3553c: 40 93 d9 04 sts 0x04D9, r20 ; 0x8004d9 35540: 50 93 da 04 sts 0x04DA, r21 ; 0x8004da 35544: 60 93 db 04 sts 0x04DB, r22 ; 0x8004db 35548: 70 93 dc 04 sts 0x04DC, r23 ; 0x8004dc #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 3554c: 20 91 7b 06 lds r18, 0x067B ; 0x80067b 35550: 30 91 7c 06 lds r19, 0x067C ; 0x80067c 35554: 40 91 7d 06 lds r20, 0x067D ; 0x80067d 35558: 50 91 7e 06 lds r21, 0x067E ; 0x80067e 3555c: 60 81 ld r22, Z 3555e: 71 81 ldd r23, Z+1 ; 0x01 35560: 82 81 ldd r24, Z+2 ; 0x02 35562: 93 81 ldd r25, Z+3 ; 0x03 35564: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 35568: 0f 94 ab e1 call 0x3c356 ; 0x3c356 3556c: e1 e5 ldi r30, 0x51 ; 81 3556e: f7 e0 ldi r31, 0x07 ; 7 35570: 64 87 std Z+12, r22 ; 0x0c 35572: 75 87 std Z+13, r23 ; 0x0d 35574: 86 87 std Z+14, r24 ; 0x0e 35576: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 35578: 8f b7 in r24, 0x3f ; 63 3557a: f8 94 cli count_position[E_AXIS] = e; 3557c: 44 85 ldd r20, Z+12 ; 0x0c 3557e: 55 85 ldd r21, Z+13 ; 0x0d 35580: 66 85 ldd r22, Z+14 ; 0x0e 35582: 77 85 ldd r23, Z+15 ; 0x0f 35584: 40 93 6d 07 sts 0x076D, r20 ; 0x80076d 35588: 50 93 6e 07 sts 0x076E, r21 ; 0x80076e 3558c: 60 93 6f 07 sts 0x076F, r22 ; 0x80076f 35590: 70 93 70 07 sts 0x0770, r23 ; 0x800770 CRITICAL_SECTION_END; 35594: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 35596: 08 95 ret 00035598 : // 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; 35598: fc 01 movw r30, r24 3559a: 40 81 ld r20, Z 3559c: 51 81 ldd r21, Z+1 ; 0x01 3559e: 62 81 ldd r22, Z+2 ; 0x02 355a0: 73 81 ldd r23, Z+3 ; 0x03 355a2: 40 93 d5 04 sts 0x04D5, r20 ; 0x8004d5 355a6: 50 93 d6 04 sts 0x04D6, r21 ; 0x8004d6 355aa: 60 93 d7 04 sts 0x04D7, r22 ; 0x8004d7 355ae: 70 93 d8 04 sts 0x04D8, r23 ; 0x8004d8 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 355b2: 20 91 77 06 lds r18, 0x0677 ; 0x800677 355b6: 30 91 78 06 lds r19, 0x0678 ; 0x800678 355ba: 40 91 79 06 lds r20, 0x0679 ; 0x800679 355be: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 355c2: 60 81 ld r22, Z 355c4: 71 81 ldd r23, Z+1 ; 0x01 355c6: 82 81 ldd r24, Z+2 ; 0x02 355c8: 93 81 ldd r25, Z+3 ; 0x03 355ca: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 355ce: 0f 94 ab e1 call 0x3c356 ; 0x3c356 355d2: 60 93 59 07 sts 0x0759, r22 ; 0x800759 355d6: 70 93 5a 07 sts 0x075A, r23 ; 0x80075a 355da: 80 93 5b 07 sts 0x075B, r24 ; 0x80075b 355de: 90 93 5c 07 sts 0x075C, r25 ; 0x80075c st_set_position(position); 355e2: 0d 94 72 87 jmp 0x30ee4 ; 0x30ee4 000355e6 : // 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) { 355e6: 2f 92 push r2 355e8: 3f 92 push r3 355ea: 4f 92 push r4 355ec: 5f 92 push r5 355ee: 6f 92 push r6 355f0: 7f 92 push r7 355f2: 8f 92 push r8 355f4: 9f 92 push r9 355f6: af 92 push r10 355f8: bf 92 push r11 355fa: cf 92 push r12 355fc: df 92 push r13 355fe: ef 92 push r14 35600: ff 92 push r15 35602: 0f 93 push r16 35604: 1f 93 push r17 35606: cf 93 push r28 35608: df 93 push r29 3560a: cd b7 in r28, 0x3d ; 61 3560c: de b7 in r29, 0x3e ; 62 3560e: c5 58 subi r28, 0x85 ; 133 35610: d1 09 sbc r29, r1 35612: 0f b6 in r0, 0x3f ; 63 35614: f8 94 cli 35616: de bf out 0x3e, r29 ; 62 35618: 0f be out 0x3f, r0 ; 63 3561a: cd bf out 0x3d, r28 ; 61 3561c: 69 a3 std Y+33, r22 ; 0x21 3561e: 7a a3 std Y+34, r23 ; 0x22 35620: 8b a3 std Y+35, r24 ; 0x23 35622: 9c a3 std Y+36, r25 ; 0x24 35624: 2d a3 std Y+37, r18 ; 0x25 35626: 3e a3 std Y+38, r19 ; 0x26 35628: 4f a3 std Y+39, r20 ; 0x27 3562a: 58 a7 std Y+40, r21 ; 0x28 3562c: a8 96 adiw r28, 0x28 ; 40 3562e: ec ae std Y+60, r14 ; 0x3c 35630: fd ae std Y+61, r15 ; 0x3d 35632: 0e af std Y+62, r16 ; 0x3e 35634: 1f af std Y+63, r17 ; 0x3f 35636: a8 97 sbiw r28, 0x28 ; 40 35638: aa 96 adiw r28, 0x2a ; 42 3563a: df ae std Y+63, r13 ; 0x3f 3563c: ce ae std Y+62, r12 ; 0x3e 3563e: aa 97 sbiw r28, 0x2a ; 42 35640: 89 aa std Y+49, r8 ; 0x31 35642: 99 ae std Y+57, r9 ; 0x39 35644: ad ae std Y+61, r10 ; 0x3d 35646: bd aa std Y+53, r11 ; 0x35 35648: c5 56 subi r28, 0x65 ; 101 3564a: df 4f sbci r29, 0xFF ; 255 3564c: 08 81 ld r16, Y 3564e: 19 81 ldd r17, Y+1 ; 0x01 35650: cb 59 subi r28, 0x9B ; 155 35652: 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); 35654: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 static bool plan_reset_next_e_sched; // Returns the index of the next block in the ring buffer // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication. static inline uint8_t next_block_index(uint8_t block_index) { if (++ block_index == BLOCK_BUFFER_SIZE) 35658: 8f 5f subi r24, 0xFF ; 255 3565a: a1 96 adiw r28, 0x21 ; 33 3565c: 8f af std Y+63, r24 ; 0x3f 3565e: a1 97 sbiw r28, 0x21 ; 33 35660: 80 31 cpi r24, 0x10 ; 16 35662: 19 f4 brne .+6 ; 0x3566a block_index = 0; 35664: a1 96 adiw r28, 0x21 ; 33 35666: 1f ae std Y+63, r1 ; 0x3f 35668: 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) { 3566a: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 3566e: a1 96 adiw r28, 0x21 ; 33 35670: 2f ad ldd r18, Y+63 ; 0x3f 35672: a1 97 sbiw r28, 0x21 ; 33 35674: 82 13 cpse r24, r18 35676: 0f c0 rjmp .+30 ; 0x35696 do { manage_heater(); 35678: 0f 94 6c 4e call 0x29cd8 ; 0x29cd8 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 3567c: 80 e0 ldi r24, 0x00 ; 0 3567e: 0e 94 f3 8b call 0x117e6 ; 0x117e6 lcd_update(0); 35682: 80 e0 ldi r24, 0x00 ; 0 35684: 0e 94 6d 6f call 0xdeda ; 0xdeda } while (block_buffer_tail == next_buffer_head); 35688: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 3568c: a1 96 adiw r28, 0x21 ; 33 3568e: 3f ad ldd r19, Y+63 ; 0x3f 35690: a1 97 sbiw r28, 0x21 ; 33 35692: 83 17 cp r24, r19 35694: 89 f3 breq .-30 ; 0x35678 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 35696: 40 91 5a 0e lds r20, 0x0E5A ; 0x800e5a 3569a: a2 96 adiw r28, 0x22 ; 34 3569c: 4f af std Y+63, r20 ; 0x3f 3569e: a2 97 sbiw r28, 0x22 ; 34 356a0: 44 23 and r20, r20 356a2: 11 f1 breq .+68 ; 0x356e8 // avoid planning the block early if aborted SERIAL_ECHO_START; 356a4: 84 e1 ldi r24, 0x14 ; 20 356a6: 9a ea ldi r25, 0xAA ; 170 356a8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(_n("Move aborted")); 356ac: 82 e7 ldi r24, 0x72 ; 114 356ae: 91 e7 ldi r25, 0x71 ; 113 356b0: 0e 94 17 7b call 0xf62e ; 0xf62e // 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(); } 356b4: cb 57 subi r28, 0x7B ; 123 356b6: df 4f sbci r29, 0xFF ; 255 356b8: 0f b6 in r0, 0x3f ; 63 356ba: f8 94 cli 356bc: de bf out 0x3e, r29 ; 62 356be: 0f be out 0x3f, r0 ; 63 356c0: cd bf out 0x3d, r28 ; 61 356c2: df 91 pop r29 356c4: cf 91 pop r28 356c6: 1f 91 pop r17 356c8: 0f 91 pop r16 356ca: ff 90 pop r15 356cc: ef 90 pop r14 356ce: df 90 pop r13 356d0: cf 90 pop r12 356d2: bf 90 pop r11 356d4: af 90 pop r10 356d6: 9f 90 pop r9 356d8: 8f 90 pop r8 356da: 7f 90 pop r7 356dc: 6f 90 pop r6 356de: 5f 90 pop r5 356e0: 4f 90 pop r4 356e2: 3f 90 pop r3 356e4: 2f 90 pop r2 356e6: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 356e8: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 356ec: 29 2e mov r2, r25 356ee: 31 2c mov r3, r1 356f0: 8e e6 ldi r24, 0x6E ; 110 356f2: 98 9f mul r25, r24 356f4: d0 01 movw r26, r0 356f6: 11 24 eor r1, r1 356f8: a4 96 adiw r28, 0x24 ; 36 356fa: bf af std Y+63, r27 ; 0x3f 356fc: ae af std Y+62, r26 ; 0x3e 356fe: 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; 35700: cd 01 movw r24, r26 35702: 8d 58 subi r24, 0x8D ; 141 35704: 98 4f sbci r25, 0xF8 ; 248 35706: fc 01 movw r30, r24 35708: e9 5b subi r30, 0xB9 ; 185 3570a: ff 4f sbci r31, 0xFF ; 255 3570c: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 3570e: 84 59 subi r24, 0x94 ; 148 35710: 9f 4f sbci r25, 0xFF ; 255 35712: fc 01 movw r30, r24 35714: 11 82 std Z+1, r1 ; 0x01 35716: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 35718: 01 15 cp r16, r1 3571a: 11 05 cpc r17, r1 3571c: 11 f4 brne .+4 ; 0x35722 3571e: 0d 94 e7 b5 jmp 0x36bce ; 0x36bce memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 35722: 80 e1 ldi r24, 0x10 ; 16 35724: f8 01 movw r30, r16 35726: a5 53 subi r26, 0x35 ; 53 35728: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 3572a: 01 90 ld r0, Z+ 3572c: 0d 92 st X+, r0 3572e: 8a 95 dec r24 35730: e1 f7 brne .-8 ; 0x3572a // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 35732: 8e e6 ldi r24, 0x6E ; 110 35734: 82 9d mul r24, r2 35736: 80 01 movw r16, r0 35738: 83 9d mul r24, r3 3573a: 10 0d add r17, r0 3573c: 11 24 eor r1, r1 3573e: 0d 58 subi r16, 0x8D ; 141 35740: 18 4f sbci r17, 0xF8 ; 248 35742: f8 01 movw r30, r16 35744: e8 59 subi r30, 0x98 ; 152 35746: ff 4f sbci r31, 0xFF ; 255 35748: c3 56 subi r28, 0x63 ; 99 3574a: df 4f sbci r29, 0xFF ; 255 3574c: 88 81 ld r24, Y 3574e: 99 81 ldd r25, Y+1 ; 0x01 35750: cd 59 subi r28, 0x9D ; 157 35752: d0 40 sbci r29, 0x00 ; 0 35754: 91 83 std Z+1, r25 ; 0x01 35756: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 35758: 06 59 subi r16, 0x96 ; 150 3575a: 1f 4f sbci r17, 0xFF ; 255 3575c: 60 91 90 02 lds r22, 0x0290 ; 0x800290 35760: 70 91 91 02 lds r23, 0x0291 ; 0x800291 35764: 80 91 92 02 lds r24, 0x0292 ; 0x800292 35768: 90 91 93 02 lds r25, 0x0293 ; 0x800293 3576c: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 35770: d8 01 movw r26, r16 35772: 6d 93 st X+, r22 35774: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 35776: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.504> 3577a: 88 23 and r24, r24 3577c: a9 f0 breq .+42 ; 0x357a8 { position[E_AXIS] = 0; 3577e: 10 92 5d 07 sts 0x075D, r1 ; 0x80075d 35782: 10 92 5e 07 sts 0x075E, r1 ; 0x80075e 35786: 10 92 5f 07 sts 0x075F, r1 ; 0x80075f 3578a: 10 92 60 07 sts 0x0760, r1 ; 0x800760 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 3578e: 10 92 d9 04 sts 0x04D9, r1 ; 0x8004d9 35792: 10 92 da 04 sts 0x04DA, r1 ; 0x8004da 35796: 10 92 db 04 sts 0x04DB, r1 ; 0x8004db 3579a: 10 92 dc 04 sts 0x04DC, r1 ; 0x8004dc #endif // the block might still be discarded later, but we need to ensure the lower-level // count_position is also reset correctly for consistent results! plan_reset_next_e_queue = false; 3579e: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.504> plan_reset_next_e_sched = true; 357a2: 81 e0 ldi r24, 0x01 ; 1 357a4: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.505> } // Apply the machine correction matrix. world2machine(x, y); 357a8: be 01 movw r22, r28 357aa: 6b 5d subi r22, 0xDB ; 219 357ac: 7f 4f sbci r23, 0xFF ; 255 357ae: ce 01 movw r24, r28 357b0: 81 96 adiw r24, 0x21 ; 33 357b2: 0e 94 c8 6a call 0xd590 ; 0xd590 // 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]); 357b6: c9 a0 ldd r12, Y+33 ; 0x21 357b8: da a0 ldd r13, Y+34 ; 0x22 357ba: eb a0 ldd r14, Y+35 ; 0x23 357bc: fc a0 ldd r15, Y+36 ; 0x24 357be: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 357c2: 30 91 70 06 lds r19, 0x0670 ; 0x800670 357c6: 40 91 71 06 lds r20, 0x0671 ; 0x800671 357ca: 50 91 72 06 lds r21, 0x0672 ; 0x800672 357ce: c7 01 movw r24, r14 357d0: b6 01 movw r22, r12 357d2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 357d6: 0f 94 ab e1 call 0x3c356 ; 0x3c356 357da: c2 58 subi r28, 0x82 ; 130 357dc: df 4f sbci r29, 0xFF ; 255 357de: 68 83 st Y, r22 357e0: 79 83 std Y+1, r23 ; 0x01 357e2: 8a 83 std Y+2, r24 ; 0x02 357e4: 9b 83 std Y+3, r25 ; 0x03 357e6: ce 57 subi r28, 0x7E ; 126 357e8: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 357ea: 8d a0 ldd r8, Y+37 ; 0x25 357ec: 9e a0 ldd r9, Y+38 ; 0x26 357ee: af a0 ldd r10, Y+39 ; 0x27 357f0: b8 a4 ldd r11, Y+40 ; 0x28 357f2: 20 91 73 06 lds r18, 0x0673 ; 0x800673 357f6: 30 91 74 06 lds r19, 0x0674 ; 0x800674 357fa: 40 91 75 06 lds r20, 0x0675 ; 0x800675 357fe: 50 91 76 06 lds r21, 0x0676 ; 0x800676 35802: c5 01 movw r24, r10 35804: b4 01 movw r22, r8 35806: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3580a: 0f 94 ab e1 call 0x3c356 ; 0x3c356 3580e: ce 57 subi r28, 0x7E ; 126 35810: df 4f sbci r29, 0xFF ; 255 35812: 68 83 st Y, r22 35814: 79 83 std Y+1, r23 ; 0x01 35816: 8a 83 std Y+2, r24 ; 0x02 35818: 9b 83 std Y+3, r25 ; 0x03 3581a: c2 58 subi r28, 0x82 ; 130 3581c: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 3581e: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 35822: 88 23 and r24, r24 35824: 11 f4 brne .+4 ; 0x3582a 35826: 0d 94 ee b5 jmp 0x36bdc ; 0x36bdc target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 3582a: a5 01 movw r20, r10 3582c: 94 01 movw r18, r8 3582e: c7 01 movw r24, r14 35830: b6 01 movw r22, r12 35832: 0f 94 08 96 call 0x32c10 ; 0x32c10 35836: a8 96 adiw r28, 0x28 ; 40 35838: 2c ad ldd r18, Y+60 ; 0x3c 3583a: 3d ad ldd r19, Y+61 ; 0x3d 3583c: 4e ad ldd r20, Y+62 ; 0x3e 3583e: 5f ad ldd r21, Y+63 ; 0x3f 35840: a8 97 sbiw r28, 0x28 ; 40 35842: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 35846: 20 91 77 06 lds r18, 0x0677 ; 0x800677 3584a: 30 91 78 06 lds r19, 0x0678 ; 0x800678 3584e: 40 91 79 06 lds r20, 0x0679 ; 0x800679 35852: 50 91 7a 06 lds r21, 0x067A ; 0x80067a }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 35856: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3585a: 0f 94 ab e1 call 0x3c356 ; 0x3c356 3585e: e6 96 adiw r28, 0x36 ; 54 35860: 6c af std Y+60, r22 ; 0x3c 35862: 7d af std Y+61, r23 ; 0x3d 35864: 8e af std Y+62, r24 ; 0x3e 35866: 9f af std Y+63, r25 ; 0x3f 35868: 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]); 3586a: aa 96 adiw r28, 0x2a ; 42 3586c: ee ad ldd r30, Y+62 ; 0x3e 3586e: ff ad ldd r31, Y+63 ; 0x3f 35870: aa 97 sbiw r28, 0x2a ; 42 35872: 80 80 ld r8, Z 35874: 91 80 ldd r9, Z+1 ; 0x01 35876: a2 80 ldd r10, Z+2 ; 0x02 35878: b3 80 ldd r11, Z+3 ; 0x03 3587a: 20 91 7b 06 lds r18, 0x067B ; 0x80067b 3587e: 30 91 7c 06 lds r19, 0x067C ; 0x80067c 35882: 40 91 7d 06 lds r20, 0x067D ; 0x80067d 35886: 50 91 7e 06 lds r21, 0x067E ; 0x80067e 3588a: c5 01 movw r24, r10 3588c: b4 01 movw r22, r8 3588e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 35892: 0f 94 ab e1 call 0x3c356 ; 0x3c356 35896: ae 96 adiw r28, 0x2e ; 46 35898: 6c af std Y+60, r22 ; 0x3c 3589a: 7d af std Y+61, r23 ; 0x3d 3589c: 8e af std Y+62, r24 ; 0x3e 3589e: 9f af std Y+63, r25 ; 0x3f 358a0: 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]; 358a2: 80 91 5d 07 lds r24, 0x075D ; 0x80075d 358a6: 90 91 5e 07 lds r25, 0x075E ; 0x80075e 358aa: a0 91 5f 07 lds r26, 0x075F ; 0x80075f 358ae: b0 91 60 07 lds r27, 0x0760 ; 0x800760 358b2: ae 96 adiw r28, 0x2e ; 46 358b4: 4c ac ldd r4, Y+60 ; 0x3c 358b6: 5d ac ldd r5, Y+61 ; 0x3d 358b8: 6e ac ldd r6, Y+62 ; 0x3e 358ba: 7f ac ldd r7, Y+63 ; 0x3f 358bc: ae 97 sbiw r28, 0x2e ; 46 358be: 48 1a sub r4, r24 358c0: 59 0a sbc r5, r25 358c2: 6a 0a sbc r6, r26 358c4: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 358c6: 80 91 51 07 lds r24, 0x0751 ; 0x800751 358ca: 90 91 52 07 lds r25, 0x0752 ; 0x800752 358ce: a0 91 53 07 lds r26, 0x0753 ; 0x800753 358d2: b0 91 54 07 lds r27, 0x0754 ; 0x800754 358d6: c2 58 subi r28, 0x82 ; 130 358d8: df 4f sbci r29, 0xFF ; 255 358da: c8 80 ld r12, Y 358dc: d9 80 ldd r13, Y+1 ; 0x01 358de: ea 80 ldd r14, Y+2 ; 0x02 358e0: fb 80 ldd r15, Y+3 ; 0x03 358e2: ce 57 subi r28, 0x7E ; 126 358e4: d0 40 sbci r29, 0x00 ; 0 358e6: c8 1a sub r12, r24 358e8: d9 0a sbc r13, r25 358ea: ea 0a sbc r14, r26 358ec: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 358ee: 80 91 55 07 lds r24, 0x0755 ; 0x800755 358f2: 90 91 56 07 lds r25, 0x0756 ; 0x800756 358f6: a0 91 57 07 lds r26, 0x0757 ; 0x800757 358fa: b0 91 58 07 lds r27, 0x0758 ; 0x800758 358fe: ce 57 subi r28, 0x7E ; 126 35900: df 4f sbci r29, 0xFF ; 255 35902: 28 81 ld r18, Y 35904: 39 81 ldd r19, Y+1 ; 0x01 35906: 4a 81 ldd r20, Y+2 ; 0x02 35908: 5b 81 ldd r21, Y+3 ; 0x03 3590a: c2 58 subi r28, 0x82 ; 130 3590c: d0 40 sbci r29, 0x00 ; 0 3590e: 28 1b sub r18, r24 35910: 39 0b sbc r19, r25 35912: 4a 0b sbc r20, r26 35914: 5b 0b sbc r21, r27 35916: 29 a7 std Y+41, r18 ; 0x29 35918: 3a a7 std Y+42, r19 ; 0x2a 3591a: 4b a7 std Y+43, r20 ; 0x2b 3591c: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 3591e: 80 91 59 07 lds r24, 0x0759 ; 0x800759 35922: 90 91 5a 07 lds r25, 0x075A ; 0x80075a 35926: a0 91 5b 07 lds r26, 0x075B ; 0x80075b 3592a: b0 91 5c 07 lds r27, 0x075C ; 0x80075c 3592e: e6 96 adiw r28, 0x36 ; 54 35930: 2c ad ldd r18, Y+60 ; 0x3c 35932: 3d ad ldd r19, Y+61 ; 0x3d 35934: 4e ad ldd r20, Y+62 ; 0x3e 35936: 5f ad ldd r21, Y+63 ; 0x3f 35938: e6 97 sbiw r28, 0x36 ; 54 3593a: 28 1b sub r18, r24 3593c: 39 0b sbc r19, r25 3593e: 4a 0b sbc r20, r26 35940: 5b 0b sbc r21, r27 35942: 2d a7 std Y+45, r18 ; 0x2d 35944: 3e a7 std Y+46, r19 ; 0x2e 35946: 4f a7 std Y+47, r20 ; 0x2f 35948: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 3594a: 41 14 cp r4, r1 3594c: 51 04 cpc r5, r1 3594e: 61 04 cpc r6, r1 35950: 71 04 cpc r7, r1 35952: 09 f4 brne .+2 ; 0x35956 35954: 80 c0 rjmp .+256 ; 0x35a56 { if((int)degHotend(active_extruder) 3595a: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 3595e: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 35962: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 35966: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 3596a: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 3596e: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 35972: 62 17 cp r22, r18 35974: 73 07 cpc r23, r19 35976: 0c f5 brge .+66 ; 0x359ba { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 35978: ae 96 adiw r28, 0x2e ; 46 3597a: 8c ad ldd r24, Y+60 ; 0x3c 3597c: 9d ad ldd r25, Y+61 ; 0x3d 3597e: ae ad ldd r26, Y+62 ; 0x3e 35980: bf ad ldd r27, Y+63 ; 0x3f 35982: ae 97 sbiw r28, 0x2e ; 46 35984: 80 93 5d 07 sts 0x075D, r24 ; 0x80075d 35988: 90 93 5e 07 sts 0x075E, r25 ; 0x80075e 3598c: a0 93 5f 07 sts 0x075F, r26 ; 0x80075f 35990: b0 93 60 07 sts 0x0760, r27 ; 0x800760 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35994: 80 92 d9 04 sts 0x04D9, r8 ; 0x8004d9 35998: 90 92 da 04 sts 0x04DA, r9 ; 0x8004da 3599c: a0 92 db 04 sts 0x04DB, r10 ; 0x8004db 359a0: b0 92 dc 04 sts 0x04DC, r11 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 359a4: 84 e1 ldi r24, 0x14 ; 20 359a6: 9a ea ldi r25, 0xAA ; 170 359a8: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 359ac: 88 e5 ldi r24, 0x58 ; 88 359ae: 91 e7 ldi r25, 0x71 ; 113 359b0: 0e 94 17 7b call 0xf62e ; 0xf62e { 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 359b4: 41 2c mov r4, r1 359b6: 51 2c mov r5, r1 359b8: 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) 359ba: c3 01 movw r24, r6 359bc: b2 01 movw r22, r4 359be: 77 fe sbrs r7, 7 359c0: 07 c0 rjmp .+14 ; 0x359d0 359c2: 66 27 eor r22, r22 359c4: 77 27 eor r23, r23 359c6: cb 01 movw r24, r22 359c8: 64 19 sub r22, r4 359ca: 75 09 sbc r23, r5 359cc: 86 09 sbc r24, r6 359ce: 97 09 sbc r25, r7 359d0: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 359d4: 4b 01 movw r8, r22 359d6: 5c 01 movw r10, r24 359d8: 20 e0 ldi r18, 0x00 ; 0 359da: 30 ec ldi r19, 0xC0 ; 192 359dc: 4b ee ldi r20, 0xEB ; 235 359de: 53 e4 ldi r21, 0x43 ; 67 359e0: 60 91 7b 06 lds r22, 0x067B ; 0x80067b 359e4: 70 91 7c 06 lds r23, 0x067C ; 0x80067c 359e8: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 359ec: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 359f0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 359f4: 9b 01 movw r18, r22 359f6: ac 01 movw r20, r24 359f8: c5 01 movw r24, r10 359fa: b4 01 movw r22, r8 359fc: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 35a00: 18 16 cp r1, r24 35a02: 4c f5 brge .+82 ; 0x35a56 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 35a04: ae 96 adiw r28, 0x2e ; 46 35a06: 2c ad ldd r18, Y+60 ; 0x3c 35a08: 3d ad ldd r19, Y+61 ; 0x3d 35a0a: 4e ad ldd r20, Y+62 ; 0x3e 35a0c: 5f ad ldd r21, Y+63 ; 0x3f 35a0e: ae 97 sbiw r28, 0x2e ; 46 35a10: 20 93 5d 07 sts 0x075D, r18 ; 0x80075d 35a14: 30 93 5e 07 sts 0x075E, r19 ; 0x80075e 35a18: 40 93 5f 07 sts 0x075F, r20 ; 0x80075f 35a1c: 50 93 60 07 sts 0x0760, r21 ; 0x800760 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35a20: aa 96 adiw r28, 0x2a ; 42 35a22: ee ad ldd r30, Y+62 ; 0x3e 35a24: ff ad ldd r31, Y+63 ; 0x3f 35a26: aa 97 sbiw r28, 0x2a ; 42 35a28: 80 81 ld r24, Z 35a2a: 91 81 ldd r25, Z+1 ; 0x01 35a2c: a2 81 ldd r26, Z+2 ; 0x02 35a2e: b3 81 ldd r27, Z+3 ; 0x03 35a30: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 35a34: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 35a38: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 35a3c: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 35a40: 84 e1 ldi r24, 0x14 ; 20 35a42: 9a ea ldi r25, 0xAA ; 170 35a44: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 35a48: 8a e3 ldi r24, 0x3A ; 58 35a4a: 91 e7 ldi r25, 0x71 ; 113 35a4c: 0e 94 17 7b call 0xf62e ; 0xf62e { 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 35a50: 41 2c mov r4, r1 35a52: 51 2c mov r5, r1 35a54: 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); 35a56: 8e e6 ldi r24, 0x6E ; 110 35a58: 82 9d mul r24, r2 35a5a: f0 01 movw r30, r0 35a5c: 83 9d mul r24, r3 35a5e: f0 0d add r31, r0 35a60: 11 24 eor r1, r1 35a62: ed 58 subi r30, 0x8D ; 141 35a64: f8 4f sbci r31, 0xF8 ; 248 35a66: d7 01 movw r26, r14 35a68: c6 01 movw r24, r12 35a6a: f7 fe sbrs r15, 7 35a6c: 07 c0 rjmp .+14 ; 0x35a7c 35a6e: 88 27 eor r24, r24 35a70: 99 27 eor r25, r25 35a72: dc 01 movw r26, r24 35a74: 8c 19 sub r24, r12 35a76: 9d 09 sbc r25, r13 35a78: ae 09 sbc r26, r14 35a7a: bf 09 sbc r27, r15 35a7c: 80 83 st Z, r24 35a7e: 91 83 std Z+1, r25 ; 0x01 35a80: a2 83 std Z+2, r26 ; 0x02 35a82: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 35a84: 8e e6 ldi r24, 0x6E ; 110 35a86: 82 9d mul r24, r2 35a88: f0 01 movw r30, r0 35a8a: 83 9d mul r24, r3 35a8c: f0 0d add r31, r0 35a8e: 11 24 eor r1, r1 35a90: ed 58 subi r30, 0x8D ; 141 35a92: f8 4f sbci r31, 0xF8 ; 248 35a94: 89 a5 ldd r24, Y+41 ; 0x29 35a96: 9a a5 ldd r25, Y+42 ; 0x2a 35a98: ab a5 ldd r26, Y+43 ; 0x2b 35a9a: bc a5 ldd r27, Y+44 ; 0x2c 35a9c: b7 ff sbrs r27, 7 35a9e: 07 c0 rjmp .+14 ; 0x35aae 35aa0: b0 95 com r27 35aa2: a0 95 com r26 35aa4: 90 95 com r25 35aa6: 81 95 neg r24 35aa8: 9f 4f sbci r25, 0xFF ; 255 35aaa: af 4f sbci r26, 0xFF ; 255 35aac: bf 4f sbci r27, 0xFF ; 255 35aae: 84 83 std Z+4, r24 ; 0x04 35ab0: 95 83 std Z+5, r25 ; 0x05 35ab2: a6 83 std Z+6, r26 ; 0x06 35ab4: 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); 35ab6: 8e e6 ldi r24, 0x6E ; 110 35ab8: 82 9d mul r24, r2 35aba: f0 01 movw r30, r0 35abc: 83 9d mul r24, r3 35abe: f0 0d add r31, r0 35ac0: 11 24 eor r1, r1 35ac2: ed 58 subi r30, 0x8D ; 141 35ac4: f8 4f sbci r31, 0xF8 ; 248 35ac6: 8d a5 ldd r24, Y+45 ; 0x2d 35ac8: 9e a5 ldd r25, Y+46 ; 0x2e 35aca: af a5 ldd r26, Y+47 ; 0x2f 35acc: b8 a9 ldd r27, Y+48 ; 0x30 35ace: b7 ff sbrs r27, 7 35ad0: 07 c0 rjmp .+14 ; 0x35ae0 35ad2: b0 95 com r27 35ad4: a0 95 com r26 35ad6: 90 95 com r25 35ad8: 81 95 neg r24 35ada: 9f 4f sbci r25, 0xFF ; 255 35adc: af 4f sbci r26, 0xFF ; 255 35ade: bf 4f sbci r27, 0xFF ; 255 35ae0: 80 87 std Z+8, r24 ; 0x08 35ae2: 91 87 std Z+9, r25 ; 0x09 35ae4: a2 87 std Z+10, r26 ; 0x0a 35ae6: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 35ae8: b3 01 movw r22, r6 35aea: a2 01 movw r20, r4 35aec: 77 fe sbrs r7, 7 35aee: 07 c0 rjmp .+14 ; 0x35afe 35af0: 44 27 eor r20, r20 35af2: 55 27 eor r21, r21 35af4: ba 01 movw r22, r20 35af6: 44 19 sub r20, r4 35af8: 55 09 sbc r21, r5 35afa: 66 09 sbc r22, r6 35afc: 77 09 sbc r23, r7 35afe: 8e e6 ldi r24, 0x6E ; 110 35b00: 82 9d mul r24, r2 35b02: f0 01 movw r30, r0 35b04: 83 9d mul r24, r3 35b06: f0 0d add r31, r0 35b08: 11 24 eor r1, r1 35b0a: ed 58 subi r30, 0x8D ; 141 35b0c: f8 4f sbci r31, 0xF8 ; 248 35b0e: 44 87 std Z+12, r20 ; 0x0c 35b10: 55 87 std Z+13, r21 ; 0x0d 35b12: 66 87 std Z+14, r22 ; 0x0e 35b14: 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))); 35b16: 00 81 ld r16, Z 35b18: 11 81 ldd r17, Z+1 ; 0x01 35b1a: 22 81 ldd r18, Z+2 ; 0x02 35b1c: 33 81 ldd r19, Z+3 ; 0x03 35b1e: 84 81 ldd r24, Z+4 ; 0x04 35b20: 95 81 ldd r25, Z+5 ; 0x05 35b22: a6 81 ldd r26, Z+6 ; 0x06 35b24: b7 81 ldd r27, Z+7 ; 0x07 35b26: 80 17 cp r24, r16 35b28: 91 07 cpc r25, r17 35b2a: a2 07 cpc r26, r18 35b2c: b3 07 cpc r27, r19 35b2e: 14 f4 brge .+4 ; 0x35b34 35b30: d9 01 movw r26, r18 35b32: c8 01 movw r24, r16 35b34: ee e6 ldi r30, 0x6E ; 110 35b36: be 2e mov r11, r30 35b38: b2 9c mul r11, r2 35b3a: f0 01 movw r30, r0 35b3c: b3 9c mul r11, r3 35b3e: f0 0d add r31, r0 35b40: 11 24 eor r1, r1 35b42: ed 58 subi r30, 0x8D ; 141 35b44: f8 4f sbci r31, 0xF8 ; 248 35b46: 80 84 ldd r8, Z+8 ; 0x08 35b48: 91 84 ldd r9, Z+9 ; 0x09 35b4a: a2 84 ldd r10, Z+10 ; 0x0a 35b4c: b3 84 ldd r11, Z+11 ; 0x0b 35b4e: 88 15 cp r24, r8 35b50: 99 05 cpc r25, r9 35b52: aa 05 cpc r26, r10 35b54: bb 05 cpc r27, r11 35b56: 14 f4 brge .+4 ; 0x35b5c 35b58: d5 01 movw r26, r10 35b5a: c4 01 movw r24, r8 35b5c: 84 17 cp r24, r20 35b5e: 95 07 cpc r25, r21 35b60: a6 07 cpc r26, r22 35b62: b7 07 cpc r27, r23 35b64: 14 f4 brge .+4 ; 0x35b6a 35b66: db 01 movw r26, r22 35b68: ca 01 movw r24, r20 35b6a: 4e e6 ldi r20, 0x6E ; 110 35b6c: 42 9d mul r20, r2 35b6e: f0 01 movw r30, r0 35b70: 43 9d mul r20, r3 35b72: f0 0d add r31, r0 35b74: 11 24 eor r1, r1 35b76: ed 58 subi r30, 0x8D ; 141 35b78: f8 4f sbci r31, 0xF8 ; 248 35b7a: 80 8b std Z+16, r24 ; 0x10 35b7c: 91 8b std Z+17, r25 ; 0x11 35b7e: a2 8b std Z+18, r26 ; 0x12 35b80: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 35b82: 06 97 sbiw r24, 0x06 ; 6 35b84: a1 05 cpc r26, r1 35b86: b1 05 cpc r27, r1 35b88: 0c f4 brge .+2 ; 0x35b8c 35b8a: 94 cd rjmp .-1240 ; 0x356b4 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 35b8c: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 35b90: df 01 movw r26, r30 35b92: aa 5b subi r26, 0xBA ; 186 35b94: bf 4f sbci r27, 0xFF ; 255 35b96: 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); 35b98: f7 fe sbrs r15, 7 35b9a: 02 c0 rjmp .+4 ; 0x35ba0 35b9c: 0d 94 fe b5 jmp 0x36bfc ; 0x36bfc } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 35ba0: 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); 35ba2: 89 a5 ldd r24, Y+41 ; 0x29 35ba4: 9a a5 ldd r25, Y+42 ; 0x2a 35ba6: ab a5 ldd r26, Y+43 ; 0x2b 35ba8: bc a5 ldd r27, Y+44 ; 0x2c 35baa: b7 ff sbrs r27, 7 35bac: 0b c0 rjmp .+22 ; 0x35bc4 35bae: 8e e6 ldi r24, 0x6E ; 110 35bb0: 82 9d mul r24, r2 35bb2: f0 01 movw r30, r0 35bb4: 83 9d mul r24, r3 35bb6: f0 0d add r31, r0 35bb8: 11 24 eor r1, r1 35bba: ed 58 subi r30, 0x8D ; 141 35bbc: f8 4f sbci r31, 0xF8 ; 248 35bbe: 80 8d ldd r24, Z+24 ; 0x18 35bc0: 82 60 ori r24, 0x02 ; 2 35bc2: 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); 35bc4: 8d a5 ldd r24, Y+45 ; 0x2d 35bc6: 9e a5 ldd r25, Y+46 ; 0x2e 35bc8: af a5 ldd r26, Y+47 ; 0x2f 35bca: b8 a9 ldd r27, Y+48 ; 0x30 35bcc: b7 ff sbrs r27, 7 35bce: 0b c0 rjmp .+22 ; 0x35be6 35bd0: 8e e6 ldi r24, 0x6E ; 110 35bd2: 82 9d mul r24, r2 35bd4: f0 01 movw r30, r0 35bd6: 83 9d mul r24, r3 35bd8: f0 0d add r31, r0 35bda: 11 24 eor r1, r1 35bdc: ed 58 subi r30, 0x8D ; 141 35bde: f8 4f sbci r31, 0xF8 ; 248 35be0: 80 8d ldd r24, Z+24 ; 0x18 35be2: 84 60 ori r24, 0x04 ; 4 35be4: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 35be6: 77 fe sbrs r7, 7 35be8: 0b c0 rjmp .+22 ; 0x35c00 35bea: 8e e6 ldi r24, 0x6E ; 110 35bec: 82 9d mul r24, r2 35bee: f0 01 movw r30, r0 35bf0: 83 9d mul r24, r3 35bf2: f0 0d add r31, r0 35bf4: 11 24 eor r1, r1 35bf6: ed 58 subi r30, 0x8D ; 141 35bf8: f8 4f sbci r31, 0xF8 ; 248 35bfa: 80 8d ldd r24, Z+24 ; 0x18 35bfc: 88 60 ori r24, 0x08 ; 8 35bfe: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 35c00: 01 2b or r16, r17 35c02: 02 2b or r16, r18 35c04: 03 2b or r16, r19 35c06: 09 f0 breq .+2 ; 0x35c0a 35c08: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 35c0a: 8e e6 ldi r24, 0x6E ; 110 35c0c: 82 9d mul r24, r2 35c0e: f0 01 movw r30, r0 35c10: 83 9d mul r24, r3 35c12: f0 0d add r31, r0 35c14: 11 24 eor r1, r1 35c16: ed 58 subi r30, 0x8D ; 141 35c18: f8 4f sbci r31, 0xF8 ; 248 35c1a: 84 81 ldd r24, Z+4 ; 0x04 35c1c: 95 81 ldd r25, Z+5 ; 0x05 35c1e: a6 81 ldd r26, Z+6 ; 0x06 35c20: b7 81 ldd r27, Z+7 ; 0x07 35c22: 89 2b or r24, r25 35c24: 8a 2b or r24, r26 35c26: 8b 2b or r24, r27 35c28: 09 f0 breq .+2 ; 0x35c2c 35c2a: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 35c2c: 8e e6 ldi r24, 0x6E ; 110 35c2e: 82 9d mul r24, r2 35c30: f0 01 movw r30, r0 35c32: 83 9d mul r24, r3 35c34: f0 0d add r31, r0 35c36: 11 24 eor r1, r1 35c38: ed 58 subi r30, 0x8D ; 141 35c3a: f8 4f sbci r31, 0xF8 ; 248 35c3c: 80 85 ldd r24, Z+8 ; 0x08 35c3e: 91 85 ldd r25, Z+9 ; 0x09 35c40: a2 85 ldd r26, Z+10 ; 0x0a 35c42: b3 85 ldd r27, Z+11 ; 0x0b 35c44: 89 2b or r24, r25 35c46: 8a 2b or r24, r26 35c48: 8b 2b or r24, r27 35c4a: 09 f0 breq .+2 ; 0x35c4e 35c4c: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 35c4e: 8e e6 ldi r24, 0x6E ; 110 35c50: 82 9d mul r24, r2 35c52: f0 01 movw r30, r0 35c54: 83 9d mul r24, r3 35c56: f0 0d add r31, r0 35c58: 11 24 eor r1, r1 35c5a: ed 58 subi r30, 0x8D ; 141 35c5c: f8 4f sbci r31, 0xF8 ; 248 35c5e: 84 85 ldd r24, Z+12 ; 0x0c 35c60: 95 85 ldd r25, Z+13 ; 0x0d 35c62: a6 85 ldd r26, Z+14 ; 0x0e 35c64: b7 85 ldd r27, Z+15 ; 0x0f 35c66: 89 2b or r24, r25 35c68: 8a 2b or r24, r26 35c6a: 8b 2b or r24, r27 35c6c: 09 f0 breq .+2 ; 0x35c70 35c6e: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 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: ed 58 subi r30, 0x8D ; 141 35c7e: f8 4f sbci r31, 0xF8 ; 248 35c80: 24 85 ldd r18, Z+12 ; 0x0c 35c82: 35 85 ldd r19, Z+13 ; 0x0d 35c84: 46 85 ldd r20, Z+14 ; 0x0e 35c86: 57 85 ldd r21, Z+15 ; 0x0f 35c88: 2a 96 adiw r28, 0x0a ; 10 35c8a: 2c af std Y+60, r18 ; 0x3c 35c8c: 3d af std Y+61, r19 ; 0x3d 35c8e: 4e af std Y+62, r20 ; 0x3e 35c90: 5f af std Y+63, r21 ; 0x3f 35c92: 2a 97 sbiw r28, 0x0a ; 10 35c94: 23 2b or r18, r19 35c96: 24 2b or r18, r20 35c98: 25 2b or r18, r21 35c9a: 09 f0 breq .+2 ; 0x35c9e 35c9c: b3 c7 rjmp .+3942 ; 0x36c04 { if(feed_rate 35ca2: b0 90 ac 06 lds r11, 0x06AC ; 0x8006ac 35ca6: 00 91 ad 06 lds r16, 0x06AD ; 0x8006ad 35caa: 10 91 ae 06 lds r17, 0x06AE ; 0x8006ae } else { if(feed_rate 35cbe: 18 16 cp r1, r24 35cc0: 24 f4 brge .+8 ; 0x35cca 35cc2: a9 aa std Y+49, r10 ; 0x31 35cc4: b9 ae std Y+57, r11 ; 0x39 35cc6: 0d af std Y+61, r16 ; 0x3d 35cc8: 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]; 35cca: c7 01 movw r24, r14 35ccc: b6 01 movw r22, r12 35cce: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 35cd2: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 35cd6: 30 91 70 06 lds r19, 0x0670 ; 0x800670 35cda: 40 91 71 06 lds r20, 0x0671 ; 0x800671 35cde: 50 91 72 06 lds r21, 0x0672 ; 0x800672 35ce2: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 35ce6: 4b 01 movw r8, r22 35ce8: 5c 01 movw r10, r24 35cea: 89 82 std Y+1, r8 ; 0x01 35cec: 9a 82 std Y+2, r9 ; 0x02 35cee: ab 82 std Y+3, r10 ; 0x03 35cf0: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 35cf2: 69 a5 ldd r22, Y+41 ; 0x29 35cf4: 7a a5 ldd r23, Y+42 ; 0x2a 35cf6: 8b a5 ldd r24, Y+43 ; 0x2b 35cf8: 9c a5 ldd r25, Y+44 ; 0x2c 35cfa: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 35cfe: 20 91 73 06 lds r18, 0x0673 ; 0x800673 35d02: 30 91 74 06 lds r19, 0x0674 ; 0x800674 35d06: 40 91 75 06 lds r20, 0x0675 ; 0x800675 35d0a: 50 91 76 06 lds r21, 0x0676 ; 0x800676 35d0e: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 35d12: 6b 01 movw r12, r22 35d14: 7c 01 movw r14, r24 35d16: cd 82 std Y+5, r12 ; 0x05 35d18: de 82 std Y+6, r13 ; 0x06 35d1a: ef 82 std Y+7, r14 ; 0x07 35d1c: 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]; 35d1e: 6d a5 ldd r22, Y+45 ; 0x2d 35d20: 7e a5 ldd r23, Y+46 ; 0x2e 35d22: 8f a5 ldd r24, Y+47 ; 0x2f 35d24: 98 a9 ldd r25, Y+48 ; 0x30 35d26: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 35d2a: 20 91 77 06 lds r18, 0x0677 ; 0x800677 35d2e: 30 91 78 06 lds r19, 0x0678 ; 0x800678 35d32: 40 91 79 06 lds r20, 0x0679 ; 0x800679 35d36: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 35d3a: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 35d3e: 22 96 adiw r28, 0x02 ; 2 35d40: 6c af std Y+60, r22 ; 0x3c 35d42: 7d af std Y+61, r23 ; 0x3d 35d44: 8e af std Y+62, r24 ; 0x3e 35d46: 9f af std Y+63, r25 ; 0x3f 35d48: 22 97 sbiw r28, 0x02 ; 2 35d4a: 69 87 std Y+9, r22 ; 0x09 35d4c: 7a 87 std Y+10, r23 ; 0x0a 35d4e: 8b 87 std Y+11, r24 ; 0x0b 35d50: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 35d52: c3 01 movw r24, r6 35d54: b2 01 movw r22, r4 35d56: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 35d5a: 20 91 7b 06 lds r18, 0x067B ; 0x80067b 35d5e: 30 91 7c 06 lds r19, 0x067C ; 0x80067c 35d62: 40 91 7d 06 lds r20, 0x067D ; 0x80067d 35d66: 50 91 7e 06 lds r21, 0x067E ; 0x80067e 35d6a: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 35d6e: 26 96 adiw r28, 0x06 ; 6 35d70: 6c af std Y+60, r22 ; 0x3c 35d72: 7d af std Y+61, r23 ; 0x3d 35d74: 8e af std Y+62, r24 ; 0x3e 35d76: 9f af std Y+63, r25 ; 0x3f 35d78: 26 97 sbiw r28, 0x06 ; 6 35d7a: 6d 87 std Y+13, r22 ; 0x0d 35d7c: 7e 87 std Y+14, r23 ; 0x0e 35d7e: 8f 87 std Y+15, r24 ; 0x0f 35d80: 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 ) 35d82: 8e e6 ldi r24, 0x6E ; 110 35d84: 82 9d mul r24, r2 35d86: f0 01 movw r30, r0 35d88: 83 9d mul r24, r3 35d8a: f0 0d add r31, r0 35d8c: 11 24 eor r1, r1 35d8e: ed 58 subi r30, 0x8D ; 141 35d90: f8 4f sbci r31, 0xF8 ; 248 35d92: 80 81 ld r24, Z 35d94: 91 81 ldd r25, Z+1 ; 0x01 35d96: a2 81 ldd r26, Z+2 ; 0x02 35d98: b3 81 ldd r27, Z+3 ; 0x03 35d9a: 2e 96 adiw r28, 0x0e ; 14 35d9c: 8c af std Y+60, r24 ; 0x3c 35d9e: 9d af std Y+61, r25 ; 0x3d 35da0: ae af std Y+62, r26 ; 0x3e 35da2: bf af std Y+63, r27 ; 0x3f 35da4: 2e 97 sbiw r28, 0x0e ; 14 35da6: 06 97 sbiw r24, 0x06 ; 6 35da8: a1 05 cpc r26, r1 35daa: b1 05 cpc r27, r1 35dac: 0c f0 brlt .+2 ; 0x35db0 35dae: 33 c7 rjmp .+3686 ; 0x36c16 35db0: 84 81 ldd r24, Z+4 ; 0x04 35db2: 95 81 ldd r25, Z+5 ; 0x05 35db4: a6 81 ldd r26, Z+6 ; 0x06 35db6: b7 81 ldd r27, Z+7 ; 0x07 35db8: 06 97 sbiw r24, 0x06 ; 6 35dba: a1 05 cpc r26, r1 35dbc: b1 05 cpc r27, r1 35dbe: 0c f0 brlt .+2 ; 0x35dc2 35dc0: 2a c7 rjmp .+3668 ; 0x36c16 35dc2: 80 85 ldd r24, Z+8 ; 0x08 35dc4: 91 85 ldd r25, Z+9 ; 0x09 35dc6: a2 85 ldd r26, Z+10 ; 0x0a 35dc8: b3 85 ldd r27, Z+11 ; 0x0b 35dca: 06 97 sbiw r24, 0x06 ; 6 35dcc: a1 05 cpc r26, r1 35dce: b1 05 cpc r27, r1 35dd0: 0c f0 brlt .+2 ; 0x35dd4 35dd2: 21 c7 rjmp .+3650 ; 0x36c16 { block->millimeters = fabs(delta_mm[E_AXIS]); 35dd4: 26 96 adiw r28, 0x06 ; 6 35dd6: 8c ad ldd r24, Y+60 ; 0x3c 35dd8: 9d ad ldd r25, Y+61 ; 0x3d 35dda: ae ad ldd r26, Y+62 ; 0x3e 35ddc: bf ad ldd r27, Y+63 ; 0x3f 35dde: 26 97 sbiw r28, 0x06 ; 6 35de0: bf 77 andi r27, 0x7F ; 127 35de2: 85 a7 std Z+45, r24 ; 0x2d 35de4: 96 a7 std Z+46, r25 ; 0x2e 35de6: a7 a7 std Z+47, r26 ; 0x2f 35de8: 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 35dea: 8e e6 ldi r24, 0x6E ; 110 35dec: 82 9d mul r24, r2 35dee: f0 01 movw r30, r0 35df0: 83 9d mul r24, r3 35df2: f0 0d add r31, r0 35df4: 11 24 eor r1, r1 35df6: ed 58 subi r30, 0x8D ; 141 35df8: f8 4f sbci r31, 0xF8 ; 248 35dfa: 45 a4 ldd r4, Z+45 ; 0x2d 35dfc: 56 a4 ldd r5, Z+46 ; 0x2e 35dfe: 67 a4 ldd r6, Z+47 ; 0x2f 35e00: 70 a8 ldd r7, Z+48 ; 0x30 35e02: a3 01 movw r20, r6 35e04: 92 01 movw r18, r4 35e06: 60 e0 ldi r22, 0x00 ; 0 35e08: 70 e0 ldi r23, 0x00 ; 0 35e0a: 80 e8 ldi r24, 0x80 ; 128 35e0c: 9f e3 ldi r25, 0x3F ; 63 35e0e: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 35e12: 29 a9 ldd r18, Y+49 ; 0x31 35e14: 39 ad ldd r19, Y+57 ; 0x39 35e16: 4d ad ldd r20, Y+61 ; 0x3d 35e18: 5d a9 ldd r21, Y+53 ; 0x35 35e1a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 35e1e: 6b 01 movw r12, r22 35e20: 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); 35e22: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 35e26: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 35e2a: 89 1b sub r24, r25 35e2c: 8f 70 andi r24, 0x0F ; 15 35e2e: 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)) { 35e30: 82 50 subi r24, 0x02 ; 2 35e32: 86 30 cpi r24, 0x06 ; 6 35e34: 08 f0 brcs .+2 ; 0x35e38 35e36: 40 c0 rjmp .+128 ; 0x35eb8 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 35e38: a7 01 movw r20, r14 35e3a: 96 01 movw r18, r12 35e3c: 60 e0 ldi r22, 0x00 ; 0 35e3e: 74 e2 ldi r23, 0x24 ; 36 35e40: 84 e7 ldi r24, 0x74 ; 116 35e42: 99 e4 ldi r25, 0x49 ; 73 35e44: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 35e48: 0f 94 ab e1 call 0x3c356 ; 0x3c356 35e4c: 4b 01 movw r8, r22 35e4e: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 35e50: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 35e54: 90 91 b0 06 lds r25, 0x06B0 ; 0x8006b0 35e58: a0 91 b1 06 lds r26, 0x06B1 ; 0x8006b1 35e5c: b0 91 b2 06 lds r27, 0x06B2 ; 0x8006b2 35e60: 88 16 cp r8, r24 35e62: 99 06 cpc r9, r25 35e64: aa 06 cpc r10, r26 35e66: bb 06 cpc r11, r27 35e68: 38 f5 brcc .+78 ; 0x35eb8 // 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)); 35e6a: bc 01 movw r22, r24 35e6c: cd 01 movw r24, r26 35e6e: 68 19 sub r22, r8 35e70: 79 09 sbc r23, r9 35e72: 8a 09 sbc r24, r10 35e74: 9b 09 sbc r25, r11 35e76: 66 0f add r22, r22 35e78: 77 1f adc r23, r23 35e7a: 88 1f adc r24, r24 35e7c: 99 1f adc r25, r25 35e7e: ad ad ldd r26, Y+61 ; 0x3d 35e80: 2a 2f mov r18, r26 35e82: 30 e0 ldi r19, 0x00 ; 0 35e84: 50 e0 ldi r21, 0x00 ; 0 35e86: 40 e0 ldi r20, 0x00 ; 0 35e88: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 35e8c: ca 01 movw r24, r20 35e8e: b9 01 movw r22, r18 35e90: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 35e94: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 35e98: 68 0d add r22, r8 35e9a: 79 1d adc r23, r9 35e9c: 8a 1d adc r24, r10 35e9e: 9b 1d adc r25, r11 35ea0: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 35ea4: 9b 01 movw r18, r22 35ea6: ac 01 movw r20, r24 35ea8: 60 e0 ldi r22, 0x00 ; 0 35eaa: 74 e2 ldi r23, 0x24 ; 36 35eac: 84 e7 ldi r24, 0x74 ; 116 35eae: 99 e4 ldi r25, 0x49 ; 73 35eb0: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 35eb4: 6b 01 movw r12, r22 35eb6: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 35eb8: a3 01 movw r20, r6 35eba: 92 01 movw r18, r4 35ebc: c7 01 movw r24, r14 35ebe: b6 01 movw r22, r12 35ec0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 35ec4: 6d ab std Y+53, r22 ; 0x35 35ec6: 7e ab std Y+54, r23 ; 0x36 35ec8: 8f ab std Y+55, r24 ; 0x37 35eca: 98 af std Y+56, r25 ; 0x38 35ecc: 8e e6 ldi r24, 0x6E ; 110 35ece: 82 9d mul r24, r2 35ed0: 80 01 movw r16, r0 35ed2: 83 9d mul r24, r3 35ed4: 10 0d add r17, r0 35ed6: 11 24 eor r1, r1 35ed8: 0d 58 subi r16, 0x8D ; 141 35eda: 18 4f sbci r17, 0xF8 ; 248 35edc: 2d a9 ldd r18, Y+53 ; 0x35 35ede: 3e a9 ldd r19, Y+54 ; 0x36 35ee0: 4f a9 ldd r20, Y+55 ; 0x37 35ee2: 58 ad ldd r21, Y+56 ; 0x38 35ee4: d8 01 movw r26, r16 35ee6: 91 96 adiw r26, 0x21 ; 33 35ee8: 2d 93 st X+, r18 35eea: 3d 93 st X+, r19 35eec: 4d 93 st X+, r20 35eee: 5c 93 st X, r21 35ef0: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 35ef2: 50 96 adiw r26, 0x10 ; 16 35ef4: 6d 91 ld r22, X+ 35ef6: 7d 91 ld r23, X+ 35ef8: 8d 91 ld r24, X+ 35efa: 9c 91 ld r25, X 35efc: 53 97 sbiw r26, 0x13 ; 19 35efe: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 35f02: 69 af std Y+57, r22 ; 0x39 35f04: 7a af std Y+58, r23 ; 0x3a 35f06: 8b af std Y+59, r24 ; 0x3b 35f08: 9c af std Y+60, r25 ; 0x3c 35f0a: 9b 01 movw r18, r22 35f0c: ac 01 movw r20, r24 35f0e: c7 01 movw r24, r14 35f10: b6 01 movw r22, r12 35f12: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 35f16: 0f 94 4c df call 0x3be98 ; 0x3be98 35f1a: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 35f1e: 62 96 adiw r28, 0x12 ; 18 35f20: 6c af std Y+60, r22 ; 0x3c 35f22: 7d af std Y+61, r23 ; 0x3d 35f24: 8e af std Y+62, r24 ; 0x3e 35f26: 9f af std Y+63, r25 ; 0x3f 35f28: 62 97 sbiw r28, 0x12 ; 18 35f2a: f8 01 movw r30, r16 35f2c: 66 ab std Z+54, r22 ; 0x36 35f2e: 77 ab std Z+55, r23 ; 0x37 35f30: 80 af std Z+56, r24 ; 0x38 35f32: 91 af std Z+57, r25 ; 0x39 35f34: 9e 01 movw r18, r28 35f36: 2f 5f subi r18, 0xFF ; 255 35f38: 3f 4f sbci r19, 0xFF ; 255 35f3a: 6c 96 adiw r28, 0x1c ; 28 35f3c: 3f af std Y+63, r19 ; 0x3f 35f3e: 2e af std Y+62, r18 ; 0x3e 35f40: 6c 97 sbiw r28, 0x1c ; 28 35f42: ae 01 movw r20, r28 35f44: 4f 5e subi r20, 0xEF ; 239 35f46: 5f 4f sbci r21, 0xFF ; 255 35f48: a0 96 adiw r28, 0x20 ; 32 35f4a: 5f af std Y+63, r21 ; 0x3f 35f4c: 4e af std Y+62, r20 ; 0x3e 35f4e: a0 97 sbiw r28, 0x20 ; 32 35f50: 80 91 99 02 lds r24, 0x0299 ; 0x800299 35f54: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 35f58: 9a ab std Y+50, r25 ; 0x32 35f5a: 89 ab std Y+49, r24 ; 0x31 35f5c: 40 96 adiw r24, 0x10 ; 16 35f5e: 6e 96 adiw r28, 0x1e ; 30 35f60: 9f af std Y+63, r25 ; 0x3f 35f62: 8e af std Y+62, r24 ; 0x3e 35f64: 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]) 35f66: 68 96 adiw r28, 0x18 ; 24 35f68: 5f af std Y+63, r21 ; 0x3f 35f6a: 4e af std Y+62, r20 ; 0x3e 35f6c: 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 35f6e: 19 a6 std Y+41, r1 ; 0x29 35f70: 1d a6 std Y+45, r1 ; 0x2d 35f72: 00 e8 ldi r16, 0x80 ; 128 35f74: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 35f76: 6c 96 adiw r28, 0x1c ; 28 35f78: ae ad ldd r26, Y+62 ; 0x3e 35f7a: bf ad ldd r27, Y+63 ; 0x3f 35f7c: 6c 97 sbiw r28, 0x1c ; 28 35f7e: 2d 91 ld r18, X+ 35f80: 3d 91 ld r19, X+ 35f82: 4d 91 ld r20, X+ 35f84: 5d 91 ld r21, X+ 35f86: 6c 96 adiw r28, 0x1c ; 28 35f88: bf af std Y+63, r27 ; 0x3f 35f8a: ae af std Y+62, r26 ; 0x3e 35f8c: 6c 97 sbiw r28, 0x1c ; 28 35f8e: c7 01 movw r24, r14 35f90: b6 01 movw r22, r12 35f92: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 35f96: 68 96 adiw r28, 0x18 ; 24 35f98: ee ad ldd r30, Y+62 ; 0x3e 35f9a: ff ad ldd r31, Y+63 ; 0x3f 35f9c: 68 97 sbiw r28, 0x18 ; 24 35f9e: 61 93 st Z+, r22 35fa0: 71 93 st Z+, r23 35fa2: 81 93 st Z+, r24 35fa4: 91 93 st Z+, r25 35fa6: 68 96 adiw r28, 0x18 ; 24 35fa8: ff af std Y+63, r31 ; 0x3f 35faa: ee af std Y+62, r30 ; 0x3e 35fac: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 35fae: 4b 01 movw r8, r22 35fb0: 5c 01 movw r10, r24 35fb2: e8 94 clt 35fb4: b7 f8 bld r11, 7 35fb6: a9 a9 ldd r26, Y+49 ; 0x31 35fb8: ba a9 ldd r27, Y+50 ; 0x32 35fba: 2d 91 ld r18, X+ 35fbc: 3d 91 ld r19, X+ 35fbe: 4d 91 ld r20, X+ 35fc0: 5d 91 ld r21, X+ 35fc2: ba ab std Y+50, r27 ; 0x32 35fc4: a9 ab std Y+49, r26 ; 0x31 35fc6: 66 96 adiw r28, 0x16 ; 22 35fc8: 2c af std Y+60, r18 ; 0x3c 35fca: 3d af std Y+61, r19 ; 0x3d 35fcc: 4e af std Y+62, r20 ; 0x3e 35fce: 5f af std Y+63, r21 ; 0x3f 35fd0: 66 97 sbiw r28, 0x16 ; 22 35fd2: c5 01 movw r24, r10 35fd4: b4 01 movw r22, r8 35fd6: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 35fda: 18 16 cp r1, r24 35fdc: b4 f4 brge .+44 ; 0x3600a { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 35fde: a5 01 movw r20, r10 35fe0: 94 01 movw r18, r8 35fe2: 66 96 adiw r28, 0x16 ; 22 35fe4: 6c ad ldd r22, Y+60 ; 0x3c 35fe6: 7d ad ldd r23, Y+61 ; 0x3d 35fe8: 8e ad ldd r24, Y+62 ; 0x3e 35fea: 9f ad ldd r25, Y+63 ; 0x3f 35fec: 66 97 sbiw r28, 0x16 ; 22 35fee: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 35ff2: 4b 01 movw r8, r22 35ff4: 5c 01 movw r10, r24 35ff6: 29 a5 ldd r18, Y+41 ; 0x29 35ff8: 3d a5 ldd r19, Y+45 ; 0x2d 35ffa: a8 01 movw r20, r16 35ffc: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36000: 18 16 cp r1, r24 36002: 1c f0 brlt .+6 ; 0x3600a 36004: 89 a6 std Y+41, r8 ; 0x29 36006: 9d a6 std Y+45, r9 ; 0x2d 36008: 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++) 3600a: 6e 96 adiw r28, 0x1e ; 30 3600c: ee ad ldd r30, Y+62 ; 0x3e 3600e: ff ad ldd r31, Y+63 ; 0x3f 36010: 6e 97 sbiw r28, 0x1e ; 30 36012: 29 a9 ldd r18, Y+49 ; 0x31 36014: 3a a9 ldd r19, Y+50 ; 0x32 36016: e2 17 cp r30, r18 36018: f3 07 cpc r31, r19 3601a: 09 f0 breq .+2 ; 0x3601e 3601c: ac cf rjmp .-168 ; 0x35f76 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 3601e: 20 e0 ldi r18, 0x00 ; 0 36020: 30 e0 ldi r19, 0x00 ; 0 36022: 40 e8 ldi r20, 0x80 ; 128 36024: 5f e3 ldi r21, 0x3F ; 63 36026: 69 a5 ldd r22, Y+41 ; 0x29 36028: 7d a5 ldd r23, Y+45 ; 0x2d 3602a: c8 01 movw r24, r16 3602c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36030: 87 ff sbrs r24, 7 36032: 50 c0 rjmp .+160 ; 0x360d4 36034: a0 96 adiw r28, 0x20 ; 32 36036: ae ac ldd r10, Y+62 ; 0x3e 36038: bf ac ldd r11, Y+63 ; 0x3f 3603a: a0 97 sbiw r28, 0x20 ; 32 3603c: 30 e1 ldi r19, 0x10 ; 16 3603e: a3 0e add r10, r19 36040: b1 1c adc r11, r1 36042: a0 96 adiw r28, 0x20 ; 32 36044: ce ac ldd r12, Y+62 ; 0x3e 36046: df ac ldd r13, Y+63 ; 0x3f 36048: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 3604a: d6 01 movw r26, r12 3604c: 6d 91 ld r22, X+ 3604e: 7d 91 ld r23, X+ 36050: 8d 91 ld r24, X+ 36052: 9d 91 ld r25, X+ 36054: 6d 01 movw r12, r26 36056: 7d 01 movw r14, r26 36058: b4 e0 ldi r27, 0x04 ; 4 3605a: eb 1a sub r14, r27 3605c: f1 08 sbc r15, r1 3605e: 29 a5 ldd r18, Y+41 ; 0x29 36060: 3d a5 ldd r19, Y+45 ; 0x2d 36062: a8 01 movw r20, r16 36064: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36068: f7 01 movw r30, r14 3606a: 60 83 st Z, r22 3606c: 71 83 std Z+1, r23 ; 0x01 3606e: 82 83 std Z+2, r24 ; 0x02 36070: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 36072: ac 14 cp r10, r12 36074: bd 04 cpc r11, r13 36076: 49 f7 brne .-46 ; 0x3604a { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 36078: 2e e6 ldi r18, 0x6E ; 110 3607a: 22 9d mul r18, r2 3607c: c0 01 movw r24, r0 3607e: 23 9d mul r18, r3 36080: 90 0d add r25, r0 36082: 11 24 eor r1, r1 36084: 9c 01 movw r18, r24 36086: 2d 58 subi r18, 0x8D ; 141 36088: 38 4f sbci r19, 0xF8 ; 248 3608a: 79 01 movw r14, r18 3608c: 29 a5 ldd r18, Y+41 ; 0x29 3608e: 3d a5 ldd r19, Y+45 ; 0x2d 36090: a8 01 movw r20, r16 36092: 6d a9 ldd r22, Y+53 ; 0x35 36094: 7e a9 ldd r23, Y+54 ; 0x36 36096: 8f a9 ldd r24, Y+55 ; 0x37 36098: 98 ad ldd r25, Y+56 ; 0x38 3609a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3609e: d7 01 movw r26, r14 360a0: 91 96 adiw r26, 0x21 ; 33 360a2: 6d 93 st X+, r22 360a4: 7d 93 st X+, r23 360a6: 8d 93 st X+, r24 360a8: 9c 93 st X, r25 360aa: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 360ac: 62 96 adiw r28, 0x12 ; 18 360ae: 6c ad ldd r22, Y+60 ; 0x3c 360b0: 7d ad ldd r23, Y+61 ; 0x3d 360b2: 8e ad ldd r24, Y+62 ; 0x3e 360b4: 9f ad ldd r25, Y+63 ; 0x3f 360b6: 62 97 sbiw r28, 0x12 ; 18 360b8: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 360bc: 29 a5 ldd r18, Y+41 ; 0x29 360be: 3d a5 ldd r19, Y+45 ; 0x2d 360c0: a8 01 movw r20, r16 360c2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 360c6: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 360ca: f7 01 movw r30, r14 360cc: 66 ab std Z+54, r22 ; 0x36 360ce: 77 ab std Z+55, r23 ; 0x37 360d0: 80 af std Z+56, r24 ; 0x38 360d2: 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; 360d4: a3 01 movw r20, r6 360d6: 92 01 movw r18, r4 360d8: 69 ad ldd r22, Y+57 ; 0x39 360da: 7a ad ldd r23, Y+58 ; 0x3a 360dc: 8b ad ldd r24, Y+59 ; 0x3b 360de: 9c ad ldd r25, Y+60 ; 0x3c 360e0: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 360e4: 69 a7 std Y+41, r22 ; 0x29 360e6: 7a a7 std Y+42, r23 ; 0x2a 360e8: 8b a7 std Y+43, r24 ; 0x2b 360ea: 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) 360ec: 2e 96 adiw r28, 0x0e ; 14 360ee: 2c ad ldd r18, Y+60 ; 0x3c 360f0: 3d ad ldd r19, Y+61 ; 0x3d 360f2: 4e ad ldd r20, Y+62 ; 0x3e 360f4: 5f ad ldd r21, Y+63 ; 0x3f 360f6: 2e 97 sbiw r28, 0x0e ; 14 360f8: 23 2b or r18, r19 360fa: 24 2b or r18, r20 360fc: 25 2b or r18, r21 360fe: 09 f0 breq .+2 ; 0x36102 36100: b9 c5 rjmp .+2930 ; 0x36c74 36102: 8e e6 ldi r24, 0x6E ; 110 36104: 82 9d mul r24, r2 36106: 80 01 movw r16, r0 36108: 83 9d mul r24, r3 3610a: 10 0d add r17, r0 3610c: 11 24 eor r1, r1 3610e: 0d 58 subi r16, 0x8D ; 141 36110: 18 4f sbci r17, 0xF8 ; 248 36112: f8 01 movw r30, r16 36114: 84 81 ldd r24, Z+4 ; 0x04 36116: 95 81 ldd r25, Z+5 ; 0x05 36118: a6 81 ldd r26, Z+6 ; 0x06 3611a: b7 81 ldd r27, Z+7 ; 0x07 3611c: 89 2b or r24, r25 3611e: 8a 2b or r24, r26 36120: 8b 2b or r24, r27 36122: 09 f0 breq .+2 ; 0x36126 36124: a7 c5 rjmp .+2894 ; 0x36c74 36126: 80 85 ldd r24, Z+8 ; 0x08 36128: 91 85 ldd r25, Z+9 ; 0x09 3612a: a2 85 ldd r26, Z+10 ; 0x0a 3612c: b3 85 ldd r27, Z+11 ; 0x0b 3612e: 89 2b or r24, r25 36130: 8a 2b or r24, r26 36132: 8b 2b or r24, r27 36134: 09 f0 breq .+2 ; 0x36138 36136: 9e c5 rjmp .+2876 ; 0x36c74 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 36138: 20 91 a3 06 lds r18, 0x06A3 ; 0x8006a3 3613c: 30 91 a4 06 lds r19, 0x06A4 ; 0x8006a4 36140: 40 91 a5 06 lds r20, 0x06A5 ; 0x8006a5 36144: 50 91 a6 06 lds r21, 0x06A6 ; 0x8006a6 36148: 69 a5 ldd r22, Y+41 ; 0x29 3614a: 7a a5 ldd r23, Y+42 ; 0x2a 3614c: 8b a5 ldd r24, Y+43 ; 0x2b 3614e: 9c a5 ldd r25, Y+44 ; 0x2c 36150: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36154: 0f 94 4c df call 0x3be98 ; 0x3be98 36158: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 3615c: 2b 01 movw r4, r22 3615e: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 36160: f8 01 movw r30, r16 36162: e4 5b subi r30, 0xB4 ; 180 36164: ff 4f sbci r31, 0xFF ; 255 36166: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36168: 6a 96 adiw r28, 0x1a ; 26 3616a: 1c ae std Y+60, r1 ; 0x3c 3616c: 1d ae std Y+61, r1 ; 0x3d 3616e: 1e ae std Y+62, r1 ; 0x3e 36170: 1f ae std Y+63, r1 ; 0x3f 36172: 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; 36174: 8e e6 ldi r24, 0x6E ; 110 36176: 82 9d mul r24, r2 36178: 80 01 movw r16, r0 3617a: 83 9d mul r24, r3 3617c: 10 0d add r17, r0 3617e: 11 24 eor r1, r1 36180: 0d 58 subi r16, 0x8D ; 141 36182: 18 4f sbci r17, 0xF8 ; 248 36184: f8 01 movw r30, r16 36186: ee 5b subi r30, 0xBE ; 190 36188: ff 4f sbci r31, 0xFF ; 255 3618a: 40 82 st Z, r4 3618c: 51 82 std Z+1, r5 ; 0x01 3618e: 62 82 std Z+2, r6 ; 0x02 36190: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 36192: c3 01 movw r24, r6 36194: b2 01 movw r22, r4 36196: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 3619a: 6b 01 movw r12, r22 3619c: 7c 01 movw r14, r24 3619e: 29 a5 ldd r18, Y+41 ; 0x29 361a0: 3a a5 ldd r19, Y+42 ; 0x2a 361a2: 4b a5 ldd r20, Y+43 ; 0x2b 361a4: 5c a5 ldd r21, Y+44 ; 0x2c 361a6: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 361aa: e2 96 adiw r28, 0x32 ; 50 361ac: 6c af std Y+60, r22 ; 0x3c 361ae: 7d af std Y+61, r23 ; 0x3d 361b0: 8e af std Y+62, r24 ; 0x3e 361b2: 9f af std Y+63, r25 ; 0x3f 361b4: e2 97 sbiw r28, 0x32 ; 50 361b6: f8 01 movw r30, r16 361b8: 61 ab std Z+49, r22 ; 0x31 361ba: 72 ab std Z+50, r23 ; 0x32 361bc: 83 ab std Z+51, r24 ; 0x33 361be: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 361c0: 2d eb ldi r18, 0xBD ; 189 361c2: 37 e3 ldi r19, 0x37 ; 55 361c4: 46 e0 ldi r20, 0x06 ; 6 361c6: 51 e4 ldi r21, 0x41 ; 65 361c8: c7 01 movw r24, r14 361ca: b6 01 movw r22, r12 361cc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 361d0: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 361d4: d8 01 movw r26, r16 361d6: 54 96 adiw r26, 0x14 ; 20 361d8: 6d 93 st X+, r22 361da: 7d 93 st X+, r23 361dc: 8d 93 st X+, r24 361de: 9c 93 st X, r25 361e0: 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; 361e2: 91 96 adiw r26, 0x21 ; 33 361e4: bc 91 ld r27, X 361e6: 27 96 adiw r28, 0x07 ; 7 361e8: bf af std Y+63, r27 ; 0x3f 361ea: 27 97 sbiw r28, 0x07 ; 7 361ec: f8 01 movw r30, r16 361ee: f2 a1 ldd r31, Z+34 ; 0x22 361f0: 2b 96 adiw r28, 0x0b ; 11 361f2: ff af std Y+63, r31 ; 0x3f 361f4: 2b 97 sbiw r28, 0x0b ; 11 361f6: d8 01 movw r26, r16 361f8: 93 96 adiw r26, 0x23 ; 35 361fa: bc 91 ld r27, X 361fc: 2f 96 adiw r28, 0x0f ; 15 361fe: bf af std Y+63, r27 ; 0x3f 36200: 2f 97 sbiw r28, 0x0f ; 15 36202: f8 01 movw r30, r16 36204: f4 a1 ldd r31, Z+36 ; 0x24 36206: 63 96 adiw r28, 0x13 ; 19 36208: ff af std Y+63, r31 ; 0x3f 3620a: 63 97 sbiw r28, 0x13 ; 19 3620c: 23 eb ldi r18, 0xB3 ; 179 3620e: 36 e0 ldi r19, 0x06 ; 6 36210: ee 96 adiw r28, 0x3e ; 62 36212: 3f af std Y+63, r19 ; 0x3f 36214: 2e af std Y+62, r18 ; 0x3e 36216: ee 97 sbiw r28, 0x3e ; 62 36218: a0 96 adiw r28, 0x20 ; 32 3621a: 4e ac ldd r4, Y+62 ; 0x3e 3621c: 5f ac ldd r5, Y+63 ; 0x3f 3621e: a0 97 sbiw r28, 0x20 ; 32 36220: 30 e1 ldi r19, 0x10 ; 16 36222: 43 0e add r4, r19 36224: 51 1c adc r5, r1 36226: 03 eb ldi r16, 0xB3 ; 179 36228: 16 e0 ldi r17, 0x06 ; 6 3622a: a0 96 adiw r28, 0x20 ; 32 3622c: 6e ac ldd r6, Y+62 ; 0x3e 3622e: 7f ac ldd r7, Y+63 ; 0x3f 36230: a0 97 sbiw r28, 0x20 ; 32 36232: 27 96 adiw r28, 0x07 ; 7 36234: 4f ad ldd r20, Y+63 ; 0x3f 36236: 27 97 sbiw r28, 0x07 ; 7 36238: 49 a7 std Y+41, r20 ; 0x29 3623a: 2b 96 adiw r28, 0x0b ; 11 3623c: 5f ad ldd r21, Y+63 ; 0x3f 3623e: 2b 97 sbiw r28, 0x0b ; 11 36240: 5d a7 std Y+45, r21 ; 0x2d 36242: b9 ab std Y+49, r27 ; 0x31 36244: f9 af std Y+57, r31 ; 0x39 bool limited = false; 36246: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 36248: d3 01 movw r26, r6 3624a: 8d 90 ld r8, X+ 3624c: 9d 90 ld r9, X+ 3624e: ad 90 ld r10, X+ 36250: bd 90 ld r11, X+ 36252: 3d 01 movw r6, r26 36254: e8 94 clt 36256: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 36258: f8 01 movw r30, r16 3625a: c1 90 ld r12, Z+ 3625c: d1 90 ld r13, Z+ 3625e: e1 90 ld r14, Z+ 36260: f1 90 ld r15, Z+ 36262: 8f 01 movw r16, r30 36264: a5 01 movw r20, r10 36266: 94 01 movw r18, r8 36268: c7 01 movw r24, r14 3626a: b6 01 movw r22, r12 3626c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36270: 87 ff sbrs r24, 7 36272: 3a c0 rjmp .+116 ; 0x362e8 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 36274: fd a9 ldd r31, Y+53 ; 0x35 36276: ff 23 and r31, r31 36278: 09 f4 brne .+2 ; 0x3627c 3627a: 7e c6 rjmp .+3324 ; 0x36f78 // 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; 3627c: 29 a5 ldd r18, Y+41 ; 0x29 3627e: 3d a5 ldd r19, Y+45 ; 0x2d 36280: 49 a9 ldd r20, Y+49 ; 0x31 36282: 59 ad ldd r21, Y+57 ; 0x39 36284: c5 01 movw r24, r10 36286: b4 01 movw r22, r8 36288: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3628c: 4b 01 movw r8, r22 3628e: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 36290: a7 01 movw r20, r14 36292: 96 01 movw r18, r12 36294: 27 96 adiw r28, 0x07 ; 7 36296: 6f ad ldd r22, Y+63 ; 0x3f 36298: 27 97 sbiw r28, 0x07 ; 7 3629a: 2b 96 adiw r28, 0x0b ; 11 3629c: 7f ad ldd r23, Y+63 ; 0x3f 3629e: 2b 97 sbiw r28, 0x0b ; 11 362a0: 2f 96 adiw r28, 0x0f ; 15 362a2: 8f ad ldd r24, Y+63 ; 0x3f 362a4: 2f 97 sbiw r28, 0x0f ; 15 362a6: 63 96 adiw r28, 0x13 ; 19 362a8: 9f ad ldd r25, Y+63 ; 0x3f 362aa: 63 97 sbiw r28, 0x13 ; 19 362ac: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 362b0: 6b 01 movw r12, r22 362b2: 7c 01 movw r14, r24 if (jerk > mjerk) { 362b4: ac 01 movw r20, r24 362b6: 9b 01 movw r18, r22 362b8: c5 01 movw r24, r10 362ba: b4 01 movw r22, r8 362bc: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 362c0: 18 16 cp r1, r24 362c2: 94 f4 brge .+36 ; 0x362e8 safe_speed *= mjerk / jerk; 362c4: a5 01 movw r20, r10 362c6: 94 01 movw r18, r8 362c8: c7 01 movw r24, r14 362ca: b6 01 movw r22, r12 362cc: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 362d0: 9b 01 movw r18, r22 362d2: ac 01 movw r20, r24 362d4: 69 a5 ldd r22, Y+41 ; 0x29 362d6: 7d a5 ldd r23, Y+45 ; 0x2d 362d8: 89 a9 ldd r24, Y+49 ; 0x31 362da: 99 ad ldd r25, Y+57 ; 0x39 362dc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 362e0: 69 a7 std Y+41, r22 ; 0x29 362e2: 7d a7 std Y+45, r23 ; 0x2d 362e4: 89 ab std Y+49, r24 ; 0x31 362e6: 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) { 362e8: 46 14 cp r4, r6 362ea: 57 04 cpc r5, r7 362ec: 09 f0 breq .+2 ; 0x362f0 362ee: ac cf rjmp .-168 ; 0x36248 } } } // Reset the block flag. block->flag = 0; 362f0: 8e e6 ldi r24, 0x6E ; 110 362f2: 82 9d mul r24, r2 362f4: f0 01 movw r30, r0 362f6: 83 9d mul r24, r3 362f8: f0 0d add r31, r0 362fa: 11 24 eor r1, r1 362fc: ed 58 subi r30, 0x8D ; 141 362fe: f8 4f sbci r31, 0xF8 ; 248 36300: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 36302: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.505> 36306: 88 23 and r24, r24 36308: 21 f0 breq .+8 ; 0x36312 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 3630a: 80 e1 ldi r24, 0x10 ; 16 3630c: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 3630e: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.505> 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) { 36312: 3d ad ldd r19, Y+61 ; 0x3d 36314: 32 30 cpi r19, 0x02 ; 2 36316: 08 f4 brcc .+2 ; 0x3631a 36318: 8f c6 rjmp .+3358 ; 0x37038 3631a: 40 91 b9 04 lds r20, 0x04B9 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.506> 3631e: 6b 96 adiw r28, 0x1b ; 27 36320: 4f af std Y+63, r20 ; 0x3f 36322: 6b 97 sbiw r28, 0x1b ; 27 36324: 50 91 ba 04 lds r21, 0x04BA ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.506+0x1> 36328: 6d 96 adiw r28, 0x1d ; 29 3632a: 5f af std Y+63, r21 ; 0x3f 3632c: 6d 97 sbiw r28, 0x1d ; 29 3632e: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.506+0x2> 36332: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.506+0x3> 36336: 27 e1 ldi r18, 0x17 ; 23 36338: 37 eb ldi r19, 0xB7 ; 183 3633a: 41 ed ldi r20, 0xD1 ; 209 3633c: 58 e3 ldi r21, 0x38 ; 56 3633e: 6b 96 adiw r28, 0x1b ; 27 36340: 6f ad ldd r22, Y+63 ; 0x3f 36342: 6b 97 sbiw r28, 0x1b ; 27 36344: 6d 96 adiw r28, 0x1d ; 29 36346: 7f ad ldd r23, Y+63 ; 0x3f 36348: 6d 97 sbiw r28, 0x1d ; 29 3634a: c8 01 movw r24, r16 3634c: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36350: 18 16 cp r1, r24 36352: 0c f0 brlt .+2 ; 0x36356 36354: 71 c6 rjmp .+3298 ; 0x37038 // 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); 36356: 6b 96 adiw r28, 0x1b ; 27 36358: 2f ad ldd r18, Y+63 ; 0x3f 3635a: 6b 97 sbiw r28, 0x1b ; 27 3635c: 6d 96 adiw r28, 0x1d ; 29 3635e: 3f ad ldd r19, Y+63 ; 0x3f 36360: 6d 97 sbiw r28, 0x1d ; 29 36362: a8 01 movw r20, r16 36364: 27 96 adiw r28, 0x07 ; 7 36366: 6f ad ldd r22, Y+63 ; 0x3f 36368: 27 97 sbiw r28, 0x07 ; 7 3636a: 2b 96 adiw r28, 0x0b ; 11 3636c: 7f ad ldd r23, Y+63 ; 0x3f 3636e: 2b 97 sbiw r28, 0x0b ; 11 36370: 2f 96 adiw r28, 0x0f ; 15 36372: 8f ad ldd r24, Y+63 ; 0x3f 36374: 2f 97 sbiw r28, 0x0f ; 15 36376: 63 96 adiw r28, 0x13 ; 19 36378: 9f ad ldd r25, Y+63 ; 0x3f 3637a: 63 97 sbiw r28, 0x13 ; 19 3637c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36380: 87 ff sbrs r24, 7 36382: 01 c6 rjmp .+3074 ; 0x36f86 36384: 6b 96 adiw r28, 0x1b ; 27 36386: 2f ad ldd r18, Y+63 ; 0x3f 36388: 6b 97 sbiw r28, 0x1b ; 27 3638a: 6d 96 adiw r28, 0x1d ; 29 3638c: 3f ad ldd r19, Y+63 ; 0x3f 3638e: 6d 97 sbiw r28, 0x1d ; 29 36390: a8 01 movw r20, r16 36392: 27 96 adiw r28, 0x07 ; 7 36394: 6f ad ldd r22, Y+63 ; 0x3f 36396: 27 97 sbiw r28, 0x07 ; 7 36398: 2b 96 adiw r28, 0x0b ; 11 3639a: 7f ad ldd r23, Y+63 ; 0x3f 3639c: 2b 97 sbiw r28, 0x0b ; 11 3639e: 2f 96 adiw r28, 0x0f ; 15 363a0: 8f ad ldd r24, Y+63 ; 0x3f 363a2: 2f 97 sbiw r28, 0x0f ; 15 363a4: 63 96 adiw r28, 0x13 ; 19 363a6: 9f ad ldd r25, Y+63 ; 0x3f 363a8: 63 97 sbiw r28, 0x13 ; 19 363aa: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 363ae: ec 96 adiw r28, 0x3c ; 60 363b0: 6c af std Y+60, r22 ; 0x3c 363b2: 7d af std Y+61, r23 ; 0x3d 363b4: 8e af std Y+62, r24 ; 0x3e 363b6: 9f af std Y+63, r25 ; 0x3f 363b8: 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; 363ba: 27 96 adiw r28, 0x07 ; 7 363bc: 8f ad ldd r24, Y+63 ; 0x3f 363be: 27 97 sbiw r28, 0x07 ; 7 363c0: 8d af std Y+61, r24 ; 0x3d 363c2: 2b 96 adiw r28, 0x0b ; 11 363c4: 9f ad ldd r25, Y+63 ; 0x3f 363c6: 2b 97 sbiw r28, 0x0b ; 11 363c8: 9d ab std Y+53, r25 ; 0x35 363ca: 2f 96 adiw r28, 0x0f ; 15 363cc: af ad ldd r26, Y+63 ; 0x3f 363ce: 2f 97 sbiw r28, 0x0f ; 15 363d0: ae af std Y+62, r26 ; 0x3e 363d2: 63 96 adiw r28, 0x13 ; 19 363d4: bf ad ldd r27, Y+63 ; 0x3f 363d6: 63 97 sbiw r28, 0x13 ; 19 363d8: 23 96 adiw r28, 0x03 ; 3 363da: bf af std Y+63, r27 ; 0x3f 363dc: 23 97 sbiw r28, 0x03 ; 3 363de: 2d eb ldi r18, 0xBD ; 189 363e0: 34 e0 ldi r19, 0x04 ; 4 363e2: e8 96 adiw r28, 0x38 ; 56 363e4: 3f af std Y+63, r19 ; 0x3f 363e6: 2e af std Y+62, r18 ; 0x3e 363e8: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 363ea: 41 2c mov r4, r1 363ec: 51 2c mov r5, r1 363ee: 30 e8 ldi r19, 0x80 ; 128 363f0: 63 2e mov r6, r19 363f2: 3f e3 ldi r19, 0x3F ; 63 363f4: 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]; 363f6: e8 96 adiw r28, 0x38 ; 56 363f8: ae ad ldd r26, Y+62 ; 0x3e 363fa: bf ad ldd r27, Y+63 ; 0x3f 363fc: e8 97 sbiw r28, 0x38 ; 56 363fe: 8d 90 ld r8, X+ 36400: 9d 90 ld r9, X+ 36402: ad 90 ld r10, X+ 36404: bd 90 ld r11, X+ 36406: e8 96 adiw r28, 0x38 ; 56 36408: bf af std Y+63, r27 ; 0x3f 3640a: ae af std Y+62, r26 ; 0x3e 3640c: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 3640e: a0 96 adiw r28, 0x20 ; 32 36410: ee ad ldd r30, Y+62 ; 0x3e 36412: ff ad ldd r31, Y+63 ; 0x3f 36414: a0 97 sbiw r28, 0x20 ; 32 36416: c1 90 ld r12, Z+ 36418: d1 90 ld r13, Z+ 3641a: e1 90 ld r14, Z+ 3641c: f1 90 ld r15, Z+ 3641e: a0 96 adiw r28, 0x20 ; 32 36420: ff af std Y+63, r31 ; 0x3f 36422: ee af std Y+62, r30 ; 0x3e 36424: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 36426: 6b 96 adiw r28, 0x1b ; 27 36428: 2f ad ldd r18, Y+63 ; 0x3f 3642a: 6b 97 sbiw r28, 0x1b ; 27 3642c: 6d 96 adiw r28, 0x1d ; 29 3642e: 3f ad ldd r19, Y+63 ; 0x3f 36430: 6d 97 sbiw r28, 0x1d ; 29 36432: a8 01 movw r20, r16 36434: 27 96 adiw r28, 0x07 ; 7 36436: 6f ad ldd r22, Y+63 ; 0x3f 36438: 27 97 sbiw r28, 0x07 ; 7 3643a: 2b 96 adiw r28, 0x0b ; 11 3643c: 7f ad ldd r23, Y+63 ; 0x3f 3643e: 2b 97 sbiw r28, 0x0b ; 11 36440: 2f 96 adiw r28, 0x0f ; 15 36442: 8f ad ldd r24, Y+63 ; 0x3f 36444: 2f 97 sbiw r28, 0x0f ; 15 36446: 63 96 adiw r28, 0x13 ; 19 36448: 9f ad ldd r25, Y+63 ; 0x3f 3644a: 63 97 sbiw r28, 0x13 ; 19 3644c: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36450: 87 ff sbrs r24, 7 36452: 0c c0 rjmp .+24 ; 0x3646c v_exit *= smaller_speed_factor; 36454: ec 96 adiw r28, 0x3c ; 60 36456: 2c ad ldd r18, Y+60 ; 0x3c 36458: 3d ad ldd r19, Y+61 ; 0x3d 3645a: 4e ad ldd r20, Y+62 ; 0x3e 3645c: 5f ad ldd r21, Y+63 ; 0x3f 3645e: ec 97 sbiw r28, 0x3c ; 60 36460: c5 01 movw r24, r10 36462: b4 01 movw r22, r8 36464: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36468: 4b 01 movw r8, r22 3646a: 5c 01 movw r10, r24 if (limited) { 3646c: a2 96 adiw r28, 0x22 ; 34 3646e: ff ad ldd r31, Y+63 ; 0x3f 36470: a2 97 sbiw r28, 0x22 ; 34 36472: ff 23 and r31, r31 36474: 81 f0 breq .+32 ; 0x36496 v_exit *= v_factor; 36476: a3 01 movw r20, r6 36478: 92 01 movw r18, r4 3647a: c5 01 movw r24, r10 3647c: b4 01 movw r22, r8 3647e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36482: 4b 01 movw r8, r22 36484: 5c 01 movw r10, r24 v_entry *= v_factor; 36486: a3 01 movw r20, r6 36488: 92 01 movw r18, r4 3648a: c7 01 movw r24, r14 3648c: b6 01 movw r22, r12 3648e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36492: 6b 01 movw r12, r22 36494: 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) ? 36496: a7 01 movw r20, r14 36498: 96 01 movw r18, r12 3649a: c5 01 movw r24, r10 3649c: b4 01 movw r22, r8 3649e: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 364a2: 20 e0 ldi r18, 0x00 ; 0 364a4: 30 e0 ldi r19, 0x00 ; 0 364a6: 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) ? 364a8: 18 16 cp r1, r24 364aa: 0c f0 brlt .+2 ; 0x364ae 364ac: a3 c5 rjmp .+2886 ; 0x36ff4 ((v_entry > 0.f || v_exit < 0.f) ? 364ae: c7 01 movw r24, r14 364b0: b6 01 movw r22, r12 364b2: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 364b6: 18 16 cp r1, r24 364b8: 4c f0 brlt .+18 ; 0x364cc 364ba: 20 e0 ldi r18, 0x00 ; 0 364bc: 30 e0 ldi r19, 0x00 ; 0 364be: a9 01 movw r20, r18 364c0: c5 01 movw r24, r10 364c2: b4 01 movw r22, r8 364c4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 364c8: 87 ff sbrs r24, 7 364ca: 85 c5 rjmp .+2826 ; 0x36fd6 364cc: a7 01 movw r20, r14 364ce: 96 01 movw r18, r12 364d0: c5 01 movw r24, r10 364d2: 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) ? 364d4: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 364d8: 6b 01 movw r12, r22 364da: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 364dc: ee 96 adiw r28, 0x3e ; 62 364de: ae ad ldd r26, Y+62 ; 0x3e 364e0: bf ad ldd r27, Y+63 ; 0x3f 364e2: ee 97 sbiw r28, 0x3e ; 62 364e4: 8d 90 ld r8, X+ 364e6: 9d 90 ld r9, X+ 364e8: ad 90 ld r10, X+ 364ea: bd 90 ld r11, X+ 364ec: ee 96 adiw r28, 0x3e ; 62 364ee: bf af std Y+63, r27 ; 0x3f 364f0: ae af std Y+62, r26 ; 0x3e 364f2: ee 97 sbiw r28, 0x3e ; 62 364f4: a5 01 movw r20, r10 364f6: 94 01 movw r18, r8 364f8: c7 01 movw r24, r14 364fa: b6 01 movw r22, r12 364fc: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36500: 18 16 cp r1, r24 36502: 94 f4 brge .+36 ; 0x36528 v_factor *= cs.max_jerk[axis] / jerk; 36504: a7 01 movw r20, r14 36506: 96 01 movw r18, r12 36508: c5 01 movw r24, r10 3650a: b4 01 movw r22, r8 3650c: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 36510: 9b 01 movw r18, r22 36512: ac 01 movw r20, r24 36514: c3 01 movw r24, r6 36516: b2 01 movw r22, r4 36518: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3651c: 2b 01 movw r4, r22 3651e: 3c 01 movw r6, r24 limited = true; 36520: b1 e0 ldi r27, 0x01 ; 1 36522: a2 96 adiw r28, 0x22 ; 34 36524: bf af std Y+63, r27 ; 0x3f 36526: 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) { 36528: ed ec ldi r30, 0xCD ; 205 3652a: f4 e0 ldi r31, 0x04 ; 4 3652c: e8 96 adiw r28, 0x38 ; 56 3652e: 2e ad ldd r18, Y+62 ; 0x3e 36530: 3f ad ldd r19, Y+63 ; 0x3f 36532: e8 97 sbiw r28, 0x38 ; 56 36534: e2 17 cp r30, r18 36536: f3 07 cpc r31, r19 36538: 09 f0 breq .+2 ; 0x3653c 3653a: 5d cf rjmp .-326 ; 0x363f6 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 3653c: a2 96 adiw r28, 0x22 ; 34 3653e: 3f ad ldd r19, Y+63 ; 0x3f 36540: a2 97 sbiw r28, 0x22 ; 34 36542: 33 23 and r19, r19 36544: 81 f0 breq .+32 ; 0x36566 vmax_junction *= v_factor; 36546: a3 01 movw r20, r6 36548: 92 01 movw r18, r4 3654a: 6d ad ldd r22, Y+61 ; 0x3d 3654c: 7d a9 ldd r23, Y+53 ; 0x35 3654e: 8e ad ldd r24, Y+62 ; 0x3e 36550: 23 96 adiw r28, 0x03 ; 3 36552: 9f ad ldd r25, Y+63 ; 0x3f 36554: 23 97 sbiw r28, 0x03 ; 3 36556: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3655a: 6d af std Y+61, r22 ; 0x3d 3655c: 7d ab std Y+53, r23 ; 0x35 3655e: 8e af std Y+62, r24 ; 0x3e 36560: 23 96 adiw r28, 0x03 ; 3 36562: 9f af std Y+63, r25 ; 0x3f 36564: 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; 36566: 24 ea ldi r18, 0xA4 ; 164 36568: 30 e7 ldi r19, 0x70 ; 112 3656a: 4d e7 ldi r20, 0x7D ; 125 3656c: 5f e3 ldi r21, 0x3F ; 63 3656e: 6d ad ldd r22, Y+61 ; 0x3d 36570: 7d a9 ldd r23, Y+53 ; 0x35 36572: 8e ad ldd r24, Y+62 ; 0x3e 36574: 23 96 adiw r28, 0x03 ; 3 36576: 9f ad ldd r25, Y+63 ; 0x3f 36578: 23 97 sbiw r28, 0x03 ; 3 3657a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3657e: 6b 01 movw r12, r22 36580: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 36582: ac 01 movw r20, r24 36584: 9b 01 movw r18, r22 36586: 60 91 e9 17 lds r22, 0x17E9 ; 0x8017e9 3658a: 70 91 ea 17 lds r23, 0x17EA ; 0x8017ea 3658e: 80 91 eb 17 lds r24, 0x17EB ; 0x8017eb 36592: 90 91 ec 17 lds r25, 0x17EC ; 0x8017ec 36596: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 3659a: 18 16 cp r1, r24 3659c: fc f4 brge .+62 ; 0x365dc 3659e: 29 a5 ldd r18, Y+41 ; 0x29 365a0: 3d a5 ldd r19, Y+45 ; 0x2d 365a2: 49 a9 ldd r20, Y+49 ; 0x31 365a4: 59 ad ldd r21, Y+57 ; 0x39 365a6: c7 01 movw r24, r14 365a8: b6 01 movw r22, r12 365aa: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 365ae: 87 ff sbrs r24, 7 365b0: 15 c0 rjmp .+42 ; 0x365dc // 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; 365b2: 8e e6 ldi r24, 0x6E ; 110 365b4: 82 9d mul r24, r2 365b6: f0 01 movw r30, r0 365b8: 83 9d mul r24, r3 365ba: f0 0d add r31, r0 365bc: 11 24 eor r1, r1 365be: ed 58 subi r30, 0x8D ; 141 365c0: f8 4f sbci r31, 0xF8 ; 248 365c2: 85 a9 ldd r24, Z+53 ; 0x35 365c4: 84 60 ori r24, 0x04 ; 4 365c6: 85 ab std Z+53, r24 ; 0x35 365c8: 49 a5 ldd r20, Y+41 ; 0x29 365ca: 4d af std Y+61, r20 ; 0x3d 365cc: 5d a5 ldd r21, Y+45 ; 0x2d 365ce: 5d ab std Y+53, r21 ; 0x35 365d0: 89 a9 ldd r24, Y+49 ; 0x31 365d2: 8e af std Y+62, r24 ; 0x3e 365d4: 99 ad ldd r25, Y+57 ; 0x39 365d6: 23 96 adiw r28, 0x03 ; 3 365d8: 9f af std Y+63, r25 ; 0x3f 365da: 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; 365dc: 8e e6 ldi r24, 0x6E ; 110 365de: 82 9d mul r24, r2 365e0: 80 01 movw r16, r0 365e2: 83 9d mul r24, r3 365e4: 10 0d add r17, r0 365e6: 11 24 eor r1, r1 365e8: 0d 58 subi r16, 0x8D ; 141 365ea: 18 4f sbci r17, 0xF8 ; 248 365ec: 8d ad ldd r24, Y+61 ; 0x3d 365ee: 9d a9 ldd r25, Y+53 ; 0x35 365f0: ae ad ldd r26, Y+62 ; 0x3e 365f2: 23 96 adiw r28, 0x03 ; 3 365f4: bf ad ldd r27, Y+63 ; 0x3f 365f6: 23 97 sbiw r28, 0x03 ; 3 365f8: f8 01 movw r30, r16 365fa: 81 a7 std Z+41, r24 ; 0x29 365fc: 92 a7 std Z+42, r25 ; 0x2a 365fe: a3 a7 std Z+43, r26 ; 0x2b 36600: 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); 36602: 29 a5 ldd r18, Y+41 ; 0x29 36604: 3d a5 ldd r19, Y+45 ; 0x2d 36606: 49 a9 ldd r20, Y+49 ; 0x31 36608: 59 ad ldd r21, Y+57 ; 0x39 3660a: 69 a5 ldd r22, Y+41 ; 0x29 3660c: 7d a5 ldd r23, Y+45 ; 0x2d 3660e: 89 a9 ldd r24, Y+49 ; 0x31 36610: 99 ad ldd r25, Y+57 ; 0x39 36612: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36616: 6b 01 movw r12, r22 36618: 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); 3661a: e2 96 adiw r28, 0x32 ; 50 3661c: 6c ad ldd r22, Y+60 ; 0x3c 3661e: 7d ad ldd r23, Y+61 ; 0x3d 36620: 8e ad ldd r24, Y+62 ; 0x3e 36622: 9f ad ldd r25, Y+63 ; 0x3f 36624: e2 97 sbiw r28, 0x32 ; 50 36626: 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); 36628: 9b 01 movw r18, r22 3662a: ac 01 movw r20, r24 3662c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 36630: d8 01 movw r26, r16 36632: 9d 96 adiw r26, 0x2d ; 45 36634: 2d 91 ld r18, X+ 36636: 3d 91 ld r19, X+ 36638: 4d 91 ld r20, X+ 3663a: 5c 91 ld r21, X 3663c: d0 97 sbiw r26, 0x30 ; 48 3663e: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36642: 9b 01 movw r18, r22 36644: ac 01 movw r20, r24 36646: c7 01 movw r24, r14 36648: b6 01 movw r22, r12 3664a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 3664e: 0f 94 3c e2 call 0x3c478 ; 0x3c478 36652: d6 2e mov r13, r22 36654: e7 2e mov r14, r23 36656: 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); 36658: 2d ad ldd r18, Y+61 ; 0x3d 3665a: 3d a9 ldd r19, Y+53 ; 0x35 3665c: 4e ad ldd r20, Y+62 ; 0x3e 3665e: 23 96 adiw r28, 0x03 ; 3 36660: 5f ad ldd r21, Y+63 ; 0x3f 36662: 23 97 sbiw r28, 0x03 ; 3 36664: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36668: 18 16 cp r1, r24 3666a: 34 f0 brlt .+12 ; 0x36678 3666c: dd ae std Y+61, r13 ; 0x3d 3666e: ed aa std Y+53, r14 ; 0x35 36670: 0e af std Y+62, r16 ; 0x3e 36672: 23 96 adiw r28, 0x03 ; 3 36674: 1f af std Y+63, r17 ; 0x3f 36676: 23 97 sbiw r28, 0x03 ; 3 36678: 8e e6 ldi r24, 0x6E ; 110 3667a: 82 9d mul r24, r2 3667c: f0 01 movw r30, r0 3667e: 83 9d mul r24, r3 36680: f0 0d add r31, r0 36682: 11 24 eor r1, r1 36684: ed 58 subi r30, 0x8D ; 141 36686: f8 4f sbci r31, 0xF8 ; 248 36688: 8d ad ldd r24, Y+61 ; 0x3d 3668a: 9d a9 ldd r25, Y+53 ; 0x35 3668c: ae ad ldd r26, Y+62 ; 0x3e 3668e: 23 96 adiw r28, 0x03 ; 3 36690: bf ad ldd r27, Y+63 ; 0x3f 36692: 23 97 sbiw r28, 0x03 ; 3 36694: 85 a3 std Z+37, r24 ; 0x25 36696: 96 a3 std Z+38, r25 ; 0x26 36698: a7 a3 std Z+39, r26 ; 0x27 3669a: 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; 3669c: f5 a8 ldd r15, Z+53 ; 0x35 3669e: 2d 2d mov r18, r13 366a0: 3e 2d mov r19, r14 366a2: a8 01 movw r20, r16 366a4: 27 96 adiw r28, 0x07 ; 7 366a6: 6f ad ldd r22, Y+63 ; 0x3f 366a8: 27 97 sbiw r28, 0x07 ; 7 366aa: 2b 96 adiw r28, 0x0b ; 11 366ac: 7f ad ldd r23, Y+63 ; 0x3f 366ae: 2b 97 sbiw r28, 0x0b ; 11 366b0: 2f 96 adiw r28, 0x0f ; 15 366b2: 8f ad ldd r24, Y+63 ; 0x3f 366b4: 2f 97 sbiw r28, 0x0f ; 15 366b6: 63 96 adiw r28, 0x13 ; 19 366b8: 9f ad ldd r25, Y+63 ; 0x3f 366ba: 63 97 sbiw r28, 0x13 ; 19 366bc: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 366c0: 18 16 cp r1, r24 366c2: 0c f4 brge .+2 ; 0x366c6 366c4: cf c4 rjmp .+2462 ; 0x37064 366c6: 83 e0 ldi r24, 0x03 ; 3 366c8: 9e e6 ldi r25, 0x6E ; 110 366ca: 92 9d mul r25, r2 366cc: 80 01 movw r16, r0 366ce: 93 9d mul r25, r3 366d0: 10 0d add r17, r0 366d2: 11 24 eor r1, r1 366d4: 0d 58 subi r16, 0x8D ; 141 366d6: 18 4f sbci r17, 0xF8 ; 248 366d8: f8 2a or r15, r24 366da: f8 01 movw r30, r16 366dc: 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[] 366de: 80 e1 ldi r24, 0x10 ; 16 366e0: fe 01 movw r30, r28 366e2: 71 96 adiw r30, 0x11 ; 17 366e4: ad eb ldi r26, 0xBD ; 189 366e6: b4 e0 ldi r27, 0x04 ; 4 366e8: 01 90 ld r0, Z+ 366ea: 0d 92 st X+, r0 366ec: 8a 95 dec r24 366ee: e1 f7 brne .-8 ; 0x366e8 previous_nominal_speed = block->nominal_speed; 366f0: 27 96 adiw r28, 0x07 ; 7 366f2: 8f ad ldd r24, Y+63 ; 0x3f 366f4: 27 97 sbiw r28, 0x07 ; 7 366f6: 2b 96 adiw r28, 0x0b ; 11 366f8: 9f ad ldd r25, Y+63 ; 0x3f 366fa: 2b 97 sbiw r28, 0x0b ; 11 366fc: 2f 96 adiw r28, 0x0f ; 15 366fe: af ad ldd r26, Y+63 ; 0x3f 36700: 2f 97 sbiw r28, 0x0f ; 15 36702: 63 96 adiw r28, 0x13 ; 19 36704: bf ad ldd r27, Y+63 ; 0x3f 36706: 63 97 sbiw r28, 0x13 ; 19 36708: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.506> 3670c: 90 93 ba 04 sts 0x04BA, r25 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.506+0x1> 36710: a0 93 bb 04 sts 0x04BB, r26 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.506+0x2> 36714: b0 93 bc 04 sts 0x04BC, r27 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.506+0x3> previous_safe_speed = safe_speed; 36718: 89 a5 ldd r24, Y+41 ; 0x29 3671a: 9d a5 ldd r25, Y+45 ; 0x2d 3671c: a9 a9 ldd r26, Y+49 ; 0x31 3671e: b9 ad ldd r27, Y+57 ; 0x39 36720: 80 93 e9 17 sts 0x17E9, r24 ; 0x8017e9 36724: 90 93 ea 17 sts 0x17EA, r25 ; 0x8017ea 36728: a0 93 eb 17 sts 0x17EB, r26 ; 0x8017eb 3672c: b0 93 ec 17 sts 0x17EC, r27 ; 0x8017ec // Precalculate the division, so when all the trapezoids in the planner queue get recalculated, the division is not repeated. block->speed_factor = block->nominal_rate / block->nominal_speed; 36730: d8 01 movw r26, r16 36732: d6 96 adiw r26, 0x36 ; 54 36734: 6d 91 ld r22, X+ 36736: 7d 91 ld r23, X+ 36738: 8d 91 ld r24, X+ 3673a: 9c 91 ld r25, X 3673c: d9 97 sbiw r26, 0x39 ; 57 3673e: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 36742: 27 96 adiw r28, 0x07 ; 7 36744: 2f ad ldd r18, Y+63 ; 0x3f 36746: 27 97 sbiw r28, 0x07 ; 7 36748: 2b 96 adiw r28, 0x0b ; 11 3674a: 3f ad ldd r19, Y+63 ; 0x3f 3674c: 2b 97 sbiw r28, 0x0b ; 11 3674e: 2f 96 adiw r28, 0x0f ; 15 36750: 4f ad ldd r20, Y+63 ; 0x3f 36752: 2f 97 sbiw r28, 0x0f ; 15 36754: 63 96 adiw r28, 0x13 ; 19 36756: 5f ad ldd r21, Y+63 ; 0x3f 36758: 63 97 sbiw r28, 0x13 ; 19 3675a: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 3675e: 2b 01 movw r4, r22 36760: 3c 01 movw r6, r24 36762: f8 01 movw r30, r16 36764: e8 5b subi r30, 0xB8 ; 184 36766: ff 4f sbci r31, 0xFF ; 255 36768: 40 82 st Z, r4 3676a: 51 82 std Z+1, r5 ; 0x01 3676c: 62 82 std Z+2, r6 ; 0x02 3676e: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 36770: 34 96 adiw r30, 0x04 ; 4 36772: 80 81 ld r24, Z 36774: 88 23 and r24, r24 36776: 09 f4 brne .+2 ; 0x3677a 36778: 89 c0 rjmp .+274 ; 0x3688c // 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)) 3677a: 20 91 04 18 lds r18, 0x1804 ; 0x801804 3677e: 30 91 05 18 lds r19, 0x1805 ; 0x801805 36782: 40 91 06 18 lds r20, 0x1806 ; 0x801806 36786: 50 91 07 18 lds r21, 0x1807 ; 0x801807 3678a: 6a 96 adiw r28, 0x1a ; 26 3678c: 6c ad ldd r22, Y+60 ; 0x3c 3678e: 7d ad ldd r23, Y+61 ; 0x3d 36790: 8e ad ldd r24, Y+62 ; 0x3e 36792: 9f ad ldd r25, Y+63 ; 0x3f 36794: 6a 97 sbiw r28, 0x1a ; 26 36796: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3679a: 4b 01 movw r8, r22 3679c: 5c 01 movw r10, r24 3679e: c0 90 7b 06 lds r12, 0x067B ; 0x80067b 367a2: d0 90 7c 06 lds r13, 0x067C ; 0x80067c 367a6: e0 90 7d 06 lds r14, 0x067D ; 0x80067d 367aa: f0 90 7e 06 lds r15, 0x067E ; 0x80067e block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 367ae: 0c 5a subi r16, 0xAC ; 172 367b0: 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)) 367b2: a7 01 movw r20, r14 367b4: 96 01 movw r18, r12 367b6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 367ba: a3 01 movw r20, r6 367bc: 92 01 movw r18, r4 367be: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 367c2: f8 01 movw r30, r16 367c4: 60 83 st Z, r22 367c6: 71 83 std Z+1, r23 ; 0x01 367c8: 82 83 std Z+2, r24 ; 0x02 367ca: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 367cc: 20 e0 ldi r18, 0x00 ; 0 367ce: 30 e0 ldi r19, 0x00 ; 0 367d0: a9 01 movw r20, r18 367d2: 6a 96 adiw r28, 0x1a ; 26 367d4: 6c ad ldd r22, Y+60 ; 0x3c 367d6: 7d ad ldd r23, Y+61 ; 0x3d 367d8: 8e ad ldd r24, Y+62 ; 0x3e 367da: 9f ad ldd r25, Y+63 ; 0x3f 367dc: 6a 97 sbiw r28, 0x1a ; 26 367de: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 367e2: 18 16 cp r1, r24 367e4: 0c f0 brlt .+2 ; 0x367e8 367e6: 40 c4 rjmp .+2176 ; 0x37068 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 367e8: a5 01 movw r20, r10 367ea: 94 01 movw r18, r8 367ec: e2 96 adiw r28, 0x32 ; 50 367ee: 6c ad ldd r22, Y+60 ; 0x3c 367f0: 7d ad ldd r23, Y+61 ; 0x3d 367f2: 8e ad ldd r24, Y+62 ; 0x3e 367f4: 9f ad ldd r25, Y+63 ; 0x3f 367f6: e2 97 sbiw r28, 0x32 ; 50 367f8: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 367fc: a7 01 movw r20, r14 367fe: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 36800: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36804: 6b 01 movw r12, r22 36806: 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; 36808: 20 e0 ldi r18, 0x00 ; 0 3680a: 30 e4 ldi r19, 0x40 ; 64 3680c: 4c e1 ldi r20, 0x1C ; 28 3680e: 57 e4 ldi r21, 0x47 ; 71 36810: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36814: 18 16 cp r1, r24 36816: 3c f4 brge .+14 ; 0x36826 36818: c1 2c mov r12, r1 3681a: 20 e4 ldi r18, 0x40 ; 64 3681c: d2 2e mov r13, r18 3681e: 2c e1 ldi r18, 0x1C ; 28 36820: e2 2e mov r14, r18 36822: 27 e4 ldi r18, 0x47 ; 71 36824: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 36826: a7 01 movw r20, r14 36828: 96 01 movw r18, r12 3682a: 60 e0 ldi r22, 0x00 ; 0 3682c: 74 e2 ldi r23, 0x24 ; 36 3682e: 84 ef ldi r24, 0xF4 ; 244 36830: 99 e4 ldi r25, 0x49 ; 73 36832: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 36836: 4b 01 movw r8, r22 36838: 5c 01 movw r10, r24 if (advance_speed > 20000) { 3683a: 20 e0 ldi r18, 0x00 ; 0 3683c: 30 e4 ldi r19, 0x40 ; 64 3683e: 4c e9 ldi r20, 0x9C ; 156 36840: 56 e4 ldi r21, 0x46 ; 70 36842: c7 01 movw r24, r14 36844: b6 01 movw r22, r12 36846: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 3684a: 18 16 cp r1, r24 3684c: 0c f0 brlt .+2 ; 0x36850 3684e: 17 c4 rjmp .+2094 ; 0x3707e block->advance_rate = advance_rate * 4; 36850: 8e e6 ldi r24, 0x6E ; 110 36852: 82 9d mul r24, r2 36854: 80 01 movw r16, r0 36856: 83 9d mul r24, r3 36858: 10 0d add r17, r0 3685a: 11 24 eor r1, r1 3685c: 0d 58 subi r16, 0x8D ; 141 3685e: 18 4f sbci r17, 0xF8 ; 248 36860: 78 01 movw r14, r16 36862: fd e4 ldi r31, 0x4D ; 77 36864: ef 0e add r14, r31 36866: f1 1c adc r15, r1 36868: 20 e0 ldi r18, 0x00 ; 0 3686a: 30 e0 ldi r19, 0x00 ; 0 3686c: 40 e8 ldi r20, 0x80 ; 128 3686e: 50 e4 ldi r21, 0x40 ; 64 36870: c5 01 movw r24, r10 36872: b4 01 movw r22, r8 36874: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36878: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 3687c: d7 01 movw r26, r14 3687e: 6d 93 st X+, r22 36880: 7c 93 st X, r23 block->advance_step_loops = 4; 36882: f8 01 movw r30, r16 36884: ed 5a subi r30, 0xAD ; 173 36886: ff 4f sbci r31, 0xFF ; 255 36888: 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; 3688a: 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); 3688c: 09 a5 ldd r16, Y+41 ; 0x29 3688e: 1d a5 ldd r17, Y+45 ; 0x2d 36890: 29 a9 ldd r18, Y+49 ; 0x31 36892: 39 ad ldd r19, Y+57 ; 0x39 36894: 4d ad ldd r20, Y+61 ; 0x3d 36896: 5d a9 ldd r21, Y+53 ; 0x35 36898: 6e ad ldd r22, Y+62 ; 0x3e 3689a: 23 96 adiw r28, 0x03 ; 3 3689c: 7f ad ldd r23, Y+63 ; 0x3f 3689e: 23 97 sbiw r28, 0x03 ; 3 368a0: a4 96 adiw r28, 0x24 ; 36 368a2: 8e ad ldd r24, Y+62 ; 0x3e 368a4: 9f ad ldd r25, Y+63 ; 0x3f 368a6: a4 97 sbiw r28, 0x24 ; 36 368a8: 8d 58 subi r24, 0x8D ; 141 368aa: 98 4f sbci r25, 0xF8 ; 248 368ac: 0f 94 3a a1 call 0x34274 ; 0x34274 if (block->step_event_count.wide <= 32767) 368b0: 8e e6 ldi r24, 0x6E ; 110 368b2: 82 9d mul r24, r2 368b4: f0 01 movw r30, r0 368b6: 83 9d mul r24, r3 368b8: f0 0d add r31, r0 368ba: 11 24 eor r1, r1 368bc: ed 58 subi r30, 0x8D ; 141 368be: f8 4f sbci r31, 0xF8 ; 248 368c0: 80 89 ldd r24, Z+16 ; 0x10 368c2: 91 89 ldd r25, Z+17 ; 0x11 368c4: a2 89 ldd r26, Z+18 ; 0x12 368c6: b3 89 ldd r27, Z+19 ; 0x13 368c8: 81 15 cp r24, r1 368ca: 90 48 sbci r25, 0x80 ; 128 368cc: a1 05 cpc r26, r1 368ce: b1 05 cpc r27, r1 368d0: 18 f4 brcc .+6 ; 0x368d8 block->flag |= BLOCK_FLAG_DDA_LOWRES; 368d2: 85 a9 ldd r24, Z+53 ; 0x35 368d4: 88 60 ori r24, 0x08 ; 8 368d6: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 368d8: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 368da: 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; 368dc: 90 91 5a 0e lds r25, 0x0E5A ; 0x800e5a 368e0: 91 11 cpse r25, r1 368e2: 93 c4 rjmp .+2342 ; 0x3720a block_buffer_head = next_buffer_head; 368e4: a1 96 adiw r28, 0x21 ; 33 368e6: 3f ad ldd r19, Y+63 ; 0x3f 368e8: a1 97 sbiw r28, 0x21 ; 33 368ea: 30 93 53 0e sts 0x0E53, r19 ; 0x800e53 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 368ee: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 368f0: c2 58 subi r28, 0x82 ; 130 368f2: df 4f sbci r29, 0xFF ; 255 368f4: 88 81 ld r24, Y 368f6: 99 81 ldd r25, Y+1 ; 0x01 368f8: aa 81 ldd r26, Y+2 ; 0x02 368fa: bb 81 ldd r27, Y+3 ; 0x03 368fc: ce 57 subi r28, 0x7E ; 126 368fe: d0 40 sbci r29, 0x00 ; 0 36900: 80 93 51 07 sts 0x0751, r24 ; 0x800751 36904: 90 93 52 07 sts 0x0752, r25 ; 0x800752 36908: a0 93 53 07 sts 0x0753, r26 ; 0x800753 3690c: b0 93 54 07 sts 0x0754, r27 ; 0x800754 36910: ce 57 subi r28, 0x7E ; 126 36912: df 4f sbci r29, 0xFF ; 255 36914: 28 81 ld r18, Y 36916: 39 81 ldd r19, Y+1 ; 0x01 36918: 4a 81 ldd r20, Y+2 ; 0x02 3691a: 5b 81 ldd r21, Y+3 ; 0x03 3691c: c2 58 subi r28, 0x82 ; 130 3691e: d0 40 sbci r29, 0x00 ; 0 36920: 20 93 55 07 sts 0x0755, r18 ; 0x800755 36924: 30 93 56 07 sts 0x0756, r19 ; 0x800756 36928: 40 93 57 07 sts 0x0757, r20 ; 0x800757 3692c: 50 93 58 07 sts 0x0758, r21 ; 0x800758 36930: e6 96 adiw r28, 0x36 ; 54 36932: 8c ad ldd r24, Y+60 ; 0x3c 36934: 9d ad ldd r25, Y+61 ; 0x3d 36936: ae ad ldd r26, Y+62 ; 0x3e 36938: bf ad ldd r27, Y+63 ; 0x3f 3693a: e6 97 sbiw r28, 0x36 ; 54 3693c: 80 93 59 07 sts 0x0759, r24 ; 0x800759 36940: 90 93 5a 07 sts 0x075A, r25 ; 0x80075a 36944: a0 93 5b 07 sts 0x075B, r26 ; 0x80075b 36948: b0 93 5c 07 sts 0x075C, r27 ; 0x80075c 3694c: ae 96 adiw r28, 0x2e ; 46 3694e: 2c ad ldd r18, Y+60 ; 0x3c 36950: 3d ad ldd r19, Y+61 ; 0x3d 36952: 4e ad ldd r20, Y+62 ; 0x3e 36954: 5f ad ldd r21, Y+63 ; 0x3f 36956: ae 97 sbiw r28, 0x2e ; 46 36958: 20 93 5d 07 sts 0x075D, r18 ; 0x80075d 3695c: 30 93 5e 07 sts 0x075E, r19 ; 0x80075e 36960: 40 93 5f 07 sts 0x075F, r20 ; 0x80075f 36964: 50 93 60 07 sts 0x0760, r21 ; 0x800760 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 36968: 89 a1 ldd r24, Y+33 ; 0x21 3696a: 9a a1 ldd r25, Y+34 ; 0x22 3696c: ab a1 ldd r26, Y+35 ; 0x23 3696e: bc a1 ldd r27, Y+36 ; 0x24 36970: 80 93 cd 04 sts 0x04CD, r24 ; 0x8004cd 36974: 90 93 ce 04 sts 0x04CE, r25 ; 0x8004ce 36978: a0 93 cf 04 sts 0x04CF, r26 ; 0x8004cf 3697c: b0 93 d0 04 sts 0x04D0, r27 ; 0x8004d0 position_float[Y_AXIS] = y; 36980: 8d a1 ldd r24, Y+37 ; 0x25 36982: 9e a1 ldd r25, Y+38 ; 0x26 36984: af a1 ldd r26, Y+39 ; 0x27 36986: b8 a5 ldd r27, Y+40 ; 0x28 36988: 80 93 d1 04 sts 0x04D1, r24 ; 0x8004d1 3698c: 90 93 d2 04 sts 0x04D2, r25 ; 0x8004d2 36990: a0 93 d3 04 sts 0x04D3, r26 ; 0x8004d3 36994: b0 93 d4 04 sts 0x04D4, r27 ; 0x8004d4 position_float[Z_AXIS] = z; 36998: a8 96 adiw r28, 0x28 ; 40 3699a: 8c ad ldd r24, Y+60 ; 0x3c 3699c: 9d ad ldd r25, Y+61 ; 0x3d 3699e: ae ad ldd r26, Y+62 ; 0x3e 369a0: bf ad ldd r27, Y+63 ; 0x3f 369a2: a8 97 sbiw r28, 0x28 ; 40 369a4: 80 93 d5 04 sts 0x04D5, r24 ; 0x8004d5 369a8: 90 93 d6 04 sts 0x04D6, r25 ; 0x8004d6 369ac: a0 93 d7 04 sts 0x04D7, r26 ; 0x8004d7 369b0: b0 93 d8 04 sts 0x04D8, r27 ; 0x8004d8 position_float[E_AXIS] = e; 369b4: aa 96 adiw r28, 0x2a ; 42 369b6: ee ad ldd r30, Y+62 ; 0x3e 369b8: ff ad ldd r31, Y+63 ; 0x3f 369ba: aa 97 sbiw r28, 0x2a ; 42 369bc: 80 81 ld r24, Z 369be: 91 81 ldd r25, Z+1 ; 0x01 369c0: a2 81 ldd r26, Z+2 ; 0x02 369c2: b3 81 ldd r27, Z+3 ; 0x03 369c4: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 369c8: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 369cc: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 369d0: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc void planner_recalculate(const float &safe_final_speed) { // Reverse pass // Make a local copy of block_buffer_tail, because the interrupt can alter it // by consuming the blocks, therefore shortening the queue. uint8_t tail = block_buffer_tail; 369d4: f0 90 54 0e lds r15, 0x0E54 ; 0x800e54 block_t *prev, *current, *next; // SERIAL_ECHOLNPGM("planner_recalculate - 1"); // At least three blocks are in the queue? uint8_t n_blocks = (block_buffer_head + BLOCK_BUFFER_SIZE - tail) & (BLOCK_BUFFER_SIZE - 1); 369d8: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 369dc: 8f 19 sub r24, r15 369de: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 369e0: 83 30 cpi r24, 0x03 ; 3 369e2: 40 f1 brcs .+80 ; 0x36a34 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 369e4: 10 91 53 0e lds r17, 0x0E53 ; 0x800e53 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 369e8: 11 11 cpse r17, r1 369ea: 01 c0 rjmp .+2 ; 0x369ee block_index = BLOCK_BUFFER_SIZE; 369ec: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 369ee: 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; 369f0: fe e6 ldi r31, 0x6E ; 110 369f2: 1f 9f mul r17, r31 369f4: c0 01 movw r24, r0 369f6: 11 24 eor r1, r1 369f8: 9c 01 movw r18, r24 369fa: 2d 58 subi r18, 0x8D ; 141 369fc: 38 4f sbci r19, 0xF8 ; 248 369fe: 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) 36a00: 11 11 cpse r17, r1 36a02: 01 c0 rjmp .+2 ; 0x36a06 block_index = BLOCK_BUFFER_SIZE; 36a04: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36a06: 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)); 36a08: 3e e6 ldi r19, 0x6E ; 110 36a0a: 13 9f mul r17, r19 36a0c: c0 01 movw r24, r0 36a0e: 11 24 eor r1, r1 36a10: ac 01 movw r20, r24 36a12: 4d 58 subi r20, 0x8D ; 141 36a14: 58 4f sbci r21, 0xF8 ; 248 36a16: 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)); 36a18: 9e e6 ldi r25, 0x6E ; 110 36a1a: 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) { 36a1c: f1 16 cp r15, r17 36a1e: 69 f0 breq .+26 ; 0x36a3a if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 36a20: d6 01 movw r26, r12 36a22: d5 96 adiw r26, 0x35 ; 53 36a24: 0c 91 ld r16, X 36a26: 02 ff sbrs r16, 2 36a28: 7e c3 rjmp .+1788 ; 0x37126 // 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); 36a2a: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 36a2e: 81 1b sub r24, r17 36a30: 8f 70 andi r24, 0x0F ; 15 36a32: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 36a34: 82 30 cpi r24, 0x02 ; 2 36a36: 08 f4 brcc .+2 ; 0x36a3a 36a38: a3 c0 rjmp .+326 ; 0x36b80 // 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; 36a3a: 3e e6 ldi r19, 0x6E ; 110 36a3c: f3 9e mul r15, r19 36a3e: c0 01 movw r24, r0 36a40: 11 24 eor r1, r1 36a42: ac 01 movw r20, r24 36a44: 4d 58 subi r20, 0x8D ; 141 36a46: 58 4f sbci r21, 0xF8 ; 248 36a48: 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) 36a4a: f3 94 inc r15 36a4c: 50 e1 ldi r21, 0x10 ; 16 36a4e: f5 12 cpse r15, r21 36a50: 01 c0 rjmp .+2 ; 0x36a54 block_index = 0; 36a52: 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)); 36a54: ae e6 ldi r26, 0x6E ; 110 36a56: fa 9e mul r15, r26 36a58: c0 01 movw r24, r0 36a5a: 11 24 eor r1, r1 36a5c: fc 01 movw r30, r24 36a5e: ed 58 subi r30, 0x8D ; 141 36a60: f8 4f sbci r31, 0xF8 ; 248 36a62: 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)); 36a64: 8e e6 ldi r24, 0x6E ; 110 36a66: 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) { 36a68: d5 01 movw r26, r10 36a6a: d5 96 adiw r26, 0x35 ; 53 36a6c: 8c 91 ld r24, X 36a6e: d5 97 sbiw r26, 0x35 ; 53 36a70: 81 fd sbrc r24, 1 36a72: 5a c0 rjmp .+180 ; 0x36b28 36a74: 95 96 adiw r26, 0x25 ; 37 36a76: 4d 90 ld r4, X+ 36a78: 5d 90 ld r5, X+ 36a7a: 6d 90 ld r6, X+ 36a7c: 7c 90 ld r7, X 36a7e: 98 97 sbiw r26, 0x28 ; 40 36a80: f6 01 movw r30, r12 36a82: 95 a0 ldd r9, Z+37 ; 0x25 36a84: e6 a0 ldd r14, Z+38 ; 0x26 36a86: 07 a1 ldd r16, Z+39 ; 0x27 36a88: 10 a5 ldd r17, Z+40 ; 0x28 36a8a: 29 2d mov r18, r9 36a8c: 3e 2d mov r19, r14 36a8e: a8 01 movw r20, r16 36a90: c3 01 movw r24, r6 36a92: b2 01 movw r22, r4 36a94: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36a98: 87 ff sbrs r24, 7 36a9a: 46 c0 rjmp .+140 ; 0x36b28 // 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); 36a9c: a3 01 movw r20, r6 36a9e: 92 01 movw r18, r4 36aa0: c3 01 movw r24, r6 36aa2: b2 01 movw r22, r4 36aa4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36aa8: 2b 01 movw r4, r22 36aaa: 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)); 36aac: d5 01 movw r26, r10 36aae: d1 96 adiw r26, 0x31 ; 49 36ab0: 6d 91 ld r22, X+ 36ab2: 7d 91 ld r23, X+ 36ab4: 8d 91 ld r24, X+ 36ab6: 9c 91 ld r25, X 36ab8: d4 97 sbiw r26, 0x34 ; 52 36aba: 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); 36abc: 9b 01 movw r18, r22 36abe: ac 01 movw r20, r24 36ac0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 36ac4: f5 01 movw r30, r10 36ac6: 25 a5 ldd r18, Z+45 ; 0x2d 36ac8: 36 a5 ldd r19, Z+46 ; 0x2e 36aca: 47 a5 ldd r20, Z+47 ; 0x2f 36acc: 50 a9 ldd r21, Z+48 ; 0x30 36ace: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36ad2: 9b 01 movw r18, r22 36ad4: ac 01 movw r20, r24 36ad6: c3 01 movw r24, r6 36ad8: b2 01 movw r22, r4 36ada: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 36ade: 0f 94 3c e2 call 0x3c478 ; 0x3c478 36ae2: 2b 01 movw r4, r22 36ae4: 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)); 36ae6: 9b 01 movw r18, r22 36ae8: ac 01 movw r20, r24 36aea: 69 2d mov r22, r9 36aec: 7e 2d mov r23, r14 36aee: c8 01 movw r24, r16 36af0: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36af4: 87 ff sbrs r24, 7 36af6: 03 c0 rjmp .+6 ; 0x36afe 36af8: 49 2c mov r4, r9 36afa: 5e 2c mov r5, r14 36afc: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 36afe: 92 01 movw r18, r4 36b00: a3 01 movw r20, r6 36b02: 69 2d mov r22, r9 36b04: 7e 2d mov r23, r14 36b06: c8 01 movw r24, r16 36b08: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36b0c: 88 23 and r24, r24 36b0e: 61 f0 breq .+24 ; 0x36b28 36b10: d6 01 movw r26, r12 36b12: d5 96 adiw r26, 0x35 ; 53 36b14: 2c 91 ld r18, X current->entry_speed = entry_speed; 36b16: c2 01 movw r24, r4 36b18: d3 01 movw r26, r6 36b1a: f6 01 movw r30, r12 36b1c: 85 a3 std Z+37, r24 ; 0x25 36b1e: 96 a3 std Z+38, r25 ; 0x26 36b20: a7 a3 std Z+39, r26 ; 0x27 36b22: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 36b24: 21 60 ori r18, 0x01 ; 1 36b26: 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) { 36b28: d5 01 movw r26, r10 36b2a: d5 96 adiw r26, 0x35 ; 53 36b2c: 8c 91 ld r24, X 36b2e: d5 97 sbiw r26, 0x35 ; 53 36b30: f6 01 movw r30, r12 36b32: 95 a9 ldd r25, Z+53 ; 0x35 36b34: 89 2b or r24, r25 36b36: 80 ff sbrs r24, 0 36b38: 14 c0 rjmp .+40 ; 0x36b62 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 36b3a: 05 a1 ldd r16, Z+37 ; 0x25 36b3c: 16 a1 ldd r17, Z+38 ; 0x26 36b3e: 27 a1 ldd r18, Z+39 ; 0x27 36b40: 30 a5 ldd r19, Z+40 ; 0x28 36b42: 95 96 adiw r26, 0x25 ; 37 36b44: 4d 91 ld r20, X+ 36b46: 5d 91 ld r21, X+ 36b48: 6d 91 ld r22, X+ 36b4a: 7c 91 ld r23, X 36b4c: 98 97 sbiw r26, 0x28 ; 40 36b4e: c5 01 movw r24, r10 36b50: 0f 94 3a a1 call 0x34274 ; 0x34274 // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 36b54: d5 01 movw r26, r10 36b56: d5 96 adiw r26, 0x35 ; 53 36b58: 8c 91 ld r24, X 36b5a: d5 97 sbiw r26, 0x35 ; 53 36b5c: 8e 7f andi r24, 0xFE ; 254 36b5e: d5 96 adiw r26, 0x35 ; 53 36b60: 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) 36b62: f3 94 inc r15 36b64: b0 e1 ldi r27, 0x10 ; 16 36b66: fb 12 cpse r15, r27 36b68: 01 c0 rjmp .+2 ; 0x36b6c block_index = 0; 36b6a: 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)); 36b6c: f8 9c mul r15, r8 36b6e: c0 01 movw r24, r0 36b70: 11 24 eor r1, r1 36b72: 8d 58 subi r24, 0x8D ; 141 36b74: 98 4f sbci r25, 0xF8 ; 248 } while (block_index != block_buffer_head); 36b76: 20 91 53 0e lds r18, 0x0E53 ; 0x800e53 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; } prev = current; 36b7a: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 36b7c: f2 12 cpse r15, r18 36b7e: 43 c3 rjmp .+1670 ; 0x37206 } // 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); 36b80: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 36b84: 81 11 cpse r24, r1 36b86: 01 c0 rjmp .+2 ; 0x36b8a block_index = BLOCK_BUFFER_SIZE; 36b88: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 36b8a: 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); 36b8c: ee e6 ldi r30, 0x6E ; 110 36b8e: 8e 9f mul r24, r30 36b90: c0 01 movw r24, r0 36b92: 11 24 eor r1, r1 36b94: 9c 01 movw r18, r24 36b96: 2d 58 subi r18, 0x8D ; 141 36b98: 38 4f sbci r19, 0xF8 ; 248 36b9a: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 36b9c: d9 01 movw r26, r18 36b9e: 95 96 adiw r26, 0x25 ; 37 36ba0: 4d 91 ld r20, X+ 36ba2: 5d 91 ld r21, X+ 36ba4: 6d 91 ld r22, X+ 36ba6: 7c 91 ld r23, X 36ba8: 98 97 sbiw r26, 0x28 ; 40 36baa: 09 a5 ldd r16, Y+41 ; 0x29 36bac: 1d a5 ldd r17, Y+45 ; 0x2d 36bae: 29 a9 ldd r18, Y+49 ; 0x31 36bb0: 39 ad ldd r19, Y+57 ; 0x39 36bb2: c7 01 movw r24, r14 36bb4: 0f 94 3a a1 call 0x34274 ; 0x34274 current->flag &= ~BLOCK_FLAG_RECALCULATE; 36bb8: f7 01 movw r30, r14 36bba: 85 a9 ldd r24, Z+53 ; 0x35 36bbc: 8e 7f andi r24, 0xFE ; 254 36bbe: 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(); 36bc0: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36bc4: 82 60 ori r24, 0x02 ; 2 36bc6: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36bca: 0d 94 5a ab jmp 0x356b4 ; 0x356b4 // 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)); 36bce: a5 53 subi r26, 0x35 ; 53 36bd0: b8 4f sbci r27, 0xF8 ; 248 36bd2: 80 e1 ldi r24, 0x10 ; 16 36bd4: e0 e4 ldi r30, 0x40 ; 64 36bd6: f7 e0 ldi r31, 0x07 ; 7 36bd8: 0d 94 95 ab jmp 0x3572a ; 0x3572a 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]); 36bdc: 20 91 77 06 lds r18, 0x0677 ; 0x800677 36be0: 30 91 78 06 lds r19, 0x0678 ; 0x800678 36be4: 40 91 79 06 lds r20, 0x0679 ; 0x800679 36be8: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 36bec: a8 96 adiw r28, 0x28 ; 40 36bee: 6c ad ldd r22, Y+60 ; 0x3c 36bf0: 7d ad ldd r23, Y+61 ; 0x3d 36bf2: 8e ad ldd r24, Y+62 ; 0x3e 36bf4: 9f ad ldd r25, Y+63 ; 0x3f 36bf6: a8 97 sbiw r28, 0x28 ; 40 36bf8: 0d 94 2b ac jmp 0x35856 ; 0x35856 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); 36bfc: 81 e0 ldi r24, 0x01 ; 1 36bfe: 80 8f std Z+24, r24 ; 0x18 36c00: 0d 94 d1 ad jmp 0x35ba2 ; 0x35ba2 { if(feed_rate 36c08: b0 90 a8 06 lds r11, 0x06A8 ; 0x8006a8 36c0c: 00 91 a9 06 lds r16, 0x06A9 ; 0x8006a9 36c10: 10 91 aa 06 lds r17, 0x06AA ; 0x8006aa 36c14: 4c c8 rjmp .-3944 ; 0x35cae 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])); 36c16: c5 01 movw r24, r10 36c18: b4 01 movw r22, r8 36c1a: 0f 94 0f d8 call 0x3b01e ; 0x3b01e 36c1e: 4b 01 movw r8, r22 36c20: 5c 01 movw r10, r24 36c22: c7 01 movw r24, r14 36c24: b6 01 movw r22, r12 36c26: 0f 94 0f d8 call 0x3b01e ; 0x3b01e 36c2a: 9b 01 movw r18, r22 36c2c: ac 01 movw r20, r24 36c2e: c5 01 movw r24, r10 36c30: b4 01 movw r22, r8 36c32: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 36c36: 6b 01 movw r12, r22 36c38: 7c 01 movw r14, r24 36c3a: 22 96 adiw r28, 0x02 ; 2 36c3c: 6c ad ldd r22, Y+60 ; 0x3c 36c3e: 7d ad ldd r23, Y+61 ; 0x3d 36c40: 8e ad ldd r24, Y+62 ; 0x3e 36c42: 9f ad ldd r25, Y+63 ; 0x3f 36c44: 22 97 sbiw r28, 0x02 ; 2 36c46: 0f 94 0f d8 call 0x3b01e ; 0x3b01e 36c4a: 9b 01 movw r18, r22 36c4c: ac 01 movw r20, r24 36c4e: c7 01 movw r24, r14 36c50: b6 01 movw r22, r12 36c52: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 36c56: 0f 94 3c e2 call 0x3c478 ; 0x3c478 36c5a: 2e e6 ldi r18, 0x6E ; 110 36c5c: 22 9d mul r18, r2 36c5e: f0 01 movw r30, r0 36c60: 23 9d mul r18, r3 36c62: f0 0d add r31, r0 36c64: 11 24 eor r1, r1 36c66: ed 58 subi r30, 0x8D ; 141 36c68: f8 4f sbci r31, 0xF8 ; 248 36c6a: 65 a7 std Z+45, r22 ; 0x2d 36c6c: 76 a7 std Z+46, r23 ; 0x2e 36c6e: 87 a7 std Z+47, r24 ; 0x2f 36c70: 90 ab std Z+48, r25 ; 0x30 36c72: bb c8 rjmp .-3722 ; 0x35dea 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 36c74: 2a 96 adiw r28, 0x0a ; 10 36c76: 2c ad ldd r18, Y+60 ; 0x3c 36c78: 3d ad ldd r19, Y+61 ; 0x3d 36c7a: 4e ad ldd r20, Y+62 ; 0x3e 36c7c: 5f ad ldd r21, Y+63 ; 0x3f 36c7e: 2a 97 sbiw r28, 0x0a ; 10 36c80: 23 2b or r18, r19 36c82: 24 2b or r18, r20 36c84: 25 2b or r18, r21 36c86: 09 f4 brne .+2 ; 0x36c8a 36c88: 0e c1 rjmp .+540 ; 0x36ea6 36c8a: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 36c8e: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 36c92: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 36c96: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 36c9a: 29 a5 ldd r18, Y+41 ; 0x29 36c9c: 3a a5 ldd r19, Y+42 ; 0x2a 36c9e: 4b a5 ldd r20, Y+43 ; 0x2b 36ca0: 5c a5 ldd r21, Y+44 ; 0x2c 36ca2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36ca6: 0f 94 4c df call 0x3be98 ; 0x3be98 36caa: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 36cae: 2b 01 movw r4, r22 36cb0: 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 36cb2: 80 91 04 18 lds r24, 0x1804 ; 0x801804 36cb6: 90 91 05 18 lds r25, 0x1805 ; 0x801805 36cba: a0 91 06 18 lds r26, 0x1806 ; 0x801806 36cbe: b0 91 07 18 lds r27, 0x1807 ; 0x801807 36cc2: 8d a7 std Y+45, r24 ; 0x2d 36cc4: 9e a7 std Y+46, r25 ; 0x2e 36cc6: af a7 std Y+47, r26 ; 0x2f 36cc8: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 36cca: 20 e0 ldi r18, 0x00 ; 0 36ccc: 30 e0 ldi r19, 0x00 ; 0 36cce: a9 01 movw r20, r18 36cd0: bc 01 movw r22, r24 36cd2: cd 01 movw r24, r26 36cd4: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36cd8: 18 16 cp r1, r24 36cda: 0c f0 brlt .+2 ; 0x36cde 36cdc: ed c0 rjmp .+474 ; 0x36eb8 * 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 36cde: 20 e0 ldi r18, 0x00 ; 0 36ce0: 30 e0 ldi r19, 0x00 ; 0 36ce2: a9 01 movw r20, r18 36ce4: 26 96 adiw r28, 0x06 ; 6 36ce6: 6c ad ldd r22, Y+60 ; 0x3c 36ce8: 7d ad ldd r23, Y+61 ; 0x3d 36cea: 8e ad ldd r24, Y+62 ; 0x3e 36cec: 9f ad ldd r25, Y+63 ; 0x3f 36cee: 26 97 sbiw r28, 0x06 ; 6 36cf0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36cf4: 87 fd sbrc r24, 7 36cf6: e0 c0 rjmp .+448 ; 0x36eb8 && fabs(delta_mm[Z_AXIS]) < 0.5; 36cf8: 22 96 adiw r28, 0x02 ; 2 36cfa: 6c ad ldd r22, Y+60 ; 0x3c 36cfc: 7d ad ldd r23, Y+61 ; 0x3d 36cfe: 8e ad ldd r24, Y+62 ; 0x3e 36d00: 9f ad ldd r25, Y+63 ; 0x3f 36d02: 22 97 sbiw r28, 0x02 ; 2 36d04: 9f 77 andi r25, 0x7F ; 127 36d06: 20 e0 ldi r18, 0x00 ; 0 36d08: 30 e0 ldi r19, 0x00 ; 0 36d0a: 40 e0 ldi r20, 0x00 ; 0 36d0c: 5f e3 ldi r21, 0x3F ; 63 36d0e: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36d12: 87 ff sbrs r24, 7 36d14: d1 c0 rjmp .+418 ; 0x36eb8 * * 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 36d16: 8e e6 ldi r24, 0x6E ; 110 36d18: 82 9d mul r24, r2 36d1a: 80 01 movw r16, r0 36d1c: 83 9d mul r24, r3 36d1e: 10 0d add r17, r0 36d20: 11 24 eor r1, r1 36d22: 01 54 subi r16, 0x41 ; 65 36d24: 18 4f sbci r17, 0xF8 ; 248 36d26: 81 e0 ldi r24, 0x01 ; 1 36d28: d8 01 movw r26, r16 36d2a: 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]) 36d2c: 20 91 cd 04 lds r18, 0x04CD ; 0x8004cd 36d30: 30 91 ce 04 lds r19, 0x04CE ; 0x8004ce 36d34: 40 91 cf 04 lds r20, 0x04CF ; 0x8004cf 36d38: 50 91 d0 04 lds r21, 0x04D0 ; 0x8004d0 36d3c: 69 a1 ldd r22, Y+33 ; 0x21 36d3e: 7a a1 ldd r23, Y+34 ; 0x22 36d40: 8b a1 ldd r24, Y+35 ; 0x23 36d42: 9c a1 ldd r25, Y+36 ; 0x24 36d44: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 36d48: 69 ab std Y+49, r22 ; 0x31 36d4a: 7a ab std Y+50, r23 ; 0x32 36d4c: 8b ab std Y+51, r24 ; 0x33 36d4e: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36d50: 20 91 d1 04 lds r18, 0x04D1 ; 0x8004d1 36d54: 30 91 d2 04 lds r19, 0x04D2 ; 0x8004d2 36d58: 40 91 d3 04 lds r20, 0x04D3 ; 0x8004d3 36d5c: 50 91 d4 04 lds r21, 0x04D4 ; 0x8004d4 36d60: 6d a1 ldd r22, Y+37 ; 0x25 36d62: 7e a1 ldd r23, Y+38 ; 0x26 36d64: 8f a1 ldd r24, Y+39 ; 0x27 36d66: 98 a5 ldd r25, Y+40 ; 0x28 36d68: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 36d6c: 4b 01 movw r8, r22 36d6e: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36d70: 20 91 d5 04 lds r18, 0x04D5 ; 0x8004d5 36d74: 30 91 d6 04 lds r19, 0x04D6 ; 0x8004d6 36d78: 40 91 d7 04 lds r20, 0x04D7 ; 0x8004d7 36d7c: 50 91 d8 04 lds r21, 0x04D8 ; 0x8004d8 36d80: a8 96 adiw r28, 0x28 ; 40 36d82: 6c ad ldd r22, Y+60 ; 0x3c 36d84: 7d ad ldd r23, Y+61 ; 0x3d 36d86: 8e ad ldd r24, Y+62 ; 0x3e 36d88: 9f ad ldd r25, Y+63 ; 0x3f 36d8a: a8 97 sbiw r28, 0x28 ; 40 36d8c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 36d90: 6b 01 movw r12, r22 36d92: 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]) 36d94: 29 a9 ldd r18, Y+49 ; 0x31 36d96: 3a a9 ldd r19, Y+50 ; 0x32 36d98: 4b a9 ldd r20, Y+51 ; 0x33 36d9a: 5c a9 ldd r21, Y+52 ; 0x34 36d9c: ca 01 movw r24, r20 36d9e: b9 01 movw r22, r18 36da0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36da4: 69 ab std Y+49, r22 ; 0x31 36da6: 7a ab std Y+50, r23 ; 0x32 36da8: 8b ab std Y+51, r24 ; 0x33 36daa: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36dac: a5 01 movw r20, r10 36dae: 94 01 movw r18, r8 36db0: c5 01 movw r24, r10 36db2: b4 01 movw r22, r8 36db4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36db8: 9b 01 movw r18, r22 36dba: ac 01 movw r20, r24 36dbc: 69 a9 ldd r22, Y+49 ; 0x31 36dbe: 7a a9 ldd r23, Y+50 ; 0x32 36dc0: 8b a9 ldd r24, Y+51 ; 0x33 36dc2: 9c a9 ldd r25, Y+52 ; 0x34 36dc4: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 36dc8: 4b 01 movw r8, r22 36dca: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36dcc: a7 01 movw r20, r14 36dce: 96 01 movw r18, r12 36dd0: c7 01 movw r24, r14 36dd2: b6 01 movw r22, r12 36dd4: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36dd8: 9b 01 movw r18, r22 36dda: ac 01 movw r20, r24 36ddc: c5 01 movw r24, r10 36dde: b4 01 movw r22, r8 36de0: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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]) 36de4: 0f 94 3c e2 call 0x3c478 ; 0x3c478 36de8: 6b 01 movw r12, r22 36dea: 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]); 36dec: 20 91 d9 04 lds r18, 0x04D9 ; 0x8004d9 36df0: 30 91 da 04 lds r19, 0x04DA ; 0x8004da 36df4: 40 91 db 04 lds r20, 0x04DB ; 0x8004db 36df8: 50 91 dc 04 lds r21, 0x04DC ; 0x8004dc 36dfc: aa 96 adiw r28, 0x2a ; 42 36dfe: ee ad ldd r30, Y+62 ; 0x3e 36e00: ff ad ldd r31, Y+63 ; 0x3f 36e02: aa 97 sbiw r28, 0x2a ; 42 36e04: 60 81 ld r22, Z 36e06: 71 81 ldd r23, Z+1 ; 0x01 36e08: 82 81 ldd r24, Z+2 ; 0x02 36e0a: 93 81 ldd r25, Z+3 ; 0x03 36e0c: 0f 94 6d de call 0x3bcda ; 0x3bcda <__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; 36e10: a7 01 movw r20, r14 36e12: 96 01 movw r18, r12 36e14: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 36e18: 6a 96 adiw r28, 0x1a ; 26 36e1a: 6c af std Y+60, r22 ; 0x3c 36e1c: 7d af std Y+61, r23 ; 0x3d 36e1e: 8e af std Y+62, r24 ; 0x3e 36e20: 9f af std Y+63, r25 ; 0x3f 36e22: 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) 36e24: 20 e0 ldi r18, 0x00 ; 0 36e26: 30 e0 ldi r19, 0x00 ; 0 36e28: 40 e4 ldi r20, 0x40 ; 64 36e2a: 50 e4 ldi r21, 0x40 ; 64 36e2c: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36e30: 18 16 cp r1, r24 36e32: 0c f4 brge .+2 ; 0x36e36 36e34: 9e c0 rjmp .+316 ; 0x36f72 block->use_advance_lead = false; else if (e_D_ratio > 0) { 36e36: 20 e0 ldi r18, 0x00 ; 0 36e38: 30 e0 ldi r19, 0x00 ; 0 36e3a: a9 01 movw r20, r18 36e3c: 6a 96 adiw r28, 0x1a ; 26 36e3e: 6c ad ldd r22, Y+60 ; 0x3c 36e40: 7d ad ldd r23, Y+61 ; 0x3d 36e42: 8e ad ldd r24, Y+62 ; 0x3e 36e44: 9f ad ldd r25, Y+63 ; 0x3f 36e46: 6a 97 sbiw r28, 0x1a ; 26 36e48: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 36e4c: 18 16 cp r1, r24 36e4e: 0c f0 brlt .+2 ; 0x36e52 36e50: 42 c0 rjmp .+132 ; 0x36ed6 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 36e52: 6a 96 adiw r28, 0x1a ; 26 36e54: 2c ad ldd r18, Y+60 ; 0x3c 36e56: 3d ad ldd r19, Y+61 ; 0x3d 36e58: 4e ad ldd r20, Y+62 ; 0x3e 36e5a: 5f ad ldd r21, Y+63 ; 0x3f 36e5c: 6a 97 sbiw r28, 0x1a ; 26 36e5e: 6d a5 ldd r22, Y+45 ; 0x2d 36e60: 7e a5 ldd r23, Y+46 ; 0x2e 36e62: 8f a5 ldd r24, Y+47 ; 0x2f 36e64: 98 a9 ldd r25, Y+48 ; 0x30 36e66: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36e6a: 9b 01 movw r18, r22 36e6c: ac 01 movw r20, r24 36e6e: 60 91 bf 06 lds r22, 0x06BF ; 0x8006bf 36e72: 70 91 c0 06 lds r23, 0x06C0 ; 0x8006c0 36e76: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 36e7a: 90 91 c2 06 lds r25, 0x06C2 ; 0x8006c2 36e7e: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 36e82: 29 a5 ldd r18, Y+41 ; 0x29 36e84: 3a a5 ldd r19, Y+42 ; 0x2a 36e86: 4b a5 ldd r20, Y+43 ; 0x2b 36e88: 5c a5 ldd r21, Y+44 ; 0x2c 36e8a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36e8e: 0f 94 4c df call 0x3be98 ; 0x3be98 36e92: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 36e96: 64 15 cp r22, r4 36e98: 75 05 cpc r23, r5 36e9a: 86 05 cpc r24, r6 36e9c: 97 05 cpc r25, r7 36e9e: d8 f4 brcc .+54 ; 0x36ed6 36ea0: 2b 01 movw r4, r22 36ea2: 3c 01 movw r6, r24 36ea4: 18 c0 rjmp .+48 ; 0x36ed6 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 36ea6: 60 91 2b 07 lds r22, 0x072B ; 0x80072b 36eaa: 70 91 2c 07 lds r23, 0x072C ; 0x80072c 36eae: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 36eb2: 90 91 2e 07 lds r25, 0x072E ; 0x80072e 36eb6: f1 ce rjmp .-542 ; 0x36c9a * * 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 36eb8: 8e e6 ldi r24, 0x6E ; 110 36eba: 82 9d mul r24, r2 36ebc: f0 01 movw r30, r0 36ebe: 83 9d mul r24, r3 36ec0: f0 0d add r31, r0 36ec2: 11 24 eor r1, r1 36ec4: e1 54 subi r30, 0x41 ; 65 36ec6: f8 4f sbci r31, 0xF8 ; 248 36ec8: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36eca: 6a 96 adiw r28, 0x1a ; 26 36ecc: 1c ae std Y+60, r1 ; 0x3c 36ece: 1d ae std Y+61, r1 ; 0x3d 36ed0: 1e ae std Y+62, r1 ; 0x3e 36ed2: 1f ae std Y+63, r1 ; 0x3f 36ed4: 6a 97 sbiw r28, 0x1a ; 26 36ed6: 10 e0 ldi r17, 0x00 ; 0 36ed8: 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) 36eda: a4 96 adiw r28, 0x24 ; 36 36edc: ee ad ldd r30, Y+62 ; 0x3e 36ede: ff ad ldd r31, Y+63 ; 0x3f 36ee0: a4 97 sbiw r28, 0x24 ; 36 36ee2: e0 0f add r30, r16 36ee4: f1 1f adc r31, r17 36ee6: ed 58 subi r30, 0x8D ; 141 36ee8: f8 4f sbci r31, 0xF8 ; 248 36eea: c0 80 ld r12, Z 36eec: d1 80 ldd r13, Z+1 ; 0x01 36eee: e2 80 ldd r14, Z+2 ; 0x02 36ef0: f3 80 ldd r15, Z+3 ; 0x03 36ef2: c1 14 cp r12, r1 36ef4: d1 04 cpc r13, r1 36ef6: e1 04 cpc r14, r1 36ef8: f1 04 cpc r15, r1 36efa: a1 f1 breq .+104 ; 0x36f64 36efc: f8 01 movw r30, r16 36efe: e3 51 subi r30, 0x13 ; 19 36f00: f8 4e sbci r31, 0xE8 ; 232 36f02: 60 81 ld r22, Z 36f04: 71 81 ldd r23, Z+1 ; 0x01 36f06: 82 81 ldd r24, Z+2 ; 0x02 36f08: 93 81 ldd r25, Z+3 ; 0x03 36f0a: 64 15 cp r22, r4 36f0c: 75 05 cpc r23, r5 36f0e: 86 05 cpc r24, r6 36f10: 97 05 cpc r25, r7 36f12: 40 f5 brcc .+80 ; 0x36f64 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 36f14: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 36f18: 29 ad ldd r18, Y+57 ; 0x39 36f1a: 3a ad ldd r19, Y+58 ; 0x3a 36f1c: 4b ad ldd r20, Y+59 ; 0x3b 36f1e: 5c ad ldd r21, Y+60 ; 0x3c 36f20: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 36f24: 4b 01 movw r8, r22 36f26: 5c 01 movw r10, r24 36f28: c7 01 movw r24, r14 36f2a: b6 01 movw r22, r12 36f2c: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 36f30: 9b 01 movw r18, r22 36f32: ac 01 movw r20, r24 36f34: c5 01 movw r24, r10 36f36: b4 01 movw r22, r8 36f38: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 36f3c: 6b 01 movw r12, r22 36f3e: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 36f40: c3 01 movw r24, r6 36f42: b2 01 movw r22, r4 36f44: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 36f48: 9b 01 movw r18, r22 36f4a: ac 01 movw r20, r24 36f4c: c7 01 movw r24, r14 36f4e: b6 01 movw r22, r12 36f50: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36f54: 87 ff sbrs r24, 7 36f56: 06 c0 rjmp .+12 ; 0x36f64 36f58: c7 01 movw r24, r14 36f5a: b6 01 movw r22, r12 36f5c: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 36f60: 2b 01 movw r4, r22 36f62: 3c 01 movw r6, r24 36f64: 0c 5f subi r16, 0xFC ; 252 36f66: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 36f68: 00 31 cpi r16, 0x10 ; 16 36f6a: 11 05 cpc r17, r1 36f6c: 09 f0 breq .+2 ; 0x36f70 36f6e: b5 cf rjmp .-150 ; 0x36eda 36f70: 01 c9 rjmp .-3582 ; 0x36174 // 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; 36f72: d8 01 movw r26, r16 36f74: 1c 92 st X, r1 36f76: af cf rjmp .-162 ; 0x36ed6 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 36f78: c9 a6 std Y+41, r12 ; 0x29 36f7a: dd a6 std Y+45, r13 ; 0x2d 36f7c: e9 aa std Y+49, r14 ; 0x31 36f7e: f9 ae std Y+57, r15 ; 0x39 limited = true; 36f80: 21 e0 ldi r18, 0x01 ; 1 36f82: 2d ab std Y+53, r18 ; 0x35 36f84: b1 c9 rjmp .-3230 ; 0x362e8 // 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); 36f86: 27 96 adiw r28, 0x07 ; 7 36f88: 2f ad ldd r18, Y+63 ; 0x3f 36f8a: 27 97 sbiw r28, 0x07 ; 7 36f8c: 2b 96 adiw r28, 0x0b ; 11 36f8e: 3f ad ldd r19, Y+63 ; 0x3f 36f90: 2b 97 sbiw r28, 0x0b ; 11 36f92: 2f 96 adiw r28, 0x0f ; 15 36f94: 4f ad ldd r20, Y+63 ; 0x3f 36f96: 2f 97 sbiw r28, 0x0f ; 15 36f98: 63 96 adiw r28, 0x13 ; 19 36f9a: 5f ad ldd r21, Y+63 ; 0x3f 36f9c: 63 97 sbiw r28, 0x13 ; 19 36f9e: 6b 96 adiw r28, 0x1b ; 27 36fa0: 6f ad ldd r22, Y+63 ; 0x3f 36fa2: 6b 97 sbiw r28, 0x1b ; 27 36fa4: 6d 96 adiw r28, 0x1d ; 29 36fa6: 7f ad ldd r23, Y+63 ; 0x3f 36fa8: 6d 97 sbiw r28, 0x1d ; 29 36faa: c8 01 movw r24, r16 36fac: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 36fb0: ec 96 adiw r28, 0x3c ; 60 36fb2: 6c af std Y+60, r22 ; 0x3c 36fb4: 7d af std Y+61, r23 ; 0x3d 36fb6: 8e af std Y+62, r24 ; 0x3e 36fb8: 9f af std Y+63, r25 ; 0x3f 36fba: ec 97 sbiw r28, 0x3c ; 60 // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed; 36fbc: 6b 96 adiw r28, 0x1b ; 27 36fbe: ef ad ldd r30, Y+63 ; 0x3f 36fc0: 6b 97 sbiw r28, 0x1b ; 27 36fc2: ed af std Y+61, r30 ; 0x3d 36fc4: 6d 96 adiw r28, 0x1d ; 29 36fc6: ff ad ldd r31, Y+63 ; 0x3f 36fc8: 6d 97 sbiw r28, 0x1d ; 29 36fca: fd ab std Y+53, r31 ; 0x35 36fcc: 0e af std Y+62, r16 ; 0x3e 36fce: 23 96 adiw r28, 0x03 ; 3 36fd0: 1f af std Y+63, r17 ; 0x3f 36fd2: 23 97 sbiw r28, 0x03 ; 3 36fd4: 04 ca rjmp .-3064 ; 0x363de (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 36fd6: f7 fa bst r15, 7 36fd8: f0 94 com r15 36fda: f7 f8 bld r15, 7 36fdc: f0 94 com r15 36fde: a5 01 movw r20, r10 36fe0: 94 01 movw r18, r8 36fe2: c7 01 movw r24, r14 36fe4: b6 01 movw r22, r12 36fe6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36fea: 87 ff sbrs r24, 7 36fec: 77 ca rjmp .-2834 ; 0x364dc // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 36fee: 75 01 movw r14, r10 36ff0: 64 01 movw r12, r8 36ff2: 74 ca rjmp .-2840 ; 0x364dc // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 36ff4: c7 01 movw r24, r14 36ff6: b6 01 movw r22, r12 36ff8: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 36ffc: 87 fd sbrc r24, 7 36ffe: 09 c0 rjmp .+18 ; 0x37012 37000: 20 e0 ldi r18, 0x00 ; 0 37002: 30 e0 ldi r19, 0x00 ; 0 37004: a9 01 movw r20, r18 37006: c5 01 movw r24, r10 37008: b4 01 movw r22, r8 3700a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 3700e: 18 16 cp r1, r24 37010: 2c f4 brge .+10 ; 0x3701c 37012: a5 01 movw r20, r10 37014: 94 01 movw r18, r8 37016: c7 01 movw r24, r14 37018: b6 01 movw r22, r12 3701a: 5c ca rjmp .-2888 ; 0x364d4 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 3701c: b7 fa bst r11, 7 3701e: b0 94 com r11 37020: b7 f8 bld r11, 7 37022: b0 94 com r11 37024: a7 01 movw r20, r14 37026: 96 01 movw r18, r12 37028: c5 01 movw r24, r10 3702a: b4 01 movw r22, r8 3702c: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 37030: 18 16 cp r1, r24 37032: 0c f0 brlt .+2 ; 0x37036 37034: 53 ca rjmp .-2906 ; 0x364dc 37036: db cf rjmp .-74 ; 0x36fee // 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; 37038: 8e e6 ldi r24, 0x6E ; 110 3703a: 82 9d mul r24, r2 3703c: f0 01 movw r30, r0 3703e: 83 9d mul r24, r3 37040: f0 0d add r31, r0 37042: 11 24 eor r1, r1 37044: ed 58 subi r30, 0x8D ; 141 37046: f8 4f sbci r31, 0xF8 ; 248 37048: 85 a9 ldd r24, Z+53 ; 0x35 3704a: 84 60 ori r24, 0x04 ; 4 3704c: 85 ab std Z+53, r24 ; 0x35 3704e: a9 a5 ldd r26, Y+41 ; 0x29 37050: ad af std Y+61, r26 ; 0x3d 37052: bd a5 ldd r27, Y+45 ; 0x2d 37054: bd ab std Y+53, r27 ; 0x35 37056: e9 a9 ldd r30, Y+49 ; 0x31 37058: ee af std Y+62, r30 ; 0x3e 3705a: f9 ad ldd r31, Y+57 ; 0x39 3705c: 23 96 adiw r28, 0x03 ; 3 3705e: ff af std Y+63, r31 ; 0x3f 37060: 23 97 sbiw r28, 0x03 ; 3 37062: bc ca rjmp .-2696 ; 0x365dc // 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; 37064: 81 e0 ldi r24, 0x01 ; 1 37066: 30 cb rjmp .-2464 ; 0x366c8 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]; 37068: 20 91 bf 06 lds r18, 0x06BF ; 0x8006bf 3706c: 30 91 c0 06 lds r19, 0x06C0 ; 0x8006c0 37070: 40 91 c1 06 lds r20, 0x06C1 ; 0x8006c1 37074: 50 91 c2 06 lds r21, 0x06C2 ; 0x8006c2 37078: c7 01 movw r24, r14 3707a: b6 01 movw r22, r12 3707c: c1 cb rjmp .-2174 ; 0x36800 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) { 3707e: 20 e0 ldi r18, 0x00 ; 0 37080: 30 e4 ldi r19, 0x40 ; 64 37082: 4c e1 ldi r20, 0x1C ; 28 37084: 56 e4 ldi r21, 0x46 ; 70 37086: c7 01 movw r24, r14 37088: b6 01 movw r22, r12 3708a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 3708e: 18 16 cp r1, r24 37090: d4 f4 brge .+52 ; 0x370c6 block->advance_rate = advance_rate * 2; 37092: 8e e6 ldi r24, 0x6E ; 110 37094: 82 9d mul r24, r2 37096: 80 01 movw r16, r0 37098: 83 9d mul r24, r3 3709a: 10 0d add r17, r0 3709c: 11 24 eor r1, r1 3709e: 0d 58 subi r16, 0x8D ; 141 370a0: 18 4f sbci r17, 0xF8 ; 248 370a2: 78 01 movw r14, r16 370a4: bd e4 ldi r27, 0x4D ; 77 370a6: eb 0e add r14, r27 370a8: f1 1c adc r15, r1 370aa: a5 01 movw r20, r10 370ac: 94 01 movw r18, r8 370ae: c5 01 movw r24, r10 370b0: b4 01 movw r22, r8 370b2: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 370b6: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 370ba: f7 01 movw r30, r14 370bc: 71 83 std Z+1, r23 ; 0x01 370be: 60 83 st Z, r22 block->advance_step_loops = 2; 370c0: 36 96 adiw r30, 0x06 ; 6 370c2: 82 e0 ldi r24, 0x02 ; 2 370c4: e2 cb rjmp .-2108 ; 0x3688a } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 370c6: 20 e0 ldi r18, 0x00 ; 0 370c8: 3f ef ldi r19, 0xFF ; 255 370ca: 4f e7 ldi r20, 0x7F ; 127 370cc: 57 e4 ldi r21, 0x47 ; 71 370ce: c5 01 movw r24, r10 370d0: b4 01 movw r22, r8 370d2: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 370d6: 87 ff sbrs r24, 7 370d8: 19 c0 rjmp .+50 ; 0x3710c block->advance_rate = advance_rate; 370da: 8e e6 ldi r24, 0x6E ; 110 370dc: 82 9d mul r24, r2 370de: 80 01 movw r16, r0 370e0: 83 9d mul r24, r3 370e2: 10 0d add r17, r0 370e4: 11 24 eor r1, r1 370e6: 00 54 subi r16, 0x40 ; 64 370e8: 18 4f sbci r17, 0xF8 ; 248 370ea: c5 01 movw r24, r10 370ec: b4 01 movw r22, r8 370ee: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 370f2: d8 01 movw r26, r16 370f4: 6d 93 st X+, r22 370f6: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 370f8: 8e e6 ldi r24, 0x6E ; 110 370fa: 82 9d mul r24, r2 370fc: f0 01 movw r30, r0 370fe: 83 9d mul r24, r3 37100: f0 0d add r31, r0 37102: 11 24 eor r1, r1 37104: ea 53 subi r30, 0x3A ; 58 37106: f8 4f sbci r31, 0xF8 ; 248 37108: 81 e0 ldi r24, 0x01 ; 1 3710a: bf cb rjmp .-2178 ; 0x3688a { // 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; 3710c: 8e e6 ldi r24, 0x6E ; 110 3710e: 82 9d mul r24, r2 37110: f0 01 movw r30, r0 37112: 83 9d mul r24, r3 37114: f0 0d add r31, r0 37116: 11 24 eor r1, r1 37118: e0 54 subi r30, 0x40 ; 64 3711a: f8 4f sbci r31, 0xF8 ; 248 3711c: 8f ef ldi r24, 0xFF ; 255 3711e: 9f ef ldi r25, 0xFF ; 255 37120: 91 83 std Z+1, r25 ; 0x01 37122: 80 83 st Z, r24 37124: e9 cf rjmp .-46 ; 0x370f8 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) { 37126: f6 01 movw r30, r12 37128: 71 a4 ldd r7, Z+41 ; 0x29 3712a: 82 a4 ldd r8, Z+42 ; 0x2a 3712c: 93 a4 ldd r9, Z+43 ; 0x2b 3712e: e4 a4 ldd r14, Z+44 ; 0x2c 37130: 27 2d mov r18, r7 37132: 38 2d mov r19, r8 37134: 49 2d mov r20, r9 37136: 5e 2d mov r21, r14 37138: 65 a1 ldd r22, Z+37 ; 0x25 3713a: 76 a1 ldd r23, Z+38 ; 0x26 3713c: 87 a1 ldd r24, Z+39 ; 0x27 3713e: 90 a5 ldd r25, Z+40 ; 0x28 37140: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 37144: 88 23 and r24, r24 37146: 09 f4 brne .+2 ; 0x3714a 37148: 51 c0 rjmp .+162 ; 0x371ec // 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) ? 3714a: 01 fd sbrc r16, 1 3714c: 44 c0 rjmp .+136 ; 0x371d6 3714e: d5 01 movw r26, r10 37150: 95 96 adiw r26, 0x25 ; 37 37152: 2d 90 ld r2, X+ 37154: 3d 90 ld r3, X+ 37156: 4d 90 ld r4, X+ 37158: 5c 90 ld r5, X 3715a: 98 97 sbiw r26, 0x28 ; 40 3715c: a2 01 movw r20, r4 3715e: 91 01 movw r18, r2 37160: 67 2d mov r22, r7 37162: 78 2d mov r23, r8 37164: 89 2d mov r24, r9 37166: 9e 2d mov r25, r14 37168: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 3716c: 18 16 cp r1, r24 3716e: 9c f5 brge .+102 ; 0x371d6 // 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); 37170: a2 01 movw r20, r4 37172: 91 01 movw r18, r2 37174: c2 01 movw r24, r4 37176: b1 01 movw r22, r2 37178: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3717c: 1b 01 movw r2, r22 3717e: 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)); 37180: f6 01 movw r30, r12 37182: 61 a9 ldd r22, Z+49 ; 0x31 37184: 72 a9 ldd r23, Z+50 ; 0x32 37186: 83 a9 ldd r24, Z+51 ; 0x33 37188: 94 a9 ldd r25, Z+52 ; 0x34 3718a: 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); 3718c: 9b 01 movw r18, r22 3718e: ac 01 movw r20, r24 37190: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 37194: d6 01 movw r26, r12 37196: 9d 96 adiw r26, 0x2d ; 45 37198: 2d 91 ld r18, X+ 3719a: 3d 91 ld r19, X+ 3719c: 4d 91 ld r20, X+ 3719e: 5c 91 ld r21, X 371a0: d0 97 sbiw r26, 0x30 ; 48 371a2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 371a6: 9b 01 movw r18, r22 371a8: ac 01 movw r20, r24 371aa: c2 01 movw r24, r4 371ac: b1 01 movw r22, r2 371ae: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 371b2: 0f 94 3c e2 call 0x3c478 ; 0x3c478 371b6: 2b 01 movw r4, r22 371b8: 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)); 371ba: 9b 01 movw r18, r22 371bc: ac 01 movw r20, r24 371be: 67 2d mov r22, r7 371c0: 78 2d mov r23, r8 371c2: 89 2d mov r24, r9 371c4: 9e 2d mov r25, r14 371c6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 371ca: 87 fd sbrc r24, 7 371cc: 04 c0 rjmp .+8 ; 0x371d6 371ce: 74 2c mov r7, r4 371d0: 85 2c mov r8, r5 371d2: 9a 2c mov r9, r10 371d4: 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) ? 371d6: 87 2d mov r24, r7 371d8: 98 2d mov r25, r8 371da: a9 2d mov r26, r9 371dc: be 2d mov r27, r14 371de: f6 01 movw r30, r12 371e0: 85 a3 std Z+37, r24 ; 0x25 371e2: 96 a3 std Z+38, r25 ; 0x26 371e4: a7 a3 std Z+39, r26 ; 0x27 371e6: 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; 371e8: 01 60 ori r16, 0x01 ; 1 371ea: 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) 371ec: 11 11 cpse r17, r1 371ee: 01 c0 rjmp .+2 ; 0x371f2 block_index = BLOCK_BUFFER_SIZE; 371f0: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 371f2: 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)); 371f4: 16 9d mul r17, r6 371f6: c0 01 movw r24, r0 371f8: 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; 371fa: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 371fc: 9c 01 movw r18, r24 371fe: 2d 58 subi r18, 0x8D ; 141 37200: 38 4f sbci r19, 0xF8 ; 248 37202: 69 01 movw r12, r18 37204: 0b cc rjmp .-2026 ; 0x36a1c 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)); 37206: 6c 01 movw r12, r24 37208: 2f cc rjmp .-1954 ; 0x36a68 3720a: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 3720c: 0d 94 5a ab jmp 0x356b4 ; 0x356b4 00037210 : 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(){ 37210: 4f 92 push r4 37212: 5f 92 push r5 37214: 6f 92 push r6 37216: 7f 92 push r7 37218: 8f 92 push r8 3721a: 9f 92 push r9 3721c: af 92 push r10 3721e: bf 92 push r11 37220: cf 92 push r12 37222: df 92 push r13 37224: ef 92 push r14 37226: ff 92 push r15 37228: cf 93 push r28 3722a: df 93 push r29 3722c: cd b7 in r28, 0x3d ; 61 3722e: de b7 in r29, 0x3e ; 62 37230: 2c 97 sbiw r28, 0x0c ; 12 37232: 0f b6 in r0, 0x3f ; 63 37234: f8 94 cli 37236: de bf out 0x3e, r29 ; 62 37238: 0f be out 0x3f, r0 ; 63 3723a: 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]); 3723c: c0 90 48 07 lds r12, 0x0748 ; 0x800748 37240: d0 90 49 07 lds r13, 0x0749 ; 0x800749 37244: e0 90 4a 07 lds r14, 0x074A ; 0x80074a 37248: f0 90 4b 07 lds r15, 0x074B ; 0x80074b 3724c: 80 91 44 07 lds r24, 0x0744 ; 0x800744 37250: 90 91 45 07 lds r25, 0x0745 ; 0x800745 37254: a0 91 46 07 lds r26, 0x0746 ; 0x800746 37258: b0 91 47 07 lds r27, 0x0747 ; 0x800747 3725c: 40 91 40 07 lds r20, 0x0740 ; 0x800740 37260: 50 91 41 07 lds r21, 0x0741 ; 0x800741 37264: 60 91 42 07 lds r22, 0x0742 ; 0x800742 37268: 70 91 43 07 lds r23, 0x0743 ; 0x800743 3726c: 4d 83 std Y+5, r20 ; 0x05 3726e: 5e 83 std Y+6, r21 ; 0x06 37270: 6f 83 std Y+7, r22 ; 0x07 37272: 78 87 std Y+8, r23 ; 0x08 37274: 89 83 std Y+1, r24 ; 0x01 37276: 9a 83 std Y+2, r25 ; 0x02 37278: ab 83 std Y+3, r26 ; 0x03 3727a: 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); 3727c: be 01 movw r22, r28 3727e: 6f 5f subi r22, 0xFF ; 255 37280: 7f 4f sbci r23, 0xFF ; 255 37282: ce 01 movw r24, r28 37284: 05 96 adiw r24, 0x05 ; 5 37286: 0e 94 c8 6a call 0xd590 ; 0xd590 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 3728a: 4d 80 ldd r4, Y+5 ; 0x05 3728c: 5e 80 ldd r5, Y+6 ; 0x06 3728e: 6f 80 ldd r6, Y+7 ; 0x07 37290: 78 84 ldd r7, Y+8 ; 0x08 37292: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 37296: 30 91 70 06 lds r19, 0x0670 ; 0x800670 3729a: 40 91 71 06 lds r20, 0x0671 ; 0x800671 3729e: 50 91 72 06 lds r21, 0x0672 ; 0x800672 372a2: c3 01 movw r24, r6 372a4: b2 01 movw r22, r4 372a6: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 372aa: 0f 94 ab e1 call 0x3c356 ; 0x3c356 372ae: 60 93 51 07 sts 0x0751, r22 ; 0x800751 372b2: 70 93 52 07 sts 0x0752, r23 ; 0x800752 372b6: 80 93 53 07 sts 0x0753, r24 ; 0x800753 372ba: 90 93 54 07 sts 0x0754, r25 ; 0x800754 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 372be: 89 80 ldd r8, Y+1 ; 0x01 372c0: 9a 80 ldd r9, Y+2 ; 0x02 372c2: ab 80 ldd r10, Y+3 ; 0x03 372c4: bc 80 ldd r11, Y+4 ; 0x04 372c6: 20 91 73 06 lds r18, 0x0673 ; 0x800673 372ca: 30 91 74 06 lds r19, 0x0674 ; 0x800674 372ce: 40 91 75 06 lds r20, 0x0675 ; 0x800675 372d2: 50 91 76 06 lds r21, 0x0676 ; 0x800676 372d6: c5 01 movw r24, r10 372d8: b4 01 movw r22, r8 372da: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 372de: 0f 94 ab e1 call 0x3c356 ; 0x3c356 372e2: 60 93 55 07 sts 0x0755, r22 ; 0x800755 372e6: 70 93 56 07 sts 0x0756, r23 ; 0x800756 372ea: 80 93 57 07 sts 0x0757, r24 ; 0x800757 372ee: 90 93 58 07 sts 0x0758, r25 ; 0x800758 #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 372f2: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 372f6: 88 23 and r24, r24 372f8: 09 f4 brne .+2 ; 0x372fc 372fa: 8c c0 rjmp .+280 ; 0x37414 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 372fc: a5 01 movw r20, r10 372fe: 94 01 movw r18, r8 37300: c3 01 movw r24, r6 37302: b2 01 movw r22, r4 37304: 0f 94 08 96 call 0x32c10 ; 0x32c10 37308: 9b 01 movw r18, r22 3730a: ac 01 movw r20, r24 3730c: c7 01 movw r24, r14 3730e: b6 01 movw r22, r12 37310: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 37314: 20 91 77 06 lds r18, 0x0677 ; 0x800677 37318: 30 91 78 06 lds r19, 0x0678 ; 0x800678 3731c: 40 91 79 06 lds r20, 0x0679 ; 0x800679 37320: 50 91 7a 06 lds r21, 0x067A ; 0x80067a lround(z*cs.axis_steps_per_mm[Z_AXIS]); 37324: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__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 ? 37328: 0f 94 ab e1 call 0x3c356 ; 0x3c356 3732c: 60 93 59 07 sts 0x0759, r22 ; 0x800759 37330: 70 93 5a 07 sts 0x075A, r23 ; 0x80075a 37334: 80 93 5b 07 sts 0x075B, r24 ; 0x80075b 37338: 90 93 5c 07 sts 0x075C, r25 ; 0x80075c lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : lround(z*cs.axis_steps_per_mm[Z_AXIS]); #else position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); #endif // ENABLE_MESH_BED_LEVELING position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 3733c: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 37340: 90 91 4d 07 lds r25, 0x074D ; 0x80074d 37344: a0 91 4e 07 lds r26, 0x074E ; 0x80074e 37348: b0 91 4f 07 lds r27, 0x074F ; 0x80074f 3734c: 89 87 std Y+9, r24 ; 0x09 3734e: 9a 87 std Y+10, r25 ; 0x0a 37350: ab 87 std Y+11, r26 ; 0x0b 37352: bc 87 std Y+12, r27 ; 0x0c 37354: 20 91 7b 06 lds r18, 0x067B ; 0x80067b 37358: 30 91 7c 06 lds r19, 0x067C ; 0x80067c 3735c: 40 91 7d 06 lds r20, 0x067D ; 0x80067d 37360: 50 91 7e 06 lds r21, 0x067E ; 0x80067e 37364: bc 01 movw r22, r24 37366: cd 01 movw r24, r26 37368: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3736c: 0f 94 ab e1 call 0x3c356 ; 0x3c356 37370: 60 93 5d 07 sts 0x075D, r22 ; 0x80075d 37374: 70 93 5e 07 sts 0x075E, r23 ; 0x80075e 37378: 80 93 5f 07 sts 0x075F, r24 ; 0x80075f 3737c: 90 93 60 07 sts 0x0760, r25 ; 0x800760 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37380: 40 92 cd 04 sts 0x04CD, r4 ; 0x8004cd 37384: 50 92 ce 04 sts 0x04CE, r5 ; 0x8004ce 37388: 60 92 cf 04 sts 0x04CF, r6 ; 0x8004cf 3738c: 70 92 d0 04 sts 0x04D0, r7 ; 0x8004d0 position_float[Y_AXIS] = y; 37390: 80 92 d1 04 sts 0x04D1, r8 ; 0x8004d1 37394: 90 92 d2 04 sts 0x04D2, r9 ; 0x8004d2 37398: a0 92 d3 04 sts 0x04D3, r10 ; 0x8004d3 3739c: b0 92 d4 04 sts 0x04D4, r11 ; 0x8004d4 position_float[Z_AXIS] = z; 373a0: c0 92 d5 04 sts 0x04D5, r12 ; 0x8004d5 373a4: d0 92 d6 04 sts 0x04D6, r13 ; 0x8004d6 373a8: e0 92 d7 04 sts 0x04D7, r14 ; 0x8004d7 373ac: f0 92 d8 04 sts 0x04D8, r15 ; 0x8004d8 position_float[E_AXIS] = e; 373b0: 89 85 ldd r24, Y+9 ; 0x09 373b2: 9a 85 ldd r25, Y+10 ; 0x0a 373b4: ab 85 ldd r26, Y+11 ; 0x0b 373b6: bc 85 ldd r27, Y+12 ; 0x0c 373b8: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 373bc: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 373c0: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 373c4: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif st_set_position(position); 373c8: 0f 94 72 87 call 0x30ee4 ; 0x30ee4 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 373cc: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.506> 373d0: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.506+0x1> 373d4: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.506+0x2> 373d8: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.506+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 373dc: ed eb ldi r30, 0xBD ; 189 373de: f4 e0 ldi r31, 0x04 ; 4 373e0: 80 e1 ldi r24, 0x10 ; 16 373e2: df 01 movw r26, r30 373e4: 1d 92 st X+, r1 373e6: 8a 95 dec r24 373e8: e9 f7 brne .-6 ; 0x373e4 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]); } 373ea: 2c 96 adiw r28, 0x0c ; 12 373ec: 0f b6 in r0, 0x3f ; 63 373ee: f8 94 cli 373f0: de bf out 0x3e, r29 ; 62 373f2: 0f be out 0x3f, r0 ; 63 373f4: cd bf out 0x3d, r28 ; 61 373f6: df 91 pop r29 373f8: cf 91 pop r28 373fa: ff 90 pop r15 373fc: ef 90 pop r14 373fe: df 90 pop r13 37400: cf 90 pop r12 37402: bf 90 pop r11 37404: af 90 pop r10 37406: 9f 90 pop r9 37408: 8f 90 pop r8 3740a: 7f 90 pop r7 3740c: 6f 90 pop r6 3740e: 5f 90 pop r5 37410: 4f 90 pop r4 37412: 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]); 37414: 20 91 77 06 lds r18, 0x0677 ; 0x800677 37418: 30 91 78 06 lds r19, 0x0678 ; 0x800678 3741c: 40 91 79 06 lds r20, 0x0679 ; 0x800679 37420: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 37424: c7 01 movw r24, r14 37426: b6 01 movw r22, r12 37428: 7d cf rjmp .-262 ; 0x37324 0003742a : 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) { 3742a: 8f 92 push r8 3742c: 9f 92 push r9 3742e: af 92 push r10 37430: bf 92 push r11 37432: cf 92 push r12 37434: df 92 push r13 37436: ef 92 push r14 37438: ff 92 push r15 3743a: 0f 93 push r16 3743c: 1f 93 push r17 3743e: 4b 01 movw r8, r22 37440: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 37442: e1 e5 ldi r30, 0x51 ; 81 37444: f5 e0 ldi r31, 0x05 ; 5 37446: e0 84 ldd r14, Z+8 ; 0x08 37448: f1 84 ldd r15, Z+9 ; 0x09 3744a: 02 85 ldd r16, Z+10 ; 0x0a 3744c: 13 85 ldd r17, Z+11 ; 0x0b 3744e: 24 81 ldd r18, Z+4 ; 0x04 37450: 35 81 ldd r19, Z+5 ; 0x05 37452: 46 81 ldd r20, Z+6 ; 0x06 37454: 57 81 ldd r21, Z+7 ; 0x07 37456: 60 81 ld r22, Z 37458: 71 81 ldd r23, Z+1 ; 0x01 3745a: 82 81 ldd r24, Z+2 ; 0x02 3745c: 93 81 ldd r25, Z+3 ; 0x03 3745e: 1f 92 push r1 37460: 1f 92 push r1 37462: 1f 92 push r1 37464: 1f 92 push r1 37466: ed e5 ldi r30, 0x5D ; 93 37468: ce 2e mov r12, r30 3746a: e5 e0 ldi r30, 0x05 ; 5 3746c: de 2e mov r13, r30 3746e: 0f 94 f3 aa call 0x355e6 ; 0x355e6 37472: 0f 90 pop r0 37474: 0f 90 pop r0 37476: 0f 90 pop r0 37478: 0f 90 pop r0 } 3747a: 1f 91 pop r17 3747c: 0f 91 pop r16 3747e: ff 90 pop r15 37480: ef 90 pop r14 37482: df 90 pop r13 37484: cf 90 pop r12 37486: bf 90 pop r11 37488: af 90 pop r10 3748a: 9f 90 pop r9 3748c: 8f 90 pop r8 3748e: 08 95 ret 00037490 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 37490: 8f 92 push r8 37492: 9f 92 push r9 37494: af 92 push r10 37496: bf 92 push r11 37498: cf 92 push r12 3749a: df 92 push r13 3749c: ef 92 push r14 3749e: ff 92 push r15 374a0: 0f 93 push r16 374a2: 1f 93 push r17 374a4: 4b 01 movw r8, r22 374a6: 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); 374a8: e0 e4 ldi r30, 0x40 ; 64 374aa: f7 e0 ldi r31, 0x07 ; 7 374ac: e0 84 ldd r14, Z+8 ; 0x08 374ae: f1 84 ldd r15, Z+9 ; 0x09 374b0: 02 85 ldd r16, Z+10 ; 0x0a 374b2: 13 85 ldd r17, Z+11 ; 0x0b 374b4: 24 81 ldd r18, Z+4 ; 0x04 374b6: 35 81 ldd r19, Z+5 ; 0x05 374b8: 46 81 ldd r20, Z+6 ; 0x06 374ba: 57 81 ldd r21, Z+7 ; 0x07 374bc: 60 81 ld r22, Z 374be: 71 81 ldd r23, Z+1 ; 0x01 374c0: 82 81 ldd r24, Z+2 ; 0x02 374c2: 93 81 ldd r25, Z+3 ; 0x03 374c4: 1f 92 push r1 374c6: 1f 92 push r1 374c8: 1f 92 push r1 374ca: 1f 92 push r1 374cc: ec e4 ldi r30, 0x4C ; 76 374ce: ce 2e mov r12, r30 374d0: e7 e0 ldi r30, 0x07 ; 7 374d2: de 2e mov r13, r30 374d4: 0f 94 f3 aa call 0x355e6 ; 0x355e6 374d8: 0f 90 pop r0 374da: 0f 90 pop r0 374dc: 0f 90 pop r0 374de: 0f 90 pop r0 } 374e0: 1f 91 pop r17 374e2: 0f 91 pop r16 374e4: ff 90 pop r15 374e6: ef 90 pop r14 374e8: df 90 pop r13 374ea: cf 90 pop r12 374ec: bf 90 pop r11 374ee: af 90 pop r10 374f0: 9f 90 pop r9 374f2: 8f 90 pop r8 374f4: 08 95 ret 000374f6 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 374f6: 4f 92 push r4 374f8: 5f 92 push r5 374fa: 6f 92 push r6 374fc: 7f 92 push r7 374fe: 8f 92 push r8 37500: 9f 92 push r9 37502: af 92 push r10 37504: bf 92 push r11 37506: cf 92 push r12 37508: df 92 push r13 3750a: ef 92 push r14 3750c: ff 92 push r15 3750e: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 37510: 80 e0 ldi r24, 0x00 ; 0 37512: 0f 94 bf 58 call 0x2b17e ; 0x2b17e 37516: 60 93 51 07 sts 0x0751, r22 ; 0x800751 3751a: 70 93 52 07 sts 0x0752, r23 ; 0x800752 3751e: 80 93 53 07 sts 0x0753, r24 ; 0x800753 37522: 90 93 54 07 sts 0x0754, r25 ; 0x800754 position[Y_AXIS] = st_get_position(Y_AXIS); 37526: 81 e0 ldi r24, 0x01 ; 1 37528: 0f 94 bf 58 call 0x2b17e ; 0x2b17e 3752c: 60 93 55 07 sts 0x0755, r22 ; 0x800755 37530: 70 93 56 07 sts 0x0756, r23 ; 0x800756 37534: 80 93 57 07 sts 0x0757, r24 ; 0x800757 37538: 90 93 58 07 sts 0x0758, r25 ; 0x800758 position[Z_AXIS] = st_get_position(Z_AXIS); 3753c: 82 e0 ldi r24, 0x02 ; 2 3753e: 0f 94 bf 58 call 0x2b17e ; 0x2b17e 37542: 60 93 59 07 sts 0x0759, r22 ; 0x800759 37546: 70 93 5a 07 sts 0x075A, r23 ; 0x80075a 3754a: 80 93 5b 07 sts 0x075B, r24 ; 0x80075b 3754e: 90 93 5c 07 sts 0x075C, r25 ; 0x80075c position[E_AXIS] = st_get_position(E_AXIS); 37552: 83 e0 ldi r24, 0x03 ; 3 37554: 0f 94 bf 58 call 0x2b17e ; 0x2b17e 37558: 60 93 5d 07 sts 0x075D, r22 ; 0x80075d 3755c: 70 93 5e 07 sts 0x075E, r23 ; 0x80075e 37560: 80 93 5f 07 sts 0x075F, r24 ; 0x80075f 37564: 90 93 60 07 sts 0x0760, r25 ; 0x800760 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 37568: 80 e0 ldi r24, 0x00 ; 0 3756a: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 3756e: 60 93 40 07 sts 0x0740, r22 ; 0x800740 37572: 70 93 41 07 sts 0x0741, r23 ; 0x800741 37576: 80 93 42 07 sts 0x0742, r24 ; 0x800742 3757a: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 3757e: 81 e0 ldi r24, 0x01 ; 1 37580: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 37584: 60 93 44 07 sts 0x0744, r22 ; 0x800744 37588: 70 93 45 07 sts 0x0745, r23 ; 0x800745 3758c: 80 93 46 07 sts 0x0746, r24 ; 0x800746 37590: 90 93 47 07 sts 0x0747, r25 ; 0x800747 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 37594: 82 e0 ldi r24, 0x02 ; 2 37596: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 3759a: 60 93 48 07 sts 0x0748, r22 ; 0x800748 3759e: 70 93 49 07 sts 0x0749, r23 ; 0x800749 375a2: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 375a6: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b current_position[E_AXIS] = st_get_position_mm(E_AXIS); 375aa: 83 e0 ldi r24, 0x03 ; 3 375ac: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 375b0: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 375b4: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 375b8: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 375bc: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 375c0: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 375c4: 88 23 and r24, r24 375c6: 31 f1 breq .+76 ; 0x37614 #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]); 375c8: 20 91 44 07 lds r18, 0x0744 ; 0x800744 375cc: 30 91 45 07 lds r19, 0x0745 ; 0x800745 375d0: 40 91 46 07 lds r20, 0x0746 ; 0x800746 375d4: 50 91 47 07 lds r21, 0x0747 ; 0x800747 375d8: 60 91 40 07 lds r22, 0x0740 ; 0x800740 375dc: 70 91 41 07 lds r23, 0x0741 ; 0x800741 375e0: 80 91 42 07 lds r24, 0x0742 ; 0x800742 375e4: 90 91 43 07 lds r25, 0x0743 ; 0x800743 375e8: 0f 94 08 96 call 0x32c10 ; 0x32c10 375ec: 9b 01 movw r18, r22 375ee: ac 01 movw r20, r24 375f0: 60 91 48 07 lds r22, 0x0748 ; 0x800748 375f4: 70 91 49 07 lds r23, 0x0749 ; 0x800749 375f8: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 375fc: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 37600: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 37604: 60 93 48 07 sts 0x0748, r22 ; 0x800748 37608: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3760c: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 37610: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 37614: c0 91 e8 17 lds r28, 0x17E8 ; 0x8017e8 37618: cc 23 and r28, r28 3761a: 09 f4 brne .+2 ; 0x3761e 3761c: 9a c0 rjmp .+308 ; 0x37752 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 3761e: c0 ff sbrs r28, 0 37620: 34 c0 rjmp .+104 ; 0x3768a // Then add the offset. x -= world2machine_shift[0]; 37622: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 37626: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 3762a: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 3762e: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 37632: 60 91 40 07 lds r22, 0x0740 ; 0x800740 37636: 70 91 41 07 lds r23, 0x0741 ; 0x800741 3763a: 80 91 42 07 lds r24, 0x0742 ; 0x800742 3763e: 90 91 43 07 lds r25, 0x0743 ; 0x800743 37642: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 37646: 60 93 40 07 sts 0x0740, r22 ; 0x800740 3764a: 70 93 41 07 sts 0x0741, r23 ; 0x800741 3764e: 80 93 42 07 sts 0x0742, r24 ; 0x800742 37652: 90 93 43 07 sts 0x0743, r25 ; 0x800743 y -= world2machine_shift[1]; 37656: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 3765a: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 3765e: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 37662: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 37666: 60 91 44 07 lds r22, 0x0744 ; 0x800744 3766a: 70 91 45 07 lds r23, 0x0745 ; 0x800745 3766e: 80 91 46 07 lds r24, 0x0746 ; 0x800746 37672: 90 91 47 07 lds r25, 0x0747 ; 0x800747 37676: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 3767a: 60 93 44 07 sts 0x0744, r22 ; 0x800744 3767e: 70 93 45 07 sts 0x0745, r23 ; 0x800745 37682: 80 93 46 07 sts 0x0746, r24 ; 0x800746 37686: 90 93 47 07 sts 0x0747, r25 ; 0x800747 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 3768a: c1 ff sbrs r28, 1 3768c: 62 c0 rjmp .+196 ; 0x37752 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 3768e: 80 90 40 07 lds r8, 0x0740 ; 0x800740 37692: 90 90 41 07 lds r9, 0x0741 ; 0x800741 37696: a0 90 42 07 lds r10, 0x0742 ; 0x800742 3769a: b0 90 43 07 lds r11, 0x0743 ; 0x800743 3769e: c0 90 44 07 lds r12, 0x0744 ; 0x800744 376a2: d0 90 45 07 lds r13, 0x0745 ; 0x800745 376a6: e0 90 46 07 lds r14, 0x0746 ; 0x800746 376aa: f0 90 47 07 lds r15, 0x0747 ; 0x800747 float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 376ae: 20 91 d8 17 lds r18, 0x17D8 ; 0x8017d8 376b2: 30 91 d9 17 lds r19, 0x17D9 ; 0x8017d9 376b6: 40 91 da 17 lds r20, 0x17DA ; 0x8017da 376ba: 50 91 db 17 lds r21, 0x17DB ; 0x8017db 376be: c5 01 movw r24, r10 376c0: b4 01 movw r22, r8 376c2: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 376c6: 2b 01 movw r4, r22 376c8: 3c 01 movw r6, r24 376ca: 20 91 dc 17 lds r18, 0x17DC ; 0x8017dc 376ce: 30 91 dd 17 lds r19, 0x17DD ; 0x8017dd 376d2: 40 91 de 17 lds r20, 0x17DE ; 0x8017de 376d6: 50 91 df 17 lds r21, 0x17DF ; 0x8017df 376da: c7 01 movw r24, r14 376dc: b6 01 movw r22, r12 376de: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 376e2: 9b 01 movw r18, r22 376e4: ac 01 movw r20, r24 376e6: c3 01 movw r24, r6 376e8: b2 01 movw r22, r4 376ea: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 376ee: 2b 01 movw r4, r22 376f0: 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; 376f2: 20 91 d0 17 lds r18, 0x17D0 ; 0x8017d0 376f6: 30 91 d1 17 lds r19, 0x17D1 ; 0x8017d1 376fa: 40 91 d2 17 lds r20, 0x17D2 ; 0x8017d2 376fe: 50 91 d3 17 lds r21, 0x17D3 ; 0x8017d3 37702: c5 01 movw r24, r10 37704: b4 01 movw r22, r8 37706: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3770a: 4b 01 movw r8, r22 3770c: 5c 01 movw r10, r24 3770e: 20 91 d4 17 lds r18, 0x17D4 ; 0x8017d4 37712: 30 91 d5 17 lds r19, 0x17D5 ; 0x8017d5 37716: 40 91 d6 17 lds r20, 0x17D6 ; 0x8017d6 3771a: 50 91 d7 17 lds r21, 0x17D7 ; 0x8017d7 3771e: c7 01 movw r24, r14 37720: b6 01 movw r22, r12 37722: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 37726: 9b 01 movw r18, r22 37728: ac 01 movw r20, r24 3772a: c5 01 movw r24, r10 3772c: b4 01 movw r22, r8 3772e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 37732: 60 93 40 07 sts 0x0740, r22 ; 0x800740 37736: 70 93 41 07 sts 0x0741, r23 ; 0x800741 3773a: 80 93 42 07 sts 0x0742, r24 ; 0x800742 3773e: 90 93 43 07 sts 0x0743, r25 ; 0x800743 y = out_y; 37742: 40 92 44 07 sts 0x0744, r4 ; 0x800744 37746: 50 92 45 07 sts 0x0745, r5 ; 0x800745 3774a: 60 92 46 07 sts 0x0746, r6 ; 0x800746 3774e: 70 92 47 07 sts 0x0747, r7 ; 0x800747 } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 37752: 0e 94 00 69 call 0xd200 ; 0xd200 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 37756: 80 e1 ldi r24, 0x10 ; 16 37758: e0 e4 ldi r30, 0x40 ; 64 3775a: f7 e0 ldi r31, 0x07 ; 7 3775c: ad ec ldi r26, 0xCD ; 205 3775e: b4 e0 ldi r27, 0x04 ; 4 37760: 01 90 ld r0, Z+ 37762: 0d 92 st X+, r0 37764: 8a 95 dec r24 37766: e1 f7 brne .-8 ; 0x37760 #endif } 37768: cf 91 pop r28 3776a: ff 90 pop r15 3776c: ef 90 pop r14 3776e: df 90 pop r13 37770: cf 90 pop r12 37772: bf 90 pop r11 37774: af 90 pop r10 37776: 9f 90 pop r9 37778: 8f 90 pop r8 3777a: 7f 90 pop r7 3777c: 6f 90 pop r6 3777e: 5f 90 pop r5 37780: 4f 90 pop r4 37782: 08 95 ret 00037784 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 37784: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 37788: 8d 7f andi r24, 0xFD ; 253 3778a: 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(); 3778e: 0f 94 7b ba call 0x374f6 ; 0x374f6 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 37792: 81 e0 ldi r24, 0x01 ; 1 37794: 80 93 5a 0e sts 0x0E5A, r24 ; 0x800e5a } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 37798: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3779c: 8d 7f andi r24, 0xFD ; 253 3779e: 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); 377a2: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 377a6: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 while (blocks_queued()) plan_discard_current_block(); 377aa: 98 17 cp r25, r24 377ac: 69 f0 breq .+26 ; 0x377c8 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) { 377ae: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 377b2: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 377b6: 98 17 cp r25, r24 377b8: a1 f3 breq .-24 ; 0x377a2 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 377ba: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 377be: 8f 5f subi r24, 0xFF ; 255 377c0: 8f 70 andi r24, 0x0F ; 15 377c2: 80 93 54 0e sts 0x0E54, r24 ; 0x800e54 377c6: ed cf rjmp .-38 ; 0x377a2 current_block = NULL; 377c8: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 377cc: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 377d0: 8f ef ldi r24, 0xFF ; 255 377d2: 9f ef ldi r25, 0xFF ; 255 377d4: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.492+0x1> 377d8: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.492> current_adv_steps = 0; 377dc: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.494+0x1> 377e0: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.494> #endif st_reset_timer(); 377e4: 0f 94 3b 59 call 0x2b276 ; 0x2b276 ENABLE_STEPPER_DRIVER_INTERRUPT(); 377e8: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 377ec: 82 60 ori r24, 0x02 ; 2 377ee: 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; 377f2: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.506> 377f6: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.506+0x1> 377fa: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.506+0x2> 377fe: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.506+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37802: ed eb ldi r30, 0xBD ; 189 37804: f4 e0 ldi r31, 0x04 ; 4 37806: 80 e1 ldi r24, 0x10 ; 16 37808: df 01 movw r26, r30 3780a: 1d 92 st X+, r1 3780c: 8a 95 dec r24 3780e: e9 f7 brne .-6 ; 0x3780a // Reset position sync requests plan_reset_next_e_queue = false; 37810: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.504> plan_reset_next_e_sched = false; 37814: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.505> } 37818: 08 95 ret 0003781a <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 3781a: 1f 92 push r1 3781c: 0f 92 push r0 3781e: 0f b6 in r0, 0x3f ; 63 37820: 0f 92 push r0 37822: 11 24 eor r1, r1 37824: 0b b6 in r0, 0x3b ; 59 37826: 0f 92 push r0 37828: 8f 92 push r8 3782a: 9f 92 push r9 3782c: af 92 push r10 3782e: bf 92 push r11 37830: cf 92 push r12 37832: df 92 push r13 37834: ef 92 push r14 37836: ff 92 push r15 37838: 0f 93 push r16 3783a: 1f 93 push r17 3783c: 2f 93 push r18 3783e: 3f 93 push r19 37840: 4f 93 push r20 37842: 5f 93 push r21 37844: 6f 93 push r22 37846: 7f 93 push r23 37848: 8f 93 push r24 3784a: 9f 93 push r25 3784c: af 93 push r26 3784e: bf 93 push r27 37850: cf 93 push r28 37852: df 93 push r29 37854: ef 93 push r30 37856: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 37858: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 3785a: 85 eb ldi r24, 0xB5 ; 181 3785c: 9f e8 ldi r25, 0x8F ; 143 3785e: 0e 94 17 7b call 0xf62e ; 0xf62e if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 37862: 85 ea ldi r24, 0xA5 ; 165 37864: 9f e0 ldi r25, 0x0F ; 15 37866: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 3786a: 18 2f mov r17, r24 3786c: 81 11 cpse r24, r1 3786e: de c2 rjmp .+1468 ; 0x37e2c <__vector_5+0x612> { if(printer_active()) { 37870: 0e 94 a7 68 call 0xd14e ; 0xd14e 37874: 88 23 and r24, r24 37876: 09 f4 brne .+2 ; 0x3787a <__vector_5+0x60> 37878: a9 c3 rjmp .+1874 ; 0x37fcc <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 3787a: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 3787e: 6b 01 movw r12, r22 37880: 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); 37882: c0 91 57 0e lds r28, 0x0E57 ; 0x800e57 37886: cc 23 and r28, r28 37888: 31 f0 breq .+12 ; 0x37896 <__vector_5+0x7c> 3788a: c1 e0 ldi r28, 0x01 ; 1 3788c: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 37890: 82 30 cpi r24, 0x02 ; 2 37892: 09 f4 brne .+2 ; 0x37896 <__vector_5+0x7c> 37894: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 37896: d0 91 56 0e lds r29, 0x0E56 ; 0x800e56 3789a: d1 11 cpse r29, r1 3789c: 02 c0 rjmp .+4 ; 0x378a2 <__vector_5+0x88> 3789e: d0 91 55 0e lds r29, 0x0E55 ; 0x800e55 // Conserve as much power as soon as possible // Turn off the LCD backlight #ifdef LCD_BL_PIN backlightMode = BACKLIGHT_MODE_DIM; 378a2: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 378a6: 10 92 f9 03 sts 0x03F9, r1 ; 0x8003f9 backlight_update(); 378aa: 0e 94 4a 8b call 0x11694 ; 0x11694 #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 378ae: 17 9a sbi 0x02, 7 ; 2 378b0: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); 378b4: 16 9a sbi 0x02, 6 ; 2 378b6: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 378ba: 64 e1 ldi r22, 0x14 ; 20 378bc: 83 e6 ldi r24, 0x63 ; 99 378be: 92 e0 ldi r25, 0x02 ; 2 378c0: 0e 94 c4 68 call 0xd188 ; 0xd188 currents[Z_AXIS].setiRun(20); 378c4: 64 e1 ldi r22, 0x14 ; 20 378c6: 83 e6 ldi r24, 0x63 ; 99 378c8: 92 e0 ldi r25, 0x02 ; 2 378ca: 0e 94 cc 68 call 0xd198 ; 0xd198 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 378ce: 50 e0 ldi r21, 0x00 ; 0 378d0: 40 e0 ldi r20, 0x00 ; 0 378d2: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 378d6: 82 e0 ldi r24, 0x02 ; 2 378d8: 0f 94 1a 3a call 0x27434 ; 0x27434 currents[E_AXIS].setiHold(20); 378dc: 64 e1 ldi r22, 0x14 ; 20 378de: 86 e6 ldi r24, 0x66 ; 102 378e0: 92 e0 ldi r25, 0x02 ; 2 378e2: 0e 94 c4 68 call 0xd188 ; 0xd188 currents[E_AXIS].setiRun(20); 378e6: 64 e1 ldi r22, 0x14 ; 20 378e8: 86 e6 ldi r24, 0x66 ; 102 378ea: 92 e0 ldi r25, 0x02 ; 2 378ec: 0e 94 cc 68 call 0xd198 ; 0xd198 tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 378f0: 50 e0 ldi r21, 0x00 ; 0 378f2: 40 e0 ldi r20, 0x00 ; 0 378f4: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 378f8: 83 e0 ldi r24, 0x03 ; 3 378fa: 0f 94 1a 3a call 0x27434 ; 0x27434 #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 378fe: c1 11 cpse r28, r1 37900: 1b c0 rjmp .+54 ; 0x37938 <__vector_5+0x11e> 37902: 80 91 50 07 lds r24, 0x0750 ; 0x800750 37906: 81 11 cpse r24, r1 37908: 17 c0 rjmp .+46 ; 0x37938 <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 3790a: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 3790e: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_temperature = target_temperature[active_extruder]; 37912: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 37916: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 3791a: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab 3791e: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 37922: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 37926: 83 fb bst r24, 3 37928: 88 27 eor r24, r24 3792a: 80 f9 bld r24, 0 3792c: 80 93 03 18 sts 0x1803, r24 ; 0x801803 saved_fan_speed = fanSpeed; 37930: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 37934: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 } // Stop all heaters before continuing disable_heater(); 37938: 0f 94 27 45 call 0x28a4e ; 0x28a4e // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 3793c: c1 11 cpse r28, r1 3793e: 04 c0 rjmp .+8 ; 0x37948 <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 37940: 0e 94 00 66 call 0xcc00 ; 0xcc00 // save the global state at planning time save_planner_global_state(); 37944: 0e 94 b6 65 call 0xcb6c ; 0xcb6c } // 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; 37948: 00 91 9d 13 lds r16, 0x139D ; 0x80139d mbl.active = false; 3794c: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d // After this call, the planner queue is emptied and the current_position is set to a current logical coordinate. // The logical coordinate will likely differ from the machine coordinate if the skew calibration and mesh bed leveling // are in action. planner_abort_hard(); 37950: 0f 94 c2 bb call 0x37784 ; 0x37784 // 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) 37954: c1 11 cpse r28, r1 37956: 1b c0 rjmp .+54 ; 0x3798e <__vector_5+0x174> 37958: 80 91 50 07 lds r24, 0x0750 ; 0x800750 3795c: 81 11 cpse r24, r1 3795e: 17 c0 rjmp .+46 ; 0x3798e <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 37960: 80 e1 ldi r24, 0x10 ; 16 37962: e0 e4 ldi r30, 0x40 ; 64 37964: f7 e0 ldi r31, 0x07 ; 7 37966: ab e9 ldi r26, 0x9B ; 155 37968: b2 e0 ldi r27, 0x02 ; 2 3796a: 01 90 ld r0, Z+ 3796c: 0d 92 st X+, r0 3796e: 8a 95 dec r24 37970: e1 f7 brne .-8 ; 0x3796a <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 37972: dd 23 and r29, r29 37974: 61 f0 breq .+24 ; 0x3798e <__vector_5+0x174> 37976: 80 e0 ldi r24, 0x00 ; 0 37978: 90 e0 ldi r25, 0x00 ; 0 3797a: a0 e8 ldi r26, 0x80 ; 128 3797c: bf eb ldi r27, 0xBF ; 191 3797e: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 37982: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 37986: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 3798a: 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]; 3798e: 80 90 a3 02 lds r8, 0x02A3 ; 0x8002a3 37992: 90 90 a4 02 lds r9, 0x02A4 ; 0x8002a4 37996: a0 90 a5 02 lds r10, 0x02A5 ; 0x8002a5 3799a: b0 90 a6 02 lds r11, 0x02A6 ; 0x8002a6 if(mbl_was_active) { 3799e: 00 23 and r16, r16 379a0: d1 f0 breq .+52 ; 0x379d6 <__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]); 379a2: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 379a6: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 379aa: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 379ae: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 379b2: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 379b6: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 379ba: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 379be: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 379c2: 0f 94 08 96 call 0x32c10 ; 0x32c10 379c6: 9b 01 movw r18, r22 379c8: ac 01 movw r20, r24 379ca: c5 01 movw r24, r10 379cc: b4 01 movw r22, r8 379ce: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 379d2: 4b 01 movw r8, r22 379d4: 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); 379d6: b5 01 movw r22, r10 379d8: a4 01 movw r20, r8 379da: 8d e8 ldi r24, 0x8D ; 141 379dc: 9f e0 ldi r25, 0x0F ; 15 379de: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 379e2: 40 91 a7 02 lds r20, 0x02A7 ; 0x8002a7 379e6: 50 91 a8 02 lds r21, 0x02A8 ; 0x8002a8 379ea: 60 91 a9 02 lds r22, 0x02A9 ; 0x8002a9 379ee: 70 91 aa 02 lds r23, 0x02AA ; 0x8002aa 379f2: 8e e6 ldi r24, 0x6E ; 110 379f4: 9f e0 ldi r25, 0x0F ; 15 379f6: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 } 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); 379fa: 60 91 03 18 lds r22, 0x1803 ; 0x801803 379fe: c1 e0 ldi r28, 0x01 ; 1 37a00: 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); 37a02: 82 e7 ldi r24, 0x72 ; 114 37a04: 9f e0 ldi r25, 0x0F ; 15 37a06: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37a0a: 0e 94 e0 80 call 0x101c0 ; 0x101c0 card.sdprinting = false; 37a0e: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b saved_printing = true; 37a12: c0 93 57 0e sts 0x0E57, r28 ; 0x800e57 // Enable stepper driver interrupt to move Z axis. This should be fine as the planner and // command queues are empty, SD card printing is disabled, usb is inhibited. planner_aborted = false; 37a16: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a sei(); 37a1a: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 37a1c: 20 e0 ldi r18, 0x00 ; 0 37a1e: 30 e0 ldi r19, 0x00 ; 0 37a20: 40 e8 ldi r20, 0x80 ; 128 37a22: 5f e3 ldi r21, 0x3F ; 63 37a24: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 37a28: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 37a2c: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 37a30: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 37a34: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 37a38: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 37a3c: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 37a40: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 37a44: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(95); 37a48: 60 e0 ldi r22, 0x00 ; 0 37a4a: 70 e0 ldi r23, 0x00 ; 0 37a4c: 8e eb ldi r24, 0xBE ; 190 37a4e: 92 e4 ldi r25, 0x42 ; 66 37a50: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 37a54: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 disable_e0(); 37a58: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 37a5a: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 37a5e: c0 e0 ldi r28, 0x00 ; 0 37a60: d1 e0 ldi r29, 0x01 ; 1 37a62: 02 c0 rjmp .+4 ; 0x37a68 <__vector_5+0x24e> 37a64: d6 95 lsr r29 37a66: c7 95 ror r28 37a68: 8a 95 dec r24 37a6a: e2 f7 brpl .-8 ; 0x37a64 <__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); 37a6c: 82 e0 ldi r24, 0x02 ; 2 37a6e: 0f 94 00 3a call 0x27400 ; 0x27400 current_position[Z_AXIS] += float(1024 - z_microsteps) 37a72: 60 e0 ldi r22, 0x00 ; 0 37a74: 74 e0 ldi r23, 0x04 ; 4 37a76: 68 1b sub r22, r24 37a78: 79 0b sbc r23, r25 37a7a: 90 e0 ldi r25, 0x00 ; 0 37a7c: 80 e0 ldi r24, 0x00 ; 0 37a7e: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 37a82: 4b 01 movw r8, r22 37a84: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37a86: be 01 movw r22, r28 37a88: 90 e0 ldi r25, 0x00 ; 0 37a8a: 80 e0 ldi r24, 0x00 ; 0 37a8c: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 37a90: 20 91 77 06 lds r18, 0x0677 ; 0x800677 37a94: 30 91 78 06 lds r19, 0x0678 ; 0x800678 37a98: 40 91 79 06 lds r20, 0x0679 ; 0x800679 37a9c: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 37aa0: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 37aa4: 9b 01 movw r18, r22 37aa6: ac 01 movw r20, r24 37aa8: c5 01 movw r24, r10 37aaa: b4 01 movw r22, r8 37aac: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> + UVLO_Z_AXIS_SHIFT; 37ab0: 2a e0 ldi r18, 0x0A ; 10 37ab2: 37 ed ldi r19, 0xD7 ; 215 37ab4: 43 e2 ldi r20, 0x23 ; 35 37ab6: 5f e3 ldi r21, 0x3F ; 63 37ab8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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) 37abc: 20 91 48 07 lds r18, 0x0748 ; 0x800748 37ac0: 30 91 49 07 lds r19, 0x0749 ; 0x800749 37ac4: 40 91 4a 07 lds r20, 0x074A ; 0x80074a 37ac8: 50 91 4b 07 lds r21, 0x074B ; 0x80074b 37acc: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 37ad0: 60 93 48 07 sts 0x0748, r22 ; 0x800748 37ad4: 70 93 49 07 sts 0x0749, r23 ; 0x800749 37ad8: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 37adc: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37ae0: 65 e5 ldi r22, 0x55 ; 85 37ae2: 75 e5 ldi r23, 0x55 ; 85 37ae4: 85 e5 ldi r24, 0x55 ; 85 37ae6: 91 e4 ldi r25, 0x41 ; 65 37ae8: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 37aec: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37af0: 40 91 ff 17 lds r20, 0x17FF ; 0x8017ff 37af4: 50 91 00 18 lds r21, 0x1800 ; 0x801800 37af8: 60 91 01 18 lds r22, 0x1801 ; 0x801801 37afc: 70 91 02 18 lds r23, 0x1802 ; 0x801802 37b00: 81 e9 ldi r24, 0x91 ; 145 37b02: 9f e0 ldi r25, 0x0F ; 15 37b04: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 37b08: ce ea ldi r28, 0xAE ; 174 37b0a: 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; 37b0c: 97 e0 ldi r25, 0x07 ; 7 37b0e: 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; 37b10: 70 e0 ldi r23, 0x00 ; 0 37b12: 60 e0 ldi r22, 0x00 ; 0 37b14: 00 23 and r16, r16 37b16: 19 f1 breq .+70 ; 0x37b5e <__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; 37b18: 81 2f mov r24, r17 37b1a: 6b 2d mov r22, r11 37b1c: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__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; 37b20: b8 9e mul r11, r24 37b22: f0 01 movw r30, r0 37b24: 11 24 eor r1, r1 37b26: e9 0f add r30, r25 37b28: f1 1d adc r31, r1 37b2a: ee 0f add r30, r30 37b2c: ff 1f adc r31, r31 37b2e: ee 0f add r30, r30 37b30: ff 1f adc r31, r31 37b32: e3 56 subi r30, 0x63 ; 99 37b34: fc 4e sbci r31, 0xEC ; 236 37b36: 20 e0 ldi r18, 0x00 ; 0 37b38: 30 e0 ldi r19, 0x00 ; 0 37b3a: 4a e7 ldi r20, 0x7A ; 122 37b3c: 54 e4 ldi r21, 0x44 ; 68 37b3e: 61 81 ldd r22, Z+1 ; 0x01 37b40: 72 81 ldd r23, Z+2 ; 0x02 37b42: 83 81 ldd r24, Z+3 ; 0x03 37b44: 94 81 ldd r25, Z+4 ; 0x04 37b46: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 37b4a: 20 e0 ldi r18, 0x00 ; 0 37b4c: 30 e0 ldi r19, 0x00 ; 0 37b4e: 40 e0 ldi r20, 0x00 ; 0 37b50: 5f e3 ldi r21, 0x3F ; 63 37b52: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 37b56: 0f 94 15 e0 call 0x3c02a ; 0x3c02a 37b5a: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37b5e: ce 01 movw r24, r28 37b60: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 // 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) 37b64: 1f 5f subi r17, 0xFF ; 255 37b66: 22 96 adiw r28, 0x02 ; 2 37b68: 11 33 cpi r17, 0x31 ; 49 37b6a: 91 f6 brne .-92 ; 0x37b10 <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37b6c: 40 91 48 07 lds r20, 0x0748 ; 0x800748 37b70: 50 91 49 07 lds r21, 0x0749 ; 0x800749 37b74: 60 91 4a 07 lds r22, 0x074A ; 0x80074a 37b78: 70 91 4b 07 lds r23, 0x074B ; 0x80074b 37b7c: 8a ed ldi r24, 0xDA ; 218 37b7e: 9e e0 ldi r25, 0x0E ; 14 37b80: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 37b84: 40 91 9b 02 lds r20, 0x029B ; 0x80029b 37b88: 50 91 9c 02 lds r21, 0x029C ; 0x80029c 37b8c: 60 91 9d 02 lds r22, 0x029D ; 0x80029d 37b90: 70 91 9e 02 lds r23, 0x029E ; 0x80029e 37b94: 8d e9 ldi r24, 0x9D ; 157 37b96: 9f e0 ldi r25, 0x0F ; 15 37b98: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 37b9c: 40 91 9f 02 lds r20, 0x029F ; 0x80029f 37ba0: 50 91 a0 02 lds r21, 0x02A0 ; 0x8002a0 37ba4: 60 91 a1 02 lds r22, 0x02A1 ; 0x8002a1 37ba8: 70 91 a2 02 lds r23, 0x02A2 ; 0x8002a2 37bac: 81 ea ldi r24, 0xA1 ; 161 37bae: 9f e0 ldi r25, 0x0F ; 15 37bb0: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37bb4: 60 91 fd 17 lds r22, 0x17FD ; 0x8017fd 37bb8: 70 91 fe 17 lds r23, 0x17FE ; 0x8017fe 37bbc: 89 e8 ldi r24, 0x89 ; 137 37bbe: 9f e0 ldi r25, 0x0F ; 15 37bc0: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 37bc4: 60 91 39 02 lds r22, 0x0239 ; 0x800239 37bc8: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 37bcc: 85 e3 ldi r24, 0x35 ; 53 37bce: 9d e0 ldi r25, 0x0D ; 13 37bd0: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 37bd4: 60 91 aa 05 lds r22, 0x05AA ; 0x8005aa 37bd8: 70 91 ab 05 lds r23, 0x05AB ; 0x8005ab 37bdc: 88 ed ldi r24, 0xD8 ; 216 37bde: 9e e0 ldi r25, 0x0E ; 14 37be0: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37be4: 60 91 ac 05 lds r22, 0x05AC ; 0x8005ac 37be8: 8b e8 ldi r24, 0x8B ; 139 37bea: 9f e0 ldi r25, 0x0F ; 15 37bec: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 37bf0: 60 91 a9 05 lds r22, 0x05A9 ; 0x8005a9 37bf4: 88 e8 ldi r24, 0x88 ; 136 37bf6: 9f e0 ldi r25, 0x0F ; 15 37bf8: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37bfc: 40 91 bb 02 lds r20, 0x02BB ; 0x8002bb 37c00: 50 91 bc 02 lds r21, 0x02BC ; 0x8002bc 37c04: 60 91 bd 02 lds r22, 0x02BD ; 0x8002bd 37c08: 70 91 be 02 lds r23, 0x02BE ; 0x8002be 37c0c: 88 ee ldi r24, 0xE8 ; 232 37c0e: 9e e0 ldi r25, 0x0E ; 14 37c10: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37c14: 60 91 94 02 lds r22, 0x0294 ; 0x800294 37c18: 70 91 95 02 lds r23, 0x0295 ; 0x800295 37c1c: 8e ed ldi r24, 0xDE ; 222 37c1e: 9e e0 ldi r25, 0x0E ; 14 37c20: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c24: 40 91 9f 06 lds r20, 0x069F ; 0x80069f 37c28: 50 91 a0 06 lds r21, 0x06A0 ; 0x8006a0 37c2c: 60 91 a1 06 lds r22, 0x06A1 ; 0x8006a1 37c30: 70 91 a2 06 lds r23, 0x06A2 ; 0x8006a2 37c34: 81 e1 ldi r24, 0x11 ; 17 37c36: 9d e0 ldi r25, 0x0D ; 13 37c38: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 37c3c: 40 91 a3 06 lds r20, 0x06A3 ; 0x8006a3 37c40: 50 91 a4 06 lds r21, 0x06A4 ; 0x8006a4 37c44: 60 91 a5 06 lds r22, 0x06A5 ; 0x8006a5 37c48: 70 91 a6 06 lds r23, 0x06A6 ; 0x8006a6 37c4c: 8d e0 ldi r24, 0x0D ; 13 37c4e: 9d e0 ldi r25, 0x0D ; 13 37c50: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 37c54: 40 91 2b 07 lds r20, 0x072B ; 0x80072b 37c58: 50 91 2c 07 lds r21, 0x072C ; 0x80072c 37c5c: 60 91 2d 07 lds r22, 0x072D ; 0x80072d 37c60: 70 91 2e 07 lds r23, 0x072E ; 0x80072e 37c64: 89 e0 ldi r24, 0x09 ; 9 37c66: 9d e0 ldi r25, 0x0D ; 13 37c68: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 #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); 37c6c: 40 e1 ldi r20, 0x10 ; 16 37c6e: 50 e0 ldi r21, 0x00 ; 0 37c70: 67 e3 ldi r22, 0x37 ; 55 37c72: 7d e0 ldi r23, 0x0D ; 13 37c74: 8b ea ldi r24, 0xAB ; 171 37c76: 92 e0 ldi r25, 0x02 ; 2 37c78: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37c7c: 60 91 08 18 lds r22, 0x1808 ; 0x801808 37c80: 70 91 09 18 lds r23, 0x1809 ; 0x801809 37c84: 8c e6 ldi r24, 0x6C ; 108 37c86: 9f e0 ldi r25, 0x0F ; 15 37c88: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37c8c: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 37c90: 8c e8 ldi r24, 0x8C ; 140 37c92: 9f e0 ldi r25, 0x0F ; 15 37c94: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c98: 40 91 04 18 lds r20, 0x1804 ; 0x801804 37c9c: 50 91 05 18 lds r21, 0x1805 ; 0x801805 37ca0: 60 91 06 18 lds r22, 0x1806 ; 0x801806 37ca4: 70 91 07 18 lds r23, 0x1807 ; 0x801807 37ca8: 8c e2 ldi r24, 0x2C ; 44 37caa: 9d e0 ldi r25, 0x0D ; 13 37cac: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37cb0: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 37cb4: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 37cb8: 8d e7 ldi r24, 0x7D ; 125 37cba: 9c e0 ldi r25, 0x0C ; 12 37cbc: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 #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); 37cc0: 40 e1 ldi r20, 0x10 ; 16 37cc2: 50 e0 ldi r21, 0x00 ; 0 37cc4: 6d e6 ldi r22, 0x6D ; 109 37cc6: 7c e0 ldi r23, 0x0C ; 12 37cc8: 8f e8 ldi r24, 0x8F ; 143 37cca: 96 e0 ldi r25, 0x06 ; 6 37ccc: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 37cd0: 40 e1 ldi r20, 0x10 ; 16 37cd2: 50 e0 ldi r21, 0x00 ; 0 37cd4: 6d e5 ldi r22, 0x5D ; 93 37cd6: 7c e0 ldi r23, 0x0C ; 12 37cd8: 87 e1 ldi r24, 0x17 ; 23 37cda: 97 e0 ldi r25, 0x07 ; 7 37cdc: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 37ce0: 40 e1 ldi r20, 0x10 ; 16 37ce2: 50 e0 ldi r21, 0x00 ; 0 37ce4: 6d e4 ldi r22, 0x4D ; 77 37ce6: 7c e0 ldi r23, 0x0C ; 12 37ce8: 8f e7 ldi r24, 0x7F ; 127 37cea: 96 e0 ldi r25, 0x06 ; 6 37cec: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 37cf0: 40 e1 ldi r20, 0x10 ; 16 37cf2: 50 e0 ldi r21, 0x00 ; 0 37cf4: 6d e3 ldi r22, 0x3D ; 61 37cf6: 7c e0 ldi r23, 0x0C ; 12 37cf8: 87 e0 ldi r24, 0x07 ; 7 37cfa: 97 e0 ldi r25, 0x07 ; 7 37cfc: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37d00: 40 91 a7 06 lds r20, 0x06A7 ; 0x8006a7 37d04: 50 91 a8 06 lds r21, 0x06A8 ; 0x8006a8 37d08: 60 91 a9 06 lds r22, 0x06A9 ; 0x8006a9 37d0c: 70 91 aa 06 lds r23, 0x06AA ; 0x8006aa 37d10: 89 e3 ldi r24, 0x39 ; 57 37d12: 9c e0 ldi r25, 0x0C ; 12 37d14: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 37d18: 40 91 ab 06 lds r20, 0x06AB ; 0x8006ab 37d1c: 50 91 ac 06 lds r21, 0x06AC ; 0x8006ac 37d20: 60 91 ad 06 lds r22, 0x06AD ; 0x8006ad 37d24: 70 91 ae 06 lds r23, 0x06AE ; 0x8006ae 37d28: 85 e3 ldi r24, 0x35 ; 53 37d2a: 9c e0 ldi r25, 0x0C ; 12 37d2c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37d30: 40 91 af 06 lds r20, 0x06AF ; 0x8006af 37d34: 50 91 b0 06 lds r21, 0x06B0 ; 0x8006b0 37d38: 60 91 b1 06 lds r22, 0x06B1 ; 0x8006b1 37d3c: 70 91 b2 06 lds r23, 0x06B2 ; 0x8006b2 37d40: 81 e3 ldi r24, 0x31 ; 49 37d42: 9c e0 ldi r25, 0x0C ; 12 37d44: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 #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); 37d48: 40 e1 ldi r20, 0x10 ; 16 37d4a: 50 e0 ldi r21, 0x00 ; 0 37d4c: 61 e2 ldi r22, 0x21 ; 33 37d4e: 7c e0 ldi r23, 0x0C ; 12 37d50: 83 eb ldi r24, 0xB3 ; 179 37d52: 96 e0 ldi r25, 0x06 ; 6 37d54: 0f 94 5a dd call 0x3bab4 ; 0x3bab4 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) { 37d58: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc 37d5c: 88 23 and r24, r24 37d5e: 29 f0 breq .+10 ; 0x37d6a <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37d60: 61 e0 ldi r22, 0x01 ; 1 37d62: 8f e7 ldi r24, 0x7F ; 127 37d64: 9c e0 ldi r25, 0x0C ; 12 37d66: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 37d6a: 61 e0 ldi r22, 0x01 ; 1 37d6c: 85 ea ldi r24, 0xA5 ; 165 37d6e: 9f e0 ldi r25, 0x0F ; 15 37d70: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 37d74: 84 e6 ldi r24, 0x64 ; 100 37d76: 9f e0 ldi r25, 0x0F ; 15 37d78: 0e 94 c4 77 call 0xef88 ; 0xef88 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 37d7c: 8f ef ldi r24, 0xFF ; 255 37d7e: 9e e0 ldi r25, 0x0E ; 14 37d80: 0e 94 b7 77 call 0xef6e ; 0xef6e printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 37d84: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 37d88: dc 01 movw r26, r24 37d8a: cb 01 movw r24, r22 37d8c: 8c 19 sub r24, r12 37d8e: 9d 09 sbc r25, r13 37d90: ae 09 sbc r26, r14 37d92: bf 09 sbc r27, r15 37d94: bf 93 push r27 37d96: af 93 push r26 37d98: 9f 93 push r25 37d9a: 8f 93 push r24 37d9c: 84 e9 ldi r24, 0x94 ; 148 37d9e: 91 e7 ldi r25, 0x71 ; 113 37da0: 9f 93 push r25 37da2: 8f 93 push r24 37da4: 0f 94 08 dc call 0x3b810 ; 0x3b810 WRITE(BEEPER,HIGH); 37da8: 9f b7 in r25, 0x3f ; 63 37daa: f8 94 cli 37dac: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37db0: 84 60 ori r24, 0x04 ; 4 37db2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37db6: 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(); 37db8: 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; 37dba: 0f 90 pop r0 37dbc: 0f 90 pop r0 37dbe: 0f 90 pop r0 37dc0: 0f 90 pop r0 37dc2: 0f 90 pop r0 37dc4: 0f 90 pop r0 37dc6: 20 e0 ldi r18, 0x00 ; 0 37dc8: 30 e0 ldi r19, 0x00 ; 0 37dca: 4f ef ldi r20, 0xFF ; 255 37dcc: 52 e4 ldi r21, 0x42 ; 66 37dce: 60 91 40 07 lds r22, 0x0740 ; 0x800740 37dd2: 70 91 41 07 lds r23, 0x0741 ; 0x800741 37dd6: 80 91 42 07 lds r24, 0x0742 ; 0x800742 37dda: 90 91 43 07 lds r25, 0x0743 ; 0x800743 37dde: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 37de2: 87 fd sbrc r24, 7 37de4: 1f c0 rjmp .+62 ; 0x37e24 <__vector_5+0x60a> 37de6: 80 e0 ldi r24, 0x00 ; 0 37de8: 90 e0 ldi r25, 0x00 ; 0 37dea: af e7 ldi r26, 0x7F ; 127 37dec: b3 e4 ldi r27, 0x43 ; 67 37dee: 80 93 40 07 sts 0x0740, r24 ; 0x800740 37df2: 90 93 41 07 sts 0x0741, r25 ; 0x800741 37df6: a0 93 42 07 sts 0x0742, r26 ; 0x800742 37dfa: b0 93 43 07 sts 0x0743, r27 ; 0x800743 plan_buffer_line_curposXYZE(500); 37dfe: 60 e0 ldi r22, 0x00 ; 0 37e00: 70 e0 ldi r23, 0x00 ; 0 37e02: 8a ef ldi r24, 0xFA ; 250 37e04: 93 e4 ldi r25, 0x43 ; 67 37e06: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 37e0a: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 37e0e: 88 e1 ldi r24, 0x18 ; 24 37e10: 9e e0 ldi r25, 0x0E ; 14 37e12: 0f b6 in r0, 0x3f ; 63 37e14: f8 94 cli 37e16: a8 95 wdr 37e18: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37e1c: 0f be out 0x3f, r0 ; 63 37e1e: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37e22: ff cf rjmp .-2 ; 0x37e22 <__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; 37e24: 80 e0 ldi r24, 0x00 ; 0 37e26: 90 e0 ldi r25, 0x00 ; 0 37e28: dc 01 movw r26, r24 37e2a: e1 cf rjmp .-62 ; 0x37dee <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 37e2c: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 37e30: 6b 01 movw r12, r22 37e32: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 37e34: 17 9a sbi 0x02, 7 ; 2 37e36: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); 37e3a: 16 9a sbi 0x02, 6 ; 2 37e3c: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_e0(); 37e40: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 37e42: 64 e1 ldi r22, 0x14 ; 20 37e44: 83 e6 ldi r24, 0x63 ; 99 37e46: 92 e0 ldi r25, 0x02 ; 2 37e48: 0e 94 c4 68 call 0xd188 ; 0xd188 currents[Z_AXIS].setiRun(20); 37e4c: 64 e1 ldi r22, 0x14 ; 20 37e4e: 83 e6 ldi r24, 0x63 ; 99 37e50: 92 e0 ldi r25, 0x02 ; 2 37e52: 0e 94 cc 68 call 0xd198 ; 0xd198 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 37e56: 50 e0 ldi r21, 0x00 ; 0 37e58: 40 e0 ldi r20, 0x00 ; 0 37e5a: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 37e5e: 82 e0 ldi r24, 0x02 ; 2 37e60: 0f 94 1a 3a call 0x27434 ; 0x27434 #endif //TMC2130 // Stop all heaters disable_heater(); 37e64: 0f 94 27 45 call 0x28a4e ; 0x28a4e // 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; 37e68: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d planner_abort_hard(); 37e6c: 0f 94 c2 bb call 0x37784 ; 0x37784 // 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]) 37e70: 80 90 48 07 lds r8, 0x0748 ; 0x800748 37e74: 90 90 49 07 lds r9, 0x0749 ; 0x800749 37e78: a0 90 4a 07 lds r10, 0x074A ; 0x80074a 37e7c: b0 90 4b 07 lds r11, 0x074B ; 0x80074b 37e80: 8a ed ldi r24, 0xDA ; 218 37e82: 9e e0 ldi r25, 0x0E ; 14 37e84: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 37e88: 9b 01 movw r18, r22 37e8a: ac 01 movw r20, r24 37e8c: c5 01 movw r24, r10 37e8e: b4 01 movw r22, r8 37e90: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 37e94: 4b 01 movw r8, r22 37e96: 5c 01 movw r10, r24 37e98: e8 94 clt 37e9a: b7 f8 bld r11, 7 37e9c: 20 91 77 06 lds r18, 0x0677 ; 0x800677 37ea0: 30 91 78 06 lds r19, 0x0678 ; 0x800678 37ea4: 40 91 79 06 lds r20, 0x0679 ; 0x800679 37ea8: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 37eac: 60 e0 ldi r22, 0x00 ; 0 37eae: 70 e0 ldi r23, 0x00 ; 0 37eb0: 80 e8 ldi r24, 0x80 ; 128 37eb2: 9f e3 ldi r25, 0x3F ; 63 37eb4: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 37eb8: 9b 01 movw r18, r22 37eba: ac 01 movw r20, r24 37ebc: c5 01 movw r24, r10 37ebe: b4 01 movw r22, r8 37ec0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 37ec4: 87 fd sbrc r24, 7 37ec6: 61 c0 rjmp .+194 ; 0x37f8a <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37ec8: 0e 94 e0 80 call 0x101c0 ; 0x101c0 card.sdprinting = false; 37ecc: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b saved_printing = true; 37ed0: 81 e0 ldi r24, 0x01 ; 1 37ed2: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 // Enable stepper driver interrupt to move Z axis. This should be fine as the planner and // command queues are empty, SD card printing is disabled, usb is inhibited. planner_aborted = false; 37ed6: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a sei(); 37eda: 78 94 sei 37edc: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 37ee0: c0 e0 ldi r28, 0x00 ; 0 37ee2: d1 e0 ldi r29, 0x01 ; 1 37ee4: 02 c0 rjmp .+4 ; 0x37eea <__vector_5+0x6d0> 37ee6: d6 95 lsr r29 37ee8: c7 95 ror r28 37eea: 8a 95 dec r24 37eec: e2 f7 brpl .-8 ; 0x37ee6 <__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); 37eee: 82 e0 ldi r24, 0x02 ; 2 37ef0: 0f 94 00 3a call 0x27400 ; 0x27400 current_position[Z_AXIS] += float(1024 - z_microsteps) 37ef4: 60 e0 ldi r22, 0x00 ; 0 37ef6: 74 e0 ldi r23, 0x04 ; 4 37ef8: 68 1b sub r22, r24 37efa: 79 0b sbc r23, r25 37efc: 90 e0 ldi r25, 0x00 ; 0 37efe: 80 e0 ldi r24, 0x00 ; 0 37f00: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 37f04: 4b 01 movw r8, r22 37f06: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37f08: be 01 movw r22, r28 37f0a: 90 e0 ldi r25, 0x00 ; 0 37f0c: 80 e0 ldi r24, 0x00 ; 0 37f0e: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 37f12: 20 91 77 06 lds r18, 0x0677 ; 0x800677 37f16: 30 91 78 06 lds r19, 0x0678 ; 0x800678 37f1a: 40 91 79 06 lds r20, 0x0679 ; 0x800679 37f1e: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 37f22: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 37f26: 9b 01 movw r18, r22 37f28: ac 01 movw r20, r24 37f2a: c5 01 movw r24, r10 37f2c: b4 01 movw r22, r8 37f2e: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 37f32: 2a e0 ldi r18, 0x0A ; 10 37f34: 37 ed ldi r19, 0xD7 ; 215 37f36: 43 e2 ldi r20, 0x23 ; 35 37f38: 5e e3 ldi r21, 0x3E ; 62 37f3a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__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) 37f3e: 20 91 48 07 lds r18, 0x0748 ; 0x800748 37f42: 30 91 49 07 lds r19, 0x0749 ; 0x800749 37f46: 40 91 4a 07 lds r20, 0x074A ; 0x80074a 37f4a: 50 91 4b 07 lds r21, 0x074B ; 0x80074b 37f4e: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 37f52: 60 93 48 07 sts 0x0748, r22 ; 0x800748 37f56: 70 93 49 07 sts 0x0749, r23 ; 0x800749 37f5a: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 37f5e: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_TINY_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37f62: 65 e5 ldi r22, 0x55 ; 85 37f64: 75 e5 ldi r23, 0x55 ; 85 37f66: 85 e5 ldi r24, 0x55 ; 85 37f68: 91 e4 ldi r25, 0x41 ; 65 37f6a: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 37f6e: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37f72: 40 91 48 07 lds r20, 0x0748 ; 0x800748 37f76: 50 91 49 07 lds r21, 0x0749 ; 0x800749 37f7a: 60 91 4a 07 lds r22, 0x074A ; 0x80074a 37f7e: 70 91 4b 07 lds r23, 0x074B ; 0x80074b 37f82: 8a ed ldi r24, 0xDA ; 218 37f84: 9e e0 ldi r25, 0x0E ; 14 37f86: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37f8a: 62 e0 ldi r22, 0x02 ; 2 37f8c: 85 ea ldi r24, 0xA5 ; 165 37f8e: 9f e0 ldi r25, 0x0F ; 15 37f90: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 // 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); 37f94: 84 e6 ldi r24, 0x64 ; 100 37f96: 9f e0 ldi r25, 0x0F ; 15 37f98: 0e 94 c4 77 call 0xef88 ; 0xef88 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 37f9c: 8f ef ldi r24, 0xFF ; 255 37f9e: 9e e0 ldi r25, 0x0E ; 14 37fa0: 0e 94 b7 77 call 0xef6e ; 0xef6e printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 37fa4: 0f 94 5b 3f call 0x27eb6 ; 0x27eb6 37fa8: dc 01 movw r26, r24 37faa: cb 01 movw r24, r22 37fac: 8c 19 sub r24, r12 37fae: 9d 09 sbc r25, r13 37fb0: ae 09 sbc r26, r14 37fb2: bf 09 sbc r27, r15 37fb4: bf 93 push r27 37fb6: af 93 push r26 37fb8: 9f 93 push r25 37fba: 8f 93 push r24 37fbc: 83 ea ldi r24, 0xA3 ; 163 37fbe: 91 e7 ldi r25, 0x71 ; 113 37fc0: 9f 93 push r25 37fc2: 8f 93 push r24 37fc4: 0f 94 08 dc call 0x3b810 ; 0x3b810 uvlo_drain_reset(); 37fc8: 0f 94 ef a9 call 0x353de ; 0x353de // 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(); } } 37fcc: ff 91 pop r31 37fce: ef 91 pop r30 37fd0: df 91 pop r29 37fd2: cf 91 pop r28 37fd4: bf 91 pop r27 37fd6: af 91 pop r26 37fd8: 9f 91 pop r25 37fda: 8f 91 pop r24 37fdc: 7f 91 pop r23 37fde: 6f 91 pop r22 37fe0: 5f 91 pop r21 37fe2: 4f 91 pop r20 37fe4: 3f 91 pop r19 37fe6: 2f 91 pop r18 37fe8: 1f 91 pop r17 37fea: 0f 91 pop r16 37fec: ff 90 pop r15 37fee: ef 90 pop r14 37ff0: df 90 pop r13 37ff2: cf 90 pop r12 37ff4: bf 90 pop r11 37ff6: af 90 pop r10 37ff8: 9f 90 pop r9 37ffa: 8f 90 pop r8 37ffc: 0f 90 pop r0 37ffe: 0b be out 0x3b, r0 ; 59 38000: 0f 90 pop r0 38002: 0f be out 0x3f, r0 ; 63 38004: 0f 90 pop r0 38006: 1f 90 pop r1 38008: 18 95 reti 0003800a : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 3800a: 84 b1 in r24, 0x04 ; 4 3800c: 81 7f andi r24, 0xF1 ; 241 3800e: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 38010: 84 b1 in r24, 0x04 ; 4 38012: 87 60 ori r24, 0x07 ; 7 38014: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 38016: 85 b1 in r24, 0x05 ; 5 38018: 81 7f andi r24, 0xF1 ; 241 3801a: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 3801c: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 3801e: 80 e5 ldi r24, 0x50 ; 80 38020: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 38022: 1d bc out 0x2d, r1 ; 45 } 38024: 08 95 ret 00038026 : //! @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() { 38026: 2f 92 push r2 38028: 3f 92 push r3 3802a: 4f 92 push r4 3802c: 5f 92 push r5 3802e: 6f 92 push r6 38030: 7f 92 push r7 38032: 8f 92 push r8 38034: 9f 92 push r9 38036: af 92 push r10 38038: bf 92 push r11 3803a: cf 92 push r12 3803c: df 92 push r13 3803e: ef 92 push r14 38040: ff 92 push r15 38042: 0f 93 push r16 38044: 1f 93 push r17 38046: cf 93 push r28 38048: df 93 push r29 3804a: cd b7 in r28, 0x3d ; 61 3804c: de b7 in r29, 0x3e ; 62 3804e: c6 50 subi r28, 0x06 ; 6 38050: d1 40 sbci r29, 0x01 ; 1 38052: 0f b6 in r0, 0x3f ; 63 38054: f8 94 cli 38056: de bf out 0x3e, r29 ; 62 38058: 0f be out 0x3f, r0 ; 63 3805a: 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; 3805c: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e6> 38060: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e7> 38064: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e8> 38068: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e9> 3806c: 8a 3a cpi r24, 0xAA ; 170 3806e: 95 45 sbci r25, 0x55 ; 85 38070: aa 4a sbci r26, 0xAA ; 170 38072: b5 45 sbci r27, 0x55 ; 85 38074: 21 f4 brne .+8 ; 0x3807e 38076: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e5> 3807a: 87 fd sbrc r24, 7 3807c: c2 c1 rjmp .+900 ; 0x38402 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(); 3807e: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 38080: d0 90 1e 05 lds r13, 0x051E ; 0x80051e // Flush the serial line. while (RECV_READY) { 38084: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 38088: 87 ff sbrs r24, 7 3808a: 04 c0 rjmp .+8 ; 0x38094 wdt_reset(); 3808c: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 3808e: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 38092: f8 cf rjmp .-16 ; 0x38084 } selectedSerialPort = 0; //switch to Serial0 38094: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e // don't reverse this or there may be problems if the RX interrupt // occurs after reading the value of rx_buffer_head but before writing // the value to rx_buffer_tail; the previous value of rx_buffer_head // may be written to rx_buffer_tail, making it appear as if the buffer // were full, not empty. rx_buffer.head = rx_buffer.tail; 38098: 00 91 92 04 lds r16, 0x0492 ; 0x800492 3809c: 10 91 93 04 lds r17, 0x0493 ; 0x800493 380a0: 10 93 91 04 sts 0x0491, r17 ; 0x800491 380a4: 00 93 90 04 sts 0x0490, r16 ; 0x800490 380a8: 53 eb ldi r21, 0xB3 ; 179 380aa: e5 2e mov r14, r21 380ac: 5b ea ldi r21, 0xAB ; 171 380ae: f5 2e mov r15, r21 380b0: 69 eb ldi r22, 0xB9 ; 185 380b2: a6 2e mov r10, r22 380b4: 6b ea ldi r22, 0xAB ; 171 380b6: 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 ++)); 380b8: f7 01 movw r30, r14 380ba: 84 91 lpm r24, Z 380bc: 0f 94 1d a1 call 0x3423a ; 0x3423a 380c0: ff ef ldi r31, 0xFF ; 255 380c2: ef 1a sub r14, r31 380c4: 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) 380c6: ae 14 cp r10, r14 380c8: bf 04 cpc r11, r15 380ca: b1 f7 brne .-20 ; 0x380b8 putch(pgm_read_byte(ptr ++)); wdt_reset(); 380cc: a8 95 wdr 380ce: 8f e0 ldi r24, 0x0F ; 15 380d0: 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) 380d2: 22 eb ldi r18, 0xB2 ; 178 380d4: 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(); 380d6: 40 e8 ldi r20, 0x80 ; 128 380d8: 54 e8 ldi r21, 0x84 ; 132 380da: 6e e1 ldi r22, 0x1E ; 30 380dc: 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) { 380de: e0 91 90 04 lds r30, 0x0490 ; 0x800490 380e2: f0 91 91 04 lds r31, 0x0491 ; 0x800491 380e6: e0 17 cp r30, r16 380e8: f1 07 cpc r31, r17 380ea: 19 f5 brne .+70 ; 0x38132 wdt_reset(); 380ec: a8 95 wdr 380ee: 41 50 subi r20, 0x01 ; 1 380f0: 51 09 sbc r21, r1 380f2: 61 09 sbc r22, r1 380f4: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 380f6: 99 f7 brne .-26 ; 0x380de 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 380f8: d0 92 1e 05 sts 0x051E, r13 ; 0x80051e return 0; 380fc: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 380fe: ca 5f subi r28, 0xFA ; 250 38100: de 4f sbci r29, 0xFE ; 254 38102: 0f b6 in r0, 0x3f ; 63 38104: f8 94 cli 38106: de bf out 0x3e, r29 ; 62 38108: 0f be out 0x3f, r0 ; 63 3810a: cd bf out 0x3d, r28 ; 61 3810c: df 91 pop r29 3810e: cf 91 pop r28 38110: 1f 91 pop r17 38112: 0f 91 pop r16 38114: ff 90 pop r15 38116: ef 90 pop r14 38118: df 90 pop r13 3811a: cf 90 pop r12 3811c: bf 90 pop r11 3811e: af 90 pop r10 38120: 9f 90 pop r9 38122: 8f 90 pop r8 38124: 7f 90 pop r7 38126: 6f 90 pop r6 38128: 5f 90 pop r5 3812a: 4f 90 pop r4 3812c: 3f 90 pop r3 3812e: 2f 90 pop r2 38130: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 38132: f8 01 movw r30, r16 38134: e0 5f subi r30, 0xF0 ; 240 38136: fb 4f sbci r31, 0xFB ; 251 38138: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 3813a: 0f 5f subi r16, 0xFF ; 255 3813c: 1f 4f sbci r17, 0xFF ; 255 3813e: 0f 77 andi r16, 0x7F ; 127 38140: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 38142: f9 01 movw r30, r18 38144: e8 1b sub r30, r24 38146: f9 0b sbc r31, r25 38148: e4 91 lpm r30, Z 3814a: 4e 13 cpse r20, r30 3814c: d5 cf rjmp .-86 ; 0x380f8 { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 3814e: a8 95 wdr 38150: 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) { 38152: 09 f0 breq .+2 ; 0x38156 38154: c0 cf rjmp .-128 ; 0x380d6 selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 38156: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 3815a: 8f 77 andi r24, 0x7F ; 127 3815c: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 38160: 05 e9 ldi r16, 0x95 ; 149 38162: 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 ++)); 38164: f8 01 movw r30, r16 38166: 84 91 lpm r24, Z 38168: 0f 94 1d a1 call 0x3423a ; 0x3423a 3816c: 0f 5f subi r16, 0xFF ; 255 3816e: 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) 38170: fb ea ldi r31, 0xAB ; 171 38172: 02 3a cpi r16, 0xA2 ; 162 38174: 1f 07 cpc r17, r31 38176: b1 f7 brne .-20 ; 0x38164 putch(pgm_read_byte(ptr ++)); } spi_init(); 38178: 0f 94 05 c0 call 0x3800a ; 0x3800a xflash_init(); 3817c: 0e 94 a6 e4 call 0x1c94c ; 0x1c94c "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" ); 38180: 0f b6 in r0, 0x3f ; 63 38182: f8 94 cli 38184: a8 95 wdr 38186: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3818a: 88 61 ori r24, 0x18 ; 24 3818c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38190: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38194: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 38196: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 3819a: 4f e6 ldi r20, 0x6F ; 111 3819c: 5b ea ldi r21, 0xAB ; 171 3819e: 61 e0 ldi r22, 0x01 ; 1 381a0: 80 e0 ldi r24, 0x00 ; 0 381a2: 0e 94 ba 6f call 0xdf74 ; 0xdf74 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 381a6: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e6> 381aa: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e7> 381ae: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e8> 381b2: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e9> pagelen_t length; // Use the planner's queue for the receive / transmit buffers. // uint8_t *buff = (uint8_t*)block_buffer; uint8_t buff[260]; // bitmap of pages to be written. Bit is set to 1 if the page has already been erased. uint8_t pages_erased = 0; 381b6: cb 5f subi r28, 0xFB ; 251 381b8: de 4f sbci r29, 0xFE ; 254 381ba: 18 82 st Y, r1 381bc: c5 50 subi r28, 0x05 ; 5 381be: 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; 381c0: 10 e0 ldi r17, 0x00 ; 0 381c2: 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; 381c4: 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); 381c6: ae 01 movw r20, r28 381c8: 4f 5f subi r20, 0xFF ; 255 381ca: 5f 4f sbci r21, 0xFF ; 255 381cc: 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(); 381ce: 0f 94 24 a1 call 0x34248 ; 0x34248 if(ch == STK_GET_PARAMETER) { 381d2: 81 34 cpi r24, 0x41 ; 65 381d4: a9 f4 brne .+42 ; 0x38200 unsigned char which = getch(); 381d6: 0f 94 24 a1 call 0x34248 ; 0x34248 381da: e8 2e mov r14, r24 verifySpace(); 381dc: 0f 94 9c a3 call 0x34738 ; 0x34738 /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 381e0: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 381e2: 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) { 381e4: e5 16 cp r14, r21 381e6: 21 f0 breq .+8 ; 0x381f0 putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 381e8: 81 e8 ldi r24, 0x81 ; 129 381ea: e8 12 cpse r14, r24 381ec: 07 c0 rjmp .+14 ; 0x381fc putch(optiboot_version >> 8); 381ee: 86 e0 ldi r24, 0x06 ; 6 381f0: 0f 94 1d a1 call 0x3423a ; 0x3423a } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 381f4: 80 e1 ldi r24, 0x10 ; 16 381f6: 0f 94 1d a1 call 0x3423a ; 0x3423a 381fa: e9 cf rjmp .-46 ; 0x381ce } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 381fc: 83 e0 ldi r24, 0x03 ; 3 381fe: f8 cf rjmp .-16 ; 0x381f0 } } else if(ch == STK_SET_DEVICE) { 38200: 82 34 cpi r24, 0x42 ; 66 38202: 21 f4 brne .+8 ; 0x3820c // SET DEVICE is ignored getNch(20); 38204: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 38206: 0f 94 a8 a3 call 0x34750 ; 0x34750 3820a: f4 cf rjmp .-24 ; 0x381f4 } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 3820c: 85 34 cpi r24, 0x45 ; 69 3820e: 11 f4 brne .+4 ; 0x38214 // SET DEVICE EXT is ignored getNch(5); 38210: 85 e0 ldi r24, 0x05 ; 5 38212: f9 cf rjmp .-14 ; 0x38206 } else if(ch == STK_LOAD_ADDRESS) { 38214: 85 35 cpi r24, 0x55 ; 85 38216: c9 f4 brne .+50 ; 0x3824a // 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(); 38218: 0f 94 24 a1 call 0x34248 ; 0x34248 3821c: 08 2f mov r16, r24 newAddress |= getch(); 3821e: 0f 94 24 a1 call 0x34248 ; 0x34248 38222: 08 2b or r16, r24 38224: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 38226: 0f 94 24 a1 call 0x34248 ; 0x34248 3822a: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 3822c: 0f 94 24 a1 call 0x34248 ; 0x34248 38230: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 38232: 17 ff sbrs r17, 7 38234: 07 c0 rjmp .+14 ; 0x38244 rampz |= 0x01; 38236: 68 94 set 38238: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 3823a: 00 0f add r16, r16 3823c: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 3823e: 0f 94 9c a3 call 0x34738 ; 0x34738 38242: d8 cf rjmp .-80 ; 0x381f4 newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 38244: e8 94 clt 38246: f0 f8 bld r15, 0 38248: f8 cf rjmp .-16 ; 0x3823a newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 3824a: 86 35 cpi r24, 0x56 ; 86 3824c: a1 f4 brne .+40 ; 0x38276 // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 3824e: 0f 94 24 a1 call 0x34248 ; 0x34248 38252: 8d 34 cpi r24, 0x4D ; 77 38254: 71 f4 brne .+28 ; 0x38272 // get address getch(); // get '0' 38256: 0f 94 24 a1 call 0x34248 ; 0x34248 rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 3825a: 0f 94 24 a1 call 0x34248 ; 0x34248 3825e: 9f 2d mov r25, r15 38260: 91 70 andi r25, 0x01 ; 1 38262: f9 2e mov r15, r25 38264: 88 0f add r24, r24 38266: f8 2a or r15, r24 getNch(1); // get last '0' 38268: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 3826a: 0f 94 a8 a3 call 0x34750 ; 0x34750 putch(0x00); 3826e: 80 e0 ldi r24, 0x00 ; 0 38270: bf cf rjmp .-130 ; 0x381f0 // response putch(0x00); } else { // everything else is ignored getNch(3); 38272: 83 e0 ldi r24, 0x03 ; 3 38274: fa cf rjmp .-12 ; 0x3826a putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 38276: 84 36 cpi r24, 0x64 ; 100 38278: 09 f0 breq .+2 ; 0x3827c 3827a: 77 c0 rjmp .+238 ; 0x3836a 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; 3827c: 0f 94 24 a1 call 0x34248 ; 0x34248 38280: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 38282: 0f 94 24 a1 call 0x34248 ; 0x34248 38286: c8 2e mov r12, r24 length |= getch(); 38288: 0f 94 24 a1 call 0x34248 ; 0x34248 3828c: e8 2e mov r14, r24 length |= getch(); 3828e: 0f 94 24 a1 call 0x34248 ; 0x34248 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; 38292: d1 2c mov r13, r1 38294: dc 2c mov r13, r12 38296: cc 24 eor r12, r12 38298: db 28 or r13, r11 length |= getch(); length |= getch(); 3829a: 8e 29 or r24, r14 3829c: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 3829e: 0f 94 24 a1 call 0x34248 ; 0x34248 382a2: 58 2e mov r5, r24 382a4: fe 01 movw r30, r28 382a6: 31 96 adiw r30, 0x01 ; 1 382a8: 5f 01 movw r10, r30 382aa: 46 01 movw r8, r12 382ac: 8e 0e add r8, r30 382ae: 9f 1e adc r9, r31 382b0: ee 2e mov r14, r30 382b2: ca 5f subi r28, 0xFA ; 250 382b4: de 4f sbci r29, 0xFE ; 254 382b6: b8 82 st Y, r11 382b8: c6 50 subi r28, 0x06 ; 6 382ba: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 382bc: 0f 94 24 a1 call 0x34248 ; 0x34248 382c0: f5 01 movw r30, r10 382c2: 81 93 st Z+, r24 382c4: 5f 01 movw r10, r30 while (--length); 382c6: 8e 16 cp r8, r30 382c8: 9f 06 cpc r9, r31 382ca: c1 f7 brne .-16 ; 0x382bc // Read command terminator, start reply verifySpace(); 382cc: 0f 94 9c a3 call 0x34738 ; 0x34738 if (desttype == 'E') { 382d0: f5 e4 ldi r31, 0x45 ; 69 382d2: 5f 12 cpse r5, r31 382d4: 01 c0 rjmp .+2 ; 0x382d8 382d6: ff cf rjmp .-2 ; 0x382d6 while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 382d8: 18 01 movw r2, r16 382da: 51 2c mov r5, r1 382dc: 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) { 382de: 01 15 cp r16, r1 382e0: 11 05 cpc r17, r1 382e2: 61 f5 brne .+88 ; 0x3833c 382e4: 42 01 movw r8, r4 382e6: aa 24 eor r10, r10 382e8: bb 24 eor r11, r11 382ea: cb 5f subi r28, 0xFB ; 251 382ec: de 4f sbci r29, 0xFE ; 254 382ee: 28 81 ld r18, Y 382f0: c5 50 subi r28, 0x05 ; 5 382f2: d1 40 sbci r29, 0x01 ; 1 382f4: 82 2f mov r24, r18 382f6: 90 e0 ldi r25, 0x00 ; 0 382f8: 08 2c mov r0, r8 382fa: 02 c0 rjmp .+4 ; 0x38300 382fc: 95 95 asr r25 382fe: 87 95 ror r24 38300: 0a 94 dec r0 38302: e2 f7 brpl .-8 ; 0x382fc 38304: 80 fd sbrc r24, 0 38306: 1a c0 rjmp .+52 ; 0x3833c xflash_wait_busy(); 38308: 0e 94 33 e3 call 0x1c666 ; 0x1c666 xflash_enable_wr(); 3830c: 0e 94 cf e3 call 0x1c79e ; 0x1c79e return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 38310: b2 01 movw r22, r4 38312: a8 01 movw r20, r16 38314: 88 ed ldi r24, 0xD8 ; 216 38316: 0e 94 51 e3 call 0x1c6a2 ; 0x1c6a2 xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 3831a: 81 e0 ldi r24, 0x01 ; 1 3831c: 90 e0 ldi r25, 0x00 ; 0 3831e: 01 c0 rjmp .+2 ; 0x38322 38320: 88 0f add r24, r24 38322: 8a 94 dec r8 38324: ea f7 brpl .-6 ; 0x38320 38326: cb 5f subi r28, 0xFB ; 251 38328: de 4f sbci r29, 0xFE ; 254 3832a: 48 81 ld r20, Y 3832c: c5 50 subi r28, 0x05 ; 5 3832e: d1 40 sbci r29, 0x01 ; 1 38330: 48 2b or r20, r24 38332: cb 5f subi r28, 0xFB ; 251 38334: de 4f sbci r29, 0xFE ; 254 38336: 48 83 st Y, r20 38338: c5 50 subi r28, 0x05 ; 5 3833a: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 3833c: 0e 94 33 e3 call 0x1c666 ; 0x1c666 xflash_enable_wr(); 38340: 0e 94 cf e3 call 0x1c79e ; 0x1c79e xflash_page_program(addr, buff, savelength); 38344: 96 01 movw r18, r12 38346: 4e 2d mov r20, r14 38348: ca 5f subi r28, 0xFA ; 250 3834a: de 4f sbci r29, 0xFE ; 254 3834c: 58 81 ld r21, Y 3834e: c6 50 subi r28, 0x06 ; 6 38350: d1 40 sbci r29, 0x01 ; 1 38352: c2 01 movw r24, r4 38354: b1 01 movw r22, r2 38356: 0e 94 56 e3 call 0x1c6ac ; 0x1c6ac xflash_wait_busy(); 3835a: 0e 94 33 e3 call 0x1c666 ; 0x1c666 _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 3835e: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 38360: 84 e0 ldi r24, 0x04 ; 4 38362: 0e 94 2d e3 call 0x1c65a ; 0x1c65a _CS_HIGH(); 38366: 45 9a sbi 0x08, 5 ; 8 38368: 45 cf rjmp .-374 ; 0x381f4 xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 3836a: 84 37 cpi r24, 0x74 ; 116 3836c: 81 f5 brne .+96 ; 0x383ce uint32_t addr = (((uint32_t)rampz) << 16) | address; 3836e: b1 2c mov r11, r1 38370: 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; 38372: 0f 94 24 a1 call 0x34248 ; 0x34248 38376: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 38378: 0f 94 24 a1 call 0x34248 ; 0x34248 3837c: c8 2e mov r12, r24 length |= getch(); 3837e: 0f 94 24 a1 call 0x34248 ; 0x34248 38382: e8 2e mov r14, r24 length |= getch(); 38384: 0f 94 24 a1 call 0x34248 ; 0x34248 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; 38388: 2c 2d mov r18, r12 3838a: 30 e0 ldi r19, 0x00 ; 0 3838c: 32 2f mov r19, r18 3838e: 22 27 eor r18, r18 38390: f9 01 movw r30, r18 38392: fd 29 or r31, r13 38394: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 38396: 8e 29 or r24, r14 38398: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 3839a: 0f 94 24 a1 call 0x34248 ; 0x34248 verifySpace(); 3839e: 0f 94 9c a3 call 0x34738 ; 0x34738 xflash_wait_busy(); 383a2: 0e 94 33 e3 call 0x1c666 ; 0x1c666 xflash_rd_data(addr, buff, length); 383a6: 96 01 movw r18, r12 383a8: a3 01 movw r20, r6 383aa: c5 01 movw r24, r10 383ac: b8 01 movw r22, r16 383ae: 0e 94 76 e3 call 0x1c6ec ; 0x1c6ec 383b2: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 383b4: c5 01 movw r24, r10 383b6: 86 19 sub r24, r6 383b8: 97 09 sbc r25, r7 383ba: 8c 15 cp r24, r12 383bc: 9d 05 cpc r25, r13 383be: 08 f0 brcs .+2 ; 0x383c2 383c0: 19 cf rjmp .-462 ; 0x381f4 putch(buff[i]); 383c2: f5 01 movw r30, r10 383c4: 81 91 ld r24, Z+ 383c6: 5f 01 movw r10, r30 383c8: 0f 94 1d a1 call 0x3423a ; 0x3423a 383cc: f3 cf rjmp .-26 ; 0x383b4 } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 383ce: 85 37 cpi r24, 0x75 ; 117 383d0: 51 f4 brne .+20 ; 0x383e6 // READ SIGN - return what Avrdude wants to hear verifySpace(); 383d2: 0f 94 9c a3 call 0x34738 ; 0x34738 putch(XFLASH_SIGNATURE_0); 383d6: 8e e1 ldi r24, 0x1E ; 30 383d8: 0f 94 1d a1 call 0x3423a ; 0x3423a putch(XFLASH_SIGNATURE_1); 383dc: 88 e9 ldi r24, 0x98 ; 152 383de: 0f 94 1d a1 call 0x3423a ; 0x3423a putch(XFLASH_SIGNATURE_2); 383e2: 81 e0 ldi r24, 0x01 ; 1 383e4: 05 cf rjmp .-502 ; 0x381f0 } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 383e6: 81 35 cpi r24, 0x51 ; 81 383e8: 09 f0 breq .+2 ; 0x383ec 383ea: 29 cf rjmp .-430 ; 0x3823e : "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" ); 383ec: f8 e1 ldi r31, 0x18 ; 24 383ee: 28 e0 ldi r18, 0x08 ; 8 383f0: 0f b6 in r0, 0x3f ; 63 383f2: f8 94 cli 383f4: a8 95 wdr 383f6: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 383fa: 0f be out 0x3f, r0 ; 63 383fc: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38400: 1e cf rjmp .-452 ; 0x3823e 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; 38402: 81 e0 ldi r24, 0x01 ; 1 38404: 7c ce rjmp .-776 ; 0x380fe 00038406 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 38406: 81 e0 ldi r24, 0x01 ; 1 38408: 0c 94 eb 6f jmp 0xdfd6 ; 0xdfd6 0003840c : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 3840c: 0f 93 push r16 3840e: 1f 93 push r17 38410: cf 93 push r28 38412: 8c 01 movw r16, r24 38414: c6 2f mov r28, r22 lcd_update_enable(false); 38416: 80 e0 ldi r24, 0x00 ; 0 38418: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_clear(); 3841c: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 lcd_puts_at_P(0, 1, pgmS); 38420: a8 01 movw r20, r16 38422: 61 e0 ldi r22, 0x01 ; 1 38424: 80 e0 ldi r24, 0x00 ; 0 38426: 0e 94 ba 6f call 0xdf74 ; 0xdf74 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 3842a: 80 e2 ldi r24, 0x20 ; 32 3842c: 0e 94 55 70 call 0xe0aa ; 0xe0aa lcd_print(' '); lcd_print(slot + 1); 38430: 6c 2f mov r22, r28 38432: 70 e0 ldi r23, 0x00 ; 0 38434: 6f 5f subi r22, 0xFF ; 255 38436: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 38438: 07 2e mov r0, r23 3843a: 00 0c add r0, r0 3843c: 88 0b sbc r24, r24 3843e: 99 0b sbc r25, r25 } 38440: cf 91 pop r28 38442: 1f 91 pop r17 38444: 0f 91 pop r16 38446: 0c 94 5f 71 jmp 0xe2be ; 0xe2be 0003844a : 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); 3844a: 82 ed ldi r24, 0xD2 ; 210 3844c: 9e e0 ldi r25, 0x0E ; 14 3844e: 0e 94 c4 77 call 0xef88 ; 0xef88 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 38452: 83 ed ldi r24, 0xD3 ; 211 38454: 9e e0 ldi r25, 0x0E ; 14 38456: 0c 94 b7 77 jmp 0xef6e ; 0xef6e 0003845a : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 3845a: 41 e0 ldi r20, 0x01 ; 1 3845c: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 38460: 81 11 cpse r24, r1 38462: 01 c0 rjmp .+2 ; 0x38466 38464: 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'); 38466: 40 5d subi r20, 0xD0 ; 208 38468: 62 e0 ldi r22, 0x02 ; 2 3846a: 83 e0 ldi r24, 0x03 ; 3 3846c: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 38470: 0e 94 cc e4 call 0x1c998 ; 0x1c998 38474: 40 e3 ldi r20, 0x30 ; 48 38476: 48 0f add r20, r24 38478: 62 e0 ldi r22, 0x02 ; 2 3847a: 88 e0 ldi r24, 0x08 ; 8 3847c: 0e 94 c6 6f call 0xdf8c ; 0xdf8c // print active/changing filament slot lcd_set_cursor(10, 2); 38480: 62 e0 ldi r22, 0x02 ; 2 38482: 8a e0 ldi r24, 0x0A ; 10 38484: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcdui_print_extruder(); 38488: 0f 94 79 37 call 0x26ef2 ; 0x26ef2 // Print active extruder temperature lcd_set_cursor(16, 2); 3848c: 62 e0 ldi r22, 0x02 ; 2 3848e: 80 e1 ldi r24, 0x10 ; 16 38490: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 38494: 20 e0 ldi r18, 0x00 ; 0 38496: 30 e0 ldi r19, 0x00 ; 0 38498: 40 e0 ldi r20, 0x00 ; 0 3849a: 5f e3 ldi r21, 0x3F ; 63 3849c: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 384a0: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 384a4: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 384a8: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 384ac: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 384b0: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> 384b4: 7f 93 push r23 384b6: 6f 93 push r22 384b8: 8d e5 ldi r24, 0x5D ; 93 384ba: 9a ea ldi r25, 0xAA ; 170 384bc: 9f 93 push r25 384be: 8f 93 push r24 384c0: 0e 94 7f 6f call 0xdefe ; 0xdefe 384c4: 0f 90 pop r0 384c6: 0f 90 pop r0 384c8: 0f 90 pop r0 384ca: 0f 90 pop r0 } 384cc: 08 95 ret 000384ce : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 384ce: 8a 30 cpi r24, 0x0A ; 10 384d0: 20 f0 brcs .+8 ; 0x384da 384d2: 80 31 cpi r24, 0x10 ; 16 384d4: 20 f4 brcc .+8 ; 0x384de case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 384d6: 89 5a subi r24, 0xA9 ; 169 384d8: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 384da: 80 5d subi r24, 0xD0 ; 208 384dc: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 384de: 80 e0 ldi r24, 0x00 ; 0 } } 384e0: 08 95 ret 000384e2 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 384e2: 0f 93 push r16 384e4: 1f 93 push r17 384e6: cf 93 push r28 384e8: df 93 push r29 384ea: 08 2f mov r16, r24 384ec: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 384ee: 90 e0 ldi r25, 0x00 ; 0 384f0: 24 e0 ldi r18, 0x04 ; 4 384f2: 95 95 asr r25 384f4: 87 95 ror r24 384f6: 2a 95 dec r18 384f8: e1 f7 brne .-8 ; 0x384f2 uint8_t charsOut = 1; 384fa: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 384fc: 00 97 sbiw r24, 0x00 ; 0 384fe: 21 f0 breq .+8 ; 0x38508 *dst = Nibble2Char(v); 38500: 0f 94 67 c2 call 0x384ce ; 0x384ce 38504: 89 93 st Y+, r24 ++dst; charsOut = 2; 38506: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 38508: 80 2f mov r24, r16 3850a: 8f 70 andi r24, 0x0F ; 15 3850c: 0f 94 67 c2 call 0x384ce ; 0x384ce 38510: 88 83 st Y, r24 return charsOut; } 38512: 81 2f mov r24, r17 38514: df 91 pop r29 38516: cf 91 pop r28 38518: 1f 91 pop r17 3851a: 0f 91 pop r16 3851c: 08 95 ret 0003851e : } 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) { 3851e: 80 33 cpi r24, 0x30 ; 48 38520: 30 f0 brcs .+12 ; 0x3852e 38522: 8a 33 cpi r24, 0x3A ; 58 38524: 30 f0 brcs .+12 ; 0x38532 38526: 9f e9 ldi r25, 0x9F ; 159 38528: 98 0f add r25, r24 3852a: 96 30 cpi r25, 0x06 ; 6 3852c: 20 f0 brcs .+8 ; 0x38536 case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 3852e: 80 e0 ldi r24, 0x00 ; 0 } } 38530: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 38532: 80 53 subi r24, 0x30 ; 48 38534: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 38536: 87 55 subi r24, 0x57 ; 87 38538: 08 95 ret 0003853a : /// 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 { 3853a: cf 93 push r28 3853c: df 93 push r29 3853e: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 38540: 68 81 ld r22, Y 38542: 80 e0 ldi r24, 0x00 ; 0 38544: 0f 94 30 a1 call 0x34260 ; 0x34260 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 38548: 69 81 ldd r22, Y+1 ; 0x01 3854a: 0f 94 30 a1 call 0x34260 ; 0x34260 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 3854e: 6a 81 ldd r22, Y+2 ; 0x02 38550: 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]); 38552: 0f 94 30 a1 call 0x34260 ; 0x34260 38556: 6c 2f mov r22, r28 return crc; } 38558: df 91 pop r29 3855a: cf 91 pop r28 3855c: 0d 94 30 a1 jmp 0x34260 ; 0x34260 00038560 : 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 { 38560: cf 93 push r28 38562: df 93 push r29 38564: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 38566: 0f 94 9d c2 call 0x3853a ; 0x3853a crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 3856a: 6d 81 ldd r22, Y+5 ; 0x05 3856c: 0f 94 30 a1 call 0x34260 ; 0x34260 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 38570: 6e 81 ldd r22, Y+6 ; 0x06 38572: cf 81 ldd r28, Y+7 ; 0x07 38574: 0f 94 30 a1 call 0x34260 ; 0x34260 38578: 6c 2f mov r22, r28 return crc; } 3857a: df 91 pop r29 3857c: cf 91 pop r28 3857e: 0d 94 30 a1 jmp 0x34260 ; 0x34260 00038582 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 38582: cf 93 push r28 38584: df 93 push r29 38586: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 38588: 68 83 st Y, r22 3858a: 49 83 std Y+1, r20 ; 0x01 3858c: 1b 82 std Y+3, r1 ; 0x03 3858e: 1a 82 std Y+2, r1 ; 0x02 38590: 0f 94 9d c2 call 0x3853a ; 0x3853a 38594: 8c 83 std Y+4, r24 ; 0x04 } 38596: df 91 pop r29 38598: cf 91 pop r28 3859a: 08 95 ret 0003859c : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 3859c: 9f b7 in r25, 0x3f ; 63 3859e: f8 94 cli 385a0: e5 e0 ldi r30, 0x05 ; 5 385a2: f1 e0 ldi r31, 0x01 ; 1 385a4: 80 81 ld r24, Z 385a6: 8f 7d andi r24, 0xDF ; 223 385a8: 80 83 st Z, r24 385aa: 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); 385ac: 8f e8 ldi r24, 0x8F ; 143 385ae: 91 e0 ldi r25, 0x01 ; 1 385b0: 01 97 sbiw r24, 0x01 ; 1 385b2: f1 f7 brne .-4 ; 0x385b0 385b4: 00 c0 rjmp .+0 ; 0x385b6 385b6: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 385b8: 9f b7 in r25, 0x3f ; 63 385ba: f8 94 cli 385bc: 80 81 ld r24, Z 385be: 80 62 ori r24, 0x20 ; 32 385c0: 80 83 st Z, r24 385c2: 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 } 385c4: 08 95 ret 000385c6 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 385c6: 14 9a sbi 0x02, 4 ; 2 } 385c8: 08 95 ret 000385ca : 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) { 385ca: cf 92 push r12 385cc: df 92 push r13 385ce: ef 92 push r14 385d0: ff 92 push r15 385d2: cf 93 push r28 385d4: df 93 push r29 385d6: 69 01 movw r12, r18 385d8: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 385da: c0 e4 ldi r28, 0x40 ; 64 385dc: d7 e0 ldi r29, 0x07 ; 7 385de: 9b 01 movw r18, r22 385e0: ac 01 movw r20, r24 385e2: 6c 85 ldd r22, Y+12 ; 0x0c 385e4: 7d 85 ldd r23, Y+13 ; 0x0d 385e6: 8e 85 ldd r24, Y+14 ; 0x0e 385e8: 9f 85 ldd r25, Y+15 ; 0x0f 385ea: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 385ee: 6c 87 std Y+12, r22 ; 0x0c 385f0: 7d 87 std Y+13, r23 ; 0x0d 385f2: 8e 87 std Y+14, r24 ; 0x0e 385f4: 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); 385f6: c7 01 movw r24, r14 385f8: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 385fa: df 91 pop r29 385fc: cf 91 pop r28 385fe: ff 90 pop r15 38600: ef 90 pop r14 38602: df 90 pop r13 38604: 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); 38606: 0d 94 48 ba jmp 0x37490 ; 0x37490 0003860a : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 3860a: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 3860e: 0d 94 e1 58 jmp 0x2b1c2 ; 0x2b1c2 00038612 : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 38612: cf 93 push r28 38614: df 93 push r29 38616: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 38618: 84 e1 ldi r24, 0x14 ; 20 3861a: 9a ea ldi r25, 0xAA ; 170 3861c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_MMU2(); 38620: 87 e5 ldi r24, 0x57 ; 87 38622: 9a ea ldi r25, 0xAA ; 170 38624: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 SERIAL_ECHOLNRPGM(msg); 38628: ce 01 movw r24, r28 } 3862a: df 91 pop r29 3862c: 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); 3862e: 0c 94 17 7b jmp 0xf62e ; 0xf62e 00038632 : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 38632: 0c 94 cc e4 jmp 0x1c998 ; 0x1c998 00038636 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38636: 89 32 cpi r24, 0x29 ; 41 38638: 20 e8 ldi r18, 0x80 ; 128 3863a: 92 07 cpc r25, r18 3863c: 09 f4 brne .+2 ; 0x38640 3863e: 97 c0 rjmp .+302 ; 0x3876e 38640: 08 f0 brcs .+2 ; 0x38644 38642: 48 c0 rjmp .+144 ; 0x386d4 38644: 86 30 cpi r24, 0x06 ; 6 38646: 60 e8 ldi r22, 0x80 ; 128 38648: 96 07 cpc r25, r22 3864a: 09 f4 brne .+2 ; 0x3864e 3864c: 9a c0 rjmp .+308 ; 0x38782 3864e: 30 f5 brcc .+76 ; 0x3869c 38650: 83 30 cpi r24, 0x03 ; 3 38652: 40 e8 ldi r20, 0x80 ; 128 38654: 94 07 cpc r25, r20 38656: 09 f4 brne .+2 ; 0x3865a 38658: 80 c0 rjmp .+256 ; 0x3875a 3865a: a8 f4 brcc .+42 ; 0x38686 3865c: 81 30 cpi r24, 0x01 ; 1 3865e: 20 e8 ldi r18, 0x80 ; 128 38660: 92 07 cpc r25, r18 38662: 09 f4 brne .+2 ; 0x38666 38664: 17 c1 rjmp .+558 ; 0x38894 38666: 82 30 cpi r24, 0x02 ; 2 38668: 40 e8 ldi r20, 0x80 ; 128 3866a: 94 07 cpc r25, r20 3866c: 09 f4 brne .+2 ; 0x38670 3866e: 73 c0 rjmp .+230 ; 0x38756 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); 38670: 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)) { 38672: 86 ff sbrs r24, 6 38674: 8e c0 rjmp .+284 ; 0x38792 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); 38676: 22 27 eor r18, r18 38678: 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) { 3867a: 21 15 cp r18, r1 3867c: 32 4c sbci r19, 0xC2 ; 194 3867e: 09 f0 breq .+2 ; 0x38682 38680: 9e c0 rjmp .+316 ; 0x387be return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 38682: 8e e1 ldi r24, 0x1E ; 30 38684: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38686: 84 30 cpi r24, 0x04 ; 4 38688: 60 e8 ldi r22, 0x80 ; 128 3868a: 96 07 cpc r25, r22 3868c: 09 f4 brne .+2 ; 0x38690 3868e: 67 c0 rjmp .+206 ; 0x3875e 38690: 85 30 cpi r24, 0x05 ; 5 38692: 20 e8 ldi r18, 0x80 ; 128 38694: 92 07 cpc r25, r18 38696: 61 f7 brne .-40 ; 0x38670 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); 38698: 84 e2 ldi r24, 0x24 ; 36 3869a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3869c: 8a 30 cpi r24, 0x0A ; 10 3869e: 40 e8 ldi r20, 0x80 ; 128 386a0: 94 07 cpc r25, r20 386a2: 09 f4 brne .+2 ; 0x386a6 386a4: 5e c0 rjmp .+188 ; 0x38762 386a6: 58 f4 brcc .+22 ; 0x386be 386a8: 88 30 cpi r24, 0x08 ; 8 386aa: 20 e8 ldi r18, 0x80 ; 128 386ac: 92 07 cpc r25, r18 386ae: 09 f4 brne .+2 ; 0x386b2 386b0: 6e c0 rjmp .+220 ; 0x3878e 386b2: 89 30 cpi r24, 0x09 ; 9 386b4: 40 e8 ldi r20, 0x80 ; 128 386b6: 94 07 cpc r25, r20 386b8: d9 f6 brne .-74 ; 0x38670 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); 386ba: 85 e0 ldi r24, 0x05 ; 5 386bc: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386be: 8c 30 cpi r24, 0x0C ; 12 386c0: 60 e8 ldi r22, 0x80 ; 128 386c2: 96 07 cpc r25, r22 386c4: 09 f4 brne .+2 ; 0x386c8 386c6: 51 c0 rjmp .+162 ; 0x3876a 386c8: 8d 30 cpi r24, 0x0D ; 13 386ca: 20 e8 ldi r18, 0x80 ; 128 386cc: 92 07 cpc r25, r18 386ce: 81 f6 brne .-96 ; 0x38670 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); 386d0: 81 e2 ldi r24, 0x21 ; 33 386d2: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386d4: 8f 32 cpi r24, 0x2F ; 47 386d6: 40 e8 ldi r20, 0x80 ; 128 386d8: 94 07 cpc r25, r20 386da: 09 f4 brne .+2 ; 0x386de 386dc: 56 c0 rjmp .+172 ; 0x3878a 386de: e0 f4 brcc .+56 ; 0x38718 386e0: 8c 32 cpi r24, 0x2C ; 44 386e2: 20 e8 ldi r18, 0x80 ; 128 386e4: 92 07 cpc r25, r18 386e6: 09 f4 brne .+2 ; 0x386ea 386e8: 4e c0 rjmp .+156 ; 0x38786 386ea: 58 f4 brcc .+22 ; 0x38702 386ec: 8a 32 cpi r24, 0x2A ; 42 386ee: 60 e8 ldi r22, 0x80 ; 128 386f0: 96 07 cpc r25, r22 386f2: c9 f1 breq .+114 ; 0x38766 386f4: 8b 32 cpi r24, 0x2B ; 43 386f6: 20 e8 ldi r18, 0x80 ; 128 386f8: 92 07 cpc r25, r18 386fa: 09 f0 breq .+2 ; 0x386fe 386fc: b9 cf rjmp .-142 ; 0x38670 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); 386fe: 86 e2 ldi r24, 0x26 ; 38 38700: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38702: 8d 32 cpi r24, 0x2D ; 45 38704: 40 e8 ldi r20, 0x80 ; 128 38706: 94 07 cpc r25, r20 38708: d1 f1 breq .+116 ; 0x3877e 3870a: 8e 32 cpi r24, 0x2E ; 46 3870c: 60 e8 ldi r22, 0x80 ; 128 3870e: 96 07 cpc r25, r22 38710: 09 f0 breq .+2 ; 0x38714 38712: ae cf rjmp .-164 ; 0x38670 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); 38714: 82 e2 ldi r24, 0x22 ; 34 38716: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38718: 87 38 cpi r24, 0x87 ; 135 3871a: 20 e8 ldi r18, 0x80 ; 128 3871c: 92 07 cpc r25, r18 3871e: 49 f1 breq .+82 ; 0x38772 38720: 58 f4 brcc .+22 ; 0x38738 38722: 87 34 cpi r24, 0x47 ; 71 38724: 60 e8 ldi r22, 0x80 ; 128 38726: 96 07 cpc r25, r22 38728: 29 f0 breq .+10 ; 0x38734 3872a: 8b 34 cpi r24, 0x4B ; 75 3872c: 20 e8 ldi r18, 0x80 ; 128 3872e: 92 07 cpc r25, r18 38730: 09 f0 breq .+2 ; 0x38734 38732: 9e cf rjmp .-196 ; 0x38670 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); 38734: 84 e0 ldi r24, 0x04 ; 4 38736: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38738: 87 30 cpi r24, 0x07 ; 7 3873a: 41 e8 ldi r20, 0x81 ; 129 3873c: 94 07 cpc r25, r20 3873e: d9 f0 breq .+54 ; 0x38776 38740: 8b 30 cpi r24, 0x0B ; 11 38742: 61 e8 ldi r22, 0x81 ; 129 38744: 96 07 cpc r25, r22 38746: c9 f0 breq .+50 ; 0x3877a 38748: 8b 38 cpi r24, 0x8B ; 139 3874a: 20 e8 ldi r18, 0x80 ; 128 3874c: 92 07 cpc r25, r18 3874e: 09 f0 breq .+2 ; 0x38752 38750: 8f cf rjmp .-226 ; 0x38670 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); 38752: 89 e0 ldi r24, 0x09 ; 9 38754: 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); 38756: 81 e0 ldi r24, 0x01 ; 1 38758: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 3875a: 82 e0 ldi r24, 0x02 ; 2 3875c: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 3875e: 83 e0 ldi r24, 0x03 ; 3 38760: 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); 38762: 86 e0 ldi r24, 0x06 ; 6 38764: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 38766: 87 e0 ldi r24, 0x07 ; 7 38768: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 3876a: 8a e2 ldi r24, 0x2A ; 42 3876c: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 3876e: 8b e2 ldi r24, 0x2B ; 43 38770: 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); 38772: 88 e0 ldi r24, 0x08 ; 8 38774: 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); 38776: 8a e0 ldi r24, 0x0A ; 10 38778: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 3877a: 8b e0 ldi r24, 0x0B ; 11 3877c: 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); 3877e: 83 e2 ldi r24, 0x23 ; 35 38780: 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); 38782: 85 e2 ldi r24, 0x25 ; 37 38784: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 38786: 87 e2 ldi r24, 0x27 ; 39 38788: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 3878a: 88 e2 ldi r24, 0x28 ; 40 3878c: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 3878e: 89 e2 ldi r24, 0x29 ; 41 38790: 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)) { 38792: 87 ff sbrs r24, 7 38794: 07 c0 rjmp .+14 ; 0x387a4 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); 38796: 22 27 eor r18, r18 38798: 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) { 3879a: 21 15 cp r18, r1 3879c: 32 4c sbci r19, 0xC2 ; 194 3879e: a1 f5 brne .+104 ; 0x38808 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 387a0: 8f e1 ldi r24, 0x1F ; 31 387a2: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 387a4: 22 27 eor r18, r18 387a6: 31 70 andi r19, 0x01 ; 1 387a8: 90 ff sbrs r25, 0 387aa: 52 c0 rjmp .+164 ; 0x38850 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); 387ac: ac 01 movw r20, r24 387ae: 44 27 eor r20, r20 387b0: 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) { 387b2: 41 15 cp r20, r1 387b4: 52 4c sbci r21, 0xC2 ; 194 387b6: 09 f0 breq .+2 ; 0x387ba 387b8: 4b c0 rjmp .+150 ; 0x38850 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 387ba: 80 e2 ldi r24, 0x20 ; 32 387bc: 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; 387be: 9c 01 movw r18, r24 387c0: 22 27 eor r18, r18 387c2: 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)) { 387c4: 23 2b or r18, r19 387c6: 09 f0 breq .+2 ; 0x387ca 387c8: 67 c0 rjmp .+206 ; 0x38898 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 387ca: 9c 01 movw r18, r24 387cc: 22 27 eor r18, r18 387ce: 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)) { 387d0: 23 2b or r18, r19 387d2: 09 f0 breq .+2 ; 0x387d6 387d4: 63 c0 rjmp .+198 ; 0x3889c 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; 387d6: 9c 01 movw r18, r24 387d8: 22 27 eor r18, r18 387da: 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)) { 387dc: 23 2b or r18, r19 387de: 09 f0 breq .+2 ; 0x387e2 387e0: 5f c0 rjmp .+190 ; 0x388a0 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; 387e2: 9c 01 movw r18, r24 387e4: 22 27 eor r18, r18 387e6: 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)) { 387e8: 23 2b or r18, r19 387ea: 09 f0 breq .+2 ; 0x387ee 387ec: 5b c0 rjmp .+182 ; 0x388a4 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; 387ee: 9c 01 movw r18, r24 387f0: 22 27 eor r18, r18 387f2: 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)) { 387f4: 23 2b or r18, r19 387f6: 09 f0 breq .+2 ; 0x387fa 387f8: 57 c0 rjmp .+174 ; 0x388a8 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; 387fa: 88 27 eor r24, r24 387fc: 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)) { 387fe: 89 2b or r24, r25 38800: 09 f4 brne .+2 ; 0x38804 38802: 68 c0 rjmp .+208 ; 0x388d4 return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 38804: 8f e0 ldi r24, 0x0F ; 15 38806: 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; 38808: 9c 01 movw r18, r24 3880a: 22 27 eor r18, r18 3880c: 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)) { 3880e: 23 2b or r18, r19 38810: 09 f0 breq .+2 ; 0x38814 38812: 4c c0 rjmp .+152 ; 0x388ac 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; 38814: 9c 01 movw r18, r24 38816: 22 27 eor r18, r18 38818: 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)) { 3881a: 23 2b or r18, r19 3881c: 09 f0 breq .+2 ; 0x38820 3881e: 48 c0 rjmp .+144 ; 0x388b0 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; 38820: 9c 01 movw r18, r24 38822: 22 27 eor r18, r18 38824: 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)) { 38826: 23 2b or r18, r19 38828: 09 f0 breq .+2 ; 0x3882c 3882a: 44 c0 rjmp .+136 ; 0x388b4 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; 3882c: 9c 01 movw r18, r24 3882e: 22 27 eor r18, r18 38830: 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)) { 38832: 23 2b or r18, r19 38834: 09 f0 breq .+2 ; 0x38838 38836: 40 c0 rjmp .+128 ; 0x388b8 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; 38838: 9c 01 movw r18, r24 3883a: 22 27 eor r18, r18 3883c: 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)) { 3883e: 23 2b or r18, r19 38840: e9 f5 brne .+122 ; 0x388bc 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; 38842: 88 27 eor r24, r24 38844: 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)) { 38846: 89 2b or r24, r25 38848: 09 f4 brne .+2 ; 0x3884c 3884a: 44 c0 rjmp .+136 ; 0x388d4 return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 3884c: 80 e1 ldi r24, 0x10 ; 16 3884e: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38850: 23 2b or r18, r19 38852: 09 f4 brne .+2 ; 0x38856 38854: 3f c0 rjmp .+126 ; 0x388d4 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 38856: 9c 01 movw r18, r24 38858: 22 27 eor r18, r18 3885a: 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)) { 3885c: 23 2b or r18, r19 3885e: 81 f5 brne .+96 ; 0x388c0 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; 38860: 9c 01 movw r18, r24 38862: 22 27 eor r18, r18 38864: 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)) { 38866: 23 2b or r18, r19 38868: 69 f5 brne .+90 ; 0x388c4 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; 3886a: 9c 01 movw r18, r24 3886c: 22 27 eor r18, r18 3886e: 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)) { 38870: 23 2b or r18, r19 38872: 51 f5 brne .+84 ; 0x388c8 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 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)) { 3887a: 23 2b or r18, r19 3887c: 39 f5 brne .+78 ; 0x388cc 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; 3887e: 9c 01 movw r18, r24 38880: 22 27 eor r18, r18 38882: 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)) { 38884: 23 2b or r18, r19 38886: 21 f5 brne .+72 ; 0x388d0 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; 38888: 88 27 eor r24, r24 3888a: 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)) { 3888c: 89 2b or r24, r25 3888e: 11 f1 breq .+68 ; 0x388d4 return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 38890: 81 e1 ldi r24, 0x11 ; 17 38892: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 38894: 80 e0 ldi r24, 0x00 ; 0 38896: 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); 38898: 82 e1 ldi r24, 0x12 ; 18 3889a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 3889c: 85 e1 ldi r24, 0x15 ; 21 3889e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 388a0: 88 e1 ldi r24, 0x18 ; 24 388a2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 388a4: 8b e1 ldi r24, 0x1B ; 27 388a6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 388a8: 8c e0 ldi r24, 0x0C ; 12 388aa: 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); 388ac: 83 e1 ldi r24, 0x13 ; 19 388ae: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 388b0: 86 e1 ldi r24, 0x16 ; 22 388b2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 388b4: 89 e1 ldi r24, 0x19 ; 25 388b6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 388b8: 8c e1 ldi r24, 0x1C ; 28 388ba: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 388bc: 8d e0 ldi r24, 0x0D ; 13 388be: 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); 388c0: 84 e1 ldi r24, 0x14 ; 20 388c2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 388c4: 87 e1 ldi r24, 0x17 ; 23 388c6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 388c8: 8a e1 ldi r24, 0x1A ; 26 388ca: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 388cc: 8d e1 ldi r24, 0x1D ; 29 388ce: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 388d0: 8e e0 ldi r24, 0x0E ; 14 388d2: 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); 388d4: 8c e2 ldi r24, 0x2C ; 44 } 388d6: 08 95 ret 000388d8 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 388d8: cf 92 push r12 388da: df 92 push r13 388dc: ef 92 push r14 388de: ff 92 push r15 388e0: 0f 93 push r16 388e2: 1f 93 push r17 388e4: cf 93 push r28 388e6: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 388e8: 20 91 66 13 lds r18, 0x1366 ; 0x801366 388ec: 30 91 67 13 lds r19, 0x1367 ; 0x801367 388f0: 21 30 cpi r18, 0x01 ; 1 388f2: 31 05 cpc r19, r1 388f4: 39 f4 brne .+14 ; 0x38904 388f6: 20 91 8f 13 lds r18, 0x138F ; 0x80138f 388fa: 21 30 cpi r18, 0x01 ; 1 388fc: 19 f4 brne .+6 ; 0x38904 // 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; 388fe: 22 e0 ldi r18, 0x02 ; 2 38900: 20 93 cf 17 sts 0x17CF, r18 ; 0x8017cf } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 38904: 0f 94 1b c3 call 0x38636 ; 0x38636 38908: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 3890a: 80 91 cf 17 lds r24, 0x17CF ; 0x8017cf 3890e: 81 30 cpi r24, 0x01 ; 1 38910: 09 f4 brne .+2 ; 0x38914 38912: 64 c0 rjmp .+200 ; 0x389dc 38914: 60 f0 brcs .+24 ; 0x3892e 38916: 82 30 cpi r24, 0x02 ; 2 38918: 09 f4 brne .+2 ; 0x3891c 3891a: f4 c0 rjmp .+488 ; 0x38b04 ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 3891c: df 91 pop r29 3891e: cf 91 pop r28 38920: 1f 91 pop r17 38922: 0f 91 pop r16 38924: ff 90 pop r15 38926: ef 90 pop r14 38928: df 90 pop r13 3892a: cf 90 pop r12 3892c: 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); 3892e: 84 e0 ldi r24, 0x04 ; 4 38930: 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); 38934: 0d 2f mov r16, r29 38936: 10 e0 ldi r17, 0x00 ; 0 38938: f8 01 movw r30, r16 3893a: ef 53 subi r30, 0x3F ; 63 3893c: f5 45 sbci r31, 0x55 ; 85 3893e: 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); 38940: fc 2e mov r15, r28 38942: f2 94 swap r15 38944: 6f e0 ldi r22, 0x0F ; 15 38946: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 38948: 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); 3894a: 80 e0 ldi r24, 0x00 ; 0 3894c: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_clear(); 38950: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 // 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); 38954: 00 0f add r16, r16 38956: 11 1f adc r17, r17 38958: f8 01 movw r30, r16 3895a: e2 51 subi r30, 0x12 ; 18 3895c: f5 45 sbci r31, 0x55 ; 85 3895e: c5 90 lpm r12, Z+ 38960: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 38962: 03 53 subi r16, 0x33 ; 51 38964: 18 45 sbci r17, 0x58 ; 88 38966: f8 01 movw r30, r16 38968: 85 91 lpm r24, Z+ 3896a: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 3896c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 38970: df 92 push r13 38972: cf 92 push r12 38974: 9f 93 push r25 38976: 8f 93 push r24 38978: 8a e5 ldi r24, 0x5A ; 90 3897a: 9b ea ldi r25, 0xAB ; 171 3897c: 9f 93 push r25 3897e: 8f 93 push r24 38980: 0e 94 7f 6f call 0xdefe ; 0xdefe 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)); 38984: 45 e4 ldi r20, 0x45 ; 69 38986: 58 ea ldi r21, 0xA8 ; 168 38988: 62 e0 ldi r22, 0x02 ; 2 3898a: 80 e0 ldi r24, 0x00 ; 0 3898c: 0e 94 ba 6f call 0xdf74 ; 0xdf74 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()); 38990: 0f 90 pop r0 38992: 0f 90 pop r0 38994: 0f 90 pop r0 38996: 0f 90 pop r0 38998: 0f 90 pop r0 3899a: 0f 90 pop r0 3899c: f1 10 cpse r15, r1 3899e: c6 c0 rjmp .+396 ; 0x38b2c 389a0: 10 e0 ldi r17, 0x00 ; 0 389a2: 00 e0 ldi r16, 0x00 ; 0 389a4: 42 e1 ldi r20, 0x12 ; 18 389a6: e4 2e mov r14, r20 389a8: 58 e3 ldi r21, 0x38 ; 56 389aa: c5 2e mov r12, r21 389ac: 51 e7 ldi r21, 0x71 ; 113 389ae: 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); 389b0: ec 2f mov r30, r28 389b2: f0 e0 ldi r31, 0x00 ; 0 389b4: ee 0f add r30, r30 389b6: ff 1f adc r31, r31 389b8: ea 5b subi r30, 0xBA ; 186 389ba: f4 45 sbci r31, 0x54 ; 84 389bc: 85 91 lpm r24, Z+ 389be: 94 91 lpm r25, Z 389c0: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 389c4: bc 01 movw r22, r24 389c6: 81 e0 ldi r24, 0x01 ; 1 389c8: f1 10 cpse r15, r1 389ca: 01 c0 rjmp .+2 ; 0x389ce 389cc: 80 e0 ldi r24, 0x00 ; 0 389ce: 2e 2d mov r18, r14 389d0: a6 01 movw r20, r12 389d2: 0f 94 04 35 call 0x26a08 ; 0x26a08 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 389d6: 81 e0 ldi r24, 0x01 ; 1 389d8: 80 93 cf 17 sts 0x17CF, r24 ; 0x8017cf [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 389dc: 81 e0 ldi r24, 0x01 ; 1 389de: 80 93 71 07 sts 0x0771, r24 ; 0x800771 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.508> ReportErrorHookDynamicRender(); // Render dynamic characters 389e2: 0f 94 2d c2 call 0x3845a ; 0x3845a sound_wait_for_user(); 389e6: 0f 94 fa 6a call 0x2d5f4 ; 0x2d5f4 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); 389ea: 0d 2f mov r16, r29 389ec: 10 e0 ldi r17, 0x00 ; 0 389ee: f8 01 movw r30, r16 389f0: ef 53 subi r30, 0x3F ; 63 389f2: f5 45 sbci r31, 0x55 ; 85 389f4: 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); 389f6: dc 2f mov r29, r28 389f8: d2 95 swap r29 389fa: 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; 389fc: 80 91 c7 17 lds r24, 0x17C7 ; 0x8017c7 38a00: 81 11 cpse r24, r1 38a02: 09 c0 rjmp .+18 ; 0x38a16 38a04: 81 e0 ldi r24, 0x01 ; 1 38a06: d1 11 cpse r29, r1 38a08: 01 c0 rjmp .+2 ; 0x38a0c 38a0a: 80 e0 ldi r24, 0x00 ; 0 38a0c: 80 93 c6 17 sts 0x17C6, r24 ; 0x8017c6 38a10: 81 e0 ldi r24, 0x01 ; 1 38a12: 80 93 c7 17 sts 0x17C7, r24 ; 0x8017c7 static int8_t choice_selected = -1; if (reset_button_selection) { 38a16: 80 91 c5 17 lds r24, 0x17C5 ; 0x8017c5 38a1a: 88 23 and r24, r24 38a1c: 41 f0 breq .+16 ; 0x38a2e // 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; 38a1e: 81 e0 ldi r24, 0x01 ; 1 38a20: d1 11 cpse r29, r1 38a22: 01 c0 rjmp .+2 ; 0x38a26 38a24: 80 e0 ldi r24, 0x00 ; 0 38a26: 80 93 c6 17 sts 0x17C6, r24 ; 0x8017c6 choice_selected = -1; reset_button_selection = 0; 38a2a: 10 92 c5 17 sts 0x17C5, r1 ; 0x8017c5 } // Check if knob was rotated if (lcd_encoder) { 38a2e: 20 91 34 05 lds r18, 0x0534 ; 0x800534 38a32: 30 91 35 05 lds r19, 0x0535 ; 0x800535 38a36: 21 15 cp r18, r1 38a38: 31 05 cpc r19, r1 38a3a: b9 f1 breq .+110 ; 0x38aaa 38a3c: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 if (two_choices == false) { // third_choice is not nullptr, safe to dereference 38a40: dd 23 and r29, r29 38a42: 61 f0 breq .+24 ; 0x38a5c if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38a44: 37 ff sbrs r19, 7 38a46: 06 c0 rjmp .+12 ; 0x38a54 38a48: 88 23 and r24, r24 38a4a: 69 f0 breq .+26 ; 0x38a66 // Rotating knob counter clockwise current_selection--; 38a4c: 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; 38a4e: 80 93 c6 17 sts 0x17C6, r24 ; 0x8017c6 38a52: 09 c0 rjmp .+18 ; 0x38a66 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) { 38a54: 82 30 cpi r24, 0x02 ; 2 38a56: 39 f0 breq .+14 ; 0x38a66 // Rotating knob clockwise current_selection++; 38a58: 8f 5f subi r24, 0xFF ; 255 38a5a: f9 cf rjmp .-14 ; 0x38a4e } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38a5c: 37 ff sbrs r19, 7 38a5e: 41 c0 rjmp .+130 ; 0x38ae2 38a60: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 38a62: 10 92 c6 17 sts 0x17C6, r1 ; 0x8017c6 //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 38a66: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 38a6a: 4e e3 ldi r20, 0x3E ; 62 38a6c: 81 11 cpse r24, r1 38a6e: 40 e2 ldi r20, 0x20 ; 32 38a70: 63 e0 ldi r22, 0x03 ; 3 38a72: 80 e0 ldi r24, 0x00 ; 0 38a74: 0e 94 c6 6f call 0xdf8c ; 0xdf8c 38a78: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 if (two_choices == false) 38a7c: dd 23 and r29, r29 38a7e: b1 f1 breq .+108 ; 0x38aec { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38a80: 4e e3 ldi r20, 0x3E ; 62 38a82: 81 30 cpi r24, 0x01 ; 1 38a84: 09 f0 breq .+2 ; 0x38a88 38a86: 40 e2 ldi r20, 0x20 ; 32 38a88: 63 e0 ldi r22, 0x03 ; 3 38a8a: 89 e0 ldi r24, 0x09 ; 9 38a8c: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 38a90: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 38a94: 82 30 cpi r24, 0x02 ; 2 38a96: 61 f5 brne .+88 ; 0x38af0 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38a98: 4e e3 ldi r20, 0x3E ; 62 38a9a: 63 e0 ldi r22, 0x03 ; 3 38a9c: 82 e1 ldi r24, 0x12 ; 18 38a9e: 0e 94 c6 6f call 0xdf8c ; 0xdf8c } // Consume rotation event lcd_encoder = 0; 38aa2: 10 92 35 05 sts 0x0535, r1 ; 0x800535 38aa6: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 38aaa: 0e 94 c3 71 call 0xe386 ; 0xe386 38aae: 88 23 and r24, r24 38ab0: 09 f4 brne .+2 ; 0x38ab4 38ab2: 34 cf rjmp .-408 ; 0x3891c choice_selected = current_selection; 38ab4: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 38ab8: d1 11 cpse r29, r1 38aba: 1c c0 rjmp .+56 ; 0x38af4 38abc: 81 30 cpi r24, 0x01 ; 1 38abe: 89 f5 brne .+98 ; 0x38b22 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); 38ac0: f8 01 movw r30, r16 38ac2: ee 0f add r30, r30 38ac4: ff 1f adc r31, r31 38ac6: e9 59 subi r30, 0x99 ; 153 38ac8: f5 45 sbci r31, 0x55 ; 85 38aca: 85 91 lpm r24, Z+ 38acc: 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))); 38ace: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 38ad2: 0f 94 dc 35 call 0x26bb8 ; 0x26bb8 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38ad6: 81 e0 ldi r24, 0x01 ; 1 38ad8: 80 93 c5 17 sts 0x17C5, r24 ; 0x8017c5 lcd_return_to_status(); sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; KEEPALIVE_STATE(IN_HANDLER); ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; 38adc: 10 92 cf 17 sts 0x17CF, r1 ; 0x8017cf 38ae0: 1d cf rjmp .-454 ; 0x3891c } } 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) { 38ae2: 81 30 cpi r24, 0x01 ; 1 38ae4: 09 f4 brne .+2 ; 0x38ae8 38ae6: bf cf rjmp .-130 ; 0x38a66 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 38ae8: 81 e0 ldi r24, 0x01 ; 1 38aea: b1 cf rjmp .-158 ; 0x38a4e { 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 ? '>': ' '); 38aec: 81 30 cpi r24, 0x01 ; 1 38aee: a1 f2 breq .-88 ; 0x38a98 38af0: 40 e2 ldi r20, 0x20 ; 32 38af2: d3 cf rjmp .-90 ; 0x38a9a // 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 38af4: 82 30 cpi r24, 0x02 ; 2 38af6: 21 f3 breq .-56 ; 0x38ac0 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 38af8: 81 30 cpi r24, 0x01 ; 1 38afa: 99 f4 brne .+38 ; 0x38b22 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 38afc: d0 93 5c 0e sts 0x0E5C, r29 ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b00: 80 93 c5 17 sts 0x17C5, r24 ; 0x8017c5 // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 38b04: 81 e0 ldi r24, 0x01 ; 1 38b06: 0e 94 eb 6f call 0xdfd6 ; 0xdfd6 lcd_return_to_status(); 38b0a: 0f 94 23 27 call 0x24e46 ; 0x24e46 38b0e: 10 92 69 05 sts 0x0569, r1 ; 0x800569 <_ZL10beep_timer.lto_priv.512> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 38b12: 10 92 6c 05 sts 0x056C, r1 ; 0x80056c <_ZL6bFirst.lto_priv.513> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 38b16: 10 92 71 07 sts 0x0771, r1 ; 0x800771 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.508> KEEPALIVE_STATE(IN_HANDLER); 38b1a: 82 e0 ldi r24, 0x02 ; 2 38b1c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 38b20: dd cf rjmp .-70 ; 0x38adc 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); 38b22: cf 70 andi r28, 0x0F ; 15 38b24: c0 93 5c 0e sts 0x0E5C, r28 ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b28: 81 e0 ldi r24, 0x01 ; 1 38b2a: ea cf rjmp .-44 ; 0x38b00 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); 38b2c: ef 2d mov r30, r15 38b2e: f0 e0 ldi r31, 0x00 ; 0 38b30: ee 0f add r30, r30 38b32: ff 1f adc r31, r31 38b34: ea 5b subi r30, 0xBA ; 186 38b36: f4 45 sbci r31, 0x54 ; 84 38b38: 85 91 lpm r24, Z+ 38b3a: 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()); 38b3c: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 38b40: 6c 01 movw r12, r24 38b42: 08 e3 ldi r16, 0x38 ; 56 38b44: 11 e7 ldi r17, 0x71 ; 113 38b46: 99 e0 ldi r25, 0x09 ; 9 38b48: e9 2e mov r14, r25 38b4a: 32 cf rjmp .-412 ; 0x389b0 00038b4c : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 38b4c: 0f 94 1b c3 call 0x38636 ; 0x38636 // 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); 38b50: e8 2f mov r30, r24 38b52: f0 e0 ldi r31, 0x00 ; 0 38b54: ee 0f add r30, r30 38b56: ff 1f adc r31, r31 38b58: e2 51 subi r30, 0x12 ; 18 38b5a: f5 45 sbci r31, 0x55 ; 85 38b5c: 25 91 lpm r18, Z+ 38b5e: 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) ) { 38b60: 23 33 cpi r18, 0x33 ; 51 38b62: 81 e0 ldi r24, 0x01 ; 1 38b64: 38 07 cpc r19, r24 38b66: 08 f0 brcs .+2 ; 0x38b6a 38b68: 41 c0 rjmp .+130 ; 0x38bec 38b6a: 2d 32 cpi r18, 0x2D ; 45 38b6c: 81 e0 ldi r24, 0x01 ; 1 38b6e: 38 07 cpc r19, r24 38b70: 78 f5 brcc .+94 ; 0x38bd0 38b72: 2e 37 cpi r18, 0x7E ; 126 38b74: 31 05 cpc r19, r1 38b76: 09 f4 brne .+2 ; 0x38b7a 38b78: 83 c0 rjmp .+262 ; 0x38c80 38b7a: f0 f4 brcc .+60 ; 0x38bb8 38b7c: 2c 36 cpi r18, 0x6C ; 108 38b7e: 31 05 cpc r19, r1 38b80: 09 f4 brne .+2 ; 0x38b84 38b82: 85 c0 rjmp .+266 ; 0x38c8e 38b84: 30 f4 brcc .+12 ; 0x38b92 38b86: 25 36 cpi r18, 0x65 ; 101 38b88: 31 05 cpc r19, r1 38b8a: 08 f0 brcs .+2 ; 0x38b8e 38b8c: 79 c0 rjmp .+242 ; 0x38c80 default: break; } return Buttons::NoButton; 38b8e: 8f ef ldi r24, 0xFF ; 255 38b90: 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) ) { 38b92: 24 37 cpi r18, 0x74 ; 116 38b94: 31 05 cpc r19, r1 38b96: 09 f4 brne .+2 ; 0x38b9a 38b98: 73 c0 rjmp .+230 ; 0x38c80 38b9a: 2d 37 cpi r18, 0x7D ; 125 38b9c: 31 05 cpc r19, r1 38b9e: 19 f0 breq .+6 ; 0x38ba6 38ba0: 23 37 cpi r18, 0x73 ; 115 38ba2: 31 05 cpc r19, r1 38ba4: a1 f7 brne .-24 ; 0x38b8e break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 38ba6: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38baa: 81 30 cpi r24, 0x01 ; 1 38bac: 09 f4 brne .+2 ; 0x38bb0 38bae: 6d c0 rjmp .+218 ; 0x38c8a 38bb0: 87 30 cpi r24, 0x07 ; 7 38bb2: 69 f7 brne .-38 ; 0x38b8e // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 38bb4: 88 e0 ldi r24, 0x08 ; 8 38bb6: 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) ) { 38bb8: 23 3d cpi r18, 0xD3 ; 211 38bba: 31 05 cpc r19, r1 38bbc: 09 f4 brne .+2 ; 0x38bc0 38bbe: 6e c0 rjmp .+220 ; 0x38c9c 38bc0: 50 f4 brcc .+20 ; 0x38bd6 38bc2: 29 3c cpi r18, 0xC9 ; 201 38bc4: 31 05 cpc r19, r1 38bc6: 09 f4 brne .+2 ; 0x38bca 38bc8: 69 c0 rjmp .+210 ; 0x38c9c 38bca: 2a 3c cpi r18, 0xCA ; 202 38bcc: 31 05 cpc r19, r1 38bce: f9 f6 brne .-66 ; 0x38b8e 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) { 38bd0: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38bd4: 67 c0 rjmp .+206 ; 0x38ca4 // 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) ) { 38bd6: 2d 3d cpi r18, 0xDD ; 221 38bd8: 31 05 cpc r19, r1 38bda: 09 f4 brne .+2 ; 0x38bde 38bdc: 5f c0 rjmp .+190 ; 0x38c9c 38bde: 2e 3d cpi r18, 0xDE ; 222 38be0: 31 05 cpc r19, r1 38be2: b1 f3 breq .-20 ; 0x38bd0 38be4: 24 3d cpi r18, 0xD4 ; 212 38be6: 31 05 cpc r19, r1 38be8: 91 f6 brne .-92 ; 0x38b8e 38bea: f2 cf rjmp .-28 ; 0x38bd0 38bec: 25 3f cpi r18, 0xF5 ; 245 38bee: 81 e0 ldi r24, 0x01 ; 1 38bf0: 38 07 cpc r19, r24 38bf2: 09 f4 brne .+2 ; 0x38bf6 38bf4: 5c c0 rjmp .+184 ; 0x38cae 38bf6: f8 f4 brcc .+62 ; 0x38c36 38bf8: 26 34 cpi r18, 0x46 ; 70 38bfa: 81 e0 ldi r24, 0x01 ; 1 38bfc: 38 07 cpc r19, r24 38bfe: 58 f4 brcc .+22 ; 0x38c16 38c00: 21 34 cpi r18, 0x41 ; 65 38c02: 81 e0 ldi r24, 0x01 ; 1 38c04: 38 07 cpc r19, r24 38c06: 20 f7 brcc .-56 ; 0x38bd0 38c08: 27 53 subi r18, 0x37 ; 55 38c0a: 31 40 sbci r19, 0x01 ; 1 38c0c: 25 30 cpi r18, 0x05 ; 5 38c0e: 31 05 cpc r19, r1 38c10: 08 f0 brcs .+2 ; 0x38c14 38c12: bd cf rjmp .-134 ; 0x38b8e 38c14: dd cf rjmp .-70 ; 0x38bd0 38c16: 21 59 subi r18, 0x91 ; 145 38c18: 31 40 sbci r19, 0x01 ; 1 38c1a: 22 30 cpi r18, 0x02 ; 2 38c1c: 31 05 cpc r19, r1 38c1e: 08 f0 brcs .+2 ; 0x38c22 38c20: b6 cf rjmp .-148 ; 0x38b8e } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 38c22: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38c26: 83 30 cpi r24, 0x03 ; 3 38c28: 09 f4 brne .+2 ; 0x38c2c 38c2a: 3f c0 rjmp .+126 ; 0x38caa 38c2c: 89 30 cpi r24, 0x09 ; 9 38c2e: 09 f0 breq .+2 ; 0x38c32 38c30: ae cf rjmp .-164 ; 0x38b8e case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 38c32: 87 e0 ldi r24, 0x07 ; 7 38c34: 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) ) { 38c36: 29 3f cpi r18, 0xF9 ; 249 38c38: 81 e0 ldi r24, 0x01 ; 1 38c3a: 38 07 cpc r19, r24 38c3c: 49 f2 breq .-110 ; 0x38bd0 38c3e: 70 f4 brcc .+28 ; 0x38c5c 38c40: 27 3f cpi r18, 0xF7 ; 247 38c42: 81 e0 ldi r24, 0x01 ; 1 38c44: 38 07 cpc r19, r24 38c46: 21 f2 breq .-120 ; 0x38bd0 38c48: 60 f7 brcc .-40 ; 0x38c22 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 38c4a: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38c4e: 83 30 cpi r24, 0x03 ; 3 38c50: 61 f1 breq .+88 ; 0x38caa 38c52: 88 30 cpi r24, 0x08 ; 8 38c54: 09 f0 breq .+2 ; 0x38c58 38c56: 9b cf rjmp .-202 ; 0x38b8e case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 38c58: 86 e0 ldi r24, 0x06 ; 6 38c5a: 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) ) { 38c5c: 2b 3f cpi r18, 0xFB ; 251 38c5e: 81 e0 ldi r24, 0x01 ; 1 38c60: 38 07 cpc r19, r24 38c62: a9 f0 breq .+42 ; 0x38c8e 38c64: 68 f0 brcs .+26 ; 0x38c80 38c66: 2c 3f cpi r18, 0xFC ; 252 38c68: 31 40 sbci r19, 0x01 ; 1 38c6a: 09 f0 breq .+2 ; 0x38c6e 38c6c: 90 cf rjmp .-224 ; 0x38b8e default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 38c6e: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38c72: 85 30 cpi r24, 0x05 ; 5 38c74: 89 f0 breq .+34 ; 0x38c98 38c76: 86 30 cpi r24, 0x06 ; 6 38c78: 09 f0 breq .+2 ; 0x38c7c 38c7a: 89 cf rjmp .-238 ; 0x38b8e case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 38c7c: 85 e0 ldi r24, 0x05 ; 5 38c7e: 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) { 38c80: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38c84: 81 30 cpi r24, 0x01 ; 1 38c86: 09 f0 breq .+2 ; 0x38c8a 38c88: 82 cf rjmp .-252 ; 0x38b8e 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; 38c8a: 81 e0 ldi r24, 0x01 ; 1 38c8c: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 38c8e: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38c92: 82 30 cpi r24, 0x02 ; 2 38c94: d1 f3 breq .-12 ; 0x38c8a 38c96: 7b cf rjmp .-266 ; 0x38b8e } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 38c98: 84 e0 ldi r24, 0x04 ; 4 38c9a: 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) { 38c9c: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38ca0: 82 30 cpi r24, 0x02 ; 2 38ca2: 61 f0 breq .+24 ; 0x38cbc 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) { 38ca4: 83 30 cpi r24, 0x03 ; 3 38ca6: 09 f0 breq .+2 ; 0x38caa 38ca8: 72 cf rjmp .-284 ; 0x38b8e 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; 38caa: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 38cac: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 38cae: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.511> 38cb2: 82 30 cpi r24, 0x02 ; 2 38cb4: 29 f0 breq .+10 ; 0x38cc0 38cb6: 84 30 cpi r24, 0x04 ; 4 38cb8: 09 f0 breq .+2 ; 0x38cbc 38cba: 69 cf rjmp .-302 ; 0x38b8e 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; 38cbc: 82 e0 ldi r24, 0x02 ; 2 38cbe: 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; 38cc0: 80 e0 ldi r24, 0x00 ; 0 38cc2: 08 95 ret 00038cc4 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 38cc4: cf 93 push r28 38cc6: df 93 push r29 38cc8: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 38cca: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 38cce: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 38cd2: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 38cd6: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 38cda: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 38cde: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 38ce2: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 38ce6: c9 01 movw r24, r18 38ce8: 86 1b sub r24, r22 38cea: 97 0b sbc r25, r23 38cec: 06 97 sbiw r24, 0x06 ; 6 38cee: 24 f0 brlt .+8 ; 0x38cf8 (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); 38cf0: ce 01 movw r24, r28 38cf2: 0e 94 98 8e call 0x11d30 ; 0x11d30 38cf6: e9 cf rjmp .-46 ; 0x38cca (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]+0x6> f(); safe_delay_keep_alive(delay); } } 38cf8: df 91 pop r29 38cfa: cf 91 pop r28 38cfc: 08 95 ret 00038cfe : } //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) { 38cfe: cf 93 push r28 38d00: df 93 push r29 38d02: 00 d0 rcall .+0 ; 0x38d04 38d04: 00 d0 rcall .+0 ; 0x38d06 38d06: 1f 92 push r1 38d08: cd b7 in r28, 0x3d ; 61 38d0a: 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)) 38d0c: 87 30 cpi r24, 0x07 ; 7 38d0e: 50 f5 brcc .+84 ; 0x38d64 38d10: 67 30 cpi r22, 0x07 ; 7 38d12: 40 f5 brcc .+80 ; 0x38d64 return false; uint8_t valid_points_mask[7] = { 38d14: 97 e0 ldi r25, 0x07 ; 7 38d16: e6 ec ldi r30, 0xC6 ; 198 38d18: f2 e0 ldi r31, 0x02 ; 2 38d1a: de 01 movw r26, r28 38d1c: 11 96 adiw r26, 0x01 ; 1 38d1e: 01 90 ld r0, Z+ 38d20: 0d 92 st X+, r0 38d22: 9a 95 dec r25 38d24: e1 f7 brne .-8 ; 0x38d1e 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 38d26: 46 e0 ldi r20, 0x06 ; 6 38d28: 50 e0 ldi r21, 0x00 ; 0 38d2a: fa 01 movw r30, r20 38d2c: e6 1b sub r30, r22 38d2e: f1 09 sbc r31, r1 38d30: 21 e0 ldi r18, 0x01 ; 1 38d32: 30 e0 ldi r19, 0x00 ; 0 38d34: 2c 0f add r18, r28 38d36: 3d 1f adc r19, r29 38d38: e2 0f add r30, r18 38d3a: f3 1f adc r31, r19 38d3c: 20 81 ld r18, Z 38d3e: 30 e0 ldi r19, 0x00 ; 0 38d40: 48 1b sub r20, r24 38d42: 51 09 sbc r21, r1 38d44: c9 01 movw r24, r18 38d46: 02 c0 rjmp .+4 ; 0x38d4c 38d48: 95 95 asr r25 38d4a: 87 95 ror r24 38d4c: 4a 95 dec r20 38d4e: e2 f7 brpl .-8 ; 0x38d48 38d50: 81 70 andi r24, 0x01 ; 1 } 38d52: 27 96 adiw r28, 0x07 ; 7 38d54: 0f b6 in r0, 0x3f ; 63 38d56: f8 94 cli 38d58: de bf out 0x3e, r29 ; 62 38d5a: 0f be out 0x3f, r0 ; 63 38d5c: cd bf out 0x3d, r28 ; 61 38d5e: df 91 pop r29 38d60: cf 91 pop r28 38d62: 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; 38d64: 80 e0 ldi r24, 0x00 ; 0 38d66: f5 cf rjmp .-22 ; 0x38d52 00038d68 : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 38d68: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.515+0x1> 38d6c: 10 92 67 05 sts 0x0567, r1 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.515> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 38d70: 80 e1 ldi r24, 0x10 ; 16 38d72: 0e 94 1f f9 call 0x1f23e ; 0x1f23e 38d76: 88 23 and r24, r24 38d78: 91 f0 breq .+36 ; 0x38d9e { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 38d7a: 0e 94 1b 7b call 0xf636 ; 0xf636 // 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))); 38d7e: 81 ea ldi r24, 0xA1 ; 161 38d80: 9d e0 ldi r25, 0x0D ; 13 38d82: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 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-> 38d86: 2b e0 ldi r18, 0x0B ; 11 38d88: 82 9f mul r24, r18 38d8a: c0 01 movw r24, r0 38d8c: 11 24 eor r1, r1 38d8e: 80 5b subi r24, 0xB0 ; 176 38d90: 92 4f sbci r25, 0xF2 ; 242 38d92: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 38d96: 90 93 68 05 sts 0x0568, r25 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.515+0x1> 38d9a: 80 93 67 05 sts 0x0567, r24 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.515> SERIAL_ECHO("correction: "); SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_mm[Z_AXIS])); SERIAL_ECHOLN(""); #endif } } 38d9e: 08 95 ret 00038da0 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 38da0: 0f 93 push r16 38da2: 1f 93 push r17 38da4: cf 93 push r28 38da6: df 93 push r29 38da8: 00 d0 rcall .+0 ; 0x38daa 38daa: 1f 92 push r1 38dac: cd b7 in r28, 0x3d ; 61 38dae: de b7 in r29, 0x3e ; 62 38db0: 9b 01 movw r18, r22 38db2: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 38db4: 00 e4 ldi r16, 0x40 ; 64 38db6: 17 e0 ldi r17, 0x07 ; 7 38db8: f8 01 movw r30, r16 38dba: 60 85 ldd r22, Z+8 ; 0x08 38dbc: 71 85 ldd r23, Z+9 ; 0x09 38dbe: 82 85 ldd r24, Z+10 ; 0x0a 38dc0: 93 85 ldd r25, Z+11 ; 0x0b 38dc2: 69 83 std Y+1, r22 ; 0x01 38dc4: 7a 83 std Y+2, r23 ; 0x02 38dc6: 8b 83 std Y+3, r24 ; 0x03 38dc8: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 38dca: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 38dce: f8 01 movw r30, r16 38dd0: 60 87 std Z+8, r22 ; 0x08 38dd2: 71 87 std Z+9, r23 ; 0x09 38dd4: 82 87 std Z+10, r24 ; 0x0a 38dd6: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 38dd8: 65 e5 ldi r22, 0x55 ; 85 38dda: 75 e5 ldi r23, 0x55 ; 85 38ddc: 85 e5 ldi r24, 0x55 ; 85 38dde: 91 e4 ldi r25, 0x41 ; 65 38de0: 0f 94 48 ba call 0x37490 ; 0x37490 st_synchronize(); 38de4: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position[Z_AXIS] = curpos_z; 38de8: 89 81 ldd r24, Y+1 ; 0x01 38dea: 9a 81 ldd r25, Y+2 ; 0x02 38dec: ab 81 ldd r26, Y+3 ; 0x03 38dee: bc 81 ldd r27, Y+4 ; 0x04 38df0: f8 01 movw r30, r16 38df2: 80 87 std Z+8, r24 ; 0x08 38df4: 91 87 std Z+9, r25 ; 0x09 38df6: a2 87 std Z+10, r26 ; 0x0a 38df8: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 38dfa: ce 01 movw r24, r28 38dfc: 01 96 adiw r24, 0x01 ; 1 38dfe: 0f 94 cc aa call 0x35598 ; 0x35598 } 38e02: 0f 90 pop r0 38e04: 0f 90 pop r0 38e06: 0f 90 pop r0 38e08: 0f 90 pop r0 38e0a: df 91 pop r29 38e0c: cf 91 pop r28 38e0e: 1f 91 pop r17 38e10: 0f 91 pop r16 38e12: 08 95 ret 00038e14 : 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])); 38e14: 60 91 67 05 lds r22, 0x0567 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.515> 38e18: 70 91 68 05 lds r23, 0x0568 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.515+0x1> 38e1c: 07 2e mov r0, r23 38e1e: 00 0c add r0, r0 38e20: 88 0b sbc r24, r24 38e22: 99 0b sbc r25, r25 38e24: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 38e28: 20 91 77 06 lds r18, 0x0677 ; 0x800677 38e2c: 30 91 78 06 lds r19, 0x0678 ; 0x800678 38e30: 40 91 79 06 lds r20, 0x0679 ; 0x800679 38e34: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 38e38: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 38e3c: 0f 94 d0 c6 call 0x38da0 ; 0x38da0 babystepLoadZ = 0; 38e40: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.515+0x1> 38e44: 10 92 67 05 sts 0x0567, r1 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.515> } 38e48: 08 95 ret 00038e4a : return sampled; } void go_home_with_z_lift() { 38e4a: cf 93 push r28 38e4c: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38e4e: 0e 94 89 67 call 0xcf12 ; 0xcf12 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 38e52: c0 e4 ldi r28, 0x40 ; 64 38e54: d7 e0 ldi r29, 0x07 ; 7 38e56: 80 e0 ldi r24, 0x00 ; 0 38e58: 90 e0 ldi r25, 0x00 ; 0 38e5a: a0 ea ldi r26, 0xA0 ; 160 38e5c: b0 e4 ldi r27, 0x40 ; 64 38e5e: 88 87 std Y+8, r24 ; 0x08 38e60: 99 87 std Y+9, r25 ; 0x09 38e62: aa 87 std Y+10, r26 ; 0x0a 38e64: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38e66: 65 e5 ldi r22, 0x55 ; 85 38e68: 75 e5 ldi r23, 0x55 ; 85 38e6a: 85 e5 ldi r24, 0x55 ; 85 38e6c: 91 e4 ldi r25, 0x41 ; 65 38e6e: 0f 94 05 c3 call 0x3860a ; 0x3860a // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 38e72: 8d ec ldi r24, 0xCD ; 205 38e74: 9c ec ldi r25, 0xCC ; 204 38e76: ac e4 ldi r26, 0x4C ; 76 38e78: be e3 ldi r27, 0x3E ; 62 38e7a: 88 83 st Y, r24 38e7c: 99 83 std Y+1, r25 ; 0x01 38e7e: aa 83 std Y+2, r26 ; 0x02 38e80: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 38e82: 83 e3 ldi r24, 0x33 ; 51 38e84: 93 e3 ldi r25, 0x33 ; 51 38e86: a3 e7 ldi r26, 0x73 ; 115 38e88: b0 ec ldi r27, 0xC0 ; 192 38e8a: 8c 83 std Y+4, r24 ; 0x04 38e8c: 9d 83 std Y+5, r25 ; 0x05 38e8e: ae 83 std Y+6, r26 ; 0x06 38e90: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 38e92: 64 e4 ldi r22, 0x44 ; 68 38e94: 77 e0 ldi r23, 0x07 ; 7 38e96: ce 01 movw r24, r28 38e98: 0e 94 70 6b call 0xd6e0 ; 0xd6e0 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 38e9c: 60 e0 ldi r22, 0x00 ; 0 38e9e: 70 e0 ldi r23, 0x00 ; 0 38ea0: 86 e1 ldi r24, 0x16 ; 22 38ea2: 93 e4 ldi r25, 0x43 ; 67 38ea4: 0f 94 05 c3 call 0x3860a ; 0x3860a // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 38ea8: 8a e9 ldi r24, 0x9A ; 154 38eaa: 99 e9 ldi r25, 0x99 ; 153 38eac: a9 e1 ldi r26, 0x19 ; 25 38eae: be e3 ldi r27, 0x3E ; 62 38eb0: 88 87 std Y+8, r24 ; 0x08 38eb2: 99 87 std Y+9, r25 ; 0x09 38eb4: aa 87 std Y+10, r26 ; 0x0a 38eb6: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38eb8: 65 e5 ldi r22, 0x55 ; 85 38eba: 75 e5 ldi r23, 0x55 ; 85 38ebc: 85 e5 ldi r24, 0x55 ; 85 38ebe: 91 e4 ldi r25, 0x41 ; 65 } 38ec0: df 91 pop r29 38ec2: 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); 38ec4: 0d 94 05 c3 jmp 0x3860a ; 0x3860a 00038ec8 : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 38ec8: 68 2f mov r22, r24 38eca: 70 e0 ldi r23, 0x00 ; 0 38ecc: 90 e0 ldi r25, 0x00 ; 0 38ece: 80 e0 ldi r24, 0x00 ; 0 38ed0: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 38ed4: 20 e0 ldi r18, 0x00 ; 0 38ed6: 30 e0 ldi r19, 0x00 ; 0 38ed8: 48 e0 ldi r20, 0x08 ; 8 38eda: 52 e4 ldi r21, 0x42 ; 66 38edc: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 38ee0: 20 e0 ldi r18, 0x00 ; 0 38ee2: 30 e0 ldi r19, 0x00 ; 0 38ee4: 40 e8 ldi r20, 0x80 ; 128 38ee6: 5f e3 ldi r21, 0x3F ; 63 38ee8: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> } 38eec: 08 95 ret 00038eee : // 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() { 38eee: 2f 92 push r2 38ef0: 3f 92 push r3 38ef2: 4f 92 push r4 38ef4: 5f 92 push r5 38ef6: 6f 92 push r6 38ef8: 7f 92 push r7 38efa: 8f 92 push r8 38efc: 9f 92 push r9 38efe: af 92 push r10 38f00: bf 92 push r11 38f02: cf 92 push r12 38f04: df 92 push r13 38f06: ef 92 push r14 38f08: ff 92 push r15 38f0a: 0f 93 push r16 38f0c: 1f 93 push r17 38f0e: cf 93 push r28 38f10: df 93 push r29 38f12: 00 d0 rcall .+0 ; 0x38f14 38f14: 00 d0 rcall .+0 ; 0x38f16 38f16: cd b7 in r28, 0x3d ; 61 38f18: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 38f1a: 84 e0 ldi r24, 0x04 ; 4 38f1c: 0f 94 63 3b call 0x276c6 ; 0x276c6 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 38f20: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 38f24: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 38f26: 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); 38f2a: 80 e0 ldi r24, 0x00 ; 0 38f2c: 0f 94 0f 64 call 0x2c81e ; 0x2c81e 38f30: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38f32: 0e 94 89 67 call 0xcf12 ; 0xcf12 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 38f36: 83 e1 ldi r24, 0x13 ; 19 38f38: 99 e4 ldi r25, 0x49 ; 73 38f3a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 38f3e: 0f 94 55 35 call 0x26aaa ; 0x26aaa // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 38f42: 44 e3 ldi r20, 0x34 ; 52 38f44: 51 e7 ldi r21, 0x71 ; 113 38f46: 63 e0 ldi r22, 0x03 ; 3 38f48: 80 e0 ldi r24, 0x00 ; 0 38f4a: 0e 94 ba 6f call 0xdf74 ; 0xdf74 38f4e: 81 e0 ldi r24, 0x01 ; 1 38f50: 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; 38f54: 80 e0 ldi r24, 0x00 ; 0 38f56: 90 e0 ldi r25, 0x00 ; 0 38f58: a0 ea ldi r26, 0xA0 ; 160 38f5a: b0 e4 ldi r27, 0x40 ; 64 38f5c: 80 93 48 07 sts 0x0748, r24 ; 0x800748 38f60: 90 93 49 07 sts 0x0749, r25 ; 0x800749 38f64: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 38f68: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b go_to_current(homing_feedrate[Z_AXIS]/60); 38f6c: 65 e5 ldi r22, 0x55 ; 85 38f6e: 75 e5 ldi r23, 0x55 ; 85 38f70: 85 e5 ldi r24, 0x55 ; 85 38f72: 91 e4 ldi r25, 0x41 ; 65 38f74: 0f 94 05 c3 call 0x3860a ; 0x3860a #ifdef TMC2130 check_Z_crash(); 38f78: 0e 94 cd 7b call 0xf79a ; 0xf79a 38f7c: 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; 38f80: 80 e0 ldi r24, 0x00 ; 0 38f82: 90 e0 ldi r25, 0x00 ; 0 38f84: a0 e8 ldi r26, 0x80 ; 128 38f86: bf e3 ldi r27, 0x3F ; 63 38f88: 80 93 40 07 sts 0x0740, r24 ; 0x800740 38f8c: 90 93 41 07 sts 0x0741, r25 ; 0x800741 38f90: a0 93 42 07 sts 0x0742, r26 ; 0x800742 38f94: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = BED_Y0; 38f98: 80 93 44 07 sts 0x0744, r24 ; 0x800744 38f9c: 90 93 45 07 sts 0x0745, r25 ; 0x800745 38fa0: a0 93 46 07 sts 0x0746, r26 ; 0x800746 38fa4: b0 93 47 07 sts 0x0747, r27 ; 0x800747 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 38fa8: 64 e4 ldi r22, 0x44 ; 68 38faa: 77 e0 ldi r23, 0x07 ; 7 38fac: 80 e4 ldi r24, 0x40 ; 64 38fae: 97 e0 ldi r25, 0x07 ; 7 38fb0: 0e 94 70 6b call 0xd6e0 ; 0xd6e0 go_to_current(homing_feedrate[X_AXIS]/60); 38fb4: 60 e0 ldi r22, 0x00 ; 0 38fb6: 70 e0 ldi r23, 0x00 ; 0 38fb8: 88 e4 ldi r24, 0x48 ; 72 38fba: 92 e4 ldi r25, 0x42 ; 66 38fbc: 0f 94 05 c3 call 0x3860a ; 0x3860a set_destination_to_current(); 38fc0: 0e 94 00 69 call 0xd200 ; 0xd200 homeaxis(Z_AXIS); 38fc4: 50 e0 ldi r21, 0x00 ; 0 38fc6: 40 e0 ldi r20, 0x00 ; 0 38fc8: 61 e0 ldi r22, 0x01 ; 1 38fca: 82 e0 ldi r24, 0x02 ; 2 38fcc: 0e 94 07 7c call 0xf80e ; 0xf80e if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 38fd0: 43 e0 ldi r20, 0x03 ; 3 38fd2: 60 e0 ldi r22, 0x00 ; 0 38fd4: 70 e0 ldi r23, 0x00 ; 0 38fd6: 80 e2 ldi r24, 0x20 ; 32 38fd8: 91 ec ldi r25, 0xC1 ; 193 38fda: 0f 94 de 8b call 0x317bc ; 0x317bc 38fde: 81 11 cpse r24, r1 38fe0: 06 c0 rjmp .+12 ; 0x38fee 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)); 38fe2: 8a ef ldi r24, 0xFA ; 250 38fe4: 94 e6 ldi r25, 0x64 ; 100 38fe6: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 38fea: 0e 94 a6 7b call 0xf74c ; 0xf74c float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 38fee: 80 91 48 07 lds r24, 0x0748 ; 0x800748 38ff2: 90 91 49 07 lds r25, 0x0749 ; 0x800749 38ff6: a0 91 4a 07 lds r26, 0x074A ; 0x80074a 38ffa: b0 91 4b 07 lds r27, 0x074B ; 0x80074b 38ffe: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e 39002: 90 93 9f 13 sts 0x139F, r25 ; 0x80139f 39006: a0 93 a0 13 sts 0x13A0, r26 ; 0x8013a0 3900a: b0 93 a1 13 sts 0x13A1, r27 ; 0x8013a1 3900e: e2 e0 ldi r30, 0x02 ; 2 39010: f0 e0 ldi r31, 0x00 ; 0 39012: fa 83 std Y+2, r31 ; 0x02 39014: 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; 39016: c1 2c mov r12, r1 39018: d1 2c mov r13, r1 3901a: 30 ea ldi r19, 0xA0 ; 160 3901c: e3 2e mov r14, r19 3901e: 30 e4 ldi r19, 0x40 ; 64 39020: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 39022: 43 e0 ldi r20, 0x03 ; 3 39024: 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 39026: 52 e0 ldi r21, 0x02 ; 2 39028: 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); 3902a: 02 e5 ldi r16, 0x52 ; 82 3902c: 1a ea ldi r17, 0xAA ; 170 3902e: 67 e0 ldi r22, 0x07 ; 7 39030: 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(); 39032: 0e 94 89 67 call 0xcf12 ; 0xcf12 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 39036: c0 92 48 07 sts 0x0748, r12 ; 0x800748 3903a: d0 92 49 07 sts 0x0749, r13 ; 0x800749 3903e: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 39042: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b go_to_current(homing_feedrate[Z_AXIS]/60); 39046: 65 e5 ldi r22, 0x55 ; 85 39048: 75 e5 ldi r23, 0x55 ; 85 3904a: 85 e5 ldi r24, 0x55 ; 85 3904c: 91 e4 ldi r25, 0x41 ; 65 3904e: 0f 94 05 c3 call 0x3860a ; 0x3860a uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 39052: 29 81 ldd r18, Y+1 ; 0x01 39054: 21 50 subi r18, 0x01 ; 1 39056: 82 2f mov r24, r18 39058: 6b 2d mov r22, r11 3905a: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__udivmodqi4> 3905e: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 39060: 82 2f mov r24, r18 39062: 0f 94 01 de call 0x3bc02 ; 0x3bc02 <__divmodqi4> 39066: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 39068: 80 ff sbrs r24, 0 3906a: 03 c0 rjmp .+6 ; 0x39072 3906c: f9 2d mov r31, r9 3906e: f8 19 sub r31, r8 39070: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 39072: 88 2d mov r24, r8 39074: 88 0f add r24, r24 39076: 88 0d add r24, r8 39078: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 3907c: 60 93 40 07 sts 0x0740, r22 ; 0x800740 39080: 70 93 41 07 sts 0x0741, r23 ; 0x800741 39084: 80 93 42 07 sts 0x0742, r24 ; 0x800742 39088: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] = BED_Y(iy * 3); 3908c: 87 2d mov r24, r7 3908e: 88 0f add r24, r24 39090: 87 0d add r24, r7 39092: 0f 94 64 c7 call 0x38ec8 ; 0x38ec8 39096: 60 93 44 07 sts 0x0744, r22 ; 0x800744 3909a: 70 93 45 07 sts 0x0745, r23 ; 0x800745 3909e: 80 93 46 07 sts 0x0746, r24 ; 0x800746 390a2: 90 93 47 07 sts 0x0747, r25 ; 0x800747 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 390a6: 64 e4 ldi r22, 0x44 ; 68 390a8: 77 e0 ldi r23, 0x07 ; 7 390aa: 80 e4 ldi r24, 0x40 ; 64 390ac: 97 e0 ldi r25, 0x07 ; 7 390ae: 0e 94 70 6b call 0xd6e0 ; 0xd6e0 go_to_current(homing_feedrate[X_AXIS]/60); 390b2: 60 e0 ldi r22, 0x00 ; 0 390b4: 70 e0 ldi r23, 0x00 ; 0 390b6: 88 e4 ldi r24, 0x48 ; 72 390b8: 92 e4 ldi r25, 0x42 ; 66 390ba: 0f 94 05 c3 call 0x3860a ; 0x3860a #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 390be: 63 e0 ldi r22, 0x03 ; 3 390c0: 80 e0 ldi r24, 0x00 ; 0 390c2: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_printf_P(PSTR("%d/9"),mesh_point+1); 390c6: 8a 81 ldd r24, Y+2 ; 0x02 390c8: 8f 93 push r24 390ca: 99 81 ldd r25, Y+1 ; 0x01 390cc: 9f 93 push r25 390ce: 1f 93 push r17 390d0: 0f 93 push r16 390d2: 0e 94 7f 6f call 0xdefe ; 0xdefe #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 390d6: 43 e0 ldi r20, 0x03 ; 3 390d8: 60 e0 ldi r22, 0x00 ; 0 390da: 70 e0 ldi r23, 0x00 ; 0 390dc: 80 e2 ldi r24, 0x20 ; 32 390de: 91 ec ldi r25, 0xC1 ; 193 390e0: 0f 94 de 8b call 0x317bc ; 0x317bc 390e4: 58 2e mov r5, r24 390e6: 0f 90 pop r0 390e8: 0f 90 pop r0 390ea: 0f 90 pop r0 390ec: 0f 90 pop r0 390ee: 88 23 and r24, r24 390f0: 09 f4 brne .+2 ; 0x390f4 390f2: 77 cf rjmp .-274 ; 0x38fe2 390f4: a7 9c mul r10, r7 390f6: f0 01 movw r30, r0 390f8: 11 24 eor r1, r1 390fa: e8 0d add r30, r8 390fc: f1 1d adc r31, r1 390fe: ee 0f add r30, r30 39100: ff 1f adc r31, r31 39102: ee 0f add r30, r30 39104: ff 1f adc r31, r31 39106: e3 56 subi r30, 0x63 ; 99 39108: fc 4e sbci r31, 0xEC ; 236 3910a: 80 91 48 07 lds r24, 0x0748 ; 0x800748 3910e: 90 91 49 07 lds r25, 0x0749 ; 0x800749 39112: a0 91 4a 07 lds r26, 0x074A ; 0x80074a 39116: b0 91 4b 07 lds r27, 0x074B ; 0x80074b 3911a: 81 83 std Z+1, r24 ; 0x01 3911c: 92 83 std Z+2, r25 ; 0x02 3911e: a3 83 std Z+3, r26 ; 0x03 39120: b4 83 std Z+4, r27 ; 0x04 39122: e9 81 ldd r30, Y+1 ; 0x01 39124: fa 81 ldd r31, Y+2 ; 0x02 39126: 31 96 adiw r30, 0x01 ; 1 39128: fa 83 std Y+2, r31 ; 0x02 3912a: 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) { 3912c: 3a 97 sbiw r30, 0x0a ; 10 3912e: 09 f0 breq .+2 ; 0x39132 39130: 80 cf rjmp .-256 ; 0x39032 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 39132: 60 90 9e 13 lds r6, 0x139E ; 0x80139e 39136: 70 90 9f 13 lds r7, 0x139F ; 0x80139f 3913a: 80 90 a0 13 lds r8, 0x13A0 ; 0x8013a0 3913e: 90 90 a1 13 lds r9, 0x13A1 ; 0x8013a1 float zmax = zmin; 39142: 46 2c mov r4, r6 39144: a7 2c mov r10, r7 39146: b8 2c mov r11, r8 39148: 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]; 3914a: 1e 82 std Y+6, r1 ; 0x06 3914c: 1d 82 std Y+5, r1 ; 0x05 3914e: 0d e9 ldi r16, 0x9D ; 157 39150: 13 e1 ldi r17, 0x13 ; 19 39152: 8d 81 ldd r24, Y+5 ; 0x05 39154: 9e 81 ldd r25, Y+6 ; 0x06 39156: 82 56 subi r24, 0x62 ; 98 39158: 9c 4e sbci r25, 0xEC ; 236 3915a: 9a 83 std Y+2, r25 ; 0x02 3915c: 89 83 std Y+1, r24 ; 0x01 3915e: 93 e0 ldi r25, 0x03 ; 3 39160: 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]); 39162: e9 81 ldd r30, Y+1 ; 0x01 39164: fa 81 ldd r31, Y+2 ; 0x02 39166: c1 90 ld r12, Z+ 39168: d1 90 ld r13, Z+ 3916a: e1 90 ld r14, Z+ 3916c: f1 90 ld r15, Z+ 3916e: fa 83 std Y+2, r31 ; 0x02 39170: e9 83 std Y+1, r30 ; 0x01 39172: 93 01 movw r18, r6 39174: a4 01 movw r20, r8 39176: c7 01 movw r24, r14 39178: b6 01 movw r22, r12 3917a: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 3917e: 18 16 cp r1, r24 39180: 14 f0 brlt .+4 ; 0x39186 39182: 36 01 movw r6, r12 39184: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 39186: 24 2d mov r18, r4 39188: 3a 2d mov r19, r10 3918a: 4b 2d mov r20, r11 3918c: 52 2d mov r21, r2 3918e: c7 01 movw r24, r14 39190: b6 01 movw r22, r12 39192: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 39196: 87 fd sbrc r24, 7 39198: 04 c0 rjmp .+8 ; 0x391a2 3919a: 4c 2c mov r4, r12 3919c: ad 2c mov r10, r13 3919e: be 2c mov r11, r14 391a0: 2f 2c mov r2, r15 391a2: 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) { 391a4: 31 10 cpse r3, r1 391a6: dd cf rjmp .-70 ; 0x39162 391a8: 8d 81 ldd r24, Y+5 ; 0x05 391aa: 9e 81 ldd r25, Y+6 ; 0x06 391ac: 4c 96 adiw r24, 0x1c ; 28 391ae: 9e 83 std Y+6, r25 ; 0x06 391b0: 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) 391b2: 84 35 cpi r24, 0x54 ; 84 391b4: 91 05 cpc r25, r1 391b6: 59 f6 brne .-106 ; 0x3914e 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) { 391b8: 93 01 movw r18, r6 391ba: a4 01 movw r20, r8 391bc: 64 2d mov r22, r4 391be: 7a 2d mov r23, r10 391c0: 8b 2d mov r24, r11 391c2: 92 2d mov r25, r2 391c4: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 391c8: 20 e0 ldi r18, 0x00 ; 0 391ca: 30 e0 ldi r19, 0x00 ; 0 391cc: 40 e4 ldi r20, 0x40 ; 64 391ce: 50 e4 ldi r21, 0x40 ; 64 391d0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 391d4: 18 16 cp r1, r24 391d6: 3c f5 brge .+78 ; 0x39226 // 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!"); 391d8: 85 e3 ldi r24, 0x35 ; 53 391da: 9a ea ldi r25, 0xAA ; 170 391dc: 0e 94 17 7b call 0xf62e ; 0xf62e // 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; 391e0: 51 2c mov r5, r1 391e2: fc 81 ldd r31, Y+4 ; 0x04 391e4: 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); 391e8: 8b 81 ldd r24, Y+3 ; 0x03 391ea: 0f 94 0f 64 call 0x2c81e ; 0x2c81e #ifdef TMC2130 tmc2130_home_exit(); 391ee: 0f 94 34 3b call 0x27668 ; 0x27668 #endif return result; } 391f2: 85 2d mov r24, r5 391f4: 26 96 adiw r28, 0x06 ; 6 391f6: 0f b6 in r0, 0x3f ; 63 391f8: f8 94 cli 391fa: de bf out 0x3e, r29 ; 62 391fc: 0f be out 0x3f, r0 ; 63 391fe: cd bf out 0x3d, r28 ; 61 39200: df 91 pop r29 39202: cf 91 pop r28 39204: 1f 91 pop r17 39206: 0f 91 pop r16 39208: ff 90 pop r15 3920a: ef 90 pop r14 3920c: df 90 pop r13 3920e: cf 90 pop r12 39210: bf 90 pop r11 39212: af 90 pop r10 39214: 9f 90 pop r9 39216: 8f 90 pop r8 39218: 7f 90 pop r7 3921a: 6f 90 pop r6 3921c: 5f 90 pop r5 3921e: 4f 90 pop r4 39220: 3f 90 pop r3 39222: 2f 90 pop r2 39224: 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) 39226: 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; 39228: 85 ec ldi r24, 0xC5 ; 197 3922a: e8 2e mov r14, r24 3922c: 8f e0 ldi r24, 0x0F ; 15 3922e: f8 2e mov r15, r24 39230: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 39232: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 39234: 9d 81 ldd r25, Y+5 ; 0x05 39236: 91 11 cpse r25, r1 39238: 03 c0 rjmp .+6 ; 0x39240 3923a: e9 81 ldd r30, Y+1 ; 0x01 3923c: ee 23 and r30, r30 3923e: 29 f1 breq .+74 ; 0x3928a continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 39240: 20 91 9e 13 lds r18, 0x139E ; 0x80139e 39244: 30 91 9f 13 lds r19, 0x139F ; 0x80139f 39248: 40 91 a0 13 lds r20, 0x13A0 ; 0x8013a0 3924c: 50 91 a1 13 lds r21, 0x13A1 ; 0x8013a1 39250: f6 01 movw r30, r12 39252: 61 81 ldd r22, Z+1 ; 0x01 39254: 72 81 ldd r23, Z+2 ; 0x02 39256: 83 81 ldd r24, Z+3 ; 0x03 39258: 94 81 ldd r25, Z+4 ; 0x04 3925a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 3925e: 20 e0 ldi r18, 0x00 ; 0 39260: 30 e0 ldi r19, 0x00 ; 0 39262: 48 ec ldi r20, 0xC8 ; 200 39264: 52 e4 ldi r21, 0x42 ; 66 39266: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3926a: 20 e0 ldi r18, 0x00 ; 0 3926c: 30 e0 ldi r19, 0x00 ; 0 3926e: 40 e0 ldi r20, 0x00 ; 0 39270: 5f e3 ldi r21, 0x3F ; 63 39272: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 39276: 0f 94 15 e0 call 0x3c02a ; 0x3c02a 3927a: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 3927e: c7 01 movw r24, r14 39280: 0f 94 88 dd call 0x3bb10 ; 0x3bb10 SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 39284: f2 e0 ldi r31, 0x02 ; 2 39286: ef 0e add r14, r31 39288: f1 1c adc r15, r1 3928a: 84 e0 ldi r24, 0x04 ; 4 3928c: c8 0e add r12, r24 3928e: d1 1c adc r13, r1 39290: 9d 81 ldd r25, Y+5 ; 0x05 39292: 9f 5f subi r25, 0xFF ; 255 39294: 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) { 39296: 93 30 cpi r25, 0x03 ; 3 39298: 69 f6 brne .-102 ; 0x39234 3929a: 04 5e subi r16, 0xE4 ; 228 3929c: 1f 4f sbci r17, 0xFF ; 255 3929e: e9 81 ldd r30, Y+1 ; 0x01 392a0: ef 5f subi r30, 0xFF ; 255 392a2: 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) 392a4: e3 30 cpi r30, 0x03 ; 3 392a6: 21 f6 brne .-120 ; 0x39230 #endif addr += 2; } } mbl.reset(); 392a8: 0f 94 d4 8b call 0x317a8 ; 0x317a8 go_home_with_z_lift(); 392ac: 0f 94 25 c7 call 0x38e4a ; 0x38e4a 392b0: 98 cf rjmp .-208 ; 0x391e2 000392b2 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 392b2: 82 e0 ldi r24, 0x02 ; 2 392b4: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 392b8: 60 93 48 07 sts 0x0748, r22 ; 0x800748 392bc: 70 93 49 07 sts 0x0749, r23 ; 0x800749 392c0: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 392c4: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_set_z_position(current_position[Z_AXIS]); 392c8: 88 e4 ldi r24, 0x48 ; 72 392ca: 97 e0 ldi r25, 0x07 ; 7 392cc: 0d 94 cc aa jmp 0x35598 ; 0x35598 000392d0 : * 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() { 392d0: 4f 92 push r4 392d2: 5f 92 push r5 392d4: 6f 92 push r6 392d6: 7f 92 push r7 392d8: 8f 92 push r8 392da: 9f 92 push r9 392dc: af 92 push r10 392de: bf 92 push r11 392e0: cf 92 push r12 392e2: df 92 push r13 392e4: ef 92 push r14 392e6: ff 92 push r15 392e8: 0f 93 push r16 392ea: 1f 93 push r17 392ec: cf 93 push r28 392ee: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 392f0: 00 e4 ldi r16, 0x40 ; 64 392f2: 17 e0 ldi r17, 0x07 ; 7 392f4: c0 ee ldi r28, 0xE0 ; 224 392f6: d7 e1 ldi r29, 0x17 ; 23 392f8: 28 81 ld r18, Y 392fa: 39 81 ldd r19, Y+1 ; 0x01 392fc: 4a 81 ldd r20, Y+2 ; 0x02 392fe: 5b 81 ldd r21, Y+3 ; 0x03 39300: f8 01 movw r30, r16 39302: 60 81 ld r22, Z 39304: 71 81 ldd r23, Z+1 ; 0x01 39306: 82 81 ldd r24, Z+2 ; 0x02 39308: 93 81 ldd r25, Z+3 ; 0x03 3930a: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 3930e: 4b 01 movw r8, r22 39310: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 39312: 2c 81 ldd r18, Y+4 ; 0x04 39314: 3d 81 ldd r19, Y+5 ; 0x05 39316: 4e 81 ldd r20, Y+6 ; 0x06 39318: 5f 81 ldd r21, Y+7 ; 0x07 3931a: f8 01 movw r30, r16 3931c: 64 81 ldd r22, Z+4 ; 0x04 3931e: 75 81 ldd r23, Z+5 ; 0x05 39320: 86 81 ldd r24, Z+6 ; 0x06 39322: 97 81 ldd r25, Z+7 ; 0x07 39324: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 39328: 6b 01 movw r12, r22 3932a: 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; 3932c: c0 ed ldi r28, 0xD0 ; 208 3932e: d7 e1 ldi r29, 0x17 ; 23 39330: 28 81 ld r18, Y 39332: 39 81 ldd r19, Y+1 ; 0x01 39334: 4a 81 ldd r20, Y+2 ; 0x02 39336: 5b 81 ldd r21, Y+3 ; 0x03 39338: c5 01 movw r24, r10 3933a: b4 01 movw r22, r8 3933c: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 39340: 2b 01 movw r4, r22 39342: 3c 01 movw r6, r24 39344: 2c 81 ldd r18, Y+4 ; 0x04 39346: 3d 81 ldd r19, Y+5 ; 0x05 39348: 4e 81 ldd r20, Y+6 ; 0x06 3934a: 5f 81 ldd r21, Y+7 ; 0x07 3934c: c7 01 movw r24, r14 3934e: b6 01 movw r22, r12 39350: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 39354: 9b 01 movw r18, r22 39356: ac 01 movw r20, r24 39358: c3 01 movw r24, r6 3935a: b2 01 movw r22, r4 3935c: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 39360: f8 01 movw r30, r16 39362: 60 83 st Z, r22 39364: 71 83 std Z+1, r23 ; 0x01 39366: 82 83 std Z+2, r24 ; 0x02 39368: 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; 3936a: 28 85 ldd r18, Y+8 ; 0x08 3936c: 39 85 ldd r19, Y+9 ; 0x09 3936e: 4a 85 ldd r20, Y+10 ; 0x0a 39370: 5b 85 ldd r21, Y+11 ; 0x0b 39372: c5 01 movw r24, r10 39374: b4 01 movw r22, r8 39376: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3937a: 4b 01 movw r8, r22 3937c: 5c 01 movw r10, r24 3937e: 2c 85 ldd r18, Y+12 ; 0x0c 39380: 3d 85 ldd r19, Y+13 ; 0x0d 39382: 4e 85 ldd r20, Y+14 ; 0x0e 39384: 5f 85 ldd r21, Y+15 ; 0x0f 39386: c7 01 movw r24, r14 39388: b6 01 movw r22, r12 3938a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3938e: 9b 01 movw r18, r22 39390: ac 01 movw r20, r24 39392: c5 01 movw r24, r10 39394: b4 01 movw r22, r8 39396: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3939a: f8 01 movw r30, r16 3939c: 64 83 std Z+4, r22 ; 0x04 3939e: 75 83 std Z+5, r23 ; 0x05 393a0: 86 83 std Z+6, r24 ; 0x06 393a2: 97 83 std Z+7, r25 ; 0x07 } 393a4: df 91 pop r29 393a6: cf 91 pop r28 393a8: 1f 91 pop r17 393aa: 0f 91 pop r16 393ac: ff 90 pop r15 393ae: ef 90 pop r14 393b0: df 90 pop r13 393b2: cf 90 pop r12 393b4: bf 90 pop r11 393b6: af 90 pop r10 393b8: 9f 90 pop r9 393ba: 8f 90 pop r8 393bc: 7f 90 pop r7 393be: 6f 90 pop r6 393c0: 5f 90 pop r5 393c2: 4f 90 pop r4 393c4: 08 95 ret 000393c6 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 393c6: 4f 92 push r4 393c8: 5f 92 push r5 393ca: 6f 92 push r6 393cc: 7f 92 push r7 393ce: 8f 92 push r8 393d0: 9f 92 push r9 393d2: af 92 push r10 393d4: bf 92 push r11 393d6: cf 92 push r12 393d8: df 92 push r13 393da: ef 92 push r14 393dc: ff 92 push r15 393de: 0f 93 push r16 393e0: 1f 93 push r17 393e2: cf 93 push r28 393e4: df 93 push r29 393e6: 00 d0 rcall .+0 ; 0x393e8 393e8: 00 d0 rcall .+0 ; 0x393ea 393ea: 1f 92 push r1 393ec: 1f 92 push r1 393ee: cd b7 in r28, 0x3d ; 61 393f0: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 393f2: dc 01 movw r26, r24 393f4: cd 90 ld r12, X+ 393f6: dd 90 ld r13, X+ 393f8: ed 90 ld r14, X+ 393fa: fc 90 ld r15, X 393fc: 13 97 sbiw r26, 0x03 ; 3 393fe: c0 92 b5 17 sts 0x17B5, r12 ; 0x8017b5 39402: d0 92 b6 17 sts 0x17B6, r13 ; 0x8017b6 39406: e0 92 b7 17 sts 0x17B7, r14 ; 0x8017b7 3940a: f0 92 b8 17 sts 0x17B8, r15 ; 0x8017b8 world2machine_rotation_and_skew[1][0] = vec_x[1]; 3940e: 14 96 adiw r26, 0x04 ; 4 39410: 0d 91 ld r16, X+ 39412: 1d 91 ld r17, X+ 39414: 2d 91 ld r18, X+ 39416: 3c 91 ld r19, X 39418: 17 97 sbiw r26, 0x07 ; 7 3941a: 09 83 std Y+1, r16 ; 0x01 3941c: 1a 83 std Y+2, r17 ; 0x02 3941e: 2b 83 std Y+3, r18 ; 0x03 39420: 3c 83 std Y+4, r19 ; 0x04 39422: 00 93 bd 17 sts 0x17BD, r16 ; 0x8017bd 39426: 10 93 be 17 sts 0x17BE, r17 ; 0x8017be 3942a: 20 93 bf 17 sts 0x17BF, r18 ; 0x8017bf 3942e: 30 93 c0 17 sts 0x17C0, r19 ; 0x8017c0 world2machine_rotation_and_skew[0][1] = vec_y[0]; 39432: db 01 movw r26, r22 39434: 0d 91 ld r16, X+ 39436: 1d 91 ld r17, X+ 39438: 2d 91 ld r18, X+ 3943a: 3c 91 ld r19, X 3943c: 13 97 sbiw r26, 0x03 ; 3 3943e: 0d 83 std Y+5, r16 ; 0x05 39440: 1e 83 std Y+6, r17 ; 0x06 39442: 2f 83 std Y+7, r18 ; 0x07 39444: 38 87 std Y+8, r19 ; 0x08 39446: 00 93 b9 17 sts 0x17B9, r16 ; 0x8017b9 3944a: 10 93 ba 17 sts 0x17BA, r17 ; 0x8017ba 3944e: 20 93 bb 17 sts 0x17BB, r18 ; 0x8017bb 39452: 30 93 bc 17 sts 0x17BC, r19 ; 0x8017bc world2machine_rotation_and_skew[1][1] = vec_y[1]; 39456: 14 96 adiw r26, 0x04 ; 4 39458: 4d 90 ld r4, X+ 3945a: 5d 90 ld r5, X+ 3945c: 6d 90 ld r6, X+ 3945e: 7c 90 ld r7, X 39460: 17 97 sbiw r26, 0x07 ; 7 39462: 40 92 c1 17 sts 0x17C1, r4 ; 0x8017c1 39466: 50 92 c2 17 sts 0x17C2, r5 ; 0x8017c2 3946a: 60 92 c3 17 sts 0x17C3, r6 ; 0x8017c3 3946e: 70 92 c4 17 sts 0x17C4, r7 ; 0x8017c4 world2machine_shift[0] = cntr[0]; 39472: fa 01 movw r30, r20 39474: 60 81 ld r22, Z 39476: 71 81 ldd r23, Z+1 ; 0x01 39478: 82 81 ldd r24, Z+2 ; 0x02 3947a: 93 81 ldd r25, Z+3 ; 0x03 3947c: 60 93 e0 17 sts 0x17E0, r22 ; 0x8017e0 39480: 70 93 e1 17 sts 0x17E1, r23 ; 0x8017e1 39484: 80 93 e2 17 sts 0x17E2, r24 ; 0x8017e2 39488: 90 93 e3 17 sts 0x17E3, r25 ; 0x8017e3 world2machine_shift[1] = cntr[1]; 3948c: 84 80 ldd r8, Z+4 ; 0x04 3948e: 95 80 ldd r9, Z+5 ; 0x05 39490: a6 80 ldd r10, Z+6 ; 0x06 39492: b7 80 ldd r11, Z+7 ; 0x07 39494: 80 92 e4 17 sts 0x17E4, r8 ; 0x8017e4 39498: 90 92 e5 17 sts 0x17E5, r9 ; 0x8017e5 3949c: a0 92 e6 17 sts 0x17E6, r10 ; 0x8017e6 394a0: b0 92 e7 17 sts 0x17E7, r11 ; 0x8017e7 // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 394a4: 20 e0 ldi r18, 0x00 ; 0 394a6: 30 e0 ldi r19, 0x00 ; 0 394a8: a9 01 movw r20, r18 394aa: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 394ae: 81 11 cpse r24, r1 394b0: aa c0 rjmp .+340 ; 0x39606 394b2: 20 e0 ldi r18, 0x00 ; 0 394b4: 30 e0 ldi r19, 0x00 ; 0 394b6: a9 01 movw r20, r18 394b8: c5 01 movw r24, r10 394ba: b4 01 movw r22, r8 394bc: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 394c0: 81 11 cpse r24, r1 394c2: a1 c0 rjmp .+322 ; 0x39606 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; 394c4: 10 92 e8 17 sts 0x17E8, r1 ; 0x8017e8 if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) // Shift correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SHIFT; if (world2machine_rotation_and_skew[0][0] != 1.f || world2machine_rotation_and_skew[0][1] != 0.f || 394c8: 20 e0 ldi r18, 0x00 ; 0 394ca: 30 e0 ldi r19, 0x00 ; 0 394cc: 40 e8 ldi r20, 0x80 ; 128 394ce: 5f e3 ldi r21, 0x3F ; 63 394d0: c7 01 movw r24, r14 394d2: b6 01 movw r22, r12 394d4: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 394d8: 81 11 cpse r24, r1 394da: 21 c0 rjmp .+66 ; 0x3951e 394dc: 20 e0 ldi r18, 0x00 ; 0 394de: 30 e0 ldi r19, 0x00 ; 0 394e0: a9 01 movw r20, r18 394e2: 6d 81 ldd r22, Y+5 ; 0x05 394e4: 7e 81 ldd r23, Y+6 ; 0x06 394e6: 8f 81 ldd r24, Y+7 ; 0x07 394e8: 98 85 ldd r25, Y+8 ; 0x08 394ea: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 394ee: 81 11 cpse r24, r1 394f0: 16 c0 rjmp .+44 ; 0x3951e 394f2: 20 e0 ldi r18, 0x00 ; 0 394f4: 30 e0 ldi r19, 0x00 ; 0 394f6: a9 01 movw r20, r18 394f8: 69 81 ldd r22, Y+1 ; 0x01 394fa: 7a 81 ldd r23, Y+2 ; 0x02 394fc: 8b 81 ldd r24, Y+3 ; 0x03 394fe: 9c 81 ldd r25, Y+4 ; 0x04 39500: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 39504: 81 11 cpse r24, r1 39506: 0b c0 rjmp .+22 ; 0x3951e world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 39508: 20 e0 ldi r18, 0x00 ; 0 3950a: 30 e0 ldi r19, 0x00 ; 0 3950c: 40 e8 ldi r20, 0x80 ; 128 3950e: 5f e3 ldi r21, 0x3F ; 63 39510: c3 01 movw r24, r6 39512: b2 01 movw r22, r4 39514: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 39518: 88 23 and r24, r24 3951a: 09 f4 brne .+2 ; 0x3951e 3951c: 78 c0 rjmp .+240 ; 0x3960e // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 3951e: 80 91 e8 17 lds r24, 0x17E8 ; 0x8017e8 39522: 82 60 ori r24, 0x02 ; 2 39524: 80 93 e8 17 sts 0x17E8, r24 ; 0x8017e8 // Invert the world2machine matrix. float d = world2machine_rotation_and_skew[0][0] * world2machine_rotation_and_skew[1][1] - world2machine_rotation_and_skew[1][0] * world2machine_rotation_and_skew[0][1]; 39528: a3 01 movw r20, r6 3952a: 92 01 movw r18, r4 3952c: c7 01 movw r24, r14 3952e: b6 01 movw r22, r12 39530: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 39534: 4b 01 movw r8, r22 39536: 5c 01 movw r10, r24 39538: 2d 81 ldd r18, Y+5 ; 0x05 3953a: 3e 81 ldd r19, Y+6 ; 0x06 3953c: 4f 81 ldd r20, Y+7 ; 0x07 3953e: 58 85 ldd r21, Y+8 ; 0x08 39540: 69 81 ldd r22, Y+1 ; 0x01 39542: 7a 81 ldd r23, Y+2 ; 0x02 39544: 8b 81 ldd r24, Y+3 ; 0x03 39546: 9c 81 ldd r25, Y+4 ; 0x04 39548: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3954c: 9b 01 movw r18, r22 3954e: ac 01 movw r20, r24 39550: c5 01 movw r24, r10 39552: b4 01 movw r22, r8 39554: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 39558: 4b 01 movw r8, r22 3955a: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 3955c: ac 01 movw r20, r24 3955e: 9b 01 movw r18, r22 39560: c3 01 movw r24, r6 39562: b2 01 movw r22, r4 39564: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 39568: 60 93 d0 17 sts 0x17D0, r22 ; 0x8017d0 3956c: 70 93 d1 17 sts 0x17D1, r23 ; 0x8017d1 39570: 80 93 d2 17 sts 0x17D2, r24 ; 0x8017d2 39574: 90 93 d3 17 sts 0x17D3, r25 ; 0x8017d3 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 39578: 6d 81 ldd r22, Y+5 ; 0x05 3957a: 7e 81 ldd r23, Y+6 ; 0x06 3957c: 8f 81 ldd r24, Y+7 ; 0x07 3957e: 98 85 ldd r25, Y+8 ; 0x08 39580: 90 58 subi r25, 0x80 ; 128 39582: a5 01 movw r20, r10 39584: 94 01 movw r18, r8 39586: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 3958a: 60 93 d4 17 sts 0x17D4, r22 ; 0x8017d4 3958e: 70 93 d5 17 sts 0x17D5, r23 ; 0x8017d5 39592: 80 93 d6 17 sts 0x17D6, r24 ; 0x8017d6 39596: 90 93 d7 17 sts 0x17D7, r25 ; 0x8017d7 world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 3959a: 69 81 ldd r22, Y+1 ; 0x01 3959c: 7a 81 ldd r23, Y+2 ; 0x02 3959e: 8b 81 ldd r24, Y+3 ; 0x03 395a0: 9c 81 ldd r25, Y+4 ; 0x04 395a2: 90 58 subi r25, 0x80 ; 128 395a4: a5 01 movw r20, r10 395a6: 94 01 movw r18, r8 395a8: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 395ac: 60 93 d8 17 sts 0x17D8, r22 ; 0x8017d8 395b0: 70 93 d9 17 sts 0x17D9, r23 ; 0x8017d9 395b4: 80 93 da 17 sts 0x17DA, r24 ; 0x8017da 395b8: 90 93 db 17 sts 0x17DB, r25 ; 0x8017db world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 395bc: a5 01 movw r20, r10 395be: 94 01 movw r18, r8 395c0: c7 01 movw r24, r14 395c2: b6 01 movw r22, r12 395c4: 0f 94 6d df call 0x3beda ; 0x3beda <__divsf3> 395c8: 60 93 dc 17 sts 0x17DC, r22 ; 0x8017dc 395cc: 70 93 dd 17 sts 0x17DD, r23 ; 0x8017dd 395d0: 80 93 de 17 sts 0x17DE, r24 ; 0x8017de 395d4: 90 93 df 17 sts 0x17DF, r25 ; 0x8017df world2machine_rotation_and_skew_inv[0][0] = 1.f; world2machine_rotation_and_skew_inv[0][1] = 0.f; world2machine_rotation_and_skew_inv[1][0] = 0.f; world2machine_rotation_and_skew_inv[1][1] = 1.f; } } 395d8: 28 96 adiw r28, 0x08 ; 8 395da: 0f b6 in r0, 0x3f ; 63 395dc: f8 94 cli 395de: de bf out 0x3e, r29 ; 62 395e0: 0f be out 0x3f, r0 ; 63 395e2: cd bf out 0x3d, r28 ; 61 395e4: df 91 pop r29 395e6: cf 91 pop r28 395e8: 1f 91 pop r17 395ea: 0f 91 pop r16 395ec: ff 90 pop r15 395ee: ef 90 pop r14 395f0: df 90 pop r13 395f2: cf 90 pop r12 395f4: bf 90 pop r11 395f6: af 90 pop r10 395f8: 9f 90 pop r9 395fa: 8f 90 pop r8 395fc: 7f 90 pop r7 395fe: 6f 90 pop r6 39600: 5f 90 pop r5 39602: 4f 90 pop r4 39604: 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; 39606: 81 e0 ldi r24, 0x01 ; 1 39608: 80 93 e8 17 sts 0x17E8, r24 ; 0x8017e8 3960c: 5d cf rjmp .-326 ; 0x394c8 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; 3960e: 80 e0 ldi r24, 0x00 ; 0 39610: 90 e0 ldi r25, 0x00 ; 0 39612: a0 e8 ldi r26, 0x80 ; 128 39614: bf e3 ldi r27, 0x3F ; 63 39616: 80 93 d0 17 sts 0x17D0, r24 ; 0x8017d0 3961a: 90 93 d1 17 sts 0x17D1, r25 ; 0x8017d1 3961e: a0 93 d2 17 sts 0x17D2, r26 ; 0x8017d2 39622: b0 93 d3 17 sts 0x17D3, r27 ; 0x8017d3 world2machine_rotation_and_skew_inv[0][1] = 0.f; 39626: 10 92 d4 17 sts 0x17D4, r1 ; 0x8017d4 3962a: 10 92 d5 17 sts 0x17D5, r1 ; 0x8017d5 3962e: 10 92 d6 17 sts 0x17D6, r1 ; 0x8017d6 39632: 10 92 d7 17 sts 0x17D7, r1 ; 0x8017d7 world2machine_rotation_and_skew_inv[1][0] = 0.f; 39636: 10 92 d8 17 sts 0x17D8, r1 ; 0x8017d8 3963a: 10 92 d9 17 sts 0x17D9, r1 ; 0x8017d9 3963e: 10 92 da 17 sts 0x17DA, r1 ; 0x8017da 39642: 10 92 db 17 sts 0x17DB, r1 ; 0x8017db world2machine_rotation_and_skew_inv[1][1] = 1.f; 39646: 80 93 dc 17 sts 0x17DC, r24 ; 0x8017dc 3964a: 90 93 dd 17 sts 0x17DD, r25 ; 0x8017dd 3964e: a0 93 de 17 sts 0x17DE, r26 ; 0x8017de 39652: b0 93 df 17 sts 0x17DF, r27 ; 0x8017df 39656: c0 cf rjmp .-128 ; 0x395d8 00039658 : * * 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() { 39658: cf 93 push r28 3965a: df 93 push r29 3965c: cd b7 in r28, 0x3d ; 61 3965e: de b7 in r29, 0x3e ; 62 39660: 68 97 sbiw r28, 0x18 ; 24 39662: 0f b6 in r0, 0x3f ; 63 39664: f8 94 cli 39666: de bf out 0x3e, r29 ; 62 39668: 0f be out 0x3f, r0 ; 63 3966a: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 3966c: 80 e0 ldi r24, 0x00 ; 0 3966e: 90 e0 ldi r25, 0x00 ; 0 39670: a0 e8 ldi r26, 0x80 ; 128 39672: bf e3 ldi r27, 0x3F ; 63 39674: 89 83 std Y+1, r24 ; 0x01 39676: 9a 83 std Y+2, r25 ; 0x02 39678: ab 83 std Y+3, r26 ; 0x03 3967a: bc 83 std Y+4, r27 ; 0x04 3967c: 1d 82 std Y+5, r1 ; 0x05 3967e: 1e 82 std Y+6, r1 ; 0x06 39680: 1f 82 std Y+7, r1 ; 0x07 39682: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 39684: 19 86 std Y+9, r1 ; 0x09 39686: 1a 86 std Y+10, r1 ; 0x0a 39688: 1b 86 std Y+11, r1 ; 0x0b 3968a: 1c 86 std Y+12, r1 ; 0x0c 3968c: 8d 87 std Y+13, r24 ; 0x0d 3968e: 9e 87 std Y+14, r25 ; 0x0e 39690: af 87 std Y+15, r26 ; 0x0f 39692: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 39694: 19 8a std Y+17, r1 ; 0x11 39696: 1a 8a std Y+18, r1 ; 0x12 39698: 1b 8a std Y+19, r1 ; 0x13 3969a: 1c 8a std Y+20, r1 ; 0x14 3969c: 1d 8a std Y+21, r1 ; 0x15 3969e: 1e 8a std Y+22, r1 ; 0x16 396a0: 1f 8a std Y+23, r1 ; 0x17 396a2: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 396a4: ae 01 movw r20, r28 396a6: 4f 5e subi r20, 0xEF ; 239 396a8: 5f 4f sbci r21, 0xFF ; 255 396aa: be 01 movw r22, r28 396ac: 67 5f subi r22, 0xF7 ; 247 396ae: 7f 4f sbci r23, 0xFF ; 255 396b0: ce 01 movw r24, r28 396b2: 01 96 adiw r24, 0x01 ; 1 396b4: 0f 94 e3 c9 call 0x393c6 ; 0x393c6 } 396b8: 68 96 adiw r28, 0x18 ; 24 396ba: 0f b6 in r0, 0x3f ; 63 396bc: f8 94 cli 396be: de bf out 0x3e, r29 ; 62 396c0: 0f be out 0x3f, r0 ; 63 396c2: cd bf out 0x3d, r28 ; 61 396c4: df 91 pop r29 396c6: cf 91 pop r28 396c8: 08 95 ret 000396ca : * * 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) { 396ca: 80 91 e8 17 lds r24, 0x17E8 ; 0x8017e8 396ce: 88 23 and r24, r24 396d0: d1 f0 breq .+52 ; 0x39706 world2machine_reset(); 396d2: 0f 94 2c cb call 0x39658 ; 0x39658 st_synchronize(); 396d6: 0f 94 e1 58 call 0x2b1c2 ; 0x2b1c2 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 396da: 80 e0 ldi r24, 0x00 ; 0 396dc: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 396e0: 60 93 40 07 sts 0x0740, r22 ; 0x800740 396e4: 70 93 41 07 sts 0x0741, r23 ; 0x800741 396e8: 80 93 42 07 sts 0x0742, r24 ; 0x800742 396ec: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 396f0: 81 e0 ldi r24, 0x01 ; 1 396f2: 0f 94 cd 58 call 0x2b19a ; 0x2b19a 396f6: 60 93 44 07 sts 0x0744, r22 ; 0x800744 396fa: 70 93 45 07 sts 0x0745, r23 ; 0x800745 396fe: 80 93 46 07 sts 0x0746, r24 ; 0x800746 39702: 90 93 47 07 sts 0x0747, r25 ; 0x800747 } } 39706: 08 95 ret 00039708 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 39708: 4f ef ldi r20, 0xFF ; 255 3970a: 5f ef ldi r21, 0xFF ; 255 3970c: ba 01 movw r22, r20 3970e: 85 ee ldi r24, 0xE5 ; 229 39710: 9f e0 ldi r25, 0x0F ; 15 39712: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 39716: 4f ef ldi r20, 0xFF ; 255 39718: 5f ef ldi r21, 0xFF ; 255 3971a: ba 01 movw r22, r20 3971c: 89 ee ldi r24, 0xE9 ; 233 3971e: 9f e0 ldi r25, 0x0F ; 15 39720: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 39724: 4f ef ldi r20, 0xFF ; 255 39726: 5f ef ldi r21, 0xFF ; 255 39728: ba 01 movw r22, r20 3972a: 8d ed ldi r24, 0xDD ; 221 3972c: 9f e0 ldi r25, 0x0F ; 15 3972e: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 39732: 4f ef ldi r20, 0xFF ; 255 39734: 5f ef ldi r21, 0xFF ; 255 39736: ba 01 movw r22, r20 39738: 81 ee ldi r24, 0xE1 ; 225 3973a: 9f e0 ldi r25, 0x0F ; 15 3973c: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 39740: 4f ef ldi r20, 0xFF ; 255 39742: 5f ef ldi r21, 0xFF ; 255 39744: ba 01 movw r22, r20 39746: 85 ed ldi r24, 0xD5 ; 213 39748: 9f e0 ldi r25, 0x0F ; 15 3974a: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 3974e: 4f ef ldi r20, 0xFF ; 255 39750: 5f ef ldi r21, 0xFF ; 255 39752: ba 01 movw r22, r20 39754: 89 ed ldi r24, 0xD9 ; 217 39756: 9f e0 ldi r25, 0x0F ; 15 39758: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 3975c: 4f ef ldi r20, 0xFF ; 255 3975e: 5f ef ldi r21, 0xFF ; 255 39760: ba 01 movw r22, r20 39762: 85 ec ldi r24, 0xC5 ; 197 39764: 9f e0 ldi r25, 0x0F ; 15 39766: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 3976a: 4f ef ldi r20, 0xFF ; 255 3976c: 5f ef ldi r21, 0xFF ; 255 3976e: ba 01 movw r22, r20 39770: 89 ec ldi r24, 0xC9 ; 201 39772: 9f e0 ldi r25, 0x0F ; 15 39774: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 39778: 4f ef ldi r20, 0xFF ; 255 3977a: 5f ef ldi r21, 0xFF ; 255 3977c: ba 01 movw r22, r20 3977e: 8d ec ldi r24, 0xCD ; 205 39780: 9f e0 ldi r25, 0x0F ; 15 39782: 0f 94 7c dd call 0x3baf8 ; 0x3baf8 39786: 4f ef ldi r20, 0xFF ; 255 39788: 5f ef ldi r21, 0xFF ; 255 3978a: ba 01 movw r22, r20 3978c: 81 ed ldi r24, 0xD1 ; 209 3978e: 9f e0 ldi r25, 0x0F ; 15 39790: 0d 94 7c dd jmp 0x3baf8 ; 0x3baf8 00039794 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 39794: 4f 92 push r4 39796: 5f 92 push r5 39798: 6f 92 push r6 3979a: 7f 92 push r7 3979c: 8f 92 push r8 3979e: 9f 92 push r9 397a0: af 92 push r10 397a2: bf 92 push r11 397a4: cf 92 push r12 397a6: df 92 push r13 397a8: ef 92 push r14 397aa: ff 92 push r15 397ac: 1f 93 push r17 397ae: cf 93 push r28 397b0: df 93 push r29 397b2: cd b7 in r28, 0x3d ; 61 397b4: de b7 in r29, 0x3e ; 62 397b6: a8 97 sbiw r28, 0x28 ; 40 397b8: 0f b6 in r0, 0x3f ; 63 397ba: f8 94 cli 397bc: de bf out 0x3e, r29 ; 62 397be: 0f be out 0x3f, r0 ; 63 397c0: 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); 397c2: 48 e0 ldi r20, 0x08 ; 8 397c4: 50 e0 ldi r21, 0x00 ; 0 397c6: 6d ed ldi r22, 0xDD ; 221 397c8: 7f e0 ldi r23, 0x0F ; 15 397ca: ce 01 movw r24, r28 397cc: 01 96 adiw r24, 0x01 ; 1 397ce: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 397d2: 48 e0 ldi r20, 0x08 ; 8 397d4: 50 e0 ldi r21, 0x00 ; 0 397d6: 65 ed ldi r22, 0xD5 ; 213 397d8: 7f e0 ldi r23, 0x0F ; 15 397da: ce 01 movw r24, r28 397dc: 09 96 adiw r24, 0x09 ; 9 397de: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 397e2: 48 e0 ldi r20, 0x08 ; 8 397e4: 50 e0 ldi r21, 0x00 ; 0 397e6: 65 ee ldi r22, 0xE5 ; 229 397e8: 7f e0 ldi r23, 0x0F ; 15 397ea: ce 01 movw r24, r28 397ec: 41 96 adiw r24, 0x11 ; 17 397ee: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 397f2: 89 89 ldd r24, Y+17 ; 0x11 397f4: 9a 89 ldd r25, Y+18 ; 0x12 397f6: ab 89 ldd r26, Y+19 ; 0x13 397f8: bc 89 ldd r27, Y+20 ; 0x14 397fa: 89 a3 std Y+33, r24 ; 0x21 397fc: 9a a3 std Y+34, r25 ; 0x22 397fe: ab a3 std Y+35, r26 ; 0x23 39800: bc a3 std Y+36, r27 ; 0x24 39802: 8f 3f cpi r24, 0xFF ; 255 39804: 9f 4f sbci r25, 0xFF ; 255 39806: af 4f sbci r26, 0xFF ; 255 39808: bf 4f sbci r27, 0xFF ; 255 3980a: 09 f4 brne .+2 ; 0x3980e 3980c: b1 c0 rjmp .+354 ; 0x39970 3980e: 8d 89 ldd r24, Y+21 ; 0x15 39810: 9e 89 ldd r25, Y+22 ; 0x16 39812: af 89 ldd r26, Y+23 ; 0x17 39814: b8 8d ldd r27, Y+24 ; 0x18 39816: 8d a3 std Y+37, r24 ; 0x25 39818: 9e a3 std Y+38, r25 ; 0x26 3981a: af a3 std Y+39, r26 ; 0x27 3981c: b8 a7 std Y+40, r27 ; 0x28 3981e: 8f 3f cpi r24, 0xFF ; 255 39820: 9f 4f sbci r25, 0xFF ; 255 39822: af 4f sbci r26, 0xFF ; 255 39824: bf 4f sbci r27, 0xFF ; 255 39826: 09 f4 brne .+2 ; 0x3982a 39828: a3 c0 rjmp .+326 ; 0x39970 3982a: 89 80 ldd r8, Y+1 ; 0x01 3982c: 9a 80 ldd r9, Y+2 ; 0x02 3982e: ab 80 ldd r10, Y+3 ; 0x03 39830: bc 80 ldd r11, Y+4 ; 0x04 39832: 8f ef ldi r24, 0xFF ; 255 39834: 88 16 cp r8, r24 39836: 98 06 cpc r9, r24 39838: a8 06 cpc r10, r24 3983a: b8 06 cpc r11, r24 3983c: 09 f4 brne .+2 ; 0x39840 3983e: 98 c0 rjmp .+304 ; 0x39970 39840: 8d 81 ldd r24, Y+5 ; 0x05 39842: 9e 81 ldd r25, Y+6 ; 0x06 39844: af 81 ldd r26, Y+7 ; 0x07 39846: b8 85 ldd r27, Y+8 ; 0x08 39848: 89 8f std Y+25, r24 ; 0x19 3984a: 9a 8f std Y+26, r25 ; 0x1a 3984c: ab 8f std Y+27, r26 ; 0x1b 3984e: bc 8f std Y+28, r27 ; 0x1c 39850: 8f 3f cpi r24, 0xFF ; 255 39852: 9f 4f sbci r25, 0xFF ; 255 39854: af 4f sbci r26, 0xFF ; 255 39856: bf 4f sbci r27, 0xFF ; 255 39858: 09 f4 brne .+2 ; 0x3985c 3985a: 8a c0 rjmp .+276 ; 0x39970 3985c: c9 84 ldd r12, Y+9 ; 0x09 3985e: da 84 ldd r13, Y+10 ; 0x0a 39860: eb 84 ldd r14, Y+11 ; 0x0b 39862: fc 84 ldd r15, Y+12 ; 0x0c 39864: 8f ef ldi r24, 0xFF ; 255 39866: c8 16 cp r12, r24 39868: d8 06 cpc r13, r24 3986a: e8 06 cpc r14, r24 3986c: f8 06 cpc r15, r24 3986e: 09 f4 brne .+2 ; 0x39872 39870: 7f c0 rjmp .+254 ; 0x39970 39872: 8d 85 ldd r24, Y+13 ; 0x0d 39874: 9e 85 ldd r25, Y+14 ; 0x0e 39876: af 85 ldd r26, Y+15 ; 0x0f 39878: b8 89 ldd r27, Y+16 ; 0x10 3987a: 8d 8f std Y+29, r24 ; 0x1d 3987c: 9e 8f std Y+30, r25 ; 0x1e 3987e: af 8f std Y+31, r26 ; 0x1f 39880: b8 a3 std Y+32, r27 ; 0x20 39882: 8f 3f cpi r24, 0xFF ; 255 39884: 9f 4f sbci r25, 0xFF ; 255 39886: af 4f sbci r26, 0xFF ; 255 39888: bf 4f sbci r27, 0xFF ; 255 3988a: 09 f4 brne .+2 ; 0x3988e 3988c: 71 c0 rjmp .+226 ; 0x39970 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 3988e: 29 8d ldd r18, Y+25 ; 0x19 39890: 3a 8d ldd r19, Y+26 ; 0x1a 39892: 4b 8d ldd r20, Y+27 ; 0x1b 39894: 5c 8d ldd r21, Y+28 ; 0x1c 39896: c5 01 movw r24, r10 39898: b4 01 movw r22, r8 3989a: 0f 94 0a e1 call 0x3c214 ; 0x3c214 3989e: 2b 01 movw r4, r22 398a0: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 398a2: 26 e6 ldi r18, 0x66 ; 102 398a4: 36 e6 ldi r19, 0x66 ; 102 398a6: 46 e6 ldi r20, 0x66 ; 102 398a8: 5f e3 ldi r21, 0x3F ; 63 398aa: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__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; 398ae: 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) 398b0: 87 fd sbrc r24, 7 398b2: 0b c0 rjmp .+22 ; 0x398ca 398b4: 2d ec ldi r18, 0xCD ; 205 398b6: 3c ec ldi r19, 0xCC ; 204 398b8: 4c e8 ldi r20, 0x8C ; 140 398ba: 5f e3 ldi r21, 0x3F ; 63 398bc: c3 01 movw r24, r6 398be: b2 01 movw r22, r4 398c0: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 398c4: 18 16 cp r1, r24 398c6: 0c f0 brlt .+2 ; 0x398ca 398c8: 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]); 398ca: 2d 8d ldd r18, Y+29 ; 0x1d 398cc: 3e 8d ldd r19, Y+30 ; 0x1e 398ce: 4f 8d ldd r20, Y+31 ; 0x1f 398d0: 58 a1 ldd r21, Y+32 ; 0x20 398d2: c7 01 movw r24, r14 398d4: b6 01 movw r22, r12 398d6: 0f 94 0a e1 call 0x3c214 ; 0x3c214 398da: 2b 01 movw r4, r22 398dc: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 398de: 26 e6 ldi r18, 0x66 ; 102 398e0: 36 e6 ldi r19, 0x66 ; 102 398e2: 46 e6 ldi r20, 0x66 ; 102 398e4: 5f e3 ldi r21, 0x3F ; 63 398e6: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 398ea: 87 fd sbrc r24, 7 398ec: 7f c0 rjmp .+254 ; 0x399ec 398ee: 2d ec ldi r18, 0xCD ; 205 398f0: 3c ec ldi r19, 0xCC ; 204 398f2: 4c e8 ldi r20, 0x8C ; 140 398f4: 5f e3 ldi r21, 0x3F ; 63 398f6: c3 01 movw r24, r6 398f8: b2 01 movw r22, r4 398fa: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 398fe: 18 16 cp r1, r24 39900: 0c f4 brge .+2 ; 0x39904 39902: 74 c0 rjmp .+232 ; 0x399ec 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]); 39904: 2d a1 ldd r18, Y+37 ; 0x25 39906: 3e a1 ldd r19, Y+38 ; 0x26 39908: 4f a1 ldd r20, Y+39 ; 0x27 3990a: 58 a5 ldd r21, Y+40 ; 0x28 3990c: 69 a1 ldd r22, Y+33 ; 0x21 3990e: 7a a1 ldd r23, Y+34 ; 0x22 39910: 8b a1 ldd r24, Y+35 ; 0x23 39912: 9c a1 ldd r25, Y+36 ; 0x24 39914: 0f 94 0a e1 call 0x3c214 ; 0x3c214 if (l > 15.f) 39918: 20 e0 ldi r18, 0x00 ; 0 3991a: 30 e0 ldi r19, 0x00 ; 0 3991c: 40 e7 ldi r20, 0x70 ; 112 3991e: 51 e4 ldi r21, 0x41 ; 65 39920: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 39924: 18 16 cp r1, r24 39926: 0c f4 brge .+2 ; 0x3992a #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 39928: 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]; 3992a: a5 01 movw r20, r10 3992c: 94 01 movw r18, r8 3992e: c7 01 movw r24, r14 39930: b6 01 movw r22, r12 39932: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 39936: 6b 01 movw r12, r22 39938: 7c 01 movw r14, r24 3993a: 2d 8d ldd r18, Y+29 ; 0x1d 3993c: 3e 8d ldd r19, Y+30 ; 0x1e 3993e: 4f 8d ldd r20, Y+31 ; 0x1f 39940: 58 a1 ldd r21, Y+32 ; 0x20 39942: 69 8d ldd r22, Y+25 ; 0x19 39944: 7a 8d ldd r23, Y+26 ; 0x1a 39946: 8b 8d ldd r24, Y+27 ; 0x1b 39948: 9c 8d ldd r25, Y+28 ; 0x1c 3994a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3994e: 9b 01 movw r18, r22 39950: ac 01 movw r20, r24 39952: c7 01 movw r24, r14 39954: b6 01 movw r22, r12 39956: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> if (fabs(l) > 0.1f) 3995a: 9f 77 andi r25, 0x7F ; 127 3995c: 2d ec ldi r18, 0xCD ; 205 3995e: 3c ec ldi r19, 0xCC ; 204 39960: 4c ec ldi r20, 0xCC ; 204 39962: 5d e3 ldi r21, 0x3D ; 61 39964: 0f 94 f7 e0 call 0x3c1ee ; 0x3c1ee <__gesf2> 39968: 18 16 cp r1, r24 3996a: 14 f0 brlt .+4 ; 0x39970 #endif reset = true; } } if (reset) 3996c: 11 23 and r17, r17 3996e: f1 f0 breq .+60 ; 0x399ac { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 39970: 0f 94 84 cb call 0x39708 ; 0x39708 * @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; 39974: 80 e0 ldi r24, 0x00 ; 0 39976: 90 e0 ldi r25, 0x00 ; 0 39978: a0 e8 ldi r26, 0x80 ; 128 3997a: bf e3 ldi r27, 0x3F ; 63 3997c: 89 83 std Y+1, r24 ; 0x01 3997e: 9a 83 std Y+2, r25 ; 0x02 39980: ab 83 std Y+3, r26 ; 0x03 39982: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 39984: 1d 82 std Y+5, r1 ; 0x05 39986: 1e 82 std Y+6, r1 ; 0x06 39988: 1f 82 std Y+7, r1 ; 0x07 3998a: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 3998c: 19 86 std Y+9, r1 ; 0x09 3998e: 1a 86 std Y+10, r1 ; 0x0a 39990: 1b 86 std Y+11, r1 ; 0x0b 39992: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 39994: 8d 87 std Y+13, r24 ; 0x0d 39996: 9e 87 std Y+14, r25 ; 0x0e 39998: af 87 std Y+15, r26 ; 0x0f 3999a: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 3999c: 19 8a std Y+17, r1 ; 0x11 3999e: 1a 8a std Y+18, r1 ; 0x12 399a0: 1b 8a std Y+19, r1 ; 0x13 399a2: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 399a4: 1d 8a std Y+21, r1 ; 0x15 399a6: 1e 8a std Y+22, r1 ; 0x16 399a8: 1f 8a std Y+23, r1 ; 0x17 399aa: 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); 399ac: ae 01 movw r20, r28 399ae: 4f 5e subi r20, 0xEF ; 239 399b0: 5f 4f sbci r21, 0xFF ; 255 399b2: be 01 movw r22, r28 399b4: 67 5f subi r22, 0xF7 ; 247 399b6: 7f 4f sbci r23, 0xFF ; 255 399b8: ce 01 movw r24, r28 399ba: 01 96 adiw r24, 0x01 ; 1 399bc: 0f 94 e3 c9 call 0x393c6 ; 0x393c6 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 399c0: a8 96 adiw r28, 0x28 ; 40 399c2: 0f b6 in r0, 0x3f ; 63 399c4: f8 94 cli 399c6: de bf out 0x3e, r29 ; 62 399c8: 0f be out 0x3f, r0 ; 63 399ca: cd bf out 0x3d, r28 ; 61 399cc: df 91 pop r29 399ce: cf 91 pop r28 399d0: 1f 91 pop r17 399d2: ff 90 pop r15 399d4: ef 90 pop r14 399d6: df 90 pop r13 399d8: cf 90 pop r12 399da: bf 90 pop r11 399dc: af 90 pop r10 399de: 9f 90 pop r9 399e0: 8f 90 pop r8 399e2: 7f 90 pop r7 399e4: 6f 90 pop r6 399e6: 5f 90 pop r5 399e8: 4f 90 pop r4 399ea: 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; 399ec: 11 e0 ldi r17, 0x01 ; 1 399ee: 8a cf rjmp .-236 ; 0x39904 000399f0 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 399f0: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 399f2: 24 e1 ldi r18, 0x14 ; 20 399f4: ac 01 movw r20, r24 399f6: 24 9f mul r18, r20 399f8: c0 01 movw r24, r0 399fa: 25 9f mul r18, r21 399fc: 90 0d add r25, r0 399fe: 11 24 eor r1, r1 39a00: 60 91 b3 17 lds r22, 0x17B3 ; 0x8017b3 39a04: 70 91 b4 17 lds r23, 0x17B4 ; 0x8017b4 39a08: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 39a0c: c6 2f mov r28, r22 39a0e: 65 31 cpi r22, 0x15 ; 21 39a10: 08 f0 brcs .+2 ; 0x39a14 39a12: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 39a14: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 39a18: 8c 17 cp r24, r28 39a1a: 48 f4 brcc .+18 ; 0x39a2e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 39a1c: 8f ef ldi r24, 0xFF ; 255 39a1e: 0e 94 55 70 call 0xe0aa ; 0xe0aa { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 39a22: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 39a26: 8f 5f subi r24, 0xFF ; 255 39a28: 80 93 b2 17 sts 0x17B2, r24 ; 0x8017b2 39a2c: f3 cf rjmp .-26 ; 0x39a14 } } 39a2e: cf 91 pop r28 39a30: 08 95 ret 00039a32 : void menu_progressbar_finish(void) { progressbar_total = 1; 39a32: 81 e0 ldi r24, 0x01 ; 1 39a34: 90 e0 ldi r25, 0x00 ; 0 39a36: 90 93 b4 17 sts 0x17B4, r25 ; 0x8017b4 39a3a: 80 93 b3 17 sts 0x17B3, r24 ; 0x8017b3 menu_progressbar_update(1); 39a3e: 0f 94 f8 cc call 0x399f0 ; 0x399f0 _delay(300); 39a42: 6c e2 ldi r22, 0x2C ; 44 39a44: 71 e0 ldi r23, 0x01 ; 1 39a46: 80 e0 ldi r24, 0x00 ; 0 39a48: 90 e0 ldi r25, 0x00 ; 0 39a4a: 0d 94 62 3d jmp 0x27ac4 ; 0x27ac4 00039a4e : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 39a4e: 0f 93 push r16 39a50: 1f 93 push r17 39a52: cf 93 push r28 39a54: df 93 push r29 39a56: 8c 01 movw r16, r24 39a58: eb 01 movw r28, r22 lcd_clear(); 39a5a: 0e 94 d9 6f call 0xdfb2 ; 0xdfb2 progressbar_block_count = 0; 39a5e: 10 92 b2 17 sts 0x17B2, r1 ; 0x8017b2 progressbar_total = total; 39a62: 10 93 b4 17 sts 0x17B4, r17 ; 0x8017b4 39a66: 00 93 b3 17 sts 0x17B3, r16 ; 0x8017b3 lcd_set_cursor(0, 1); 39a6a: 61 e0 ldi r22, 0x01 ; 1 39a6c: 80 e0 ldi r24, 0x00 ; 0 39a6e: 0e 94 a6 6f call 0xdf4c ; 0xdf4c lcd_print_pad_P(title, LCD_WIDTH); 39a72: 64 e1 ldi r22, 0x14 ; 20 39a74: ce 01 movw r24, r28 39a76: 0e 94 7b 71 call 0xe2f6 ; 0xe2f6 lcd_set_cursor(0, 2); 39a7a: 62 e0 ldi r22, 0x02 ; 2 39a7c: 80 e0 ldi r24, 0x00 ; 0 } 39a7e: df 91 pop r29 39a80: cf 91 pop r28 39a82: 1f 91 pop r17 39a84: 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); 39a86: 0c 94 a6 6f jmp 0xdf4c ; 0xdf4c 00039a8a : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 39a8a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39a8e: 90 91 14 05 lds r25, 0x0514 ; 0x800514 39a92: 89 13 cpse r24, r25 39a94: 0b c0 rjmp .+22 ; 0x39aac 39a96: 90 91 13 05 lds r25, 0x0513 ; 0x800513 39a9a: 99 23 and r25, r25 39a9c: 39 f0 breq .+14 ; 0x39aac 39a9e: 20 91 34 05 lds r18, 0x0534 ; 0x800534 39aa2: 30 91 35 05 lds r19, 0x0535 ; 0x800535 39aa6: 82 17 cp r24, r18 39aa8: 13 06 cpc r1, r19 39aaa: 39 f0 breq .+14 ; 0x39aba 39aac: 81 e0 ldi r24, 0x01 ; 1 39aae: 90 91 cf 03 lds r25, 0x03CF ; 0x8003cf 39ab2: 91 11 cpse r25, r1 39ab4: 03 c0 rjmp .+6 ; 0x39abc 39ab6: 80 e0 ldi r24, 0x00 ; 0 39ab8: 08 95 ret 39aba: 81 e0 ldi r24, 0x01 ; 1 } 39abc: 08 95 ret 00039abe : //! @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) { 39abe: 0f 93 push r16 39ac0: 1f 93 push r17 39ac2: cf 93 push r28 39ac4: df 93 push r29 39ac6: 8c 01 movw r16, r24 39ac8: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 39aca: 89 ec ldi r24, 0xC9 ; 201 39acc: 93 e4 ldi r25, 0x43 ; 67 39ace: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 39ad2: 9f 93 push r25 39ad4: 8f 93 push r24 39ad6: 8a e2 ldi r24, 0x2A ; 42 39ad8: 9a ea ldi r25, 0xAA ; 170 39ada: 9f 93 push r25 39adc: 8f 93 push r24 39ade: df 93 push r29 39ae0: cf 93 push r28 39ae2: 0f 94 5d dc call 0x3b8ba ; 0x3b8ba eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 39ae6: c8 0f add r28, r24 39ae8: d1 1d adc r29, r1 39aea: 47 e0 ldi r20, 0x07 ; 7 39aec: 50 e0 ldi r21, 0x00 ; 0 39aee: b8 01 movw r22, r16 39af0: ce 01 movw r24, r28 39af2: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c //index += 7; buffer.c[index + 7] = '\0'; 39af6: 1f 82 std Y+7, r1 ; 0x07 39af8: 0f 90 pop r0 39afa: 0f 90 pop r0 39afc: 0f 90 pop r0 39afe: 0f 90 pop r0 39b00: 0f 90 pop r0 39b02: 0f 90 pop r0 } 39b04: df 91 pop r29 39b06: cf 91 pop r28 39b08: 1f 91 pop r17 39b0a: 0f 91 pop r16 39b0c: 08 95 ret 00039b0e : 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)?'>':' '; 39b0e: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39b12: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39b16: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39b1a: 28 17 cp r18, r24 39b1c: 19 06 cpc r1, r25 39b1e: 11 f0 breq .+4 ; 0x39b24 39b20: 80 e2 ldi r24, 0x20 ; 32 39b22: 08 95 ret 39b24: 8e e3 ldi r24, 0x3E ; 62 } 39b26: 08 95 ret 00039b28 : static void menu_draw_item_puts_P(char type_char, const char* str) { 39b28: 0f 93 push r16 39b2a: 1f 93 push r17 39b2c: cf 93 push r28 39b2e: c8 2f mov r28, r24 39b30: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 39b32: 0f 94 87 cd call 0x39b0e ; 0x39b0e 39b36: 48 2f mov r20, r24 39b38: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39b3c: 80 e0 ldi r24, 0x00 ; 0 39b3e: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_print_pad_P(str, LCD_WIDTH - 2); 39b42: 62 e1 ldi r22, 0x12 ; 18 39b44: c8 01 movw r24, r16 39b46: 0e 94 7b 71 call 0xe2f6 ; 0xe2f6 lcd_putc(type_char); 39b4a: 8c 2f mov r24, r28 } 39b4c: cf 91 pop r28 39b4e: 1f 91 pop r17 39b50: 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); 39b52: 0c 94 95 6f jmp 0xdf2a ; 0xdf2a 00039b56 : } } void menu_item_ret(void) { lcd_draw_update = 2; 39b56: 82 e0 ldi r24, 0x02 ; 2 39b58: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 39b5c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39b60: 8f 5f subi r24, 0xFF ; 255 39b62: 80 93 15 05 sts 0x0515, r24 ; 0x800515 //prevent the rest of the menu items from rendering or getting clicked menu_row = LCD_HEIGHT; // early exit from the MENU_BEGIN() for loop at the end of the current cycle 39b66: 84 e0 ldi r24, 0x04 ; 4 39b68: 80 93 12 05 sts 0x0512, r24 ; 0x800512 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 39b6c: 10 92 14 05 sts 0x0514, r1 ; 0x800514 menu_clicked = 0; // prevent subsequent items from being able to be clicked in case the current menu or position was changed by the clicked menu item 39b70: 10 92 13 05 sts 0x0513, r1 ; 0x800513 } 39b74: 08 95 ret 00039b76 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 39b76: cf 93 push r28 39b78: df 93 push r29 if (menu_item == menu_line) 39b7a: 30 91 15 05 lds r19, 0x0515 ; 0x800515 39b7e: 20 91 14 05 lds r18, 0x0514 ; 0x800514 39b82: 32 13 cpse r19, r18 39b84: 20 c0 rjmp .+64 ; 0x39bc6 39b86: eb 01 movw r28, r22 39b88: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39b8a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39b8e: 88 23 and r24, r24 39b90: 19 f0 breq .+6 ; 0x39b98 39b92: 80 e2 ldi r24, 0x20 ; 32 39b94: 0f 94 94 cd call 0x39b28 ; 0x39b28 if (menu_clicked && (lcd_encoder == menu_item)) 39b98: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39b9c: 88 23 and r24, r24 39b9e: 99 f0 breq .+38 ; 0x39bc6 39ba0: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39ba4: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39ba8: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39bac: 28 17 cp r18, r24 39bae: 19 06 cpc r1, r25 39bb0: 51 f4 brne .+20 ; 0x39bc6 { if (str_gcode) enquecommand_P(str_gcode); 39bb2: 20 97 sbiw r28, 0x00 ; 0 39bb4: 21 f0 breq .+8 ; 0x39bbe 39bb6: 61 e0 ldi r22, 0x01 ; 1 39bb8: ce 01 movw r24, r28 39bba: 0e 94 5c 89 call 0x112b8 ; 0x112b8 menu_item_ret(); return; } } menu_item++; } 39bbe: df 91 pop r29 39bc0: 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(); 39bc2: 0d 94 ab cd jmp 0x39b56 ; 0x39b56 return; } } menu_item++; 39bc6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39bca: 8f 5f subi r24, 0xFF ; 255 39bcc: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 39bd0: df 91 pop r29 39bd2: cf 91 pop r28 39bd4: 08 95 ret 00039bd6 : //! @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) { 39bd6: ef 92 push r14 39bd8: ff 92 push r15 39bda: 0f 93 push r16 39bdc: 1f 93 push r17 39bde: cf 93 push r28 39be0: df 93 push r29 if (menu_item == menu_line) 39be2: 70 91 15 05 lds r23, 0x0515 ; 0x800515 39be6: 30 91 14 05 lds r19, 0x0514 ; 0x800514 39bea: 73 13 cpse r23, r19 39bec: 3f c0 rjmp .+126 ; 0x39c6c 39bee: 12 2f mov r17, r18 39bf0: ea 01 movw r28, r20 39bf2: 06 2f mov r16, r22 39bf4: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 39bf6: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39bfa: 88 23 and r24, r24 39bfc: d1 f0 breq .+52 ; 0x39c32 } 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()); 39bfe: 0f 94 87 cd call 0x39b0e ; 0x39b0e 39c02: 48 2f mov r20, r24 39c04: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39c08: 80 e0 ldi r24, 0x00 ; 0 39c0a: 0e 94 c6 6f call 0xdf8c ; 0xdf8c uint8_t len = lcd_print_pad_P(str, max_strlen); 39c0e: 61 e1 ldi r22, 0x11 ; 17 39c10: c7 01 movw r24, r14 39c12: 0e 94 7b 71 call 0xe2f6 ; 0xe2f6 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 39c16: 40 2f mov r20, r16 39c18: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39c1c: 93 e1 ldi r25, 0x13 ; 19 39c1e: 98 1b sub r25, r24 39c20: 89 2f mov r24, r25 39c22: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 39c26: 40 e2 ldi r20, 0x20 ; 32 39c28: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39c2c: 83 e1 ldi r24, 0x13 ; 19 39c2e: 0e 94 c6 6f call 0xdf8c ; 0xdf8c 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)) 39c32: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39c36: 88 23 and r24, r24 39c38: c9 f0 breq .+50 ; 0x39c6c 39c3a: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39c3e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39c42: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39c46: 28 17 cp r18, r24 39c48: 19 06 cpc r1, r25 39c4a: 81 f4 brne .+32 ; 0x39c6c { lcd_update_enabled = 0; 39c4c: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 39c50: 81 2f mov r24, r17 39c52: fe 01 movw r30, r28 39c54: 19 95 eicall lcd_update_enabled = 1; 39c56: 81 e0 ldi r24, 0x01 ; 1 39c58: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39c5c: df 91 pop r29 39c5e: cf 91 pop r28 39c60: 1f 91 pop r17 39c62: 0f 91 pop r16 39c64: ff 90 pop r15 39c66: 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(); 39c68: 0d 94 ab cd jmp 0x39b56 ; 0x39b56 return; } } menu_item++; 39c6c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39c70: 8f 5f subi r24, 0xFF ; 255 39c72: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 39c76: df 91 pop r29 39c78: cf 91 pop r28 39c7a: 1f 91 pop r17 39c7c: 0f 91 pop r16 39c7e: ff 90 pop r15 39c80: ef 90 pop r14 39c82: 08 95 ret 00039c84 : 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) { 39c84: cf 93 push r28 39c86: df 93 push r29 if (menu_item == menu_line) 39c88: 30 91 15 05 lds r19, 0x0515 ; 0x800515 39c8c: 20 91 14 05 lds r18, 0x0514 ; 0x800514 39c90: 32 13 cpse r19, r18 39c92: 21 c0 rjmp .+66 ; 0x39cd6 39c94: eb 01 movw r28, r22 39c96: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39c98: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39c9c: 88 23 and r24, r24 39c9e: 19 f0 breq .+6 ; 0x39ca6 39ca0: 80 e2 ldi r24, 0x20 ; 32 39ca2: 0f 94 94 cd call 0x39b28 ; 0x39b28 if (menu_clicked && (lcd_encoder == menu_item)) 39ca6: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39caa: 88 23 and r24, r24 39cac: a1 f0 breq .+40 ; 0x39cd6 39cae: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39cb2: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39cb6: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39cba: 28 17 cp r18, r24 39cbc: 19 06 cpc r1, r25 39cbe: 59 f4 brne .+22 ; 0x39cd6 { lcd_update_enabled = 0; 39cc0: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 39cc4: fe 01 movw r30, r28 39cc6: 19 95 eicall lcd_update_enabled = 1; 39cc8: 81 e0 ldi r24, 0x01 ; 1 39cca: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39cce: df 91 pop r29 39cd0: 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(); 39cd2: 0d 94 ab cd jmp 0x39b56 ; 0x39b56 return; } } menu_item++; 39cd6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39cda: 8f 5f subi r24, 0xFF ; 255 39cdc: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 39ce0: df 91 pop r29 39ce2: cf 91 pop r28 39ce4: 08 95 ret 00039ce6 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 39ce6: 30 91 15 05 lds r19, 0x0515 ; 0x800515 39cea: 20 91 14 05 lds r18, 0x0514 ; 0x800514 39cee: 32 13 cpse r19, r18 39cf0: 19 c0 rjmp .+50 ; 0x39d24 39cf2: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39cf4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39cf8: 88 23 and r24, r24 39cfa: 19 f0 breq .+6 ; 0x39d02 39cfc: 80 e2 ldi r24, 0x20 ; 32 39cfe: 0f 94 94 cd call 0x39b28 ; 0x39b28 if (menu_clicked && (lcd_encoder == menu_item)) 39d02: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39d06: 88 23 and r24, r24 39d08: 69 f0 breq .+26 ; 0x39d24 39d0a: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39d0e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39d12: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39d16: 28 17 cp r18, r24 39d18: 19 06 cpc r1, r25 39d1a: 21 f4 brne .+8 ; 0x39d24 { menu_item_ret(); 39d1c: 0f 94 ab cd call 0x39b56 ; 0x39b56 return 1; 39d20: 81 e0 ldi r24, 0x01 ; 1 39d22: 08 95 ret } } menu_item++; 39d24: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39d28: 8f 5f subi r24, 0xFF ; 255 39d2a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 return 0; 39d2e: 80 e0 ldi r24, 0x00 ; 0 } 39d30: 08 95 ret 00039d32 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 39d32: 80 91 12 05 lds r24, 0x0512 ; 0x800512 39d36: 84 30 cpi r24, 0x04 ; 4 39d38: 38 f5 brcc .+78 ; 0x39d88 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 39d3a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39d3e: 90 e0 ldi r25, 0x00 ; 0 39d40: 20 91 34 05 lds r18, 0x0534 ; 0x800534 39d44: 30 91 35 05 lds r19, 0x0535 ; 0x800535 39d48: 28 17 cp r18, r24 39d4a: 39 07 cpc r19, r25 39d4c: 44 f0 brlt .+16 ; 0x39d5e { lcd_encoder = menu_item - 1; 39d4e: 01 97 sbiw r24, 0x01 ; 1 39d50: 90 93 35 05 sts 0x0535, r25 ; 0x800535 39d54: 80 93 34 05 sts 0x0534, r24 ; 0x800534 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39d58: 87 e0 ldi r24, 0x07 ; 7 39d5a: 0f 94 34 64 call 0x2c868 ; 0x2c868 } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 39d5e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39d62: 20 91 a1 03 lds r18, 0x03A1 ; 0x8003a1 39d66: 30 e0 ldi r19, 0x00 ; 0 39d68: 2d 5f subi r18, 0xFD ; 253 39d6a: 3f 4f sbci r19, 0xFF ; 255 39d6c: 82 17 cp r24, r18 39d6e: 13 06 cpc r1, r19 39d70: 59 f0 breq .+22 ; 0x39d88 39d72: 54 f0 brlt .+20 ; 0x39d88 { menu_top = lcd_encoder - LCD_HEIGHT + 1; 39d74: 9d ef ldi r25, 0xFD ; 253 39d76: 98 0f add r25, r24 39d78: 90 93 a1 03 sts 0x03A1, r25 ; 0x8003a1 menu_line = menu_top - 1; 39d7c: 84 50 subi r24, 0x04 ; 4 39d7e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_row = -1; 39d82: 8f ef ldi r24, 0xFF ; 255 39d84: 80 93 12 05 sts 0x0512, r24 ; 0x800512 } } 39d88: 08 95 ret 00039d8a : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 39d8a: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39d8e: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39d92: 97 ff sbrs r25, 7 39d94: 07 c0 rjmp .+14 ; 0x39da4 { lcd_encoder = 0; 39d96: 10 92 35 05 sts 0x0535, r1 ; 0x800535 39d9a: 10 92 34 05 sts 0x0534, r1 ; 0x800534 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39d9e: 87 e0 ldi r24, 0x07 ; 7 39da0: 0f 94 34 64 call 0x2c868 ; 0x2c868 } if (lcd_encoder < menu_top) 39da4: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39da8: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39dac: 20 91 a1 03 lds r18, 0x03A1 ; 0x8003a1 39db0: 28 17 cp r18, r24 39db2: 19 06 cpc r1, r25 39db4: 19 f0 breq .+6 ; 0x39dbc 39db6: 14 f0 brlt .+4 ; 0x39dbc menu_top = lcd_encoder; 39db8: 80 93 a1 03 sts 0x03A1, r24 ; 0x8003a1 menu_line = menu_top; 39dbc: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 39dc0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_clicked = lcd_clicked(); // Consume click event 39dc4: 0e 94 c3 71 call 0xe386 ; 0xe386 39dc8: 80 93 13 05 sts 0x0513, r24 ; 0x800513 } 39dcc: 08 95 ret 00039dce : 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)); 39dce: e5 ea ldi r30, 0xA5 ; 165 39dd0: f3 e0 ldi r31, 0x03 ; 3 39dd2: 80 e2 ldi r24, 0x20 ; 32 39dd4: df 01 movw r26, r30 39dd6: 1d 92 st X+, r1 39dd8: 8a 95 dec r24 39dda: e9 f7 brne .-6 ; 0x39dd6 } 39ddc: 08 95 ret 00039dde : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 39dde: cf 93 push r28 CRITICAL_SECTION_START; 39de0: 3f b7 in r19, 0x3f ; 63 39de2: f8 94 cli if (menu_menu != menu) 39de4: e0 91 66 0e lds r30, 0x0E66 ; 0x800e66 39de8: f0 91 67 0e lds r31, 0x0E67 ; 0x800e67 39dec: e8 17 cp r30, r24 39dee: f9 07 cpc r31, r25 39df0: c9 f0 breq .+50 ; 0x39e24 39df2: c4 2f mov r28, r20 { menu_menu = menu; 39df4: 90 93 67 0e sts 0x0E67, r25 ; 0x800e67 39df8: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 lcd_encoder = encoder; 39dfc: 70 93 35 05 sts 0x0535, r23 ; 0x800535 39e00: 60 93 34 05 sts 0x0534, r22 ; 0x800534 menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 39e04: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 lcd_draw_update = 2; // Full LCD re-draw 39e08: 82 e0 ldi r24, 0x02 ; 2 39e0a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 39e0e: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 39e10: 22 23 and r18, r18 39e12: 19 f0 breq .+6 ; 0x39e1a } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 39e14: 80 e0 ldi r24, 0x00 ; 0 39e16: 0f 94 34 64 call 0x2c868 ; 0x2c868 if (reset_menu_state) menu_data_reset(); 39e1a: cc 23 and r28, r28 39e1c: 21 f0 breq .+8 ; 0x39e26 } else CRITICAL_SECTION_END; } 39e1e: 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(); 39e20: 0d 94 e7 ce jmp 0x39dce ; 0x39dce } else CRITICAL_SECTION_END; 39e24: 3f bf out 0x3f, r19 ; 63 } 39e26: cf 91 pop r28 39e28: 08 95 ret 00039e2a : 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) { 39e2a: 7f 92 push r7 39e2c: 8f 92 push r8 39e2e: 9f 92 push r9 39e30: af 92 push r10 39e32: bf 92 push r11 39e34: cf 92 push r12 39e36: df 92 push r13 39e38: ef 92 push r14 39e3a: ff 92 push r15 39e3c: 0f 93 push r16 39e3e: 1f 93 push r17 39e40: cf 93 push r28 39e42: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 39e44: e0 91 15 05 lds r30, 0x0515 ; 0x800515 39e48: 50 91 14 05 lds r21, 0x0514 ; 0x800514 39e4c: e5 13 cpse r30, r21 39e4e: 73 c0 rjmp .+230 ; 0x39f36 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 39e50: fb 01 movw r30, r22 39e52: 48 30 cpi r20, 0x08 ; 8 39e54: 09 f0 breq .+2 ; 0x39e58 39e56: 6c c0 rjmp .+216 ; 0x39f30 39e58: c0 81 ld r28, Z 39e5a: d0 e0 ldi r29, 0x00 ; 0 39e5c: 49 01 movw r8, r18 39e5e: 74 2e mov r7, r20 39e60: 6b 01 movw r12, r22 39e62: 5c 01 movw r10, r24 if (lcd_draw_update) 39e64: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39e68: 88 23 and r24, r24 39e6a: 59 f0 breq .+22 ; 0x39e82 { lcd_set_cursor(0, menu_row); 39e6c: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39e70: 80 e0 ldi r24, 0x00 ; 0 39e72: 0e 94 a6 6f call 0xdf4c ; 0xdf4c menu_draw_P(menu_selection_mark(), str, cur_val); 39e76: 0f 94 87 cd call 0x39b0e ; 0x39b0e 39e7a: ae 01 movw r20, r28 39e7c: b5 01 movw r22, r10 39e7e: 0f 94 b1 a3 call 0x34762 ; 0x34762 } if (menu_clicked && (lcd_encoder == menu_item)) 39e82: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39e86: 88 23 and r24, r24 39e88: 09 f4 brne .+2 ; 0x39e8c 39e8a: 55 c0 rjmp .+170 ; 0x39f36 39e8c: 90 91 15 05 lds r25, 0x0515 ; 0x800515 39e90: 20 91 34 05 lds r18, 0x0534 ; 0x800534 39e94: 30 91 35 05 lds r19, 0x0535 ; 0x800535 39e98: 92 17 cp r25, r18 39e9a: 13 06 cpc r1, r19 39e9c: 09 f0 breq .+2 ; 0x39ea0 39e9e: 4b c0 rjmp .+150 ; 0x39f36 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 39ea0: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 39ea4: 87 30 cpi r24, 0x07 ; 7 39ea6: d8 f4 brcc .+54 ; 0x39ede { menu_stack[menu_depth].menu = menu_menu; 39ea8: 28 2f mov r18, r24 39eaa: 30 e0 ldi r19, 0x00 ; 0 39eac: f9 01 movw r30, r18 39eae: ee 0f add r30, r30 39eb0: ff 1f adc r31, r31 39eb2: e2 0f add r30, r18 39eb4: f3 1f adc r31, r19 39eb6: e3 56 subi r30, 0x63 ; 99 39eb8: f8 4e sbci r31, 0xE8 ; 232 39eba: 20 91 66 0e lds r18, 0x0E66 ; 0x800e66 39ebe: 30 91 67 0e lds r19, 0x0E67 ; 0x800e67 39ec2: 31 83 std Z+1, r19 ; 0x01 39ec4: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 39ec6: 8f 5f subi r24, 0xFF ; 255 39ec8: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 39ecc: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 39ece: 20 e0 ldi r18, 0x00 ; 0 39ed0: 40 e0 ldi r20, 0x00 ; 0 39ed2: 70 e0 ldi r23, 0x00 ; 0 39ed4: 60 e0 ldi r22, 0x00 ; 0 39ed6: 84 e6 ldi r24, 0x64 ; 100 39ed8: 9a e3 ldi r25, 0x3A ; 58 39eda: 0f 94 ef ce call 0x39dde ; 0x39dde 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; 39ede: b0 92 a6 03 sts 0x03A6, r11 ; 0x8003a6 39ee2: a0 92 a5 03 sts 0x03A5, r10 ; 0x8003a5 _md->editValuePtr = pval; 39ee6: d0 92 a9 03 sts 0x03A9, r13 ; 0x8003a9 39eea: c0 92 a8 03 sts 0x03A8, r12 ; 0x8003a8 _md->editValueBits = pbits; 39eee: 70 92 a7 03 sts 0x03A7, r7 ; 0x8003a7 _md->currentValue = cur_val; 39ef2: d0 93 ab 03 sts 0x03AB, r29 ; 0x8003ab 39ef6: c0 93 aa 03 sts 0x03AA, r28 ; 0x8003aa _md->minEditValue = min_val; 39efa: 90 92 ad 03 sts 0x03AD, r9 ; 0x8003ad 39efe: 80 92 ac 03 sts 0x03AC, r8 ; 0x8003ac _md->maxEditValue = max_val; 39f02: 10 93 af 03 sts 0x03AF, r17 ; 0x8003af 39f06: 00 93 ae 03 sts 0x03AE, r16 ; 0x8003ae _md->minJumpValue = jmp_val; 39f0a: f0 92 b1 03 sts 0x03B1, r15 ; 0x8003b1 39f0e: e0 92 b0 03 sts 0x03B0, r14 ; 0x8003b0 menu_item_ret(); return; } } menu_item++; } 39f12: df 91 pop r29 39f14: cf 91 pop r28 39f16: 1f 91 pop r17 39f18: 0f 91 pop r16 39f1a: ff 90 pop r15 39f1c: ef 90 pop r14 39f1e: df 90 pop r13 39f20: cf 90 pop r12 39f22: bf 90 pop r11 39f24: af 90 pop r10 39f26: 9f 90 pop r9 39f28: 8f 90 pop r8 39f2a: 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(); 39f2c: 0d 94 ab cd jmp 0x39b56 ; 0x39b56 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)); 39f30: c0 81 ld r28, Z 39f32: d1 81 ldd r29, Z+1 ; 0x01 39f34: 93 cf rjmp .-218 ; 0x39e5c _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 39f36: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39f3a: 8f 5f subi r24, 0xFF ; 255 39f3c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 39f40: df 91 pop r29 39f42: cf 91 pop r28 39f44: 1f 91 pop r17 39f46: 0f 91 pop r16 39f48: ff 90 pop r15 39f4a: ef 90 pop r14 39f4c: df 90 pop r13 39f4e: cf 90 pop r12 39f50: bf 90 pop r11 39f52: af 90 pop r10 39f54: 9f 90 pop r9 39f56: 8f 90 pop r8 39f58: 7f 90 pop r7 39f5a: 08 95 ret 00039f5c <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 39f5c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39f60: 88 23 and r24, r24 39f62: 09 f4 brne .+2 ; 0x39f66 <_menu_edit_P()+0xa> 39f64: 52 c0 rjmp .+164 ; 0x3a00a <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 39f66: 20 91 b0 03 lds r18, 0x03B0 ; 0x8003b0 39f6a: 30 91 b1 03 lds r19, 0x03B1 ; 0x8003b1 39f6e: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 39f72: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 39f76: 21 15 cp r18, r1 39f78: 31 05 cpc r19, r1 39f7a: d9 f0 breq .+54 ; 0x39fb2 <_menu_edit_P()+0x56> 39f7c: 40 91 34 05 lds r20, 0x0534 ; 0x800534 39f80: 50 91 35 05 lds r21, 0x0535 ; 0x800535 39f84: 41 15 cp r20, r1 39f86: 51 05 cpc r21, r1 39f88: a1 f0 breq .+40 ; 0x39fb2 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 39f8a: 7c f0 brlt .+30 ; 0x39faa <_menu_edit_P()+0x4e> 39f8c: 40 91 aa 03 lds r20, 0x03AA ; 0x8003aa 39f90: 50 91 ab 03 lds r21, 0x03AB ; 0x8003ab 39f94: 48 17 cp r20, r24 39f96: 59 07 cpc r21, r25 39f98: 41 f4 brne .+16 ; 0x39faa <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 39f9a: 30 93 ab 03 sts 0x03AB, r19 ; 0x8003ab 39f9e: 20 93 aa 03 sts 0x03AA, r18 ; 0x8003aa lcd_encoder = 0; 39fa2: 10 92 35 05 sts 0x0535, r1 ; 0x800535 39fa6: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 39faa: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 39fae: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 } _md->currentValue += lcd_encoder; 39fb2: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 39fb6: 30 91 ab 03 lds r19, 0x03AB ; 0x8003ab 39fba: 40 91 34 05 lds r20, 0x0534 ; 0x800534 39fbe: 50 91 35 05 lds r21, 0x0535 ; 0x800535 39fc2: 24 0f add r18, r20 39fc4: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 39fc6: 10 92 35 05 sts 0x0535, r1 ; 0x800535 39fca: 10 92 34 05 sts 0x0534, r1 ; 0x800534 // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 39fce: 28 17 cp r18, r24 39fd0: 39 07 cpc r19, r25 39fd2: 44 f0 brlt .+16 ; 0x39fe4 <_menu_edit_P()+0x88> 39fd4: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 39fd8: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 39fdc: 28 17 cp r18, r24 39fde: 39 07 cpc r19, r25 39fe0: 0c f4 brge .+2 ; 0x39fe4 <_menu_edit_P()+0x88> 39fe2: c9 01 movw r24, r18 39fe4: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 39fe8: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa lcd_set_cursor(0, 1); 39fec: 61 e0 ldi r22, 0x01 ; 1 39fee: 80 e0 ldi r24, 0x00 ; 0 39ff0: 0e 94 a6 6f call 0xdf4c ; 0xdf4c menu_draw_P(' ', _md->editLabel, _md->currentValue); 39ff4: 40 91 aa 03 lds r20, 0x03AA ; 0x8003aa 39ff8: 50 91 ab 03 lds r21, 0x03AB ; 0x8003ab 39ffc: 60 91 a5 03 lds r22, 0x03A5 ; 0x8003a5 3a000: 70 91 a6 03 lds r23, 0x03A6 ; 0x8003a6 3a004: 80 e2 ldi r24, 0x20 ; 32 3a006: 0f 94 b1 a3 call 0x34762 ; 0x34762 } if (lcd_clicked()) 3a00a: 0e 94 c3 71 call 0xe386 ; 0xe386 3a00e: 88 23 and r24, r24 3a010: 41 f1 breq .+80 ; 0x3a062 <_menu_edit_P()+0x106> 3a012: e0 91 a8 03 lds r30, 0x03A8 ; 0x8003a8 3a016: f0 91 a9 03 lds r31, 0x03A9 ; 0x8003a9 3a01a: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 3a01e: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab { if (_md->editValueBits == 8) 3a022: 20 91 a7 03 lds r18, 0x03A7 ; 0x8003a7 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 3a026: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 3a028: 28 30 cpi r18, 0x08 ; 8 3a02a: c9 f4 brne .+50 ; 0x3a05e <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3a02c: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 3a030: 88 23 and r24, r24 3a032: b9 f0 breq .+46 ; 0x3a062 <_menu_edit_P()+0x106> { menu_depth--; 3a034: 81 50 subi r24, 0x01 ; 1 3a036: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3a03a: 90 e0 ldi r25, 0x00 ; 0 3a03c: fc 01 movw r30, r24 3a03e: ee 0f add r30, r30 3a040: ff 1f adc r31, r31 3a042: e8 0f add r30, r24 3a044: f9 1f adc r31, r25 3a046: e3 56 subi r30, 0x63 ; 99 3a048: f8 4e sbci r31, 0xE8 ; 232 3a04a: 62 81 ldd r22, Z+2 ; 0x02 3a04c: 06 2e mov r0, r22 3a04e: 00 0c add r0, r0 3a050: 77 0b sbc r23, r23 3a052: 20 e0 ldi r18, 0x00 ; 0 3a054: 40 e0 ldi r20, 0x00 ; 0 3a056: 80 81 ld r24, Z 3a058: 91 81 ldd r25, Z+1 ; 0x01 3a05a: 0d 94 ef ce jmp 0x39dde ; 0x39dde if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3a05e: 91 83 std Z+1, r25 ; 0x01 3a060: e5 cf rjmp .-54 ; 0x3a02c <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 3a062: 08 95 ret 0003a064 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 3a064: dc 01 movw r26, r24 3a066: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 3a068: 90 91 f1 03 lds r25, 0x03F1 ; 0x8003f1 3a06c: 97 30 cpi r25, 0x07 ; 7 3a06e: d8 f4 brcc .+54 ; 0x3a0a6 { menu_stack[menu_depth].menu = menu_menu; 3a070: 49 2f mov r20, r25 3a072: 50 e0 ldi r21, 0x00 ; 0 3a074: fa 01 movw r30, r20 3a076: ee 0f add r30, r30 3a078: ff 1f adc r31, r31 3a07a: e4 0f add r30, r20 3a07c: f5 1f adc r31, r21 3a07e: e3 56 subi r30, 0x63 ; 99 3a080: f8 4e sbci r31, 0xE8 ; 232 3a082: 40 91 66 0e lds r20, 0x0E66 ; 0x800e66 3a086: 50 91 67 0e lds r21, 0x0E67 ; 0x800e67 3a08a: 51 83 std Z+1, r21 ; 0x01 3a08c: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a08e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a092: 9f 5f subi r25, 0xFF ; 255 3a094: 90 93 f1 03 sts 0x03F1, r25 ; 0x8003f1 3a098: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a09a: 41 e0 ldi r20, 0x01 ; 1 3a09c: 70 e0 ldi r23, 0x00 ; 0 3a09e: 60 e0 ldi r22, 0x00 ; 0 3a0a0: cd 01 movw r24, r26 3a0a2: 0d 94 ef ce jmp 0x39dde ; 0x39dde } } 3a0a6: 08 95 ret 0003a0a8 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a0a8: 8f 92 push r8 3a0aa: 9f 92 push r9 3a0ac: af 92 push r10 3a0ae: bf 92 push r11 3a0b0: cf 92 push r12 3a0b2: df 92 push r13 3a0b4: ef 92 push r14 3a0b6: ff 92 push r15 3a0b8: 0f 93 push r16 3a0ba: 1f 93 push r17 3a0bc: cf 93 push r28 3a0be: df 93 push r29 if (menu_item == menu_line) 3a0c0: e0 91 15 05 lds r30, 0x0515 ; 0x800515 3a0c4: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a0c8: e3 13 cpse r30, r19 3a0ca: 73 c0 rjmp .+230 ; 0x3a1b2 3a0cc: c2 2f mov r28, r18 3a0ce: 6a 01 movw r12, r20 3a0d0: 7b 01 movw r14, r22 3a0d2: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a0d4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a0d8: 88 23 and r24, r24 3a0da: a1 f1 breq .+104 ; 0x3a144 3a0dc: 0f 94 87 cd call 0x39b0e ; 0x39b0e 3a0e0: 01 e0 ldi r16, 0x01 ; 1 3a0e2: 8e 33 cpi r24, 0x3E ; 62 3a0e4: 09 f0 breq .+2 ; 0x3a0e8 3a0e6: 00 e0 ldi r16, 0x00 ; 0 3a0e8: 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; 3a0ea: 80 2f mov r24, r16 3a0ec: 82 70 andi r24, 0x02 ; 2 3a0ee: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a0f0: e1 14 cp r14, r1 3a0f2: f1 04 cpc r15, r1 3a0f4: 09 f4 brne .+2 ; 0x3a0f8 3a0f6: 6f c0 rjmp .+222 ; 0x3a1d6 3a0f8: e7 01 movw r28, r14 3a0fa: 90 e2 ldi r25, 0x20 ; 32 3a0fc: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a0fe: 88 20 and r8, r8 3a100: 09 f4 brne .+2 ; 0x3a104 3a102: 41 c0 rjmp .+130 ; 0x3a186 3a104: ce 01 movw r24, r28 3a106: 0f 94 04 db call 0x3b608 ; 0x3b608 <__strlen_P> 3a10a: 14 e0 ldi r17, 0x04 ; 4 3a10c: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a10e: 4e e3 ldi r20, 0x3E ; 62 3a110: 00 ff sbrs r16, 0 3a112: 40 e2 ldi r20, 0x20 ; 32 3a114: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a118: 80 e0 ldi r24, 0x00 ; 0 3a11a: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_print_pad_P(str, LCD_WIDTH - len); 3a11e: 64 e1 ldi r22, 0x14 ; 20 3a120: 61 1b sub r22, r17 3a122: c5 01 movw r24, r10 3a124: 0e 94 7b 71 call 0xe2f6 ; 0xe2f6 lcd_putc('['); 3a128: 8b e5 ldi r24, 0x5B ; 91 3a12a: 0e 94 95 6f call 0xdf2a ; 0xdf2a if (is_progmem) { lcd_puts_P(toggle); 3a12e: 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) 3a130: 88 20 and r8, r8 3a132: 89 f1 breq .+98 ; 0x3a196 { lcd_puts_P(toggle); 3a134: 0e 94 91 6f call 0xdf22 ; 0xdf22 } else { lcd_print(toggle); } lcd_putc(']'); 3a138: 8d e5 ldi r24, 0x5D ; 93 3a13a: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_putc(eol); 3a13e: 89 2d mov r24, r9 3a140: 0e 94 95 6f call 0xdf2a ; 0xdf2a 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)) 3a144: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a148: 88 23 and r24, r24 3a14a: 99 f1 breq .+102 ; 0x3a1b2 3a14c: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a150: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a154: 90 91 35 05 lds r25, 0x0535 ; 0x800535 3a158: 28 17 cp r18, r24 3a15a: 19 06 cpc r1, r25 3a15c: 51 f5 brne .+84 ; 0x3a1b2 { if (toggle == NULL) // print N/A warning message 3a15e: ef 28 or r14, r15 3a160: e9 f4 brne .+58 ; 0x3a19c { menu_submenu(func); 3a162: 60 e0 ldi r22, 0x00 ; 0 3a164: c6 01 movw r24, r12 3a166: 0f 94 32 d0 call 0x3a064 ; 0x3a064 menu_item_ret(); return; } } menu_item++; } 3a16a: df 91 pop r29 3a16c: cf 91 pop r28 3a16e: 1f 91 pop r17 3a170: 0f 91 pop r16 3a172: ff 90 pop r15 3a174: ef 90 pop r14 3a176: df 90 pop r13 3a178: cf 90 pop r12 3a17a: bf 90 pop r11 3a17c: af 90 pop r10 3a17e: 9f 90 pop r9 3a180: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a182: 0d 94 ab cd jmp 0x39b56 ; 0x39b56 //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)); 3a186: fe 01 movw r30, r28 3a188: 01 90 ld r0, Z+ 3a18a: 00 20 and r0, r0 3a18c: e9 f7 brne .-6 ; 0x3a188 3a18e: ec 1b sub r30, r28 3a190: 13 e0 ldi r17, 0x03 ; 3 3a192: 1e 0f add r17, r30 3a194: bc cf rjmp .-136 ; 0x3a10e lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a196: 0e 94 ad 71 call 0xe35a ; 0xe35a 3a19a: ce cf rjmp .-100 ; 0x3a138 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a19c: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a1a0: c1 14 cp r12, r1 3a1a2: d1 04 cpc r13, r1 3a1a4: 11 f0 breq .+4 ; 0x3a1aa 3a1a6: f6 01 movw r30, r12 3a1a8: 19 95 eicall lcd_update_enabled = 1; 3a1aa: 81 e0 ldi r24, 0x01 ; 1 3a1ac: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a1b0: dc cf rjmp .-72 ; 0x3a16a } menu_item_ret(); return; } } menu_item++; 3a1b2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a1b6: 8f 5f subi r24, 0xFF ; 255 3a1b8: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a1bc: df 91 pop r29 3a1be: cf 91 pop r28 3a1c0: 1f 91 pop r17 3a1c2: 0f 91 pop r16 3a1c4: ff 90 pop r15 3a1c6: ef 90 pop r14 3a1c8: df 90 pop r13 3a1ca: cf 90 pop r12 3a1cc: bf 90 pop r11 3a1ce: af 90 pop r10 3a1d0: 9f 90 pop r9 3a1d2: 8f 90 pop r8 3a1d4: 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); 3a1d6: 8b ef ldi r24, 0xFB ; 251 3a1d8: 9c e3 ldi r25, 0x3C ; 60 3a1da: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 3a1de: 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] : ' '; 3a1e0: 8e e7 ldi r24, 0x7E ; 126 3a1e2: 98 2e mov r9, r24 3a1e4: 8c cf rjmp .-232 ; 0x3a0fe 0003a1e6 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a1e6: 0f 93 push r16 3a1e8: 1f 93 push r17 3a1ea: cf 93 push r28 3a1ec: df 93 push r29 3a1ee: cd b7 in r28, 0x3d ; 61 3a1f0: de b7 in r29, 0x3e ; 62 3a1f2: 63 97 sbiw r28, 0x13 ; 19 3a1f4: 0f b6 in r0, 0x3f ; 63 3a1f6: f8 94 cli 3a1f8: de bf out 0x3e, r29 ; 62 3a1fa: 0f be out 0x3f, r0 ; 63 3a1fc: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a1fe: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a202: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a206: 32 13 cpse r19, r18 3a208: 38 c0 rjmp .+112 ; 0x3a27a 3a20a: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a20c: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a210: 22 23 and r18, r18 3a212: a9 f0 breq .+42 ; 0x3a23e static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a214: be 01 movw r22, r28 3a216: 6f 5f subi r22, 0xFF ; 255 3a218: 7f 4f sbci r23, 0xFF ; 255 3a21a: 0f 94 5f cd call 0x39abe ; 0x39abe lcd_putc_at(0, menu_row, menu_selection_mark()); 3a21e: 0f 94 87 cd call 0x39b0e ; 0x39b0e 3a222: 48 2f mov r20, r24 3a224: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a228: 80 e0 ldi r24, 0x00 ; 0 3a22a: 0e 94 c6 6f call 0xdf8c ; 0xdf8c lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a22e: 62 e1 ldi r22, 0x12 ; 18 3a230: ce 01 movw r24, r28 3a232: 01 96 adiw r24, 0x01 ; 1 3a234: 0e 94 95 71 call 0xe32a ; 0xe32a lcd_putc(type_char); 3a238: 8e e7 ldi r24, 0x7E ; 126 3a23a: 0e 94 95 6f call 0xdf2a ; 0xdf2a 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)) 3a23e: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a242: 88 23 and r24, r24 3a244: d1 f0 breq .+52 ; 0x3a27a 3a246: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a24a: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a24e: 90 91 35 05 lds r25, 0x0535 ; 0x800535 3a252: 28 17 cp r18, r24 3a254: 19 06 cpc r1, r25 3a256: 89 f4 brne .+34 ; 0x3a27a 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); 3a258: 60 e0 ldi r22, 0x00 ; 0 3a25a: c8 01 movw r24, r16 3a25c: 0f 94 32 d0 call 0x3a064 ; 0x3a064 menu_item_ret(); 3a260: 0f 94 ab cd call 0x39b56 ; 0x39b56 menu_item_ret(); return; } } menu_item++; } 3a264: 63 96 adiw r28, 0x13 ; 19 3a266: 0f b6 in r0, 0x3f ; 63 3a268: f8 94 cli 3a26a: de bf out 0x3e, r29 ; 62 3a26c: 0f be out 0x3f, r0 ; 63 3a26e: cd bf out 0x3d, r28 ; 61 3a270: df 91 pop r29 3a272: cf 91 pop r28 3a274: 1f 91 pop r17 3a276: 0f 91 pop r16 3a278: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a27a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a27e: 8f 5f subi r24, 0xFF ; 255 3a280: 80 93 15 05 sts 0x0515, r24 ; 0x800515 3a284: ef cf rjmp .-34 ; 0x3a264 0003a286 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a286: cf 93 push r28 3a288: df 93 push r29 if (menu_item == menu_line) 3a28a: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a28e: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a292: 32 13 cpse r19, r18 3a294: 1e c0 rjmp .+60 ; 0x3a2d2 3a296: eb 01 movw r28, r22 3a298: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a29a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a29e: 88 23 and r24, r24 3a2a0: 19 f0 breq .+6 ; 0x3a2a8 3a2a2: 8e e7 ldi r24, 0x7E ; 126 3a2a4: 0f 94 94 cd call 0x39b28 ; 0x39b28 if (menu_clicked && (lcd_encoder == menu_item)) 3a2a8: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a2ac: 88 23 and r24, r24 3a2ae: 89 f0 breq .+34 ; 0x3a2d2 3a2b0: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a2b4: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a2b8: 90 91 35 05 lds r25, 0x0535 ; 0x800535 3a2bc: 28 17 cp r18, r24 3a2be: 19 06 cpc r1, r25 3a2c0: 41 f4 brne .+16 ; 0x3a2d2 { menu_submenu(submenu); 3a2c2: 60 e0 ldi r22, 0x00 ; 0 3a2c4: ce 01 movw r24, r28 3a2c6: 0f 94 32 d0 call 0x3a064 ; 0x3a064 menu_item_ret(); return; } } menu_item++; } 3a2ca: df 91 pop r29 3a2cc: 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(); 3a2ce: 0d 94 ab cd jmp 0x39b56 ; 0x39b56 return; } } menu_item++; 3a2d2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a2d6: 8f 5f subi r24, 0xFF ; 255 3a2d8: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a2dc: df 91 pop r29 3a2de: cf 91 pop r28 3a2e0: 08 95 ret 0003a2e2 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a2e2: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a2e4: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 3a2e8: 98 17 cp r25, r24 3a2ea: a8 f4 brcc .+42 ; 0x3a316 3a2ec: 89 1b sub r24, r25 3a2ee: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a2f2: 90 e0 ldi r25, 0x00 ; 0 3a2f4: fc 01 movw r30, r24 3a2f6: ee 0f add r30, r30 3a2f8: ff 1f adc r31, r31 3a2fa: e8 0f add r30, r24 3a2fc: f9 1f adc r31, r25 3a2fe: e3 56 subi r30, 0x63 ; 99 3a300: f8 4e sbci r31, 0xE8 ; 232 3a302: 62 81 ldd r22, Z+2 ; 0x02 3a304: 06 2e mov r0, r22 3a306: 00 0c add r0, r0 3a308: 77 0b sbc r23, r23 3a30a: 20 e0 ldi r18, 0x00 ; 0 3a30c: 41 e0 ldi r20, 0x01 ; 1 3a30e: 80 81 ld r24, Z 3a310: 91 81 ldd r25, Z+1 ; 0x01 3a312: 0d 94 ef ce jmp 0x39dde ; 0x39dde } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a316: 80 e0 ldi r24, 0x00 ; 0 3a318: ea cf rjmp .-44 ; 0x3a2ee 0003a31a : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a31a: 81 e0 ldi r24, 0x01 ; 1 3a31c: 0d 94 71 d1 jmp 0x3a2e2 ; 0x3a2e2 0003a320 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a320: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a324: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a328: 32 13 cpse r19, r18 3a32a: 19 c0 rjmp .+50 ; 0x3a35e 3a32c: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a32e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a332: 88 23 and r24, r24 3a334: 19 f0 breq .+6 ; 0x3a33c 3a336: 83 e8 ldi r24, 0x83 ; 131 3a338: 0f 94 94 cd call 0x39b28 ; 0x39b28 if (menu_clicked && (lcd_encoder == menu_item)) 3a33c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a340: 88 23 and r24, r24 3a342: 69 f0 breq .+26 ; 0x3a35e 3a344: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a348: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a34c: 90 91 35 05 lds r25, 0x0535 ; 0x800535 3a350: 28 17 cp r18, r24 3a352: 19 06 cpc r1, r25 3a354: 21 f4 brne .+8 ; 0x3a35e { menu_back(); 3a356: 0f 94 8d d1 call 0x3a31a ; 0x3a31a menu_item_ret(); 3a35a: 0d 94 ab cd jmp 0x39b56 ; 0x39b56 return; } } menu_item++; 3a35e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a362: 8f 5f subi r24, 0xFF ; 255 3a364: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a368: 08 95 ret 0003a36a : }; 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() { 3a36a: ef 92 push r14 3a36c: ff 92 push r15 3a36e: 0f 93 push r16 3a370: 1f 93 push r17 3a372: cf 93 push r28 3a374: df 93 push r29 3a376: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 static constexpr _menu_tune_data_t * const _md = (_menu_tune_data_t*)&(menu_data[0]); // Do not timeout the screen, otherwise there will be FW crash (menu recursion) lcd_timeoutToStatus.stop(); if (_md->status == 0) 3a37a: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 3a37e: 81 11 cpse r24, r1 3a380: 23 c0 rjmp .+70 ; 0x3a3c8 { _md->status = 1; // Menu entered for the first time 3a382: 81 e0 ldi r24, 0x01 ; 1 3a384: 80 93 b2 03 sts 0x03B2, r24 ; 0x8003b2 // Fetch the TuneItem from PROGMEM const uint8_t offset = (mmu2.MMUCurrentErrorCode() == ErrorCode::HOMING_IDLER_FAILED) ? 1 : 0; 3a388: 81 e0 ldi r24, 0x01 ; 1 3a38a: 90 e0 ldi r25, 0x00 ; 0 3a38c: 20 91 66 13 lds r18, 0x1366 ; 0x801366 3a390: 30 91 67 13 lds r19, 0x1367 ; 0x801367 3a394: 27 30 cpi r18, 0x07 ; 7 3a396: 31 48 sbci r19, 0x81 ; 129 3a398: 11 f0 breq .+4 ; 0x3a39e 3a39a: 90 e0 ldi r25, 0x00 ; 0 3a39c: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a39e: bc 01 movw r22, r24 3a3a0: 66 0f add r22, r22 3a3a2: 77 1f adc r23, r23 3a3a4: 68 0f add r22, r24 3a3a6: 79 1f adc r23, r25 3a3a8: 6f 59 subi r22, 0x9F ; 159 3a3aa: 75 45 sbci r23, 0x55 ; 85 3a3ac: 43 e0 ldi r20, 0x03 ; 3 3a3ae: 50 e0 ldi r21, 0x00 ; 0 3a3b0: 84 eb ldi r24, 0xB4 ; 180 3a3b2: 93 e0 ldi r25, 0x03 ; 3 3a3b4: 0f 94 e0 da call 0x3b5c0 ; 0x3b5c0 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a3b8: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 3a3bc: 0f 94 a8 1d call 0x23b50 ; 0x23b50 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a3c0: 80 91 91 13 lds r24, 0x1391 ; 0x801391 3a3c4: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 } MENU_BEGIN(); 3a3c8: 0f 94 c5 ce call 0x39d8a ; 0x39d8a 3a3cc: 10 92 12 05 sts 0x0512, r1 ; 0x800512 3a3d0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a3d4: 84 30 cpi r24, 0x04 ; 4 3a3d6: e0 f5 brcc .+120 ; 0x3a450 3a3d8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 3a3dc: 0f 94 45 cd call 0x39a8a ; 0x39a8a 3a3e0: 88 23 and r24, r24 3a3e2: 89 f0 breq .+34 ; 0x3a406 3a3e4: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 3a3e8: 70 e0 ldi r23, 0x00 ; 0 3a3ea: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 3a3ee: 0e 94 d3 de call 0x1bda6 ; 0x1bda6 3a3f2: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.514> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a3f6: df 91 pop r29 3a3f8: cf 91 pop r28 3a3fa: 1f 91 pop r17 3a3fc: 0f 91 pop r16 3a3fe: ff 90 pop r15 3a400: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3a402: 0d 94 23 27 jmp 0x24e46 ; 0x24e46 mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3a406: 8b e5 ldi r24, 0x5B ; 91 3a408: 95 e6 ldi r25, 0x65 ; 101 3a40a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 3a40e: 0f 94 90 d1 call 0x3a320 ; 0x3a320 MENU_ITEM_EDIT_int3_P( 3a412: 00 91 b6 03 lds r16, 0x03B6 ; 0x8003b6 3a416: 10 e0 ldi r17, 0x00 ; 0 3a418: c0 91 b5 03 lds r28, 0x03B5 ; 0x8003b5 3a41c: d0 e0 ldi r29, 0x00 ; 0 3a41e: 8d e4 ldi r24, 0x4D ; 77 3a420: 95 e6 ldi r25, 0x65 ; 101 3a422: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 3a426: f1 2c mov r15, r1 3a428: e1 2c mov r14, r1 3a42a: 9e 01 movw r18, r28 3a42c: 48 e0 ldi r20, 0x08 ; 8 3a42e: 63 eb ldi r22, 0xB3 ; 179 3a430: 73 e0 ldi r23, 0x03 ; 3 3a432: 0f 94 15 cf call 0x39e2a ; 0x39e2a _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3a436: 0f 94 99 ce call 0x39d32 ; 0x39d32 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3a43a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a43e: 8f 5f subi r24, 0xFF ; 255 3a440: 80 93 12 05 sts 0x0512, r24 ; 0x800512 3a444: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a448: 8f 5f subi r24, 0xFF ; 255 3a44a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 3a44e: c0 cf rjmp .-128 ; 0x3a3d0 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a450: df 91 pop r29 3a452: cf 91 pop r28 3a454: 1f 91 pop r17 3a456: 0f 91 pop r16 3a458: ff 90 pop r15 3a45a: ef 90 pop r14 3a45c: 08 95 ret 0003a45e : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3a45e: 0e 94 c3 71 call 0xe386 ; 0xe386 3a462: 81 11 cpse r24, r1 menu_back(); 3a464: 0d 94 8d d1 jmp 0x3a31a ; 0x3a31a } 3a468: 08 95 ret 0003a46a : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3a46a: 8f 92 push r8 3a46c: 9f 92 push r9 3a46e: af 92 push r10 3a470: bf 92 push r11 3a472: ef 92 push r14 3a474: ff 92 push r15 3a476: 0f 93 push r16 3a478: 1f 93 push r17 3a47a: cf 93 push r28 3a47c: df 93 push r29 3a47e: cd b7 in r28, 0x3d ; 61 3a480: de b7 in r29, 0x3e ; 62 3a482: a0 97 sbiw r28, 0x20 ; 32 3a484: 0f b6 in r0, 0x3f ; 63 3a486: f8 94 cli 3a488: de bf out 0x3e, r29 ; 62 3a48a: 0f be out 0x3f, r0 ; 63 3a48c: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3a48e: 61 15 cp r22, r1 3a490: 71 05 cpc r23, r1 3a492: 81 05 cpc r24, r1 3a494: 91 05 cpc r25, r1 3a496: 99 f4 brne .+38 ; 0x3a4be } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a498: 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)); } 3a49a: a0 96 adiw r28, 0x20 ; 32 3a49c: 0f b6 in r0, 0x3f ; 63 3a49e: f8 94 cli 3a4a0: de bf out 0x3e, r29 ; 62 3a4a2: 0f be out 0x3f, r0 ; 63 3a4a4: cd bf out 0x3d, r28 ; 61 3a4a6: df 91 pop r29 3a4a8: cf 91 pop r28 3a4aa: 1f 91 pop r17 3a4ac: 0f 91 pop r16 3a4ae: ff 90 pop r15 3a4b0: ef 90 pop r14 3a4b2: bf 90 pop r11 3a4b4: af 90 pop r10 3a4b6: 9f 90 pop r9 3a4b8: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a4ba: 0c 94 d3 78 jmp 0xf1a6 ; 0xf1a6 // 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; 3a4be: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a4c0: 84 2e mov r8, r20 3a4c2: 91 2c mov r9, r1 3a4c4: b1 2c mov r11, r1 3a4c6: a1 2c mov r10, r1 3a4c8: 9e 01 movw r18, r28 3a4ca: 2f 5f subi r18, 0xFF ; 255 3a4cc: 3f 4f sbci r19, 0xFF ; 255 3a4ce: 79 01 movw r14, r18 3a4d0: a5 01 movw r20, r10 3a4d2: 94 01 movw r18, r8 3a4d4: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 3a4d8: f7 01 movw r30, r14 3a4da: e0 0f add r30, r16 3a4dc: f1 1d adc r31, r1 3a4de: 60 83 st Z, r22 n /= base; 3a4e0: b9 01 movw r22, r18 3a4e2: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a4e4: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3a4e6: 61 15 cp r22, r1 3a4e8: 71 05 cpc r23, r1 3a4ea: 81 05 cpc r24, r1 3a4ec: 91 05 cpc r25, r1 3a4ee: 81 f7 brne .-32 ; 0x3a4d0 3a4f0: 0e 0d add r16, r14 3a4f2: 1f 2d mov r17, r15 3a4f4: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3a4f6: e0 16 cp r14, r16 3a4f8: f1 06 cpc r15, r17 3a4fa: 59 f0 breq .+22 ; 0x3a512 print((char) (buf[i - 1] < 10 ? 3a4fc: f8 01 movw r30, r16 3a4fe: 82 91 ld r24, -Z 3a500: 8f 01 movw r16, r30 3a502: 8a 30 cpi r24, 0x0A ; 10 3a504: 20 f4 brcc .+8 ; 0x3a50e '0' + buf[i - 1] : 3a506: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a508: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 3a50c: f4 cf rjmp .-24 ; 0x3a4f6 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3a50e: 89 5c subi r24, 0xC9 ; 201 3a510: fb cf rjmp .-10 ; 0x3a508 } 3a512: a0 96 adiw r28, 0x20 ; 32 3a514: 0f b6 in r0, 0x3f ; 63 3a516: f8 94 cli 3a518: de bf out 0x3e, r29 ; 62 3a51a: 0f be out 0x3f, r0 ; 63 3a51c: cd bf out 0x3d, r28 ; 61 3a51e: df 91 pop r29 3a520: cf 91 pop r28 3a522: 1f 91 pop r17 3a524: 0f 91 pop r16 3a526: ff 90 pop r15 3a528: ef 90 pop r14 3a52a: bf 90 pop r11 3a52c: af 90 pop r10 3a52e: 9f 90 pop r9 3a530: 8f 90 pop r8 3a532: 08 95 ret 0003a534 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3a534: cf 92 push r12 3a536: df 92 push r13 3a538: ef 92 push r14 3a53a: ff 92 push r15 3a53c: 6b 01 movw r12, r22 3a53e: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3a540: f7 fe sbrs r15, 7 3a542: 0b c0 rjmp .+22 ; 0x3a55a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a544: 8d e2 ldi r24, 0x2D ; 45 3a546: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3a54a: f0 94 com r15 3a54c: e0 94 com r14 3a54e: d0 94 com r13 3a550: c0 94 com r12 3a552: c1 1c adc r12, r1 3a554: d1 1c adc r13, r1 3a556: e1 1c adc r14, r1 3a558: f1 1c adc r15, r1 } printNumber(n, 10); 3a55a: 4a e0 ldi r20, 0x0A ; 10 3a55c: c7 01 movw r24, r14 3a55e: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3a560: ff 90 pop r15 3a562: ef 90 pop r14 3a564: df 90 pop r13 3a566: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3a568: 0d 94 35 d2 jmp 0x3a46a ; 0x3a46a 0003a56c : void recover_print(uint8_t automatic) { 3a56c: 4f 92 push r4 3a56e: 5f 92 push r5 3a570: 6f 92 push r6 3a572: 7f 92 push r7 3a574: 8f 92 push r8 3a576: 9f 92 push r9 3a578: af 92 push r10 3a57a: bf 92 push r11 3a57c: cf 92 push r12 3a57e: df 92 push r13 3a580: ef 92 push r14 3a582: ff 92 push r15 3a584: 0f 93 push r16 3a586: 1f 93 push r17 3a588: cf 93 push r28 3a58a: df 93 push r29 3a58c: 1f 92 push r1 3a58e: 1f 92 push r1 3a590: cd b7 in r28, 0x3d ; 61 3a592: de b7 in r29, 0x3e ; 62 3a594: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 3a596: 82 e6 ldi r24, 0x62 ; 98 3a598: 95 e6 ldi r25, 0x65 ; 101 3a59a: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 3a59e: 0f 94 be 0b call 0x2177c ; 0x2177c gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 3a5a2: 10 92 40 07 sts 0x0740, r1 ; 0x800740 3a5a6: 10 92 41 07 sts 0x0741, r1 ; 0x800741 3a5aa: 10 92 42 07 sts 0x0742, r1 ; 0x800742 3a5ae: 10 92 43 07 sts 0x0743, r1 ; 0x800743 current_position[Y_AXIS] = 0; 3a5b2: 10 92 44 07 sts 0x0744, r1 ; 0x800744 3a5b6: 10 92 45 07 sts 0x0745, r1 ; 0x800745 3a5ba: 10 92 46 07 sts 0x0746, r1 ; 0x800746 3a5be: 10 92 47 07 sts 0x0747, r1 ; 0x800747 3a5c2: 9e ea ldi r25, 0xAE ; 174 3a5c4: e9 2e mov r14, r25 3a5c6: 9d e0 ldi r25, 0x0D ; 13 3a5c8: 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; 3a5ca: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 3a5cc: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 3a5ce: 27 e0 ldi r18, 0x07 ; 7 3a5d0: b2 2e mov r11, r18 3a5d2: 8c 2d mov r24, r12 3a5d4: 6b 2d mov r22, r11 3a5d6: 0f 94 01 de call 0x3bc02 ; 0x3bc02 <__divmodqi4> 3a5da: 08 2f mov r16, r24 3a5dc: 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); 3a5de: 42 e0 ldi r20, 0x02 ; 2 3a5e0: 50 e0 ldi r21, 0x00 ; 0 3a5e2: b7 01 movw r22, r14 3a5e4: ce 01 movw r24, r28 3a5e6: 01 96 adiw r24, 0x01 ; 1 3a5e8: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c if (v != 0) 3a5ec: 69 81 ldd r22, Y+1 ; 0x01 3a5ee: 7a 81 ldd r23, Y+2 ; 0x02 3a5f0: 61 15 cp r22, r1 3a5f2: 71 05 cpc r23, r1 3a5f4: 11 f0 breq .+4 ; 0x3a5fa mbl_was_active = true; 3a5f6: dd 24 eor r13, r13 3a5f8: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 3a5fa: 2b 2d mov r18, r11 3a5fc: 02 03 mulsu r16, r18 3a5fe: 80 01 movw r16, r0 3a600: 11 24 eor r1, r1 3a602: 09 0d add r16, r9 3a604: 11 1d adc r17, r1 3a606: 97 fc sbrc r9, 7 3a608: 1a 95 dec r17 3a60a: 00 0f add r16, r16 3a60c: 11 1f adc r17, r17 3a60e: 00 0f add r16, r16 3a610: 11 1f adc r17, r17 3a612: 03 56 subi r16, 0x63 ; 99 3a614: 1c 4e sbci r17, 0xEC ; 236 3a616: 07 2e mov r0, r23 3a618: 00 0c add r0, r0 3a61a: 88 0b sbc r24, r24 3a61c: 99 0b sbc r25, r25 3a61e: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 3a622: 2f e6 ldi r18, 0x6F ; 111 3a624: 32 e1 ldi r19, 0x12 ; 18 3a626: 43 e8 ldi r20, 0x83 ; 131 3a628: 5a e3 ldi r21, 0x3A ; 58 3a62a: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3a62e: f8 01 movw r30, r16 3a630: 61 83 std Z+1, r22 ; 0x01 3a632: 72 83 std Z+2, r23 ; 0x02 3a634: 83 83 std Z+3, r24 ; 0x03 3a636: 94 83 std Z+4, r25 ; 0x04 3a638: f2 e0 ldi r31, 0x02 ; 2 3a63a: ef 0e add r14, r31 3a63c: f1 1c adc r15, r1 3a63e: 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) { 3a640: 21 e3 ldi r18, 0x31 ; 49 3a642: c2 12 cpse r12, r18 3a644: c6 cf rjmp .-116 ; 0x3a5d2 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)); 3a646: 8a ed ldi r24, 0xDA ; 218 3a648: 9e e0 ldi r25, 0x0E ; 14 3a64a: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a64e: 60 93 48 07 sts 0x0748, r22 ; 0x800748 3a652: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3a656: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 3a65a: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b // Recover last E axis position current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3a65e: 8e e6 ldi r24, 0x6E ; 110 3a660: 9f e0 ldi r25, 0x0F ; 15 3a662: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a666: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 3a66a: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 3a66e: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 3a672: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 3a676: 0f 94 ca cb call 0x39794 ; 0x39794 // 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(); 3a67a: 0f 94 b4 c6 call 0x38d68 ; 0x38d68 // 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); 3a67e: 80 e4 ldi r24, 0x40 ; 64 3a680: 97 e0 ldi r25, 0x07 ; 7 3a682: 0e 94 8f 6c call 0xd91e ; 0xd91e set_destination_to_current(); 3a686: 0e 94 00 69 call 0xd200 ; 0xd200 plan_set_position_curposXYZE(); 3a68a: 0f 94 08 b9 call 0x37210 ; 0x37210 SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 3a68e: 8a eb ldi r24, 0xBA ; 186 3a690: 9b ea ldi r25, 0xAB ; 171 3a692: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 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]); 3a696: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 3a69a: 8f 93 push r24 3a69c: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a6a0: 8f 93 push r24 3a6a2: 80 91 49 07 lds r24, 0x0749 ; 0x800749 3a6a6: 8f 93 push r24 3a6a8: 80 91 48 07 lds r24, 0x0748 ; 0x800748 3a6ac: 8f 93 push r24 3a6ae: 80 91 47 07 lds r24, 0x0747 ; 0x800747 3a6b2: 8f 93 push r24 3a6b4: 80 91 46 07 lds r24, 0x0746 ; 0x800746 3a6b8: 8f 93 push r24 3a6ba: 80 91 45 07 lds r24, 0x0745 ; 0x800745 3a6be: 8f 93 push r24 3a6c0: 80 91 44 07 lds r24, 0x0744 ; 0x800744 3a6c4: 8f 93 push r24 3a6c6: 80 91 43 07 lds r24, 0x0743 ; 0x800743 3a6ca: 8f 93 push r24 3a6cc: 80 91 42 07 lds r24, 0x0742 ; 0x800742 3a6d0: 8f 93 push r24 3a6d2: 80 91 41 07 lds r24, 0x0741 ; 0x800741 3a6d6: 8f 93 push r24 3a6d8: 80 91 40 07 lds r24, 0x0740 ; 0x800740 3a6dc: 8f 93 push r24 3a6de: 87 eb ldi r24, 0xB7 ; 183 3a6e0: 91 e7 ldi r25, 0x71 ; 113 3a6e2: 9f 93 push r25 3a6e4: 8f 93 push r24 3a6e6: 0f 94 08 dc call 0x3b810 ; 0x3b810 print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 3a6ea: 81 e0 ldi r24, 0x01 ; 1 3a6ec: 80 93 3f 07 sts 0x073F, r24 ; 0x80073f enable_z(); 3a6f0: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 3a6f2: 88 ed ldi r24, 0xD8 ; 216 3a6f4: 9e e0 ldi r25, 0x0E ; 14 3a6f6: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 3a6fa: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 3a6fe: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 3a702: 8b e8 ldi r24, 0x8B ; 139 3a704: 9f e0 ldi r25, 0x0F ; 15 3a706: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 3a70a: 90 e0 ldi r25, 0x00 ; 0 3a70c: 90 93 69 0e sts 0x0E69, r25 ; 0x800e69 3a710: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 3a714: 88 ee ldi r24, 0xE8 ; 232 3a716: 9e e0 ldi r25, 0x0E ; 14 3a718: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a71c: 60 93 bb 02 sts 0x02BB, r22 ; 0x8002bb 3a720: 70 93 bc 02 sts 0x02BC, r23 ; 0x8002bc 3a724: 80 93 bd 02 sts 0x02BD, r24 ; 0x8002bd 3a728: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 3a72c: 8e ed ldi r24, 0xDE ; 222 3a72e: 9e e0 ldi r25, 0x0E ; 14 3a730: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 3a734: 90 93 95 02 sts 0x0295, r25 ; 0x800295 3a738: 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)); 3a73c: 40 e1 ldi r20, 0x10 ; 16 3a73e: 50 e0 ldi r21, 0x00 ; 0 3a740: 67 e3 ldi r22, 0x37 ; 55 3a742: 7d e0 ldi r23, 0x0D ; 13 3a744: 8b ea ldi r24, 0xAB ; 171 3a746: 92 e0 ldi r25, 0x02 ; 2 3a748: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 3a74c: 8c e6 ldi r24, 0x6C ; 108 3a74e: 9f e0 ldi r25, 0x0F ; 15 3a750: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 3a754: 90 93 09 18 sts 0x1809, r25 ; 0x801809 3a758: 80 93 08 18 sts 0x1808, r24 ; 0x801808 #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 3a75c: 8c e2 ldi r24, 0x2C ; 44 3a75e: 9d e0 ldi r25, 0x0D ; 13 3a760: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a764: 60 93 04 18 sts 0x1804, r22 ; 0x801804 3a768: 70 93 05 18 sts 0x1805, r23 ; 0x801805 3a76c: 80 93 06 18 sts 0x1806, r24 ; 0x801806 3a770: 90 93 07 18 sts 0x1807, r25 ; 0x801807 #endif #ifdef PREVENT_DANGEROUS_EXTRUDE extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP); 3a774: 8d e7 ldi r24, 0x7D ; 125 3a776: 9c e0 ldi r25, 0x0C ; 12 3a778: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 3a77c: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 3a780: 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)); 3a784: 40 e1 ldi r20, 0x10 ; 16 3a786: 50 e0 ldi r21, 0x00 ; 0 3a788: 6d e6 ldi r22, 0x6D ; 109 3a78a: 7c e0 ldi r23, 0x0C ; 12 3a78c: 8f e8 ldi r24, 0x8F ; 143 3a78e: 96 e0 ldi r25, 0x06 ; 6 3a790: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c 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)); 3a794: 40 e1 ldi r20, 0x10 ; 16 3a796: 50 e0 ldi r21, 0x00 ; 0 3a798: 6d e5 ldi r22, 0x5D ; 93 3a79a: 7c e0 ldi r23, 0x0C ; 12 3a79c: 87 e1 ldi r24, 0x17 ; 23 3a79e: 97 e0 ldi r25, 0x07 ; 7 3a7a0: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 3a7a4: 40 e1 ldi r20, 0x10 ; 16 3a7a6: 50 e0 ldi r21, 0x00 ; 0 3a7a8: 6d e4 ldi r22, 0x4D ; 77 3a7aa: 7c e0 ldi r23, 0x0C ; 12 3a7ac: 8f e7 ldi r24, 0x7F ; 127 3a7ae: 96 e0 ldi r25, 0x06 ; 6 3a7b0: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 3a7b4: 40 e1 ldi r20, 0x10 ; 16 3a7b6: 50 e0 ldi r21, 0x00 ; 0 3a7b8: 6d e3 ldi r22, 0x3D ; 61 3a7ba: 7c e0 ldi r23, 0x0C ; 12 3a7bc: 87 e0 ldi r24, 0x07 ; 7 3a7be: 97 e0 ldi r25, 0x07 ; 7 3a7c0: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 3a7c4: 89 e3 ldi r24, 0x39 ; 57 3a7c6: 9c e0 ldi r25, 0x0C ; 12 3a7c8: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a7cc: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 3a7d0: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 3a7d4: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 3a7d8: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 3a7dc: 85 e3 ldi r24, 0x35 ; 53 3a7de: 9c e0 ldi r25, 0x0C ; 12 3a7e0: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a7e4: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 3a7e8: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 3a7ec: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 3a7f0: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 3a7f4: 81 e3 ldi r24, 0x31 ; 49 3a7f6: 9c e0 ldi r25, 0x0C ; 12 3a7f8: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a7fc: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 3a800: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 3a804: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 3a808: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 3a80c: 40 e1 ldi r20, 0x10 ; 16 3a80e: 50 e0 ldi r21, 0x00 ; 0 3a810: 61 e2 ldi r22, 0x21 ; 33 3a812: 7c e0 ldi r23, 0x0C ; 12 3a814: 83 eb ldi r24, 0xB3 ; 179 3a816: 96 e0 ldi r25, 0x06 ; 6 3a818: 0f 94 36 dd call 0x3ba6c ; 0x3ba6c 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 ) { 3a81c: 8f e7 ldi r24, 0x7F ; 127 3a81e: 9c e0 ldi r25, 0x0C ; 12 3a820: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 3a824: 0f b6 in r0, 0x3f ; 63 3a826: f8 94 cli 3a828: de bf out 0x3e, r29 ; 62 3a82a: 0f be out 0x3f, r0 ; 63 3a82c: cd bf out 0x3d, r28 ; 61 3a82e: 81 30 cpi r24, 0x01 ; 1 3a830: b1 f4 brne .+44 ; 0x3a85e current_position[Z_AXIS] += Z_PAUSE_LIFT; 3a832: 20 e0 ldi r18, 0x00 ; 0 3a834: 30 e0 ldi r19, 0x00 ; 0 3a836: 40 ea ldi r20, 0xA0 ; 160 3a838: 51 e4 ldi r21, 0x41 ; 65 3a83a: 60 91 48 07 lds r22, 0x0748 ; 0x800748 3a83e: 70 91 49 07 lds r23, 0x0749 ; 0x800749 3a842: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a846: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 3a84a: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3a84e: 60 93 48 07 sts 0x0748, r22 ; 0x800748 3a852: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3a856: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 3a85a: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b } // Lift the print head ONCE plus Z_PAUSE_LIFT first to avoid collisions with oozed material with the print, if(eeprom_read_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED) == 0) { 3a85e: 8f e7 ldi r24, 0x7F ; 127 3a860: 9c e0 ldi r25, 0x0C ; 12 3a862: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 3a866: 81 11 cpse r24, r1 3a868: 23 c0 rjmp .+70 ; 0x3a8b0 enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 3a86a: 20 e0 ldi r18, 0x00 ; 0 3a86c: 30 e0 ldi r19, 0x00 ; 0 3a86e: 40 ea ldi r20, 0xA0 ; 160 3a870: 51 e4 ldi r21, 0x41 ; 65 3a872: 60 91 48 07 lds r22, 0x0748 ; 0x800748 3a876: 70 91 49 07 lds r23, 0x0749 ; 0x800749 3a87a: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a87e: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 3a882: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3a886: 9f 93 push r25 3a888: 8f 93 push r24 3a88a: 7f 93 push r23 3a88c: 6f 93 push r22 3a88e: 8f eb ldi r24, 0xBF ; 191 3a890: 9c ea ldi r25, 0xAC ; 172 3a892: 9f 93 push r25 3a894: 8f 93 push r24 3a896: 0e 94 fa 89 call 0x113f4 ; 0x113f4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 3a89a: 61 e0 ldi r22, 0x01 ; 1 3a89c: 8f e7 ldi r24, 0x7F ; 127 3a89e: 9c e0 ldi r25, 0x0C ; 12 3a8a0: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 3a8a4: 0f 90 pop r0 3a8a6: 0f 90 pop r0 3a8a8: 0f 90 pop r0 3a8aa: 0f 90 pop r0 3a8ac: 0f 90 pop r0 3a8ae: 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")); 3a8b0: 61 e0 ldi r22, 0x01 ; 1 3a8b2: 87 eb ldi r24, 0xB7 ; 183 3a8b4: 9c ea ldi r25, 0xAC ; 172 3a8b6: 0e 94 5c 89 call 0x112b8 ; 0x112b8 // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 3a8ba: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3a8be: 8f 93 push r24 3a8c0: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 3a8c4: 8f 93 push r24 3a8c6: 8e ea ldi r24, 0xAE ; 174 3a8c8: 9c ea ldi r25, 0xAC ; 172 3a8ca: 9f 93 push r25 3a8cc: 8f 93 push r24 3a8ce: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 3a8d2: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 3a8d6: 8f 93 push r24 3a8d8: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 3a8dc: 8f 93 push r24 3a8de: 85 ea ldi r24, 0xA5 ; 165 3a8e0: 9c ea ldi r25, 0xAC ; 172 3a8e2: 9f 93 push r25 3a8e4: 8f 93 push r24 3a8e6: 0e 94 fa 89 call 0x113f4 ; 0x113f4 //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) { 3a8ea: 8c e8 ldi r24, 0x8C ; 140 3a8ec: 9f e0 ldi r25, 0x0F ; 15 3a8ee: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 3a8f2: 0f b6 in r0, 0x3f ; 63 3a8f4: f8 94 cli 3a8f6: de bf out 0x3e, r29 ; 62 3a8f8: 0f be out 0x3f, r0 ; 63 3a8fa: cd bf out 0x3d, r28 ; 61 3a8fc: 81 11 cpse r24, r1 3a8fe: 10 c0 rjmp .+32 ; 0x3a920 enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 3a900: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3a904: 8f 93 push r24 3a906: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 3a90a: 8f 93 push r24 3a90c: 8c e9 ldi r24, 0x9C ; 156 3a90e: 9c ea ldi r25, 0xAC ; 172 3a910: 9f 93 push r25 3a912: 8f 93 push r24 3a914: 0e 94 fa 89 call 0x113f4 ; 0x113f4 3a918: 0f 90 pop r0 3a91a: 0f 90 pop r0 3a91c: 0f 90 pop r0 3a91e: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 3a920: 61 e0 ldi r22, 0x01 ; 1 3a922: 87 e5 ldi r24, 0x57 ; 87 3a924: 9c e6 ldi r25, 0x6C ; 108 3a926: 0e 94 5c 89 call 0x112b8 ; 0x112b8 // If not automatically recoreverd (long power loss) if(automatic == 0){ 3a92a: a1 10 cpse r10, r1 3a92c: 17 c0 rjmp .+46 ; 0x3a95c //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 3a92e: 61 e0 ldi r22, 0x01 ; 1 3a930: 81 e9 ldi r24, 0x91 ; 145 3a932: 9c ea ldi r25, 0xAC ; 172 3a934: 0e 94 5c 89 call 0x112b8 ; 0x112b8 // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 3a938: 8f e3 ldi r24, 0x3F ; 63 3a93a: 8f 93 push r24 3a93c: 80 e8 ldi r24, 0x80 ; 128 3a93e: 8f 93 push r24 3a940: 1f 92 push r1 3a942: 1f 92 push r1 3a944: 82 e1 ldi r24, 0x12 ; 18 3a946: 92 e7 ldi r25, 0x72 ; 114 3a948: 9f 93 push r25 3a94a: 8f 93 push r24 3a94c: 0e 94 fa 89 call 0x113f4 ; 0x113f4 3a950: 0f 90 pop r0 3a952: 0f 90 pop r0 3a954: 0f 90 pop r0 3a956: 0f 90 pop r0 3a958: 0f 90 pop r0 3a95a: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 3a95c: 8c ef ldi r24, 0xFC ; 252 3a95e: 91 e7 ldi r25, 0x71 ; 113 3a960: 0f 94 2f dc call 0x3b85e ; 0x3b85e gcode_M114(); 3a964: 0e 94 e3 79 call 0xf3c6 ; 0xf3c6 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); 3a968: 88 e8 ldi r24, 0x88 ; 136 3a96a: 9f e0 ldi r25, 0x0F ; 15 3a96c: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 3a970: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 3a972: 89 e8 ldi r24, 0x89 ; 137 3a974: 9f e0 ldi r25, 0x0F ; 15 3a976: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 3a97a: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 3a97c: 85 e3 ldi r24, 0x35 ; 53 3a97e: 9d e0 ldi r25, 0x0D ; 13 3a980: 0f 94 54 dd call 0x3baa8 ; 0x3baa8 3a984: f8 2e mov r15, r24 3a986: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 3a988: 87 e8 ldi r24, 0x87 ; 135 3a98a: 9c ea ldi r25, 0xAC ; 172 3a98c: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3a990: b8 01 movw r22, r16 3a992: 01 2e mov r0, r17 3a994: 00 0c add r0, r0 3a996: 88 0b sbc r24, r24 3a998: 99 0b sbc r25, r25 3a99a: 0f 94 9a d2 call 0x3a534 ; 0x3a534 MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 3a99e: 87 e7 ldi r24, 0x77 ; 119 3a9a0: 9c ea ldi r25, 0xAC ; 172 3a9a2: 0e 94 ec 78 call 0xf1d8 ; 0xf1d8 MYSERIAL.println(feedmultiply_rec); 3a9a6: 8f 2d mov r24, r15 3a9a8: 9e 2d mov r25, r14 3a9aa: 0f 94 ce 76 call 0x2ed9c ; 0x2ed9c if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3a9ae: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 3a9b2: 81 11 cpse r24, r1 3a9b4: 02 c0 rjmp .+4 ; 0x3a9ba { // M23 restore_file_from_sd(); 3a9b6: 0e 94 1f 8a call 0x1143e ; 0x1143e } // 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)); 3a9ba: 8d e9 ldi r24, 0x9D ; 157 3a9bc: 9f e0 ldi r25, 0x0F ; 15 3a9be: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a9c2: c6 2e mov r12, r22 3a9c4: b7 2e mov r11, r23 3a9c6: a8 2e mov r10, r24 3a9c8: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 3a9ca: 81 ea ldi r24, 0xA1 ; 161 3a9cc: 9f e0 ldi r25, 0x0F ; 15 3a9ce: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3a9d2: 76 2e mov r7, r22 3a9d4: 67 2e mov r6, r23 3a9d6: 58 2e mov r5, r24 3a9d8: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 3a9da: 20 e0 ldi r18, 0x00 ; 0 3a9dc: 30 e0 ldi r19, 0x00 ; 0 3a9de: 40 e8 ldi r20, 0x80 ; 128 3a9e0: 5f eb ldi r21, 0xBF ; 191 3a9e2: 6c 2d mov r22, r12 3a9e4: 7b 2d mov r23, r11 3a9e6: 8a 2d mov r24, r10 3a9e8: 99 2d mov r25, r9 3a9ea: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 3a9ee: 88 23 and r24, r24 3a9f0: 99 f0 breq .+38 ; 0x3aa18 enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 3a9f2: 4f 92 push r4 3a9f4: 5f 92 push r5 3a9f6: 6f 92 push r6 3a9f8: 7f 92 push r7 3a9fa: 9f 92 push r9 3a9fc: af 92 push r10 3a9fe: bf 92 push r11 3aa00: cf 92 push r12 3aa02: 80 e6 ldi r24, 0x60 ; 96 3aa04: 9c ea ldi r25, 0xAC ; 172 3aa06: 9f 93 push r25 3aa08: 8f 93 push r24 3aa0a: 0e 94 fa 89 call 0x113f4 ; 0x113f4 3aa0e: 0f b6 in r0, 0x3f ; 63 3aa10: f8 94 cli 3aa12: de bf out 0x3e, r29 ; 62 3aa14: 0f be out 0x3f, r0 ; 63 3aa16: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 3aa18: dd 20 and r13, r13 3aa1a: 29 f0 breq .+10 ; 0x3aa26 enquecommand_P(PSTR("PRUSA MBL V1")); 3aa1c: 61 e0 ldi r22, 0x01 ; 1 3aa1e: 83 e5 ldi r24, 0x53 ; 83 3aa20: 9c ea ldi r25, 0xAC ; 172 3aa22: 0e 94 5c 89 call 0x112b8 ; 0x112b8 // 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))); 3aa26: 8d e8 ldi r24, 0x8D ; 141 3aa28: 9f e0 ldi r25, 0x0F ; 15 3aa2a: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3aa2e: 9f 93 push r25 3aa30: 8f 93 push r24 3aa32: 7f 93 push r23 3aa34: 6f 93 push r22 3aa36: 89 e4 ldi r24, 0x49 ; 73 3aa38: 9c ea ldi r25, 0xAC ; 172 3aa3a: 9f 93 push r25 3aa3c: 8f 93 push r24 3aa3e: 0e 94 fa 89 call 0x113f4 ; 0x113f4 // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 3aa42: 81 e1 ldi r24, 0x11 ; 17 3aa44: 9d e0 ldi r25, 0x0D ; 13 3aa46: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3aa4a: d6 2e mov r13, r22 3aa4c: c7 2e mov r12, r23 3aa4e: b8 2e mov r11, r24 3aa50: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 3aa52: 8d e0 ldi r24, 0x0D ; 13 3aa54: 9d e0 ldi r25, 0x0D ; 13 3aa56: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c 3aa5a: 96 2e mov r9, r22 3aa5c: 77 2e mov r7, r23 3aa5e: 68 2e mov r6, r24 3aa60: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 3aa62: 89 e0 ldi r24, 0x09 ; 9 3aa64: 9d e0 ldi r25, 0x0D ; 13 3aa66: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c // 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); 3aa6a: 9f 93 push r25 3aa6c: 8f 93 push r24 3aa6e: 7f 93 push r23 3aa70: 6f 93 push r22 3aa72: 5f 92 push r5 3aa74: 6f 92 push r6 3aa76: 7f 92 push r7 3aa78: 9f 92 push r9 3aa7a: af 92 push r10 3aa7c: bf 92 push r11 3aa7e: cf 92 push r12 3aa80: df 92 push r13 3aa82: 8f e2 ldi r24, 0x2F ; 47 3aa84: 9c ea ldi r25, 0xAC ; 172 3aa86: 9f 93 push r25 3aa88: 8f 93 push r24 3aa8a: 0e 94 fa 89 call 0x113f4 ; 0x113f4 // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 3aa8e: 8f e3 ldi r24, 0x3F ; 63 3aa90: 8f 93 push r24 3aa92: 80 e8 ldi r24, 0x80 ; 128 3aa94: 8f 93 push r24 3aa96: 1f 92 push r1 3aa98: 1f 92 push r1 3aa9a: 82 e1 ldi r24, 0x12 ; 18 3aa9c: 92 e7 ldi r25, 0x72 ; 114 3aa9e: 9f 93 push r25 3aaa0: 8f 93 push r24 3aaa2: 0e 94 fa 89 call 0x113f4 ; 0x113f4 // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3aaa6: 8e e6 ldi r24, 0x6E ; 110 3aaa8: 9f e0 ldi r25, 0x0F ; 15 3aaaa: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 3aaae: 9f 93 push r25 3aab0: 8f 93 push r24 3aab2: 7f 93 push r23 3aab4: 6f 93 push r22 3aab6: 84 e2 ldi r24, 0x24 ; 36 3aab8: 9c ea ldi r25, 0xAC ; 172 3aaba: 9f 93 push r25 3aabc: 8f 93 push r24 3aabe: 0e 94 fa 89 call 0x113f4 ; 0x113f4 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 3aac2: 0f b6 in r0, 0x3f ; 63 3aac4: f8 94 cli 3aac6: de bf out 0x3e, r29 ; 62 3aac8: 0f be out 0x3f, r0 ; 63 3aaca: cd bf out 0x3d, r28 ; 61 3aacc: 82 e7 ldi r24, 0x72 ; 114 3aace: 9f e0 ldi r25, 0x0F ; 15 3aad0: 0f 94 46 dd call 0x3ba8c ; 0x3ba8c 3aad4: 88 23 and r24, r24 3aad6: 29 f0 breq .+10 ; 0x3aae2 enquecommand_P(PSTR("M82")); //E axis abslute mode 3aad8: 61 e0 ldi r22, 0x01 ; 1 3aada: 80 e2 ldi r24, 0x20 ; 32 3aadc: 9c ea ldi r25, 0xAC ; 172 3aade: 0e 94 5c 89 call 0x112b8 ; 0x112b8 // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 3aae2: 1f 93 push r17 3aae4: 0f 93 push r16 3aae6: 89 e1 ldi r24, 0x19 ; 25 3aae8: 9c ea ldi r25, 0xAC ; 172 3aaea: 9f 93 push r25 3aaec: 8f 93 push r24 3aaee: 0e 94 fa 89 call 0x113f4 ; 0x113f4 enquecommandf_P(MSG_M220, feedmultiply_rec); 3aaf2: ef 92 push r14 3aaf4: ff 92 push r15 3aaf6: 8e ed ldi r24, 0xDE ; 222 3aaf8: 91 e7 ldi r25, 0x71 ; 113 3aafa: 9f 93 push r25 3aafc: 8f 93 push r24 3aafe: 0e 94 fa 89 call 0x113f4 ; 0x113f4 // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 3ab02: 1f 92 push r1 3ab04: 8f 92 push r8 3ab06: 80 e1 ldi r24, 0x10 ; 16 3ab08: 9c ea ldi r25, 0xAC ; 172 3ab0a: 9f 93 push r25 3ab0c: 8f 93 push r24 3ab0e: 0e 94 fa 89 call 0x113f4 ; 0x113f4 // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 3ab12: 81 e9 ldi r24, 0x91 ; 145 3ab14: 9f e0 ldi r25, 0x0F ; 15 3ab16: 0f 94 4e dd call 0x3ba9c ; 0x3ba9c if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3ab1a: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 3ab1e: 0f b6 in r0, 0x3f ; 63 3ab20: f8 94 cli 3ab22: de bf out 0x3e, r29 ; 62 3ab24: 0f be out 0x3f, r0 ; 63 3ab26: cd bf out 0x3d, r28 ; 61 3ab28: 21 11 cpse r18, r1 3ab2a: 33 c0 rjmp .+102 ; 0x3ab92 { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 3ab2c: 9f 93 push r25 3ab2e: 8f 93 push r24 3ab30: 7f 93 push r23 3ab32: 6f 93 push r22 3ab34: 87 e0 ldi r24, 0x07 ; 7 3ab36: 9c ea ldi r25, 0xAC ; 172 } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3ab38: 9f 93 push r25 3ab3a: 8f 93 push r24 3ab3c: 0e 94 fa 89 call 0x113f4 ; 0x113f4 3ab40: 0f 90 pop r0 3ab42: 0f 90 pop r0 3ab44: 0f 90 pop r0 3ab46: 0f 90 pop r0 3ab48: 0f 90 pop r0 3ab4a: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 3ab4c: 61 e0 ldi r22, 0x01 ; 1 3ab4e: 87 ef ldi r24, 0xF7 ; 247 3ab50: 9b ea ldi r25, 0xAB ; 171 3ab52: 0e 94 5c 89 call 0x112b8 ; 0x112b8 enquecommand_P(PSTR("PRUSA uvlo")); 3ab56: 61 e0 ldi r22, 0x01 ; 1 3ab58: 8c ee ldi r24, 0xEC ; 236 3ab5a: 9b ea ldi r25, 0xAB ; 171 3ab5c: 0e 94 5c 89 call 0x112b8 ; 0x112b8 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")); 3ab60: 87 ee ldi r24, 0xE7 ; 231 3ab62: 91 e7 ldi r25, 0x71 ; 113 3ab64: 0f 94 2f dc call 0x3b85e ; 0x3b85e gcode_M114(); 3ab68: 0e 94 e3 79 call 0xf3c6 ; 0xf3c6 } 3ab6c: 0f 90 pop r0 3ab6e: 0f 90 pop r0 3ab70: df 91 pop r29 3ab72: cf 91 pop r28 3ab74: 1f 91 pop r17 3ab76: 0f 91 pop r16 3ab78: ff 90 pop r15 3ab7a: ef 90 pop r14 3ab7c: df 90 pop r13 3ab7e: cf 90 pop r12 3ab80: bf 90 pop r11 3ab82: af 90 pop r10 3ab84: 9f 90 pop r9 3ab86: 8f 90 pop r8 3ab88: 7f 90 pop r7 3ab8a: 6f 90 pop r6 3ab8c: 5f 90 pop r5 3ab8e: 4f 90 pop r4 3ab90: 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) 3ab92: 21 30 cpi r18, 0x01 ; 1 3ab94: d9 f6 brne .-74 ; 0x3ab4c { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3ab96: 9f 93 push r25 3ab98: 8f 93 push r24 3ab9a: 7f 93 push r23 3ab9c: 6f 93 push r22 3ab9e: 8d ef ldi r24, 0xFD ; 253 3aba0: 9b ea ldi r25, 0xAB ; 171 3aba2: ca cf rjmp .-108 ; 0x3ab38 0003aba4 : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3aba4: 8f 92 push r8 3aba6: 9f 92 push r9 3aba8: af 92 push r10 3abaa: bf 92 push r11 3abac: cf 92 push r12 3abae: df 92 push r13 3abb0: ef 92 push r14 3abb2: ff 92 push r15 3abb4: cf 93 push r28 3abb6: 6b 01 movw r12, r22 3abb8: 7c 01 movw r14, r24 3abba: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3abbc: 20 e0 ldi r18, 0x00 ; 0 3abbe: 30 e0 ldi r19, 0x00 ; 0 3abc0: a9 01 movw r20, r18 3abc2: 0f 94 63 df call 0x3bec6 ; 0x3bec6 <__cmpsf2> 3abc6: 87 ff sbrs r24, 7 3abc8: 07 c0 rjmp .+14 ; 0x3abd8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3abca: 8d e2 ldi r24, 0x2D ; 45 3abcc: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3abd0: f7 fa bst r15, 7 3abd2: f0 94 com r15 3abd4: f7 f8 bld r15, 7 3abd6: 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; 3abe6: 20 e0 ldi r18, 0x00 ; 0 3abe8: 30 e0 ldi r19, 0x00 ; 0 3abea: 40 e2 ldi r20, 0x20 ; 32 3abec: 51 e4 ldi r21, 0x41 ; 65 3abee: 0f 94 6d df call 0x3beda ; 0x3beda <__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; 3abf6: 9b 01 movw r18, r22 3abf8: ac 01 movw r20, r24 3abfa: c7 01 movw r24, r14 3abfc: b6 01 movw r22, r12 3abfe: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3ac02: 6b 01 movw r12, r22 3ac04: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3ac06: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 3ac0a: 4b 01 movw r8, r22 3ac0c: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3ac0e: 4a e0 ldi r20, 0x0A ; 10 3ac10: 0f 94 35 d2 call 0x3a46a ; 0x3a46a 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) 3ac14: cc 23 and r28, r28 3ac16: 91 f1 breq .+100 ; 0x3ac7c 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; 3ac18: c5 01 movw r24, r10 3ac1a: b4 01 movw r22, r8 3ac1c: 0f 94 d2 d7 call 0x3afa4 ; 0x3afa4 <__floatunsisf> 3ac20: 9b 01 movw r18, r22 3ac22: ac 01 movw r20, r24 3ac24: c7 01 movw r24, r14 3ac26: b6 01 movw r22, r12 3ac28: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 3ac2c: 6b 01 movw r12, r22 3ac2e: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac30: 8e e2 ldi r24, 0x2E ; 46 3ac32: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 // 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) 3ac36: c1 50 subi r28, 0x01 ; 1 3ac38: 08 f1 brcs .+66 ; 0x3ac7c { remainder *= 10.0; 3ac3a: 20 e0 ldi r18, 0x00 ; 0 3ac3c: 30 e0 ldi r19, 0x00 ; 0 3ac3e: 40 e2 ldi r20, 0x20 ; 32 3ac40: 51 e4 ldi r21, 0x41 ; 65 3ac42: c7 01 movw r24, r14 3ac44: b6 01 movw r22, r12 3ac46: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3ac4a: 4b 01 movw r8, r22 3ac4c: 5c 01 movw r10, r24 int toPrint = int(remainder); 3ac4e: 0f 94 df df call 0x3bfbe ; 0x3bfbe <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3ac52: 6b 01 movw r12, r22 3ac54: 77 0f add r23, r23 3ac56: ee 08 sbc r14, r14 3ac58: ff 08 sbc r15, r15 3ac5a: c7 01 movw r24, r14 3ac5c: b6 01 movw r22, r12 3ac5e: 0f 94 9a d2 call 0x3a534 ; 0x3a534 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3ac62: c7 01 movw r24, r14 3ac64: b6 01 movw r22, r12 3ac66: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 3ac6a: 9b 01 movw r18, r22 3ac6c: ac 01 movw r20, r24 3ac6e: c5 01 movw r24, r10 3ac70: b4 01 movw r22, r8 3ac72: 0f 94 6d de call 0x3bcda ; 0x3bcda <__subsf3> 3ac76: 6b 01 movw r12, r22 3ac78: 7c 01 movw r14, r24 3ac7a: dd cf rjmp .-70 ; 0x3ac36 } } 3ac7c: cf 91 pop r28 3ac7e: ff 90 pop r15 3ac80: ef 90 pop r14 3ac82: df 90 pop r13 3ac84: cf 90 pop r12 3ac86: bf 90 pop r11 3ac88: af 90 pop r10 3ac8a: 9f 90 pop r9 3ac8c: 8f 90 pop r8 3ac8e: 08 95 ret 0003ac90 : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac90: 8a e0 ldi r24, 0x0A ; 10 3ac92: 0c 94 d3 78 jmp 0xf1a6 ; 0xf1a6 0003ac96 : 3ac96: 0e 94 50 89 call 0x112a0 ; 0x112a0 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3ac9a: 0d 94 48 d6 jmp 0x3ac90 ; 0x3ac90 0003ac9e : } 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) { 3ac9e: 20 91 92 04 lds r18, 0x0492 ; 0x800492 3aca2: 30 91 93 04 lds r19, 0x0493 ; 0x800493 3aca6: 80 91 90 04 lds r24, 0x0490 ; 0x800490 3acaa: 90 91 91 04 lds r25, 0x0491 ; 0x800491 3acae: 82 17 cp r24, r18 3acb0: 93 07 cpc r25, r19 3acb2: 71 f0 breq .+28 ; 0x3acd0 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3acb4: f9 01 movw r30, r18 3acb6: e0 5f subi r30, 0xF0 ; 240 3acb8: fb 4f sbci r31, 0xFB ; 251 3acba: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3acbc: 2f 5f subi r18, 0xFF ; 255 3acbe: 3f 4f sbci r19, 0xFF ; 255 3acc0: 2f 77 andi r18, 0x7F ; 127 3acc2: 33 27 eor r19, r19 3acc4: 30 93 93 04 sts 0x0493, r19 ; 0x800493 3acc8: 20 93 92 04 sts 0x0492, r18 ; 0x800492 return c; 3accc: 90 e0 ldi r25, 0x00 ; 0 3acce: 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; 3acd0: 8f ef ldi r24, 0xFF ; 255 3acd2: 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; } } 3acd4: 08 95 ret 0003acd6 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3acd6: 1f 92 push r1 3acd8: 0f 92 push r0 3acda: 0f b6 in r0, 0x3f ; 63 3acdc: 0f 92 push r0 3acde: 11 24 eor r1, r1 3ace0: 0b b6 in r0, 0x3b ; 59 3ace2: 0f 92 push r0 3ace4: 2f 93 push r18 3ace6: 3f 93 push r19 3ace8: 4f 93 push r20 3acea: 6f 93 push r22 3acec: 7f 93 push r23 3acee: 8f 93 push r24 3acf0: 9f 93 push r25 3acf2: ef 93 push r30 3acf4: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3acfa: 84 ff sbrs r24, 4 3acfc: 12 c0 rjmp .+36 ; 0x3ad22 <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3acfe: 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 } } 3ad02: ff 91 pop r31 3ad04: ef 91 pop r30 3ad06: 9f 91 pop r25 3ad08: 8f 91 pop r24 3ad0a: 7f 91 pop r23 3ad0c: 6f 91 pop r22 3ad0e: 4f 91 pop r20 3ad10: 3f 91 pop r19 3ad12: 2f 91 pop r18 3ad14: 0f 90 pop r0 3ad16: 0b be out 0x3b, r0 ; 59 3ad18: 0f 90 pop r0 3ad1a: 0f be out 0x3f, r0 ; 63 3ad1c: 0f 90 pop r0 3ad1e: 1f 90 pop r1 3ad20: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3ad22: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3ad26: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 3ad2a: 81 30 cpi r24, 0x01 ; 1 3ad2c: 51 f7 brne .-44 ; 0x3ad02 <__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; 3ad2e: 20 91 90 04 lds r18, 0x0490 ; 0x800490 3ad32: 30 91 91 04 lds r19, 0x0491 ; 0x800491 3ad36: c9 01 movw r24, r18 3ad38: 01 96 adiw r24, 0x01 ; 1 3ad3a: 8f 77 andi r24, 0x7F ; 127 3ad3c: 99 27 eor r25, r25 // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the // current location of the tail), we're about to overflow the buffer // and so we don't write the character or advance the head. if (i != rx_buffer.tail) { 3ad3e: 60 91 92 04 lds r22, 0x0492 ; 0x800492 3ad42: 70 91 93 04 lds r23, 0x0493 ; 0x800493 3ad46: 86 17 cp r24, r22 3ad48: 97 07 cpc r25, r23 3ad4a: d9 f2 breq .-74 ; 0x3ad02 <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ad4c: 20 5f subi r18, 0xF0 ; 240 3ad4e: 3b 4f sbci r19, 0xFB ; 251 3ad50: f9 01 movw r30, r18 3ad52: 40 83 st Z, r20 rx_buffer.head = i; 3ad54: 90 93 91 04 sts 0x0491, r25 ; 0x800491 3ad58: 80 93 90 04 sts 0x0490, r24 ; 0x800490 3ad5c: d2 cf rjmp .-92 ; 0x3ad02 <__vector_36+0x2c> 0003ad5e <__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) { 3ad5e: 1f 92 push r1 3ad60: 0f 92 push r0 3ad62: 0f b6 in r0, 0x3f ; 63 3ad64: 0f 92 push r0 3ad66: 11 24 eor r1, r1 3ad68: 0b b6 in r0, 0x3b ; 59 3ad6a: 0f 92 push r0 3ad6c: 2f 93 push r18 3ad6e: 3f 93 push r19 3ad70: 4f 93 push r20 3ad72: 6f 93 push r22 3ad74: 7f 93 push r23 3ad76: 8f 93 push r24 3ad78: 9f 93 push r25 3ad7a: ef 93 push r30 3ad7c: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3ad82: 84 ff sbrs r24, 4 3ad84: 12 c0 rjmp .+36 ; 0x3adaa <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3ad86: 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 } } 3ad8a: ff 91 pop r31 3ad8c: ef 91 pop r30 3ad8e: 9f 91 pop r25 3ad90: 8f 91 pop r24 3ad92: 7f 91 pop r23 3ad94: 6f 91 pop r22 3ad96: 4f 91 pop r20 3ad98: 3f 91 pop r19 3ad9a: 2f 91 pop r18 3ad9c: 0f 90 pop r0 3ad9e: 0b be out 0x3b, r0 ; 59 3ada0: 0f 90 pop r0 3ada2: 0f be out 0x3f, r0 ; 63 3ada4: 0f 90 pop r0 3ada6: 1f 90 pop r1 3ada8: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3adaa: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3adae: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 3adb2: 81 11 cpse r24, r1 3adb4: ea cf rjmp .-44 ; 0x3ad8a <__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; 3adb6: 20 91 90 04 lds r18, 0x0490 ; 0x800490 3adba: 30 91 91 04 lds r19, 0x0491 ; 0x800491 3adbe: c9 01 movw r24, r18 3adc0: 01 96 adiw r24, 0x01 ; 1 3adc2: 8f 77 andi r24, 0x7F ; 127 3adc4: 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) { 3adc6: 60 91 92 04 lds r22, 0x0492 ; 0x800492 3adca: 70 91 93 04 lds r23, 0x0493 ; 0x800493 3adce: 86 17 cp r24, r22 3add0: 97 07 cpc r25, r23 3add2: d9 f2 breq .-74 ; 0x3ad8a <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3add4: 20 5f subi r18, 0xF0 ; 240 3add6: 3b 4f sbci r19, 0xFB ; 251 3add8: f9 01 movw r30, r18 3adda: 40 83 st Z, r20 rx_buffer.head = i; 3addc: 90 93 91 04 sts 0x0491, r25 ; 0x800491 3ade0: 80 93 90 04 sts 0x0490, r24 ; 0x800490 3ade4: d2 cf rjmp .-92 ; 0x3ad8a <__vector_25+0x2c> 0003ade6 : * 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) { 3ade6: 2f 92 push r2 3ade8: 3f 92 push r3 3adea: 4f 92 push r4 3adec: 5f 92 push r5 3adee: 6f 92 push r6 3adf0: 7f 92 push r7 3adf2: 8f 92 push r8 3adf4: 9f 92 push r9 3adf6: af 92 push r10 3adf8: bf 92 push r11 3adfa: cf 92 push r12 3adfc: df 92 push r13 3adfe: ef 92 push r14 3ae00: ff 92 push r15 3ae02: 0f 93 push r16 3ae04: 1f 93 push r17 3ae06: cf 93 push r28 3ae08: df 93 push r29 3ae0a: cd b7 in r28, 0x3d ; 61 3ae0c: de b7 in r29, 0x3e ; 62 3ae0e: c2 54 subi r28, 0x42 ; 66 3ae10: d1 09 sbc r29, r1 3ae12: 0f b6 in r0, 0x3f ; 63 3ae14: f8 94 cli 3ae16: de bf out 0x3e, r29 ; 62 3ae18: 0f be out 0x3f, r0 ; 63 3ae1a: cd bf out 0x3d, r28 ; 61 3ae1c: 4c 01 movw r8, r24 3ae1e: 5b 01 movw r10, r22 3ae20: 6a 01 movw r12, r20 3ae22: 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) {} 3ae24: 19 82 std Y+1, r1 ; 0x01 3ae26: 1c 82 std Y+4, r1 ; 0x04 3ae28: 1c 8e std Y+28, r1 ; 0x1c 3ae2a: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 3ae2c: 67 2b or r22, r23 3ae2e: 21 f5 brne .+72 ; 0x3ae78 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 3ae30: 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; 3ae32: ce 01 movw r24, r28 3ae34: 4c 96 adiw r24, 0x1c ; 28 3ae36: 0e 94 cd 78 call 0xf19a ; 0xf19a 3ae3a: ce 01 movw r24, r28 3ae3c: 01 96 adiw r24, 0x01 ; 1 3ae3e: 0e 94 cd 78 call 0xf19a ; 0xf19a } return open(parent, dname, oflag); fail: return false; } 3ae42: 81 2f mov r24, r17 3ae44: ce 5b subi r28, 0xBE ; 190 3ae46: df 4f sbci r29, 0xFF ; 255 3ae48: 0f b6 in r0, 0x3f ; 63 3ae4a: f8 94 cli 3ae4c: de bf out 0x3e, r29 ; 62 3ae4e: 0f be out 0x3f, r0 ; 63 3ae50: cd bf out 0x3d, r28 ; 61 3ae52: df 91 pop r29 3ae54: cf 91 pop r28 3ae56: 1f 91 pop r17 3ae58: 0f 91 pop r16 3ae5a: ff 90 pop r15 3ae5c: ef 90 pop r14 3ae5e: df 90 pop r13 3ae60: cf 90 pop r12 3ae62: bf 90 pop r11 3ae64: af 90 pop r10 3ae66: 9f 90 pop r9 3ae68: 8f 90 pop r8 3ae6a: 7f 90 pop r7 3ae6c: 6f 90 pop r6 3ae6e: 5f 90 pop r5 3ae70: 4f 90 pop r4 3ae72: 3f 90 pop r3 3ae74: 2f 90 pop r2 3ae76: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 3ae78: fc 01 movw r30, r24 3ae7a: 83 81 ldd r24, Z+3 ; 0x03 3ae7c: 81 11 cpse r24, r1 3ae7e: d8 cf rjmp .-80 ; 0x3ae30 if (*path == '/') { 3ae80: fa 01 movw r30, r20 3ae82: 80 81 ld r24, Z 3ae84: 8f 32 cpi r24, 0x2F ; 47 3ae86: c1 f4 brne .+48 ; 0x3aeb8 3ae88: ca 01 movw r24, r20 3ae8a: 6c 01 movw r12, r24 3ae8c: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 3ae8e: f6 01 movw r30, r12 3ae90: 20 81 ld r18, Z 3ae92: 2f 32 cpi r18, 0x2F ; 47 3ae94: d1 f3 breq .-12 ; 0x3ae8a 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; 3ae96: f5 01 movw r30, r10 3ae98: 83 81 ldd r24, Z+3 ; 0x03 3ae9a: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 3ae9c: 82 30 cpi r24, 0x02 ; 2 3ae9e: 60 f0 brcs .+24 ; 0x3aeb8 if (!dir2.openRoot(dirFile->vol_)) goto fail; 3aea0: 61 8d ldd r22, Z+25 ; 0x19 3aea2: 72 8d ldd r23, Z+26 ; 0x1a 3aea4: ce 01 movw r24, r28 3aea6: 4c 96 adiw r24, 0x1c ; 28 3aea8: 0f 94 d9 a3 call 0x347b2 ; 0x347b2 parent = &dir2; 3aeac: 8e 01 movw r16, r28 3aeae: 04 5e subi r16, 0xE4 ; 228 3aeb0: 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; 3aeb2: 81 11 cpse r24, r1 3aeb4: 02 c0 rjmp .+4 ; 0x3aeba 3aeb6: bc cf rjmp .-136 ; 0x3ae30 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 3aeb8: 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; 3aeba: ce 01 movw r24, r28 3aebc: 01 96 adiw r24, 0x01 ; 1 3aebe: 7c 01 movw r14, r24 3aec0: 3c 01 movw r6, r24 3aec2: 2e 01 movw r4, r28 3aec4: 9c e1 ldi r25, 0x1C ; 28 3aec6: 49 0e add r4, r25 3aec8: 51 1c adc r5, r1 3aeca: 23 96 adiw r28, 0x03 ; 3 3aecc: ef ae std Y+63, r14 ; 0x3f 3aece: 23 97 sbiw r28, 0x03 ; 3 3aed0: 2f 2c mov r2, r15 3aed2: fe 01 movw r30, r28 3aed4: f7 96 adiw r30, 0x37 ; 55 3aed6: cf 01 movw r24, r30 3aed8: 0b 96 adiw r24, 0x0b ; 11 3aeda: 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++] = ' '; 3aedc: 20 e2 ldi r18, 0x20 ; 32 3aede: 21 93 st Z+, r18 3aee0: e8 17 cp r30, r24 3aee2: f9 07 cpc r31, r25 3aee4: d9 f7 brne .-10 ; 0x3aedc 3aee6: 96 01 movw r18, r12 i = 0; 3aee8: 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 3aeea: 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 != '/') { 3aeec: d9 01 movw r26, r18 3aeee: 8d 91 ld r24, X+ 3aef0: 88 23 and r24, r24 3aef2: 49 f1 breq .+82 ; 0x3af46 3aef4: 8f 32 cpi r24, 0x2F ; 47 3aef6: 39 f1 breq .+78 ; 0x3af46 c = *str++; 3aef8: 28 2f mov r18, r24 if (c == '.') { 3aefa: 8e 32 cpi r24, 0x2E ; 46 3aefc: 39 f4 brne .+14 ; 0x3af0c if (n == 10) goto fail; // only one dot allowed 3aefe: 6a 30 cpi r22, 0x0A ; 10 3af00: 09 f4 brne .+2 ; 0x3af04 3af02: 96 cf rjmp .-212 ; 0x3ae30 n = 10; // max index for full 8.3 name i = 8; // place for extension 3af04: 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 3af06: 6a e0 ldi r22, 0x0A ; 10 3af08: 9d 01 movw r18, r26 3af0a: f0 cf rjmp .-32 ; 0x3aeec 3af0c: ed ec ldi r30, 0xCD ; 205 3af0e: 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; 3af10: 34 91 lpm r19, Z 3af12: 33 23 and r19, r19 3af14: 21 f0 breq .+8 ; 0x3af1e 3af16: 31 96 adiw r30, 0x01 ; 1 3af18: 83 13 cpse r24, r19 3af1a: fa cf rjmp .-12 ; 0x3af10 3af1c: 89 cf rjmp .-238 ; 0x3ae30 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 3af1e: 69 17 cp r22, r25 3af20: 08 f4 brcc .+2 ; 0x3af24 3af22: 86 cf rjmp .-244 ; 0x3ae30 3af24: 3f ed ldi r19, 0xDF ; 223 3af26: 38 0f add r19, r24 3af28: 3e 35 cpi r19, 0x5E ; 94 3af2a: 08 f0 brcs .+2 ; 0x3af2e 3af2c: 81 cf rjmp .-254 ; 0x3ae30 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 3af2e: 3f e9 ldi r19, 0x9F ; 159 3af30: 38 0f add r19, r24 3af32: 3a 31 cpi r19, 0x1A ; 26 3af34: 10 f4 brcc .+4 ; 0x3af3a 3af36: 20 ee ldi r18, 0xE0 ; 224 3af38: 28 0f add r18, r24 3af3a: fa 01 movw r30, r20 3af3c: e9 0f add r30, r25 3af3e: f1 1d adc r31, r1 3af40: 20 83 st Z, r18 3af42: 9f 5f subi r25, 0xFF ; 255 3af44: e1 cf rjmp .-62 ; 0x3af08 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 3af46: 8f a9 ldd r24, Y+55 ; 0x37 3af48: 80 32 cpi r24, 0x20 ; 32 3af4a: 09 f4 brne .+2 ; 0x3af4e 3af4c: 71 cf rjmp .-286 ; 0x3ae30 3af4e: 69 01 movw r12, r18 while (*path == '/') path++; 3af50: f9 01 movw r30, r18 3af52: 80 81 ld r24, Z 3af54: 2f 5f subi r18, 0xFF ; 255 3af56: 3f 4f sbci r19, 0xFF ; 255 3af58: 8f 32 cpi r24, 0x2F ; 47 3af5a: c9 f3 breq .-14 ; 0x3af4e if (!*path) break; 3af5c: 88 23 and r24, r24 3af5e: d9 f0 breq .+54 ; 0x3af96 if (!sub->open(parent, dname, O_READ)) goto fail; 3af60: 21 e0 ldi r18, 0x01 ; 1 3af62: b8 01 movw r22, r16 3af64: c7 01 movw r24, r14 3af66: 0f 94 26 a8 call 0x3504c ; 0x3504c 3af6a: 88 23 and r24, r24 3af6c: 09 f4 brne .+2 ; 0x3af70 3af6e: 60 cf rjmp .-320 ; 0x3ae30 if (parent != dirFile) parent->close(); 3af70: 0a 15 cp r16, r10 3af72: 1b 05 cpc r17, r11 3af74: 19 f0 breq .+6 ; 0x3af7c 3af76: c8 01 movw r24, r16 3af78: 0f 94 29 a4 call 0x34852 ; 0x34852 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 3af7c: 94 2d mov r25, r4 3af7e: 85 2d mov r24, r5 3af80: 6e 14 cp r6, r14 3af82: 7f 04 cpc r7, r15 3af84: 21 f0 breq .+8 ; 0x3af8e 3af86: 23 96 adiw r28, 0x03 ; 3 3af88: 9f ad ldd r25, Y+63 ; 0x3f 3af8a: 23 97 sbiw r28, 0x03 ; 3 3af8c: 82 2d mov r24, r2 3af8e: 87 01 movw r16, r14 3af90: e9 2e mov r14, r25 3af92: f8 2e mov r15, r24 3af94: 9e cf rjmp .-196 ; 0x3aed2 } return open(parent, dname, oflag); 3af96: 23 2d mov r18, r3 3af98: b8 01 movw r22, r16 3af9a: c4 01 movw r24, r8 3af9c: 0f 94 26 a8 call 0x3504c ; 0x3504c 3afa0: 18 2f mov r17, r24 3afa2: 47 cf rjmp .-370 ; 0x3ae32 0003afa4 <__floatunsisf>: 3afa4: e8 94 clt 3afa6: 09 c0 rjmp .+18 ; 0x3afba <__floatsisf+0x12> 0003afa8 <__floatsisf>: 3afa8: 97 fb bst r25, 7 3afaa: 3e f4 brtc .+14 ; 0x3afba <__floatsisf+0x12> 3afac: 90 95 com r25 3afae: 80 95 com r24 3afb0: 70 95 com r23 3afb2: 61 95 neg r22 3afb4: 7f 4f sbci r23, 0xFF ; 255 3afb6: 8f 4f sbci r24, 0xFF ; 255 3afb8: 9f 4f sbci r25, 0xFF ; 255 3afba: 99 23 and r25, r25 3afbc: a9 f0 breq .+42 ; 0x3afe8 <__floatsisf+0x40> 3afbe: f9 2f mov r31, r25 3afc0: 96 e9 ldi r25, 0x96 ; 150 3afc2: bb 27 eor r27, r27 3afc4: 93 95 inc r25 3afc6: f6 95 lsr r31 3afc8: 87 95 ror r24 3afca: 77 95 ror r23 3afcc: 67 95 ror r22 3afce: b7 95 ror r27 3afd0: f1 11 cpse r31, r1 3afd2: f8 cf rjmp .-16 ; 0x3afc4 <__floatsisf+0x1c> 3afd4: fa f4 brpl .+62 ; 0x3b014 <__floatsisf+0x6c> 3afd6: bb 0f add r27, r27 3afd8: 11 f4 brne .+4 ; 0x3afde <__floatsisf+0x36> 3afda: 60 ff sbrs r22, 0 3afdc: 1b c0 rjmp .+54 ; 0x3b014 <__floatsisf+0x6c> 3afde: 6f 5f subi r22, 0xFF ; 255 3afe0: 7f 4f sbci r23, 0xFF ; 255 3afe2: 8f 4f sbci r24, 0xFF ; 255 3afe4: 9f 4f sbci r25, 0xFF ; 255 3afe6: 16 c0 rjmp .+44 ; 0x3b014 <__floatsisf+0x6c> 3afe8: 88 23 and r24, r24 3afea: 11 f0 breq .+4 ; 0x3aff0 <__floatsisf+0x48> 3afec: 96 e9 ldi r25, 0x96 ; 150 3afee: 11 c0 rjmp .+34 ; 0x3b012 <__floatsisf+0x6a> 3aff0: 77 23 and r23, r23 3aff2: 21 f0 breq .+8 ; 0x3affc <__floatsisf+0x54> 3aff4: 9e e8 ldi r25, 0x8E ; 142 3aff6: 87 2f mov r24, r23 3aff8: 76 2f mov r23, r22 3affa: 05 c0 rjmp .+10 ; 0x3b006 <__floatsisf+0x5e> 3affc: 66 23 and r22, r22 3affe: 71 f0 breq .+28 ; 0x3b01c <__floatsisf+0x74> 3b000: 96 e8 ldi r25, 0x86 ; 134 3b002: 86 2f mov r24, r22 3b004: 70 e0 ldi r23, 0x00 ; 0 3b006: 60 e0 ldi r22, 0x00 ; 0 3b008: 2a f0 brmi .+10 ; 0x3b014 <__floatsisf+0x6c> 3b00a: 9a 95 dec r25 3b00c: 66 0f add r22, r22 3b00e: 77 1f adc r23, r23 3b010: 88 1f adc r24, r24 3b012: da f7 brpl .-10 ; 0x3b00a <__floatsisf+0x62> 3b014: 88 0f add r24, r24 3b016: 96 95 lsr r25 3b018: 87 95 ror r24 3b01a: 97 f9 bld r25, 7 3b01c: 08 95 ret 0003b01e : 3b01e: 9b 01 movw r18, r22 3b020: ac 01 movw r20, r24 3b022: 0d 94 13 d8 jmp 0x3b026 ; 0x3b026 <__mulsf3> 0003b026 <__mulsf3>: 3b026: 0f 94 26 d8 call 0x3b04c ; 0x3b04c <__mulsf3x> 3b02a: 0d 94 97 d8 jmp 0x3b12e ; 0x3b12e <__fp_round> 3b02e: 0f 94 89 d8 call 0x3b112 ; 0x3b112 <__fp_pscA> 3b032: 38 f0 brcs .+14 ; 0x3b042 <__mulsf3+0x1c> 3b034: 0f 94 90 d8 call 0x3b120 ; 0x3b120 <__fp_pscB> 3b038: 20 f0 brcs .+8 ; 0x3b042 <__mulsf3+0x1c> 3b03a: 95 23 and r25, r21 3b03c: 11 f0 breq .+4 ; 0x3b042 <__mulsf3+0x1c> 3b03e: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 3b042: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 3b046: 11 24 eor r1, r1 3b048: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 0003b04c <__mulsf3x>: 3b04c: 0f 94 a8 d8 call 0x3b150 ; 0x3b150 <__fp_split3> 3b050: 70 f3 brcs .-36 ; 0x3b02e <__mulsf3+0x8> 0003b052 <__mulsf3_pse>: 3b052: 95 9f mul r25, r21 3b054: c1 f3 breq .-16 ; 0x3b046 <__mulsf3+0x20> 3b056: 95 0f add r25, r21 3b058: 50 e0 ldi r21, 0x00 ; 0 3b05a: 55 1f adc r21, r21 3b05c: 62 9f mul r22, r18 3b05e: f0 01 movw r30, r0 3b060: 72 9f mul r23, r18 3b062: bb 27 eor r27, r27 3b064: f0 0d add r31, r0 3b066: b1 1d adc r27, r1 3b068: 63 9f mul r22, r19 3b06a: aa 27 eor r26, r26 3b06c: f0 0d add r31, r0 3b06e: b1 1d adc r27, r1 3b070: aa 1f adc r26, r26 3b072: 64 9f mul r22, r20 3b074: 66 27 eor r22, r22 3b076: b0 0d add r27, r0 3b078: a1 1d adc r26, r1 3b07a: 66 1f adc r22, r22 3b07c: 82 9f mul r24, r18 3b07e: 22 27 eor r18, r18 3b080: b0 0d add r27, r0 3b082: a1 1d adc r26, r1 3b084: 62 1f adc r22, r18 3b086: 73 9f mul r23, r19 3b088: b0 0d add r27, r0 3b08a: a1 1d adc r26, r1 3b08c: 62 1f adc r22, r18 3b08e: 83 9f mul r24, r19 3b090: a0 0d add r26, r0 3b092: 61 1d adc r22, r1 3b094: 22 1f adc r18, r18 3b096: 74 9f mul r23, r20 3b098: 33 27 eor r19, r19 3b09a: a0 0d add r26, r0 3b09c: 61 1d adc r22, r1 3b09e: 23 1f adc r18, r19 3b0a0: 84 9f mul r24, r20 3b0a2: 60 0d add r22, r0 3b0a4: 21 1d adc r18, r1 3b0a6: 82 2f mov r24, r18 3b0a8: 76 2f mov r23, r22 3b0aa: 6a 2f mov r22, r26 3b0ac: 11 24 eor r1, r1 3b0ae: 9f 57 subi r25, 0x7F ; 127 3b0b0: 50 40 sbci r21, 0x00 ; 0 3b0b2: 9a f0 brmi .+38 ; 0x3b0da <__mulsf3_pse+0x88> 3b0b4: f1 f0 breq .+60 ; 0x3b0f2 <__mulsf3_pse+0xa0> 3b0b6: 88 23 and r24, r24 3b0b8: 4a f0 brmi .+18 ; 0x3b0cc <__mulsf3_pse+0x7a> 3b0ba: ee 0f add r30, r30 3b0bc: ff 1f adc r31, r31 3b0be: bb 1f adc r27, r27 3b0c0: 66 1f adc r22, r22 3b0c2: 77 1f adc r23, r23 3b0c4: 88 1f adc r24, r24 3b0c6: 91 50 subi r25, 0x01 ; 1 3b0c8: 50 40 sbci r21, 0x00 ; 0 3b0ca: a9 f7 brne .-22 ; 0x3b0b6 <__mulsf3_pse+0x64> 3b0cc: 9e 3f cpi r25, 0xFE ; 254 3b0ce: 51 05 cpc r21, r1 3b0d0: 80 f0 brcs .+32 ; 0x3b0f2 <__mulsf3_pse+0xa0> 3b0d2: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 3b0d6: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 3b0da: 5f 3f cpi r21, 0xFF ; 255 3b0dc: e4 f3 brlt .-8 ; 0x3b0d6 <__mulsf3_pse+0x84> 3b0de: 98 3e cpi r25, 0xE8 ; 232 3b0e0: d4 f3 brlt .-12 ; 0x3b0d6 <__mulsf3_pse+0x84> 3b0e2: 86 95 lsr r24 3b0e4: 77 95 ror r23 3b0e6: 67 95 ror r22 3b0e8: b7 95 ror r27 3b0ea: f7 95 ror r31 3b0ec: e7 95 ror r30 3b0ee: 9f 5f subi r25, 0xFF ; 255 3b0f0: c1 f7 brne .-16 ; 0x3b0e2 <__mulsf3_pse+0x90> 3b0f2: fe 2b or r31, r30 3b0f4: 88 0f add r24, r24 3b0f6: 91 1d adc r25, r1 3b0f8: 96 95 lsr r25 3b0fa: 87 95 ror r24 3b0fc: 97 f9 bld r25, 7 3b0fe: 08 95 ret 0003b100 <__fp_inf>: 3b100: 97 f9 bld r25, 7 3b102: 9f 67 ori r25, 0x7F ; 127 3b104: 80 e8 ldi r24, 0x80 ; 128 3b106: 70 e0 ldi r23, 0x00 ; 0 3b108: 60 e0 ldi r22, 0x00 ; 0 3b10a: 08 95 ret 0003b10c <__fp_nan>: 3b10c: 9f ef ldi r25, 0xFF ; 255 3b10e: 80 ec ldi r24, 0xC0 ; 192 3b110: 08 95 ret 0003b112 <__fp_pscA>: 3b112: 00 24 eor r0, r0 3b114: 0a 94 dec r0 3b116: 16 16 cp r1, r22 3b118: 17 06 cpc r1, r23 3b11a: 18 06 cpc r1, r24 3b11c: 09 06 cpc r0, r25 3b11e: 08 95 ret 0003b120 <__fp_pscB>: 3b120: 00 24 eor r0, r0 3b122: 0a 94 dec r0 3b124: 12 16 cp r1, r18 3b126: 13 06 cpc r1, r19 3b128: 14 06 cpc r1, r20 3b12a: 05 06 cpc r0, r21 3b12c: 08 95 ret 0003b12e <__fp_round>: 3b12e: 09 2e mov r0, r25 3b130: 03 94 inc r0 3b132: 00 0c add r0, r0 3b134: 11 f4 brne .+4 ; 0x3b13a <__fp_round+0xc> 3b136: 88 23 and r24, r24 3b138: 52 f0 brmi .+20 ; 0x3b14e <__fp_round+0x20> 3b13a: bb 0f add r27, r27 3b13c: 40 f4 brcc .+16 ; 0x3b14e <__fp_round+0x20> 3b13e: bf 2b or r27, r31 3b140: 11 f4 brne .+4 ; 0x3b146 <__fp_round+0x18> 3b142: 60 ff sbrs r22, 0 3b144: 04 c0 rjmp .+8 ; 0x3b14e <__fp_round+0x20> 3b146: 6f 5f subi r22, 0xFF ; 255 3b148: 7f 4f sbci r23, 0xFF ; 255 3b14a: 8f 4f sbci r24, 0xFF ; 255 3b14c: 9f 4f sbci r25, 0xFF ; 255 3b14e: 08 95 ret 0003b150 <__fp_split3>: 3b150: 57 fd sbrc r21, 7 3b152: 90 58 subi r25, 0x80 ; 128 3b154: 44 0f add r20, r20 3b156: 55 1f adc r21, r21 3b158: 59 f0 breq .+22 ; 0x3b170 <__fp_splitA+0x10> 3b15a: 5f 3f cpi r21, 0xFF ; 255 3b15c: 71 f0 breq .+28 ; 0x3b17a <__fp_splitA+0x1a> 3b15e: 47 95 ror r20 0003b160 <__fp_splitA>: 3b160: 88 0f add r24, r24 3b162: 97 fb bst r25, 7 3b164: 99 1f adc r25, r25 3b166: 61 f0 breq .+24 ; 0x3b180 <__fp_splitA+0x20> 3b168: 9f 3f cpi r25, 0xFF ; 255 3b16a: 79 f0 breq .+30 ; 0x3b18a <__fp_splitA+0x2a> 3b16c: 87 95 ror r24 3b16e: 08 95 ret 3b170: 12 16 cp r1, r18 3b172: 13 06 cpc r1, r19 3b174: 14 06 cpc r1, r20 3b176: 55 1f adc r21, r21 3b178: f2 cf rjmp .-28 ; 0x3b15e <__fp_split3+0xe> 3b17a: 46 95 lsr r20 3b17c: f1 df rcall .-30 ; 0x3b160 <__fp_splitA> 3b17e: 08 c0 rjmp .+16 ; 0x3b190 <__fp_splitA+0x30> 3b180: 16 16 cp r1, r22 3b182: 17 06 cpc r1, r23 3b184: 18 06 cpc r1, r24 3b186: 99 1f adc r25, r25 3b188: f1 cf rjmp .-30 ; 0x3b16c <__fp_splitA+0xc> 3b18a: 86 95 lsr r24 3b18c: 71 05 cpc r23, r1 3b18e: 61 05 cpc r22, r1 3b190: 08 94 sec 3b192: 08 95 ret 0003b194 <__fp_zero>: 3b194: e8 94 clt 0003b196 <__fp_szero>: 3b196: bb 27 eor r27, r27 3b198: 66 27 eor r22, r22 3b19a: 77 27 eor r23, r23 3b19c: cb 01 movw r24, r22 3b19e: 97 f9 bld r25, 7 3b1a0: 08 95 ret 0003b1a2 : 3b1a2: 3f 92 push r3 3b1a4: 4f 92 push r4 3b1a6: 5f 92 push r5 3b1a8: 6f 92 push r6 3b1aa: 7f 92 push r7 3b1ac: 8f 92 push r8 3b1ae: 9f 92 push r9 3b1b0: af 92 push r10 3b1b2: bf 92 push r11 3b1b4: cf 92 push r12 3b1b6: df 92 push r13 3b1b8: ef 92 push r14 3b1ba: ff 92 push r15 3b1bc: 0f 93 push r16 3b1be: 1f 93 push r17 3b1c0: cf 93 push r28 3b1c2: df 93 push r29 3b1c4: 5c 01 movw r10, r24 3b1c6: 6b 01 movw r12, r22 3b1c8: 7a 01 movw r14, r20 3b1ca: 61 15 cp r22, r1 3b1cc: 71 05 cpc r23, r1 3b1ce: 19 f0 breq .+6 ; 0x3b1d6 3b1d0: fb 01 movw r30, r22 3b1d2: 91 83 std Z+1, r25 ; 0x01 3b1d4: 80 83 st Z, r24 3b1d6: e1 14 cp r14, r1 3b1d8: f1 04 cpc r15, r1 3b1da: 51 f0 breq .+20 ; 0x3b1f0 3b1dc: c7 01 movw r24, r14 3b1de: 02 97 sbiw r24, 0x02 ; 2 3b1e0: 83 97 sbiw r24, 0x23 ; 35 3b1e2: 30 f0 brcs .+12 ; 0x3b1f0 3b1e4: 40 e0 ldi r20, 0x00 ; 0 3b1e6: 30 e0 ldi r19, 0x00 ; 0 3b1e8: 20 e0 ldi r18, 0x00 ; 0 3b1ea: 90 e0 ldi r25, 0x00 ; 0 3b1ec: 6b c0 rjmp .+214 ; 0x3b2c4 3b1ee: 5e 01 movw r10, r28 3b1f0: e5 01 movw r28, r10 3b1f2: 21 96 adiw r28, 0x01 ; 1 3b1f4: f5 01 movw r30, r10 3b1f6: 10 81 ld r17, Z 3b1f8: 81 2f mov r24, r17 3b1fa: 90 e0 ldi r25, 0x00 ; 0 3b1fc: 0f 94 d7 da call 0x3b5ae ; 0x3b5ae 3b200: 89 2b or r24, r25 3b202: a9 f7 brne .-22 ; 0x3b1ee 3b204: 1d 32 cpi r17, 0x2D ; 45 3b206: 01 f5 brne .+64 ; 0x3b248 3b208: 21 96 adiw r28, 0x01 ; 1 3b20a: f5 01 movw r30, r10 3b20c: 11 81 ldd r17, Z+1 ; 0x01 3b20e: 01 e0 ldi r16, 0x01 ; 1 3b210: e1 14 cp r14, r1 3b212: f1 04 cpc r15, r1 3b214: 09 f4 brne .+2 ; 0x3b218 3b216: e6 c0 rjmp .+460 ; 0x3b3e4 3b218: f0 e1 ldi r31, 0x10 ; 16 3b21a: ef 16 cp r14, r31 3b21c: f1 04 cpc r15, r1 3b21e: 09 f0 breq .+2 ; 0x3b222 3b220: 88 c0 rjmp .+272 ; 0x3b332 3b222: 10 33 cpi r17, 0x30 ; 48 3b224: 59 f4 brne .+22 ; 0x3b23c 3b226: 88 81 ld r24, Y 3b228: 8f 7d andi r24, 0xDF ; 223 3b22a: 88 35 cpi r24, 0x58 ; 88 3b22c: 09 f0 breq .+2 ; 0x3b230 3b22e: 7c c0 rjmp .+248 ; 0x3b328 3b230: 19 81 ldd r17, Y+1 ; 0x01 3b232: 22 96 adiw r28, 0x02 ; 2 3b234: 02 60 ori r16, 0x02 ; 2 3b236: f0 e1 ldi r31, 0x10 ; 16 3b238: ef 2e mov r14, r31 3b23a: f1 2c mov r15, r1 3b23c: 81 2c mov r8, r1 3b23e: 91 2c mov r9, r1 3b240: a1 2c mov r10, r1 3b242: 88 e0 ldi r24, 0x08 ; 8 3b244: b8 2e mov r11, r24 3b246: 92 c0 rjmp .+292 ; 0x3b36c 3b248: 1b 32 cpi r17, 0x2B ; 43 3b24a: 21 f4 brne .+8 ; 0x3b254 3b24c: e5 01 movw r28, r10 3b24e: 22 96 adiw r28, 0x02 ; 2 3b250: f5 01 movw r30, r10 3b252: 11 81 ldd r17, Z+1 ; 0x01 3b254: 00 e0 ldi r16, 0x00 ; 0 3b256: dc cf rjmp .-72 ; 0x3b210 3b258: ea e0 ldi r30, 0x0A ; 10 3b25a: ee 16 cp r14, r30 3b25c: f1 04 cpc r15, r1 3b25e: 09 f4 brne .+2 ; 0x3b262 3b260: c7 c0 rjmp .+398 ; 0x3b3f0 3b262: f0 e1 ldi r31, 0x10 ; 16 3b264: ef 16 cp r14, r31 3b266: f1 04 cpc r15, r1 3b268: 09 f0 breq .+2 ; 0x3b26c 3b26a: 73 c0 rjmp .+230 ; 0x3b352 3b26c: e7 cf rjmp .-50 ; 0x3b23c 3b26e: 78 e0 ldi r23, 0x08 ; 8 3b270: e7 2e mov r14, r23 3b272: f1 2c mov r15, r1 3b274: 81 2c mov r8, r1 3b276: 91 2c mov r9, r1 3b278: a1 2c mov r10, r1 3b27a: 60 e1 ldi r22, 0x10 ; 16 3b27c: b6 2e mov r11, r22 3b27e: 76 c0 rjmp .+236 ; 0x3b36c 3b280: 21 e0 ldi r18, 0x01 ; 1 3b282: ad c0 rjmp .+346 ; 0x3b3de 3b284: 30 2f mov r19, r16 3b286: 31 70 andi r19, 0x01 ; 1 3b288: c1 14 cp r12, r1 3b28a: d1 04 cpc r13, r1 3b28c: 31 f0 breq .+12 ; 0x3b29a 3b28e: 22 23 and r18, r18 3b290: 71 f1 breq .+92 ; 0x3b2ee 3b292: 21 97 sbiw r28, 0x01 ; 1 3b294: f6 01 movw r30, r12 3b296: d1 83 std Z+1, r29 ; 0x01 3b298: c0 83 st Z, r28 3b29a: 27 ff sbrs r18, 7 3b29c: 2e c0 rjmp .+92 ; 0x3b2fa 3b29e: 60 e0 ldi r22, 0x00 ; 0 3b2a0: 70 e0 ldi r23, 0x00 ; 0 3b2a2: 80 e0 ldi r24, 0x00 ; 0 3b2a4: 90 e8 ldi r25, 0x80 ; 128 3b2a6: 31 11 cpse r19, r1 3b2a8: 04 c0 rjmp .+8 ; 0x3b2b2 3b2aa: 6f ef ldi r22, 0xFF ; 255 3b2ac: 7f ef ldi r23, 0xFF ; 255 3b2ae: 8f ef ldi r24, 0xFF ; 255 3b2b0: 9f e7 ldi r25, 0x7F ; 127 3b2b2: 22 e2 ldi r18, 0x22 ; 34 3b2b4: 30 e0 ldi r19, 0x00 ; 0 3b2b6: 30 93 0b 18 sts 0x180B, r19 ; 0x80180b 3b2ba: 20 93 0a 18 sts 0x180A, r18 ; 0x80180a 3b2be: 46 2f mov r20, r22 3b2c0: 37 2f mov r19, r23 3b2c2: 28 2f mov r18, r24 3b2c4: 64 2f mov r22, r20 3b2c6: 73 2f mov r23, r19 3b2c8: 82 2f mov r24, r18 3b2ca: df 91 pop r29 3b2cc: cf 91 pop r28 3b2ce: 1f 91 pop r17 3b2d0: 0f 91 pop r16 3b2d2: ff 90 pop r15 3b2d4: ef 90 pop r14 3b2d6: df 90 pop r13 3b2d8: cf 90 pop r12 3b2da: bf 90 pop r11 3b2dc: af 90 pop r10 3b2de: 9f 90 pop r9 3b2e0: 8f 90 pop r8 3b2e2: 7f 90 pop r7 3b2e4: 6f 90 pop r6 3b2e6: 5f 90 pop r5 3b2e8: 4f 90 pop r4 3b2ea: 3f 90 pop r3 3b2ec: 08 95 ret 3b2ee: 01 ff sbrs r16, 1 3b2f0: 04 c0 rjmp .+8 ; 0x3b2fa 3b2f2: 22 97 sbiw r28, 0x02 ; 2 3b2f4: f6 01 movw r30, r12 3b2f6: d1 83 std Z+1, r29 ; 0x01 3b2f8: c0 83 st Z, r28 3b2fa: 33 23 and r19, r19 3b2fc: 41 f0 breq .+16 ; 0x3b30e 3b2fe: 90 95 com r25 3b300: 80 95 com r24 3b302: 70 95 com r23 3b304: 61 95 neg r22 3b306: 7f 4f sbci r23, 0xFF ; 255 3b308: 8f 4f sbci r24, 0xFF ; 255 3b30a: 9f 4f sbci r25, 0xFF ; 255 3b30c: d8 cf rjmp .-80 ; 0x3b2be 3b30e: 97 ff sbrs r25, 7 3b310: d6 cf rjmp .-84 ; 0x3b2be 3b312: 82 e2 ldi r24, 0x22 ; 34 3b314: 90 e0 ldi r25, 0x00 ; 0 3b316: 90 93 0b 18 sts 0x180B, r25 ; 0x80180b 3b31a: 80 93 0a 18 sts 0x180A, r24 ; 0x80180a 3b31e: 6f ef ldi r22, 0xFF ; 255 3b320: 7f ef ldi r23, 0xFF ; 255 3b322: 8f ef ldi r24, 0xFF ; 255 3b324: 9f e7 ldi r25, 0x7F ; 127 3b326: cb cf rjmp .-106 ; 0x3b2be 3b328: 10 e3 ldi r17, 0x30 ; 48 3b32a: e1 14 cp r14, r1 3b32c: f1 04 cpc r15, r1 3b32e: 09 f4 brne .+2 ; 0x3b332 3b330: 9e cf rjmp .-196 ; 0x3b26e 3b332: 28 e0 ldi r18, 0x08 ; 8 3b334: e2 16 cp r14, r18 3b336: f1 04 cpc r15, r1 3b338: 09 f4 brne .+2 ; 0x3b33c 3b33a: 9c cf rjmp .-200 ; 0x3b274 3b33c: 0c f0 brlt .+2 ; 0x3b340 3b33e: 8c cf rjmp .-232 ; 0x3b258 3b340: 81 2c mov r8, r1 3b342: 91 2c mov r9, r1 3b344: a1 2c mov r10, r1 3b346: e0 e4 ldi r30, 0x40 ; 64 3b348: be 2e mov r11, r30 3b34a: 82 e0 ldi r24, 0x02 ; 2 3b34c: e8 16 cp r14, r24 3b34e: f1 04 cpc r15, r1 3b350: 69 f0 breq .+26 ; 0x3b36c 3b352: 60 e0 ldi r22, 0x00 ; 0 3b354: 70 e0 ldi r23, 0x00 ; 0 3b356: 80 e0 ldi r24, 0x00 ; 0 3b358: 90 e8 ldi r25, 0x80 ; 128 3b35a: 97 01 movw r18, r14 3b35c: 0f 2c mov r0, r15 3b35e: 00 0c add r0, r0 3b360: 44 0b sbc r20, r20 3b362: 55 0b sbc r21, r21 3b364: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 3b368: 49 01 movw r8, r18 3b36a: 5a 01 movw r10, r20 3b36c: 20 e0 ldi r18, 0x00 ; 0 3b36e: 60 e0 ldi r22, 0x00 ; 0 3b370: 70 e0 ldi r23, 0x00 ; 0 3b372: cb 01 movw r24, r22 3b374: 27 01 movw r4, r14 3b376: 0f 2c mov r0, r15 3b378: 00 0c add r0, r0 3b37a: 66 08 sbc r6, r6 3b37c: 77 08 sbc r7, r7 3b37e: fe 01 movw r30, r28 3b380: 50 ed ldi r21, 0xD0 ; 208 3b382: 35 2e mov r3, r21 3b384: 31 0e add r3, r17 3b386: 39 e0 ldi r19, 0x09 ; 9 3b388: 33 15 cp r19, r3 3b38a: 70 f4 brcc .+28 ; 0x3b3a8 3b38c: 3f eb ldi r19, 0xBF ; 191 3b38e: 31 0f add r19, r17 3b390: 49 ec ldi r20, 0xC9 ; 201 3b392: 34 2e mov r3, r20 3b394: 3a 31 cpi r19, 0x1A ; 26 3b396: 38 f0 brcs .+14 ; 0x3b3a6 3b398: 3f e9 ldi r19, 0x9F ; 159 3b39a: 31 0f add r19, r17 3b39c: 3a 31 cpi r19, 0x1A ; 26 3b39e: 08 f0 brcs .+2 ; 0x3b3a2 3b3a0: 71 cf rjmp .-286 ; 0x3b284 3b3a2: 39 ea ldi r19, 0xA9 ; 169 3b3a4: 33 2e mov r3, r19 3b3a6: 31 0e add r3, r17 3b3a8: 3e 14 cp r3, r14 3b3aa: 1f 04 cpc r1, r15 3b3ac: 0c f0 brlt .+2 ; 0x3b3b0 3b3ae: 6a cf rjmp .-300 ; 0x3b284 3b3b0: 27 fd sbrc r18, 7 3b3b2: 15 c0 rjmp .+42 ; 0x3b3de 3b3b4: 86 16 cp r8, r22 3b3b6: 97 06 cpc r9, r23 3b3b8: a8 06 cpc r10, r24 3b3ba: b9 06 cpc r11, r25 3b3bc: 78 f0 brcs .+30 ; 0x3b3dc 3b3be: a3 01 movw r20, r6 3b3c0: 92 01 movw r18, r4 3b3c2: 0f 94 a9 dd call 0x3bb52 ; 0x3bb52 <__mulsi3> 3b3c6: 63 0d add r22, r3 3b3c8: 71 1d adc r23, r1 3b3ca: 81 1d adc r24, r1 3b3cc: 91 1d adc r25, r1 3b3ce: 61 30 cpi r22, 0x01 ; 1 3b3d0: 71 05 cpc r23, r1 3b3d2: 81 05 cpc r24, r1 3b3d4: 20 e8 ldi r18, 0x80 ; 128 3b3d6: 92 07 cpc r25, r18 3b3d8: 08 f4 brcc .+2 ; 0x3b3dc 3b3da: 52 cf rjmp .-348 ; 0x3b280 3b3dc: 2f ef ldi r18, 0xFF ; 255 3b3de: 21 96 adiw r28, 0x01 ; 1 3b3e0: 10 81 ld r17, Z 3b3e2: cd cf rjmp .-102 ; 0x3b37e 3b3e4: 10 33 cpi r17, 0x30 ; 48 3b3e6: 09 f4 brne .+2 ; 0x3b3ea 3b3e8: 1e cf rjmp .-452 ; 0x3b226 3b3ea: 2a e0 ldi r18, 0x0A ; 10 3b3ec: e2 2e mov r14, r18 3b3ee: f1 2c mov r15, r1 3b3f0: 9c ec ldi r25, 0xCC ; 204 3b3f2: 89 2e mov r8, r25 3b3f4: 98 2c mov r9, r8 3b3f6: a8 2c mov r10, r8 3b3f8: 9c e0 ldi r25, 0x0C ; 12 3b3fa: b9 2e mov r11, r25 3b3fc: b7 cf rjmp .-146 ; 0x3b36c 0003b3fe <__ftoa_engine>: 3b3fe: 28 30 cpi r18, 0x08 ; 8 3b400: 08 f0 brcs .+2 ; 0x3b404 <__ftoa_engine+0x6> 3b402: 27 e0 ldi r18, 0x07 ; 7 3b404: 33 27 eor r19, r19 3b406: da 01 movw r26, r20 3b408: 99 0f add r25, r25 3b40a: 31 1d adc r19, r1 3b40c: 87 fd sbrc r24, 7 3b40e: 91 60 ori r25, 0x01 ; 1 3b410: 00 96 adiw r24, 0x00 ; 0 3b412: 61 05 cpc r22, r1 3b414: 71 05 cpc r23, r1 3b416: 39 f4 brne .+14 ; 0x3b426 <__ftoa_engine+0x28> 3b418: 32 60 ori r19, 0x02 ; 2 3b41a: 2e 5f subi r18, 0xFE ; 254 3b41c: 3d 93 st X+, r19 3b41e: 30 e3 ldi r19, 0x30 ; 48 3b420: 2a 95 dec r18 3b422: e1 f7 brne .-8 ; 0x3b41c <__ftoa_engine+0x1e> 3b424: 08 95 ret 3b426: 9f 3f cpi r25, 0xFF ; 255 3b428: 30 f0 brcs .+12 ; 0x3b436 <__ftoa_engine+0x38> 3b42a: 80 38 cpi r24, 0x80 ; 128 3b42c: 71 05 cpc r23, r1 3b42e: 61 05 cpc r22, r1 3b430: 09 f0 breq .+2 ; 0x3b434 <__ftoa_engine+0x36> 3b432: 3c 5f subi r19, 0xFC ; 252 3b434: 3c 5f subi r19, 0xFC ; 252 3b436: 3d 93 st X+, r19 3b438: 91 30 cpi r25, 0x01 ; 1 3b43a: 08 f0 brcs .+2 ; 0x3b43e <__ftoa_engine+0x40> 3b43c: 80 68 ori r24, 0x80 ; 128 3b43e: 91 1d adc r25, r1 3b440: df 93 push r29 3b442: cf 93 push r28 3b444: 1f 93 push r17 3b446: 0f 93 push r16 3b448: ff 92 push r15 3b44a: ef 92 push r14 3b44c: 19 2f mov r17, r25 3b44e: 98 7f andi r25, 0xF8 ; 248 3b450: 96 95 lsr r25 3b452: e9 2f mov r30, r25 3b454: 96 95 lsr r25 3b456: 96 95 lsr r25 3b458: e9 0f add r30, r25 3b45a: ff 27 eor r31, r31 3b45c: e6 57 subi r30, 0x76 ; 118 3b45e: f8 48 sbci r31, 0x88 ; 136 3b460: 99 27 eor r25, r25 3b462: 33 27 eor r19, r19 3b464: ee 24 eor r14, r14 3b466: ff 24 eor r15, r15 3b468: a7 01 movw r20, r14 3b46a: e7 01 movw r28, r14 3b46c: 05 90 lpm r0, Z+ 3b46e: 08 94 sec 3b470: 07 94 ror r0 3b472: 28 f4 brcc .+10 ; 0x3b47e <__ftoa_engine+0x80> 3b474: 36 0f add r19, r22 3b476: e7 1e adc r14, r23 3b478: f8 1e adc r15, r24 3b47a: 49 1f adc r20, r25 3b47c: 51 1d adc r21, r1 3b47e: 66 0f add r22, r22 3b480: 77 1f adc r23, r23 3b482: 88 1f adc r24, r24 3b484: 99 1f adc r25, r25 3b486: 06 94 lsr r0 3b488: a1 f7 brne .-24 ; 0x3b472 <__ftoa_engine+0x74> 3b48a: 05 90 lpm r0, Z+ 3b48c: 07 94 ror r0 3b48e: 28 f4 brcc .+10 ; 0x3b49a <__ftoa_engine+0x9c> 3b490: e7 0e add r14, r23 3b492: f8 1e adc r15, r24 3b494: 49 1f adc r20, r25 3b496: 56 1f adc r21, r22 3b498: c1 1d adc r28, r1 3b49a: 77 0f add r23, r23 3b49c: 88 1f adc r24, r24 3b49e: 99 1f adc r25, r25 3b4a0: 66 1f adc r22, r22 3b4a2: 06 94 lsr r0 3b4a4: a1 f7 brne .-24 ; 0x3b48e <__ftoa_engine+0x90> 3b4a6: 05 90 lpm r0, Z+ 3b4a8: 07 94 ror r0 3b4aa: 28 f4 brcc .+10 ; 0x3b4b6 <__ftoa_engine+0xb8> 3b4ac: f8 0e add r15, r24 3b4ae: 49 1f adc r20, r25 3b4b0: 56 1f adc r21, r22 3b4b2: c7 1f adc r28, r23 3b4b4: d1 1d adc r29, r1 3b4b6: 88 0f add r24, r24 3b4b8: 99 1f adc r25, r25 3b4ba: 66 1f adc r22, r22 3b4bc: 77 1f adc r23, r23 3b4be: 06 94 lsr r0 3b4c0: a1 f7 brne .-24 ; 0x3b4aa <__ftoa_engine+0xac> 3b4c2: 05 90 lpm r0, Z+ 3b4c4: 07 94 ror r0 3b4c6: 20 f4 brcc .+8 ; 0x3b4d0 <__ftoa_engine+0xd2> 3b4c8: 49 0f add r20, r25 3b4ca: 56 1f adc r21, r22 3b4cc: c7 1f adc r28, r23 3b4ce: d8 1f adc r29, r24 3b4d0: 99 0f add r25, r25 3b4d2: 66 1f adc r22, r22 3b4d4: 77 1f adc r23, r23 3b4d6: 88 1f adc r24, r24 3b4d8: 06 94 lsr r0 3b4da: a9 f7 brne .-22 ; 0x3b4c6 <__ftoa_engine+0xc8> 3b4dc: 84 91 lpm r24, Z 3b4de: 10 95 com r17 3b4e0: 17 70 andi r17, 0x07 ; 7 3b4e2: 41 f0 breq .+16 ; 0x3b4f4 <__ftoa_engine+0xf6> 3b4e4: d6 95 lsr r29 3b4e6: c7 95 ror r28 3b4e8: 57 95 ror r21 3b4ea: 47 95 ror r20 3b4ec: f7 94 ror r15 3b4ee: e7 94 ror r14 3b4f0: 1a 95 dec r17 3b4f2: c1 f7 brne .-16 ; 0x3b4e4 <__ftoa_engine+0xe6> 3b4f4: e0 e3 ldi r30, 0x30 ; 48 3b4f6: f7 e7 ldi r31, 0x77 ; 119 3b4f8: 68 94 set 3b4fa: 15 90 lpm r1, Z+ 3b4fc: 15 91 lpm r17, Z+ 3b4fe: 35 91 lpm r19, Z+ 3b500: 65 91 lpm r22, Z+ 3b502: 95 91 lpm r25, Z+ 3b504: 05 90 lpm r0, Z+ 3b506: 7f e2 ldi r23, 0x2F ; 47 3b508: 73 95 inc r23 3b50a: e1 18 sub r14, r1 3b50c: f1 0a sbc r15, r17 3b50e: 43 0b sbc r20, r19 3b510: 56 0b sbc r21, r22 3b512: c9 0b sbc r28, r25 3b514: d0 09 sbc r29, r0 3b516: c0 f7 brcc .-16 ; 0x3b508 <__ftoa_engine+0x10a> 3b518: e1 0c add r14, r1 3b51a: f1 1e adc r15, r17 3b51c: 43 1f adc r20, r19 3b51e: 56 1f adc r21, r22 3b520: c9 1f adc r28, r25 3b522: d0 1d adc r29, r0 3b524: 7e f4 brtc .+30 ; 0x3b544 <__ftoa_engine+0x146> 3b526: 70 33 cpi r23, 0x30 ; 48 3b528: 11 f4 brne .+4 ; 0x3b52e <__ftoa_engine+0x130> 3b52a: 8a 95 dec r24 3b52c: e6 cf rjmp .-52 ; 0x3b4fa <__ftoa_engine+0xfc> 3b52e: e8 94 clt 3b530: 01 50 subi r16, 0x01 ; 1 3b532: 30 f0 brcs .+12 ; 0x3b540 <__ftoa_engine+0x142> 3b534: 08 0f add r16, r24 3b536: 0a f4 brpl .+2 ; 0x3b53a <__ftoa_engine+0x13c> 3b538: 00 27 eor r16, r16 3b53a: 02 17 cp r16, r18 3b53c: 08 f4 brcc .+2 ; 0x3b540 <__ftoa_engine+0x142> 3b53e: 20 2f mov r18, r16 3b540: 23 95 inc r18 3b542: 02 2f mov r16, r18 3b544: 7a 33 cpi r23, 0x3A ; 58 3b546: 28 f0 brcs .+10 ; 0x3b552 <__ftoa_engine+0x154> 3b548: 79 e3 ldi r23, 0x39 ; 57 3b54a: 7d 93 st X+, r23 3b54c: 2a 95 dec r18 3b54e: e9 f7 brne .-6 ; 0x3b54a <__ftoa_engine+0x14c> 3b550: 10 c0 rjmp .+32 ; 0x3b572 <__ftoa_engine+0x174> 3b552: 7d 93 st X+, r23 3b554: 2a 95 dec r18 3b556: 89 f6 brne .-94 ; 0x3b4fa <__ftoa_engine+0xfc> 3b558: 06 94 lsr r0 3b55a: 97 95 ror r25 3b55c: 67 95 ror r22 3b55e: 37 95 ror r19 3b560: 17 95 ror r17 3b562: 17 94 ror r1 3b564: e1 18 sub r14, r1 3b566: f1 0a sbc r15, r17 3b568: 43 0b sbc r20, r19 3b56a: 56 0b sbc r21, r22 3b56c: c9 0b sbc r28, r25 3b56e: d0 09 sbc r29, r0 3b570: 98 f0 brcs .+38 ; 0x3b598 <__ftoa_engine+0x19a> 3b572: 23 95 inc r18 3b574: 7e 91 ld r23, -X 3b576: 73 95 inc r23 3b578: 7a 33 cpi r23, 0x3A ; 58 3b57a: 08 f0 brcs .+2 ; 0x3b57e <__ftoa_engine+0x180> 3b57c: 70 e3 ldi r23, 0x30 ; 48 3b57e: 7c 93 st X, r23 3b580: 20 13 cpse r18, r16 3b582: b8 f7 brcc .-18 ; 0x3b572 <__ftoa_engine+0x174> 3b584: 7e 91 ld r23, -X 3b586: 70 61 ori r23, 0x10 ; 16 3b588: 7d 93 st X+, r23 3b58a: 30 f0 brcs .+12 ; 0x3b598 <__ftoa_engine+0x19a> 3b58c: 83 95 inc r24 3b58e: 71 e3 ldi r23, 0x31 ; 49 3b590: 7d 93 st X+, r23 3b592: 70 e3 ldi r23, 0x30 ; 48 3b594: 2a 95 dec r18 3b596: e1 f7 brne .-8 ; 0x3b590 <__ftoa_engine+0x192> 3b598: 11 24 eor r1, r1 3b59a: ef 90 pop r14 3b59c: ff 90 pop r15 3b59e: 0f 91 pop r16 3b5a0: 1f 91 pop r17 3b5a2: cf 91 pop r28 3b5a4: df 91 pop r29 3b5a6: 99 27 eor r25, r25 3b5a8: 87 fd sbrc r24, 7 3b5aa: 90 95 com r25 3b5ac: 08 95 ret 0003b5ae : 3b5ae: 91 11 cpse r25, r1 3b5b0: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__ctype_isfalse> 3b5b4: 80 32 cpi r24, 0x20 ; 32 3b5b6: 19 f0 breq .+6 ; 0x3b5be 3b5b8: 89 50 subi r24, 0x09 ; 9 3b5ba: 85 50 subi r24, 0x05 ; 5 3b5bc: c8 f7 brcc .-14 ; 0x3b5b0 3b5be: 08 95 ret 0003b5c0 : 3b5c0: fb 01 movw r30, r22 3b5c2: dc 01 movw r26, r24 3b5c4: 02 c0 rjmp .+4 ; 0x3b5ca 3b5c6: 05 90 lpm r0, Z+ 3b5c8: 0d 92 st X+, r0 3b5ca: 41 50 subi r20, 0x01 ; 1 3b5cc: 50 40 sbci r21, 0x00 ; 0 3b5ce: d8 f7 brcc .-10 ; 0x3b5c6 3b5d0: 08 95 ret 0003b5d2 : 3b5d2: fb 01 movw r30, r22 3b5d4: dc 01 movw r26, r24 3b5d6: 0d 90 ld r0, X+ 3b5d8: 00 20 and r0, r0 3b5da: e9 f7 brne .-6 ; 0x3b5d6 3b5dc: 11 97 sbiw r26, 0x01 ; 1 3b5de: 05 90 lpm r0, Z+ 3b5e0: 0d 92 st X+, r0 3b5e2: 00 20 and r0, r0 3b5e4: e1 f7 brne .-8 ; 0x3b5de 3b5e6: 08 95 ret 0003b5e8 : 3b5e8: fb 01 movw r30, r22 3b5ea: dc 01 movw r26, r24 3b5ec: 8d 91 ld r24, X+ 3b5ee: 05 90 lpm r0, Z+ 3b5f0: 80 19 sub r24, r0 3b5f2: 01 10 cpse r0, r1 3b5f4: d9 f3 breq .-10 ; 0x3b5ec 3b5f6: 99 0b sbc r25, r25 3b5f8: 08 95 ret 0003b5fa : 3b5fa: fb 01 movw r30, r22 3b5fc: dc 01 movw r26, r24 3b5fe: 05 90 lpm r0, Z+ 3b600: 0d 92 st X+, r0 3b602: 00 20 and r0, r0 3b604: e1 f7 brne .-8 ; 0x3b5fe 3b606: 08 95 ret 0003b608 <__strlen_P>: 3b608: fc 01 movw r30, r24 3b60a: 05 90 lpm r0, Z+ 3b60c: 00 20 and r0, r0 3b60e: e9 f7 brne .-6 ; 0x3b60a <__strlen_P+0x2> 3b610: 80 95 com r24 3b612: 90 95 com r25 3b614: 8e 0f add r24, r30 3b616: 9f 1f adc r25, r31 3b618: 08 95 ret 0003b61a : 3b61a: fb 01 movw r30, r22 3b61c: dc 01 movw r26, r24 3b61e: 41 50 subi r20, 0x01 ; 1 3b620: 50 40 sbci r21, 0x00 ; 0 3b622: 88 f0 brcs .+34 ; 0x3b646 3b624: 8d 91 ld r24, X+ 3b626: 81 34 cpi r24, 0x41 ; 65 3b628: 1c f0 brlt .+6 ; 0x3b630 3b62a: 8b 35 cpi r24, 0x5B ; 91 3b62c: 0c f4 brge .+2 ; 0x3b630 3b62e: 80 5e subi r24, 0xE0 ; 224 3b630: 65 91 lpm r22, Z+ 3b632: 61 34 cpi r22, 0x41 ; 65 3b634: 1c f0 brlt .+6 ; 0x3b63c 3b636: 6b 35 cpi r22, 0x5B ; 91 3b638: 0c f4 brge .+2 ; 0x3b63c 3b63a: 60 5e subi r22, 0xE0 ; 224 3b63c: 86 1b sub r24, r22 3b63e: 61 11 cpse r22, r1 3b640: 71 f3 breq .-36 ; 0x3b61e 3b642: 99 0b sbc r25, r25 3b644: 08 95 ret 3b646: 88 1b sub r24, r24 3b648: fc cf rjmp .-8 ; 0x3b642 0003b64a : 3b64a: fb 01 movw r30, r22 3b64c: dc 01 movw r26, r24 3b64e: 41 50 subi r20, 0x01 ; 1 3b650: 50 40 sbci r21, 0x00 ; 0 3b652: 30 f0 brcs .+12 ; 0x3b660 3b654: 8d 91 ld r24, X+ 3b656: 05 90 lpm r0, Z+ 3b658: 80 19 sub r24, r0 3b65a: 19 f4 brne .+6 ; 0x3b662 3b65c: 00 20 and r0, r0 3b65e: b9 f7 brne .-18 ; 0x3b64e 3b660: 88 1b sub r24, r24 3b662: 99 0b sbc r25, r25 3b664: 08 95 ret 0003b666 : 3b666: fb 01 movw r30, r22 3b668: dc 01 movw r26, r24 3b66a: 41 50 subi r20, 0x01 ; 1 3b66c: 50 40 sbci r21, 0x00 ; 0 3b66e: 48 f0 brcs .+18 ; 0x3b682 3b670: 05 90 lpm r0, Z+ 3b672: 0d 92 st X+, r0 3b674: 00 20 and r0, r0 3b676: c9 f7 brne .-14 ; 0x3b66a 3b678: 01 c0 rjmp .+2 ; 0x3b67c 3b67a: 1d 92 st X+, r1 3b67c: 41 50 subi r20, 0x01 ; 1 3b67e: 50 40 sbci r21, 0x00 ; 0 3b680: e0 f7 brcc .-8 ; 0x3b67a 3b682: 08 95 ret 0003b684 : 3b684: fc 01 movw r30, r24 3b686: 05 90 lpm r0, Z+ 3b688: 61 50 subi r22, 0x01 ; 1 3b68a: 70 40 sbci r23, 0x00 ; 0 3b68c: 01 10 cpse r0, r1 3b68e: d8 f7 brcc .-10 ; 0x3b686 3b690: 80 95 com r24 3b692: 90 95 com r25 3b694: 8e 0f add r24, r30 3b696: 9f 1f adc r25, r31 3b698: 08 95 ret 0003b69a : 3b69a: fb 01 movw r30, r22 3b69c: 55 91 lpm r21, Z+ 3b69e: 55 23 and r21, r21 3b6a0: a9 f0 breq .+42 ; 0x3b6cc 3b6a2: bf 01 movw r22, r30 3b6a4: dc 01 movw r26, r24 3b6a6: 4d 91 ld r20, X+ 3b6a8: 45 17 cp r20, r21 3b6aa: 41 11 cpse r20, r1 3b6ac: e1 f7 brne .-8 ; 0x3b6a6 3b6ae: 59 f4 brne .+22 ; 0x3b6c6 3b6b0: cd 01 movw r24, r26 3b6b2: 05 90 lpm r0, Z+ 3b6b4: 00 20 and r0, r0 3b6b6: 49 f0 breq .+18 ; 0x3b6ca 3b6b8: 4d 91 ld r20, X+ 3b6ba: 40 15 cp r20, r0 3b6bc: 41 11 cpse r20, r1 3b6be: c9 f3 breq .-14 ; 0x3b6b2 3b6c0: fb 01 movw r30, r22 3b6c2: 41 11 cpse r20, r1 3b6c4: ef cf rjmp .-34 ; 0x3b6a4 3b6c6: 81 e0 ldi r24, 0x01 ; 1 3b6c8: 90 e0 ldi r25, 0x00 ; 0 3b6ca: 01 97 sbiw r24, 0x01 ; 1 3b6cc: 08 95 ret 0003b6ce : 3b6ce: fc 01 movw r30, r24 3b6d0: 61 50 subi r22, 0x01 ; 1 3b6d2: 70 40 sbci r23, 0x00 ; 0 3b6d4: 01 90 ld r0, Z+ 3b6d6: 01 10 cpse r0, r1 3b6d8: d8 f7 brcc .-10 ; 0x3b6d0 3b6da: 80 95 com r24 3b6dc: 90 95 com r25 3b6de: 8e 0f add r24, r30 3b6e0: 9f 1f adc r25, r31 3b6e2: 08 95 ret 0003b6e4 : 3b6e4: cf 93 push r28 3b6e6: df 93 push r29 3b6e8: ec 01 movw r28, r24 3b6ea: 2b 81 ldd r18, Y+3 ; 0x03 3b6ec: 20 ff sbrs r18, 0 3b6ee: 1a c0 rjmp .+52 ; 0x3b724 3b6f0: 26 ff sbrs r18, 6 3b6f2: 0c c0 rjmp .+24 ; 0x3b70c 3b6f4: 2f 7b andi r18, 0xBF ; 191 3b6f6: 2b 83 std Y+3, r18 ; 0x03 3b6f8: 8e 81 ldd r24, Y+6 ; 0x06 3b6fa: 9f 81 ldd r25, Y+7 ; 0x07 3b6fc: 01 96 adiw r24, 0x01 ; 1 3b6fe: 9f 83 std Y+7, r25 ; 0x07 3b700: 8e 83 std Y+6, r24 ; 0x06 3b702: 8a 81 ldd r24, Y+2 ; 0x02 3b704: 90 e0 ldi r25, 0x00 ; 0 3b706: df 91 pop r29 3b708: cf 91 pop r28 3b70a: 08 95 ret 3b70c: 22 ff sbrs r18, 2 3b70e: 18 c0 rjmp .+48 ; 0x3b740 3b710: e8 81 ld r30, Y 3b712: f9 81 ldd r31, Y+1 ; 0x01 3b714: 80 81 ld r24, Z 3b716: 08 2e mov r0, r24 3b718: 00 0c add r0, r0 3b71a: 99 0b sbc r25, r25 3b71c: 00 97 sbiw r24, 0x00 ; 0 3b71e: 29 f4 brne .+10 ; 0x3b72a 3b720: 20 62 ori r18, 0x20 ; 32 3b722: 2b 83 std Y+3, r18 ; 0x03 3b724: 8f ef ldi r24, 0xFF ; 255 3b726: 9f ef ldi r25, 0xFF ; 255 3b728: ee cf rjmp .-36 ; 0x3b706 3b72a: 31 96 adiw r30, 0x01 ; 1 3b72c: f9 83 std Y+1, r31 ; 0x01 3b72e: e8 83 st Y, r30 3b730: 2e 81 ldd r18, Y+6 ; 0x06 3b732: 3f 81 ldd r19, Y+7 ; 0x07 3b734: 2f 5f subi r18, 0xFF ; 255 3b736: 3f 4f sbci r19, 0xFF ; 255 3b738: 3f 83 std Y+7, r19 ; 0x07 3b73a: 2e 83 std Y+6, r18 ; 0x06 3b73c: 99 27 eor r25, r25 3b73e: e3 cf rjmp .-58 ; 0x3b706 3b740: ea 85 ldd r30, Y+10 ; 0x0a 3b742: fb 85 ldd r31, Y+11 ; 0x0b 3b744: 19 95 eicall 3b746: 97 ff sbrs r25, 7 3b748: f3 cf rjmp .-26 ; 0x3b730 3b74a: 2b 81 ldd r18, Y+3 ; 0x03 3b74c: 01 96 adiw r24, 0x01 ; 1 3b74e: 21 f0 breq .+8 ; 0x3b758 3b750: 80 e2 ldi r24, 0x20 ; 32 3b752: 82 2b or r24, r18 3b754: 8b 83 std Y+3, r24 ; 0x03 3b756: e6 cf rjmp .-52 ; 0x3b724 3b758: 80 e1 ldi r24, 0x10 ; 16 3b75a: fb cf rjmp .-10 ; 0x3b752 0003b75c : 3b75c: 0f 93 push r16 3b75e: 1f 93 push r17 3b760: cf 93 push r28 3b762: df 93 push r29 3b764: 18 2f mov r17, r24 3b766: 09 2f mov r16, r25 3b768: eb 01 movw r28, r22 3b76a: 8b 81 ldd r24, Y+3 ; 0x03 3b76c: 81 fd sbrc r24, 1 3b76e: 09 c0 rjmp .+18 ; 0x3b782 3b770: 1f ef ldi r17, 0xFF ; 255 3b772: 0f ef ldi r16, 0xFF ; 255 3b774: 81 2f mov r24, r17 3b776: 90 2f mov r25, r16 3b778: df 91 pop r29 3b77a: cf 91 pop r28 3b77c: 1f 91 pop r17 3b77e: 0f 91 pop r16 3b780: 08 95 ret 3b782: 82 ff sbrs r24, 2 3b784: 14 c0 rjmp .+40 ; 0x3b7ae 3b786: 2e 81 ldd r18, Y+6 ; 0x06 3b788: 3f 81 ldd r19, Y+7 ; 0x07 3b78a: 8c 81 ldd r24, Y+4 ; 0x04 3b78c: 9d 81 ldd r25, Y+5 ; 0x05 3b78e: 28 17 cp r18, r24 3b790: 39 07 cpc r19, r25 3b792: 3c f4 brge .+14 ; 0x3b7a2 3b794: e8 81 ld r30, Y 3b796: f9 81 ldd r31, Y+1 ; 0x01 3b798: cf 01 movw r24, r30 3b79a: 01 96 adiw r24, 0x01 ; 1 3b79c: 99 83 std Y+1, r25 ; 0x01 3b79e: 88 83 st Y, r24 3b7a0: 10 83 st Z, r17 3b7a2: 8e 81 ldd r24, Y+6 ; 0x06 3b7a4: 9f 81 ldd r25, Y+7 ; 0x07 3b7a6: 01 96 adiw r24, 0x01 ; 1 3b7a8: 9f 83 std Y+7, r25 ; 0x07 3b7aa: 8e 83 std Y+6, r24 ; 0x06 3b7ac: e3 cf rjmp .-58 ; 0x3b774 3b7ae: e8 85 ldd r30, Y+8 ; 0x08 3b7b0: f9 85 ldd r31, Y+9 ; 0x09 3b7b2: 81 2f mov r24, r17 3b7b4: 19 95 eicall 3b7b6: 89 2b or r24, r25 3b7b8: a1 f3 breq .-24 ; 0x3b7a2 3b7ba: da cf rjmp .-76 ; 0x3b770 0003b7bc : 3b7bc: ef 92 push r14 3b7be: ff 92 push r15 3b7c0: 0f 93 push r16 3b7c2: 1f 93 push r17 3b7c4: cf 93 push r28 3b7c6: df 93 push r29 3b7c8: 8c 01 movw r16, r24 3b7ca: 7b 01 movw r14, r22 3b7cc: db 01 movw r26, r22 3b7ce: 13 96 adiw r26, 0x03 ; 3 3b7d0: 8c 91 ld r24, X 3b7d2: d0 e0 ldi r29, 0x00 ; 0 3b7d4: c0 e0 ldi r28, 0x00 ; 0 3b7d6: 81 fd sbrc r24, 1 3b7d8: 0f c0 rjmp .+30 ; 0x3b7f8 3b7da: cf ef ldi r28, 0xFF ; 255 3b7dc: df ef ldi r29, 0xFF ; 255 3b7de: 10 c0 rjmp .+32 ; 0x3b800 3b7e0: d7 01 movw r26, r14 3b7e2: 18 96 adiw r26, 0x08 ; 8 3b7e4: ed 91 ld r30, X+ 3b7e6: fc 91 ld r31, X 3b7e8: b7 01 movw r22, r14 3b7ea: 19 95 eicall 3b7ec: 89 2b or r24, r25 3b7ee: 11 f0 breq .+4 ; 0x3b7f4 3b7f0: cf ef ldi r28, 0xFF ; 255 3b7f2: df ef ldi r29, 0xFF ; 255 3b7f4: 0f 5f subi r16, 0xFF ; 255 3b7f6: 1f 4f sbci r17, 0xFF ; 255 3b7f8: f8 01 movw r30, r16 3b7fa: 84 91 lpm r24, Z 3b7fc: 81 11 cpse r24, r1 3b7fe: f0 cf rjmp .-32 ; 0x3b7e0 3b800: ce 01 movw r24, r28 3b802: df 91 pop r29 3b804: cf 91 pop r28 3b806: 1f 91 pop r17 3b808: 0f 91 pop r16 3b80a: ff 90 pop r15 3b80c: ef 90 pop r14 3b80e: 08 95 ret 0003b810 : 3b810: 0f 93 push r16 3b812: 1f 93 push r17 3b814: cf 93 push r28 3b816: df 93 push r29 3b818: cd b7 in r28, 0x3d ; 61 3b81a: de b7 in r29, 0x3e ; 62 3b81c: ae 01 movw r20, r28 3b81e: 48 5f subi r20, 0xF8 ; 248 3b820: 5f 4f sbci r21, 0xFF ; 255 3b822: da 01 movw r26, r20 3b824: 6d 91 ld r22, X+ 3b826: 7d 91 ld r23, X+ 3b828: ad 01 movw r20, r26 3b82a: 00 e1 ldi r16, 0x10 ; 16 3b82c: 18 e1 ldi r17, 0x18 ; 24 3b82e: f8 01 movw r30, r16 3b830: 82 81 ldd r24, Z+2 ; 0x02 3b832: 93 81 ldd r25, Z+3 ; 0x03 3b834: dc 01 movw r26, r24 3b836: 13 96 adiw r26, 0x03 ; 3 3b838: 2c 91 ld r18, X 3b83a: 13 97 sbiw r26, 0x03 ; 3 3b83c: 28 60 ori r18, 0x08 ; 8 3b83e: 13 96 adiw r26, 0x03 ; 3 3b840: 2c 93 st X, r18 3b842: 0e 94 a0 57 call 0xaf40 ; 0xaf40 3b846: d8 01 movw r26, r16 3b848: 12 96 adiw r26, 0x02 ; 2 3b84a: ed 91 ld r30, X+ 3b84c: fc 91 ld r31, X 3b84e: 23 81 ldd r18, Z+3 ; 0x03 3b850: 27 7f andi r18, 0xF7 ; 247 3b852: 23 83 std Z+3, r18 ; 0x03 3b854: df 91 pop r29 3b856: cf 91 pop r28 3b858: 1f 91 pop r17 3b85a: 0f 91 pop r16 3b85c: 08 95 ret 0003b85e : 3b85e: 0f 93 push r16 3b860: 1f 93 push r17 3b862: cf 93 push r28 3b864: df 93 push r29 3b866: 8c 01 movw r16, r24 3b868: e0 91 12 18 lds r30, 0x1812 ; 0x801812 <__iob+0x2> 3b86c: f0 91 13 18 lds r31, 0x1813 ; 0x801813 <__iob+0x3> 3b870: 83 81 ldd r24, Z+3 ; 0x03 3b872: d0 e0 ldi r29, 0x00 ; 0 3b874: c0 e0 ldi r28, 0x00 ; 0 3b876: 81 fd sbrc r24, 1 3b878: 0a c0 rjmp .+20 ; 0x3b88e 3b87a: cf ef ldi r28, 0xFF ; 255 3b87c: df ef ldi r29, 0xFF ; 255 3b87e: 17 c0 rjmp .+46 ; 0x3b8ae 3b880: 19 95 eicall 3b882: 89 2b or r24, r25 3b884: 11 f0 breq .+4 ; 0x3b88a 3b886: cf ef ldi r28, 0xFF ; 255 3b888: df ef ldi r29, 0xFF ; 255 3b88a: 0f 5f subi r16, 0xFF ; 255 3b88c: 1f 4f sbci r17, 0xFF ; 255 3b88e: f8 01 movw r30, r16 3b890: 84 91 lpm r24, Z 3b892: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 3b896: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 3b89a: db 01 movw r26, r22 3b89c: 18 96 adiw r26, 0x08 ; 8 3b89e: ed 91 ld r30, X+ 3b8a0: fc 91 ld r31, X 3b8a2: 81 11 cpse r24, r1 3b8a4: ed cf rjmp .-38 ; 0x3b880 3b8a6: 8a e0 ldi r24, 0x0A ; 10 3b8a8: 19 95 eicall 3b8aa: 89 2b or r24, r25 3b8ac: 31 f7 brne .-52 ; 0x3b87a 3b8ae: ce 01 movw r24, r28 3b8b0: df 91 pop r29 3b8b2: cf 91 pop r28 3b8b4: 1f 91 pop r17 3b8b6: 0f 91 pop r16 3b8b8: 08 95 ret 0003b8ba : 3b8ba: 0f 93 push r16 3b8bc: 1f 93 push r17 3b8be: cf 93 push r28 3b8c0: df 93 push r29 3b8c2: cd b7 in r28, 0x3d ; 61 3b8c4: de b7 in r29, 0x3e ; 62 3b8c6: 2e 97 sbiw r28, 0x0e ; 14 3b8c8: 0f b6 in r0, 0x3f ; 63 3b8ca: f8 94 cli 3b8cc: de bf out 0x3e, r29 ; 62 3b8ce: 0f be out 0x3f, r0 ; 63 3b8d0: cd bf out 0x3d, r28 ; 61 3b8d2: 0e 89 ldd r16, Y+22 ; 0x16 3b8d4: 1f 89 ldd r17, Y+23 ; 0x17 3b8d6: 8e e0 ldi r24, 0x0E ; 14 3b8d8: 8c 83 std Y+4, r24 ; 0x04 3b8da: 1a 83 std Y+2, r17 ; 0x02 3b8dc: 09 83 std Y+1, r16 ; 0x01 3b8de: 8f ef ldi r24, 0xFF ; 255 3b8e0: 9f e7 ldi r25, 0x7F ; 127 3b8e2: 9e 83 std Y+6, r25 ; 0x06 3b8e4: 8d 83 std Y+5, r24 ; 0x05 3b8e6: ae 01 movw r20, r28 3b8e8: 46 5e subi r20, 0xE6 ; 230 3b8ea: 5f 4f sbci r21, 0xFF ; 255 3b8ec: 68 8d ldd r22, Y+24 ; 0x18 3b8ee: 79 8d ldd r23, Y+25 ; 0x19 3b8f0: ce 01 movw r24, r28 3b8f2: 01 96 adiw r24, 0x01 ; 1 3b8f4: 0e 94 a0 57 call 0xaf40 ; 0xaf40 3b8f8: 2f 81 ldd r18, Y+7 ; 0x07 3b8fa: 38 85 ldd r19, Y+8 ; 0x08 3b8fc: 02 0f add r16, r18 3b8fe: 13 1f adc r17, r19 3b900: f8 01 movw r30, r16 3b902: 10 82 st Z, r1 3b904: 2e 96 adiw r28, 0x0e ; 14 3b906: 0f b6 in r0, 0x3f ; 63 3b908: f8 94 cli 3b90a: de bf out 0x3e, r29 ; 62 3b90c: 0f be out 0x3f, r0 ; 63 3b90e: cd bf out 0x3d, r28 ; 61 3b910: df 91 pop r29 3b912: cf 91 pop r28 3b914: 1f 91 pop r17 3b916: 0f 91 pop r16 3b918: 08 95 ret 0003b91a : 3b91a: cf 93 push r28 3b91c: df 93 push r29 3b91e: ec 01 movw r28, r24 3b920: 8b 81 ldd r24, Y+3 ; 0x03 3b922: 88 60 ori r24, 0x08 ; 8 3b924: 8b 83 std Y+3, r24 ; 0x03 3b926: ce 01 movw r24, r28 3b928: 0e 94 a0 57 call 0xaf40 ; 0xaf40 3b92c: 2b 81 ldd r18, Y+3 ; 0x03 3b92e: 27 7f andi r18, 0xF7 ; 247 3b930: 2b 83 std Y+3, r18 ; 0x03 3b932: df 91 pop r29 3b934: cf 91 pop r28 3b936: 08 95 ret 0003b938 : 3b938: 0f 93 push r16 3b93a: 1f 93 push r17 3b93c: cf 93 push r28 3b93e: df 93 push r29 3b940: cd b7 in r28, 0x3d ; 61 3b942: de b7 in r29, 0x3e ; 62 3b944: 2e 97 sbiw r28, 0x0e ; 14 3b946: 0f b6 in r0, 0x3f ; 63 3b948: f8 94 cli 3b94a: de bf out 0x3e, r29 ; 62 3b94c: 0f be out 0x3f, r0 ; 63 3b94e: cd bf out 0x3d, r28 ; 61 3b950: 8c 01 movw r16, r24 3b952: fa 01 movw r30, r20 3b954: 8e e0 ldi r24, 0x0E ; 14 3b956: 8c 83 std Y+4, r24 ; 0x04 3b958: 1a 83 std Y+2, r17 ; 0x02 3b95a: 09 83 std Y+1, r16 ; 0x01 3b95c: 77 ff sbrs r23, 7 3b95e: 02 c0 rjmp .+4 ; 0x3b964 3b960: 60 e0 ldi r22, 0x00 ; 0 3b962: 70 e8 ldi r23, 0x80 ; 128 3b964: 61 50 subi r22, 0x01 ; 1 3b966: 71 09 sbc r23, r1 3b968: 7e 83 std Y+6, r23 ; 0x06 3b96a: 6d 83 std Y+5, r22 ; 0x05 3b96c: a9 01 movw r20, r18 3b96e: bf 01 movw r22, r30 3b970: ce 01 movw r24, r28 3b972: 01 96 adiw r24, 0x01 ; 1 3b974: 0e 94 a0 57 call 0xaf40 ; 0xaf40 3b978: 4d 81 ldd r20, Y+5 ; 0x05 3b97a: 5e 81 ldd r21, Y+6 ; 0x06 3b97c: 57 fd sbrc r21, 7 3b97e: 0a c0 rjmp .+20 ; 0x3b994 3b980: 2f 81 ldd r18, Y+7 ; 0x07 3b982: 38 85 ldd r19, Y+8 ; 0x08 3b984: 42 17 cp r20, r18 3b986: 53 07 cpc r21, r19 3b988: 0c f4 brge .+2 ; 0x3b98c 3b98a: 9a 01 movw r18, r20 3b98c: 02 0f add r16, r18 3b98e: 13 1f adc r17, r19 3b990: f8 01 movw r30, r16 3b992: 10 82 st Z, r1 3b994: 2e 96 adiw r28, 0x0e ; 14 3b996: 0f b6 in r0, 0x3f ; 63 3b998: f8 94 cli 3b99a: de bf out 0x3e, r29 ; 62 3b99c: 0f be out 0x3f, r0 ; 63 3b99e: cd bf out 0x3d, r28 ; 61 3b9a0: df 91 pop r29 3b9a2: cf 91 pop r28 3b9a4: 1f 91 pop r17 3b9a6: 0f 91 pop r16 3b9a8: 08 95 ret 0003b9aa <__ultoa_invert>: 3b9aa: fa 01 movw r30, r20 3b9ac: aa 27 eor r26, r26 3b9ae: 28 30 cpi r18, 0x08 ; 8 3b9b0: 51 f1 breq .+84 ; 0x3ba06 <__ultoa_invert+0x5c> 3b9b2: 20 31 cpi r18, 0x10 ; 16 3b9b4: 81 f1 breq .+96 ; 0x3ba16 <__ultoa_invert+0x6c> 3b9b6: e8 94 clt 3b9b8: 6f 93 push r22 3b9ba: 6e 7f andi r22, 0xFE ; 254 3b9bc: 6e 5f subi r22, 0xFE ; 254 3b9be: 7f 4f sbci r23, 0xFF ; 255 3b9c0: 8f 4f sbci r24, 0xFF ; 255 3b9c2: 9f 4f sbci r25, 0xFF ; 255 3b9c4: af 4f sbci r26, 0xFF ; 255 3b9c6: b1 e0 ldi r27, 0x01 ; 1 3b9c8: 3e d0 rcall .+124 ; 0x3ba46 <__ultoa_invert+0x9c> 3b9ca: b4 e0 ldi r27, 0x04 ; 4 3b9cc: 3c d0 rcall .+120 ; 0x3ba46 <__ultoa_invert+0x9c> 3b9ce: 67 0f add r22, r23 3b9d0: 78 1f adc r23, r24 3b9d2: 89 1f adc r24, r25 3b9d4: 9a 1f adc r25, r26 3b9d6: a1 1d adc r26, r1 3b9d8: 68 0f add r22, r24 3b9da: 79 1f adc r23, r25 3b9dc: 8a 1f adc r24, r26 3b9de: 91 1d adc r25, r1 3b9e0: a1 1d adc r26, r1 3b9e2: 6a 0f add r22, r26 3b9e4: 71 1d adc r23, r1 3b9e6: 81 1d adc r24, r1 3b9e8: 91 1d adc r25, r1 3b9ea: a1 1d adc r26, r1 3b9ec: 20 d0 rcall .+64 ; 0x3ba2e <__ultoa_invert+0x84> 3b9ee: 09 f4 brne .+2 ; 0x3b9f2 <__ultoa_invert+0x48> 3b9f0: 68 94 set 3b9f2: 3f 91 pop r19 3b9f4: 2a e0 ldi r18, 0x0A ; 10 3b9f6: 26 9f mul r18, r22 3b9f8: 11 24 eor r1, r1 3b9fa: 30 19 sub r19, r0 3b9fc: 30 5d subi r19, 0xD0 ; 208 3b9fe: 31 93 st Z+, r19 3ba00: de f6 brtc .-74 ; 0x3b9b8 <__ultoa_invert+0xe> 3ba02: cf 01 movw r24, r30 3ba04: 08 95 ret 3ba06: 46 2f mov r20, r22 3ba08: 47 70 andi r20, 0x07 ; 7 3ba0a: 40 5d subi r20, 0xD0 ; 208 3ba0c: 41 93 st Z+, r20 3ba0e: b3 e0 ldi r27, 0x03 ; 3 3ba10: 0f d0 rcall .+30 ; 0x3ba30 <__ultoa_invert+0x86> 3ba12: c9 f7 brne .-14 ; 0x3ba06 <__ultoa_invert+0x5c> 3ba14: f6 cf rjmp .-20 ; 0x3ba02 <__ultoa_invert+0x58> 3ba16: 46 2f mov r20, r22 3ba18: 4f 70 andi r20, 0x0F ; 15 3ba1a: 40 5d subi r20, 0xD0 ; 208 3ba1c: 4a 33 cpi r20, 0x3A ; 58 3ba1e: 18 f0 brcs .+6 ; 0x3ba26 <__ultoa_invert+0x7c> 3ba20: 49 5d subi r20, 0xD9 ; 217 3ba22: 31 fd sbrc r19, 1 3ba24: 40 52 subi r20, 0x20 ; 32 3ba26: 41 93 st Z+, r20 3ba28: 02 d0 rcall .+4 ; 0x3ba2e <__ultoa_invert+0x84> 3ba2a: a9 f7 brne .-22 ; 0x3ba16 <__ultoa_invert+0x6c> 3ba2c: ea cf rjmp .-44 ; 0x3ba02 <__ultoa_invert+0x58> 3ba2e: b4 e0 ldi r27, 0x04 ; 4 3ba30: a6 95 lsr r26 3ba32: 97 95 ror r25 3ba34: 87 95 ror r24 3ba36: 77 95 ror r23 3ba38: 67 95 ror r22 3ba3a: ba 95 dec r27 3ba3c: c9 f7 brne .-14 ; 0x3ba30 <__ultoa_invert+0x86> 3ba3e: 00 97 sbiw r24, 0x00 ; 0 3ba40: 61 05 cpc r22, r1 3ba42: 71 05 cpc r23, r1 3ba44: 08 95 ret 3ba46: 9b 01 movw r18, r22 3ba48: ac 01 movw r20, r24 3ba4a: 0a 2e mov r0, r26 3ba4c: 06 94 lsr r0 3ba4e: 57 95 ror r21 3ba50: 47 95 ror r20 3ba52: 37 95 ror r19 3ba54: 27 95 ror r18 3ba56: ba 95 dec r27 3ba58: c9 f7 brne .-14 ; 0x3ba4c <__ultoa_invert+0xa2> 3ba5a: 62 0f add r22, r18 3ba5c: 73 1f adc r23, r19 3ba5e: 84 1f adc r24, r20 3ba60: 95 1f adc r25, r21 3ba62: a0 1d adc r26, r0 3ba64: 08 95 ret 0003ba66 <__ctype_isfalse>: 3ba66: 99 27 eor r25, r25 3ba68: 88 27 eor r24, r24 0003ba6a <__ctype_istrue>: 3ba6a: 08 95 ret 0003ba6c : 3ba6c: dc 01 movw r26, r24 3ba6e: cb 01 movw r24, r22 0003ba70 : 3ba70: fc 01 movw r30, r24 3ba72: f9 99 sbic 0x1f, 1 ; 31 3ba74: fe cf rjmp .-4 ; 0x3ba72 3ba76: 06 c0 rjmp .+12 ; 0x3ba84 3ba78: f2 bd out 0x22, r31 ; 34 3ba7a: e1 bd out 0x21, r30 ; 33 3ba7c: f8 9a sbi 0x1f, 0 ; 31 3ba7e: 31 96 adiw r30, 0x01 ; 1 3ba80: 00 b4 in r0, 0x20 ; 32 3ba82: 0d 92 st X+, r0 3ba84: 41 50 subi r20, 0x01 ; 1 3ba86: 50 40 sbci r21, 0x00 ; 0 3ba88: b8 f7 brcc .-18 ; 0x3ba78 3ba8a: 08 95 ret 0003ba8c : 3ba8c: f9 99 sbic 0x1f, 1 ; 31 3ba8e: fe cf rjmp .-4 ; 0x3ba8c 3ba90: 92 bd out 0x22, r25 ; 34 3ba92: 81 bd out 0x21, r24 ; 33 3ba94: f8 9a sbi 0x1f, 0 ; 31 3ba96: 99 27 eor r25, r25 3ba98: 80 b5 in r24, 0x20 ; 32 3ba9a: 08 95 ret 0003ba9c : 3ba9c: a6 e1 ldi r26, 0x16 ; 22 3ba9e: b0 e0 ldi r27, 0x00 ; 0 3baa0: 44 e0 ldi r20, 0x04 ; 4 3baa2: 50 e0 ldi r21, 0x00 ; 0 3baa4: 0d 94 38 dd jmp 0x3ba70 ; 0x3ba70 0003baa8 : 3baa8: a8 e1 ldi r26, 0x18 ; 24 3baaa: b0 e0 ldi r27, 0x00 ; 0 3baac: 42 e0 ldi r20, 0x02 ; 2 3baae: 50 e0 ldi r21, 0x00 ; 0 3bab0: 0d 94 38 dd jmp 0x3ba70 ; 0x3ba70 0003bab4 : 3bab4: dc 01 movw r26, r24 3bab6: a4 0f add r26, r20 3bab8: b5 1f adc r27, r21 3baba: 41 50 subi r20, 0x01 ; 1 3babc: 50 40 sbci r21, 0x00 ; 0 3babe: 48 f0 brcs .+18 ; 0x3bad2 3bac0: cb 01 movw r24, r22 3bac2: 84 0f add r24, r20 3bac4: 95 1f adc r25, r21 3bac6: 2e 91 ld r18, -X 3bac8: 0f 94 6b dd call 0x3bad6 ; 0x3bad6 3bacc: 41 50 subi r20, 0x01 ; 1 3bace: 50 40 sbci r21, 0x00 ; 0 3bad0: d0 f7 brcc .-12 ; 0x3bac6 3bad2: 08 95 ret 0003bad4 : 3bad4: 26 2f mov r18, r22 0003bad6 : 3bad6: f9 99 sbic 0x1f, 1 ; 31 3bad8: fe cf rjmp .-4 ; 0x3bad6 3bada: 92 bd out 0x22, r25 ; 34 3badc: 81 bd out 0x21, r24 ; 33 3bade: f8 9a sbi 0x1f, 0 ; 31 3bae0: 01 97 sbiw r24, 0x01 ; 1 3bae2: 00 b4 in r0, 0x20 ; 32 3bae4: 02 16 cp r0, r18 3bae6: 39 f0 breq .+14 ; 0x3baf6 3bae8: 1f ba out 0x1f, r1 ; 31 3baea: 20 bd out 0x20, r18 ; 32 3baec: 0f b6 in r0, 0x3f ; 63 3baee: f8 94 cli 3baf0: fa 9a sbi 0x1f, 2 ; 31 3baf2: f9 9a sbi 0x1f, 1 ; 31 3baf4: 0f be out 0x3f, r0 ; 63 3baf6: 08 95 ret 0003baf8 : 3baf8: 03 96 adiw r24, 0x03 ; 3 3bafa: 27 2f mov r18, r23 3bafc: 0f 94 6b dd call 0x3bad6 ; 0x3bad6 3bb00: 0f 94 6a dd call 0x3bad4 ; 0x3bad4 3bb04: 25 2f mov r18, r21 3bb06: 0f 94 6b dd call 0x3bad6 ; 0x3bad6 3bb0a: 24 2f mov r18, r20 3bb0c: 0d 94 6b dd jmp 0x3bad6 ; 0x3bad6 0003bb10 : 3bb10: 01 96 adiw r24, 0x01 ; 1 3bb12: 27 2f mov r18, r23 3bb14: 0f 94 6b dd call 0x3bad6 ; 0x3bad6 3bb18: 0d 94 6a dd jmp 0x3bad4 ; 0x3bad4 0003bb1c : 3bb1c: 26 2f mov r18, r22 0003bb1e : 3bb1e: f9 99 sbic 0x1f, 1 ; 31 3bb20: fe cf rjmp .-4 ; 0x3bb1e 3bb22: 1f ba out 0x1f, r1 ; 31 3bb24: 92 bd out 0x22, r25 ; 34 3bb26: 81 bd out 0x21, r24 ; 33 3bb28: 20 bd out 0x20, r18 ; 32 3bb2a: 0f b6 in r0, 0x3f ; 63 3bb2c: f8 94 cli 3bb2e: fa 9a sbi 0x1f, 2 ; 31 3bb30: f9 9a sbi 0x1f, 1 ; 31 3bb32: 0f be out 0x3f, r0 ; 63 3bb34: 01 96 adiw r24, 0x01 ; 1 3bb36: 08 95 ret 0003bb38 : 3bb38: 24 2f mov r18, r20 3bb3a: 0f 94 8f dd call 0x3bb1e ; 0x3bb1e 3bb3e: 25 2f mov r18, r21 3bb40: 0f 94 8f dd call 0x3bb1e ; 0x3bb1e 3bb44: 0d 94 a4 dd jmp 0x3bb48 ; 0x3bb48 0003bb48 : 3bb48: 0f 94 8e dd call 0x3bb1c ; 0x3bb1c 3bb4c: 27 2f mov r18, r23 3bb4e: 0d 94 8f dd jmp 0x3bb1e ; 0x3bb1e 0003bb52 <__mulsi3>: 3bb52: db 01 movw r26, r22 3bb54: 8f 93 push r24 3bb56: 9f 93 push r25 3bb58: 0f 94 db dd call 0x3bbb6 ; 0x3bbb6 <__muluhisi3> 3bb5c: bf 91 pop r27 3bb5e: af 91 pop r26 3bb60: a2 9f mul r26, r18 3bb62: 80 0d add r24, r0 3bb64: 91 1d adc r25, r1 3bb66: a3 9f mul r26, r19 3bb68: 90 0d add r25, r0 3bb6a: b2 9f mul r27, r18 3bb6c: 90 0d add r25, r0 3bb6e: 11 24 eor r1, r1 3bb70: 08 95 ret 0003bb72 <__udivmodsi4>: 3bb72: a1 e2 ldi r26, 0x21 ; 33 3bb74: 1a 2e mov r1, r26 3bb76: aa 1b sub r26, r26 3bb78: bb 1b sub r27, r27 3bb7a: fd 01 movw r30, r26 3bb7c: 0d c0 rjmp .+26 ; 0x3bb98 <__udivmodsi4_ep> 0003bb7e <__udivmodsi4_loop>: 3bb7e: aa 1f adc r26, r26 3bb80: bb 1f adc r27, r27 3bb82: ee 1f adc r30, r30 3bb84: ff 1f adc r31, r31 3bb86: a2 17 cp r26, r18 3bb88: b3 07 cpc r27, r19 3bb8a: e4 07 cpc r30, r20 3bb8c: f5 07 cpc r31, r21 3bb8e: 20 f0 brcs .+8 ; 0x3bb98 <__udivmodsi4_ep> 3bb90: a2 1b sub r26, r18 3bb92: b3 0b sbc r27, r19 3bb94: e4 0b sbc r30, r20 3bb96: f5 0b sbc r31, r21 0003bb98 <__udivmodsi4_ep>: 3bb98: 66 1f adc r22, r22 3bb9a: 77 1f adc r23, r23 3bb9c: 88 1f adc r24, r24 3bb9e: 99 1f adc r25, r25 3bba0: 1a 94 dec r1 3bba2: 69 f7 brne .-38 ; 0x3bb7e <__udivmodsi4_loop> 3bba4: 60 95 com r22 3bba6: 70 95 com r23 3bba8: 80 95 com r24 3bbaa: 90 95 com r25 3bbac: 9b 01 movw r18, r22 3bbae: ac 01 movw r20, r24 3bbb0: bd 01 movw r22, r26 3bbb2: cf 01 movw r24, r30 3bbb4: 08 95 ret 0003bbb6 <__muluhisi3>: 3bbb6: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 3bbba: a5 9f mul r26, r21 3bbbc: 90 0d add r25, r0 3bbbe: b4 9f mul r27, r20 3bbc0: 90 0d add r25, r0 3bbc2: a4 9f mul r26, r20 3bbc4: 80 0d add r24, r0 3bbc6: 91 1d adc r25, r1 3bbc8: 11 24 eor r1, r1 3bbca: 08 95 ret 0003bbcc <__umulhisi3>: 3bbcc: a2 9f mul r26, r18 3bbce: b0 01 movw r22, r0 3bbd0: b3 9f mul r27, r19 3bbd2: c0 01 movw r24, r0 3bbd4: a3 9f mul r26, r19 3bbd6: 70 0d add r23, r0 3bbd8: 81 1d adc r24, r1 3bbda: 11 24 eor r1, r1 3bbdc: 91 1d adc r25, r1 3bbde: b2 9f mul r27, r18 3bbe0: 70 0d add r23, r0 3bbe2: 81 1d adc r24, r1 3bbe4: 11 24 eor r1, r1 3bbe6: 91 1d adc r25, r1 3bbe8: 08 95 ret 0003bbea <__udivmodqi4>: 3bbea: 99 1b sub r25, r25 3bbec: 79 e0 ldi r23, 0x09 ; 9 3bbee: 04 c0 rjmp .+8 ; 0x3bbf8 <__udivmodqi4_ep> 0003bbf0 <__udivmodqi4_loop>: 3bbf0: 99 1f adc r25, r25 3bbf2: 96 17 cp r25, r22 3bbf4: 08 f0 brcs .+2 ; 0x3bbf8 <__udivmodqi4_ep> 3bbf6: 96 1b sub r25, r22 0003bbf8 <__udivmodqi4_ep>: 3bbf8: 88 1f adc r24, r24 3bbfa: 7a 95 dec r23 3bbfc: c9 f7 brne .-14 ; 0x3bbf0 <__udivmodqi4_loop> 3bbfe: 80 95 com r24 3bc00: 08 95 ret 0003bc02 <__divmodqi4>: 3bc02: 87 fb bst r24, 7 3bc04: 08 2e mov r0, r24 3bc06: 06 26 eor r0, r22 3bc08: 87 fd sbrc r24, 7 3bc0a: 81 95 neg r24 3bc0c: 67 fd sbrc r22, 7 3bc0e: 61 95 neg r22 3bc10: 0f 94 f5 dd call 0x3bbea ; 0x3bbea <__udivmodqi4> 3bc14: 0e f4 brtc .+2 ; 0x3bc18 <__divmodqi4_1> 3bc16: 91 95 neg r25 0003bc18 <__divmodqi4_1>: 3bc18: 07 fc sbrc r0, 7 3bc1a: 81 95 neg r24 0003bc1c <__divmodqi4_exit>: 3bc1c: 08 95 ret 0003bc1e <__udivmodhi4>: 3bc1e: aa 1b sub r26, r26 3bc20: bb 1b sub r27, r27 3bc22: 51 e1 ldi r21, 0x11 ; 17 3bc24: 07 c0 rjmp .+14 ; 0x3bc34 <__udivmodhi4_ep> 0003bc26 <__udivmodhi4_loop>: 3bc26: aa 1f adc r26, r26 3bc28: bb 1f adc r27, r27 3bc2a: a6 17 cp r26, r22 3bc2c: b7 07 cpc r27, r23 3bc2e: 10 f0 brcs .+4 ; 0x3bc34 <__udivmodhi4_ep> 3bc30: a6 1b sub r26, r22 3bc32: b7 0b sbc r27, r23 0003bc34 <__udivmodhi4_ep>: 3bc34: 88 1f adc r24, r24 3bc36: 99 1f adc r25, r25 3bc38: 5a 95 dec r21 3bc3a: a9 f7 brne .-22 ; 0x3bc26 <__udivmodhi4_loop> 3bc3c: 80 95 com r24 3bc3e: 90 95 com r25 3bc40: bc 01 movw r22, r24 3bc42: cd 01 movw r24, r26 3bc44: 08 95 ret 0003bc46 <__divmodhi4>: 3bc46: 97 fb bst r25, 7 3bc48: 07 2e mov r0, r23 3bc4a: 16 f4 brtc .+4 ; 0x3bc50 <__divmodhi4+0xa> 3bc4c: 00 94 com r0 3bc4e: 07 d0 rcall .+14 ; 0x3bc5e <__divmodhi4_neg1> 3bc50: 77 fd sbrc r23, 7 3bc52: 09 d0 rcall .+18 ; 0x3bc66 <__divmodhi4_neg2> 3bc54: 0f 94 0f de call 0x3bc1e ; 0x3bc1e <__udivmodhi4> 3bc58: 07 fc sbrc r0, 7 3bc5a: 05 d0 rcall .+10 ; 0x3bc66 <__divmodhi4_neg2> 3bc5c: 3e f4 brtc .+14 ; 0x3bc6c <__divmodhi4_exit> 0003bc5e <__divmodhi4_neg1>: 3bc5e: 90 95 com r25 3bc60: 81 95 neg r24 3bc62: 9f 4f sbci r25, 0xFF ; 255 3bc64: 08 95 ret 0003bc66 <__divmodhi4_neg2>: 3bc66: 70 95 com r23 3bc68: 61 95 neg r22 3bc6a: 7f 4f sbci r23, 0xFF ; 255 0003bc6c <__divmodhi4_exit>: 3bc6c: 08 95 ret 0003bc6e <__divmodsi4>: 3bc6e: 05 2e mov r0, r21 3bc70: 97 fb bst r25, 7 3bc72: 1e f4 brtc .+6 ; 0x3bc7a <__divmodsi4+0xc> 3bc74: 00 94 com r0 3bc76: 0f 94 4e de call 0x3bc9c ; 0x3bc9c <__negsi2> 3bc7a: 57 fd sbrc r21, 7 3bc7c: 07 d0 rcall .+14 ; 0x3bc8c <__divmodsi4_neg2> 3bc7e: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 <__udivmodsi4> 3bc82: 07 fc sbrc r0, 7 3bc84: 03 d0 rcall .+6 ; 0x3bc8c <__divmodsi4_neg2> 3bc86: 4e f4 brtc .+18 ; 0x3bc9a <__divmodsi4_exit> 3bc88: 0d 94 4e de jmp 0x3bc9c ; 0x3bc9c <__negsi2> 0003bc8c <__divmodsi4_neg2>: 3bc8c: 50 95 com r21 3bc8e: 40 95 com r20 3bc90: 30 95 com r19 3bc92: 21 95 neg r18 3bc94: 3f 4f sbci r19, 0xFF ; 255 3bc96: 4f 4f sbci r20, 0xFF ; 255 3bc98: 5f 4f sbci r21, 0xFF ; 255 0003bc9a <__divmodsi4_exit>: 3bc9a: 08 95 ret 0003bc9c <__negsi2>: 3bc9c: 90 95 com r25 3bc9e: 80 95 com r24 3bca0: 70 95 com r23 3bca2: 61 95 neg r22 3bca4: 7f 4f sbci r23, 0xFF ; 255 3bca6: 8f 4f sbci r24, 0xFF ; 255 3bca8: 9f 4f sbci r25, 0xFF ; 255 3bcaa: 08 95 ret 0003bcac <__tablejump2__>: 3bcac: ee 0f add r30, r30 3bcae: ff 1f adc r31, r31 3bcb0: 88 1f adc r24, r24 3bcb2: 8b bf out 0x3b, r24 ; 59 3bcb4: 07 90 elpm r0, Z+ 3bcb6: f6 91 elpm r31, Z 3bcb8: e0 2d mov r30, r0 3bcba: 19 94 eijmp 0003bcbc <__mulhisi3>: 3bcbc: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 3bcc0: 33 23 and r19, r19 3bcc2: 12 f4 brpl .+4 ; 0x3bcc8 <__mulhisi3+0xc> 3bcc4: 8a 1b sub r24, r26 3bcc6: 9b 0b sbc r25, r27 3bcc8: 0d 94 68 de jmp 0x3bcd0 ; 0x3bcd0 <__usmulhisi3_tail> 0003bccc <__usmulhisi3>: 3bccc: 0f 94 e6 dd call 0x3bbcc ; 0x3bbcc <__umulhisi3> 0003bcd0 <__usmulhisi3_tail>: 3bcd0: b7 ff sbrs r27, 7 3bcd2: 08 95 ret 3bcd4: 82 1b sub r24, r18 3bcd6: 93 0b sbc r25, r19 3bcd8: 08 95 ret 0003bcda <__subsf3>: 3bcda: 50 58 subi r21, 0x80 ; 128 0003bcdc <__addsf3>: 3bcdc: bb 27 eor r27, r27 3bcde: aa 27 eor r26, r26 3bce0: 0f 94 85 de call 0x3bd0a ; 0x3bd0a <__addsf3x> 3bce4: 0d 94 97 d8 jmp 0x3b12e ; 0x3b12e <__fp_round> 3bce8: 0f 94 89 d8 call 0x3b112 ; 0x3b112 <__fp_pscA> 3bcec: 38 f0 brcs .+14 ; 0x3bcfc <__addsf3+0x20> 3bcee: 0f 94 90 d8 call 0x3b120 ; 0x3b120 <__fp_pscB> 3bcf2: 20 f0 brcs .+8 ; 0x3bcfc <__addsf3+0x20> 3bcf4: 39 f4 brne .+14 ; 0x3bd04 <__addsf3+0x28> 3bcf6: 9f 3f cpi r25, 0xFF ; 255 3bcf8: 19 f4 brne .+6 ; 0x3bd00 <__addsf3+0x24> 3bcfa: 26 f4 brtc .+8 ; 0x3bd04 <__addsf3+0x28> 3bcfc: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 3bd00: 0e f4 brtc .+2 ; 0x3bd04 <__addsf3+0x28> 3bd02: e0 95 com r30 3bd04: e7 fb bst r30, 7 3bd06: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 0003bd0a <__addsf3x>: 3bd0a: e9 2f mov r30, r25 3bd0c: 0f 94 a8 d8 call 0x3b150 ; 0x3b150 <__fp_split3> 3bd10: 58 f3 brcs .-42 ; 0x3bce8 <__addsf3+0xc> 3bd12: ba 17 cp r27, r26 3bd14: 62 07 cpc r22, r18 3bd16: 73 07 cpc r23, r19 3bd18: 84 07 cpc r24, r20 3bd1a: 95 07 cpc r25, r21 3bd1c: 20 f0 brcs .+8 ; 0x3bd26 <__addsf3x+0x1c> 3bd1e: 79 f4 brne .+30 ; 0x3bd3e <__addsf3x+0x34> 3bd20: a6 f5 brtc .+104 ; 0x3bd8a <__addsf3x+0x80> 3bd22: 0d 94 ca d8 jmp 0x3b194 ; 0x3b194 <__fp_zero> 3bd26: 0e f4 brtc .+2 ; 0x3bd2a <__addsf3x+0x20> 3bd28: e0 95 com r30 3bd2a: 0b 2e mov r0, r27 3bd2c: ba 2f mov r27, r26 3bd2e: a0 2d mov r26, r0 3bd30: 0b 01 movw r0, r22 3bd32: b9 01 movw r22, r18 3bd34: 90 01 movw r18, r0 3bd36: 0c 01 movw r0, r24 3bd38: ca 01 movw r24, r20 3bd3a: a0 01 movw r20, r0 3bd3c: 11 24 eor r1, r1 3bd3e: ff 27 eor r31, r31 3bd40: 59 1b sub r21, r25 3bd42: 99 f0 breq .+38 ; 0x3bd6a <__addsf3x+0x60> 3bd44: 59 3f cpi r21, 0xF9 ; 249 3bd46: 50 f4 brcc .+20 ; 0x3bd5c <__addsf3x+0x52> 3bd48: 50 3e cpi r21, 0xE0 ; 224 3bd4a: 68 f1 brcs .+90 ; 0x3bda6 <__addsf3x+0x9c> 3bd4c: 1a 16 cp r1, r26 3bd4e: f0 40 sbci r31, 0x00 ; 0 3bd50: a2 2f mov r26, r18 3bd52: 23 2f mov r18, r19 3bd54: 34 2f mov r19, r20 3bd56: 44 27 eor r20, r20 3bd58: 58 5f subi r21, 0xF8 ; 248 3bd5a: f3 cf rjmp .-26 ; 0x3bd42 <__addsf3x+0x38> 3bd5c: 46 95 lsr r20 3bd5e: 37 95 ror r19 3bd60: 27 95 ror r18 3bd62: a7 95 ror r26 3bd64: f0 40 sbci r31, 0x00 ; 0 3bd66: 53 95 inc r21 3bd68: c9 f7 brne .-14 ; 0x3bd5c <__addsf3x+0x52> 3bd6a: 7e f4 brtc .+30 ; 0x3bd8a <__addsf3x+0x80> 3bd6c: 1f 16 cp r1, r31 3bd6e: ba 0b sbc r27, r26 3bd70: 62 0b sbc r22, r18 3bd72: 73 0b sbc r23, r19 3bd74: 84 0b sbc r24, r20 3bd76: ba f0 brmi .+46 ; 0x3bda6 <__addsf3x+0x9c> 3bd78: 91 50 subi r25, 0x01 ; 1 3bd7a: a1 f0 breq .+40 ; 0x3bda4 <__addsf3x+0x9a> 3bd7c: ff 0f add r31, r31 3bd7e: bb 1f adc r27, r27 3bd80: 66 1f adc r22, r22 3bd82: 77 1f adc r23, r23 3bd84: 88 1f adc r24, r24 3bd86: c2 f7 brpl .-16 ; 0x3bd78 <__addsf3x+0x6e> 3bd88: 0e c0 rjmp .+28 ; 0x3bda6 <__addsf3x+0x9c> 3bd8a: ba 0f add r27, r26 3bd8c: 62 1f adc r22, r18 3bd8e: 73 1f adc r23, r19 3bd90: 84 1f adc r24, r20 3bd92: 48 f4 brcc .+18 ; 0x3bda6 <__addsf3x+0x9c> 3bd94: 87 95 ror r24 3bd96: 77 95 ror r23 3bd98: 67 95 ror r22 3bd9a: b7 95 ror r27 3bd9c: f7 95 ror r31 3bd9e: 9e 3f cpi r25, 0xFE ; 254 3bda0: 08 f0 brcs .+2 ; 0x3bda4 <__addsf3x+0x9a> 3bda2: b0 cf rjmp .-160 ; 0x3bd04 <__addsf3+0x28> 3bda4: 93 95 inc r25 3bda6: 88 0f add r24, r24 3bda8: 08 f0 brcs .+2 ; 0x3bdac <__addsf3x+0xa2> 3bdaa: 99 27 eor r25, r25 3bdac: ee 0f add r30, r30 3bdae: 97 95 ror r25 3bdb0: 87 95 ror r24 3bdb2: 08 95 ret 3bdb4: 0f 94 89 d8 call 0x3b112 ; 0x3b112 <__fp_pscA> 3bdb8: 60 f0 brcs .+24 ; 0x3bdd2 <__addsf3x+0xc8> 3bdba: 80 e8 ldi r24, 0x80 ; 128 3bdbc: 91 e0 ldi r25, 0x01 ; 1 3bdbe: 09 f4 brne .+2 ; 0x3bdc2 <__addsf3x+0xb8> 3bdc0: 9e ef ldi r25, 0xFE ; 254 3bdc2: 0f 94 90 d8 call 0x3b120 ; 0x3b120 <__fp_pscB> 3bdc6: 28 f0 brcs .+10 ; 0x3bdd2 <__addsf3x+0xc8> 3bdc8: 40 e8 ldi r20, 0x80 ; 128 3bdca: 51 e0 ldi r21, 0x01 ; 1 3bdcc: 71 f4 brne .+28 ; 0x3bdea 3bdce: 5e ef ldi r21, 0xFE ; 254 3bdd0: 0c c0 rjmp .+24 ; 0x3bdea 3bdd2: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 3bdd6: 0d 94 ca d8 jmp 0x3b194 ; 0x3b194 <__fp_zero> 0003bdda : 3bdda: e9 2f mov r30, r25 3bddc: e0 78 andi r30, 0x80 ; 128 3bdde: 0f 94 a8 d8 call 0x3b150 ; 0x3b150 <__fp_split3> 3bde2: 40 f3 brcs .-48 ; 0x3bdb4 <__addsf3x+0xaa> 3bde4: 09 2e mov r0, r25 3bde6: 05 2a or r0, r21 3bde8: b1 f3 breq .-20 ; 0x3bdd6 <__addsf3x+0xcc> 3bdea: 26 17 cp r18, r22 3bdec: 37 07 cpc r19, r23 3bdee: 48 07 cpc r20, r24 3bdf0: 59 07 cpc r21, r25 3bdf2: 38 f0 brcs .+14 ; 0x3be02 3bdf4: 0e 2e mov r0, r30 3bdf6: 07 f8 bld r0, 7 3bdf8: e0 25 eor r30, r0 3bdfa: 69 f0 breq .+26 ; 0x3be16 3bdfc: e0 25 eor r30, r0 3bdfe: e0 64 ori r30, 0x40 ; 64 3be00: 0a c0 rjmp .+20 ; 0x3be16 3be02: ef 63 ori r30, 0x3F ; 63 3be04: 07 f8 bld r0, 7 3be06: 00 94 com r0 3be08: 07 fa bst r0, 7 3be0a: db 01 movw r26, r22 3be0c: b9 01 movw r22, r18 3be0e: 9d 01 movw r18, r26 3be10: dc 01 movw r26, r24 3be12: ca 01 movw r24, r20 3be14: ad 01 movw r20, r26 3be16: ef 93 push r30 3be18: 0f 94 84 df call 0x3bf08 ; 0x3bf08 <__divsf3_pse> 3be1c: 0f 94 97 d8 call 0x3b12e ; 0x3b12e <__fp_round> 3be20: 0f 94 1d df call 0x3be3a ; 0x3be3a 3be24: 5f 91 pop r21 3be26: 55 23 and r21, r21 3be28: 39 f0 breq .+14 ; 0x3be38 3be2a: 2b ed ldi r18, 0xDB ; 219 3be2c: 3f e0 ldi r19, 0x0F ; 15 3be2e: 49 e4 ldi r20, 0x49 ; 73 3be30: 50 fd sbrc r21, 0 3be32: 49 ec ldi r20, 0xC9 ; 201 3be34: 0d 94 6e de jmp 0x3bcdc ; 0x3bcdc <__addsf3> 3be38: 08 95 ret 0003be3a : 3be3a: df 93 push r29 3be3c: dd 27 eor r29, r29 3be3e: b9 2f mov r27, r25 3be40: bf 77 andi r27, 0x7F ; 127 3be42: 40 e8 ldi r20, 0x80 ; 128 3be44: 5f e3 ldi r21, 0x3F ; 63 3be46: 16 16 cp r1, r22 3be48: 17 06 cpc r1, r23 3be4a: 48 07 cpc r20, r24 3be4c: 5b 07 cpc r21, r27 3be4e: 18 f4 brcc .+6 ; 0x3be56 3be50: d9 2f mov r29, r25 3be52: 0f 94 69 e1 call 0x3c2d2 ; 0x3c2d2 3be56: 9f 93 push r25 3be58: 8f 93 push r24 3be5a: 7f 93 push r23 3be5c: 6f 93 push r22 3be5e: 0f 94 0f d8 call 0x3b01e ; 0x3b01e 3be62: e2 e2 ldi r30, 0x22 ; 34 3be64: f2 e7 ldi r31, 0x72 ; 114 3be66: 0f 94 79 e0 call 0x3c0f2 ; 0x3c0f2 <__fp_powser> 3be6a: 0f 94 97 d8 call 0x3b12e ; 0x3b12e <__fp_round> 3be6e: 2f 91 pop r18 3be70: 3f 91 pop r19 3be72: 4f 91 pop r20 3be74: 5f 91 pop r21 3be76: 0f 94 26 d8 call 0x3b04c ; 0x3b04c <__mulsf3x> 3be7a: dd 23 and r29, r29 3be7c: 51 f0 breq .+20 ; 0x3be92 3be7e: 90 58 subi r25, 0x80 ; 128 3be80: a2 ea ldi r26, 0xA2 ; 162 3be82: 2a ed ldi r18, 0xDA ; 218 3be84: 3f e0 ldi r19, 0x0F ; 15 3be86: 49 ec ldi r20, 0xC9 ; 201 3be88: 5f e3 ldi r21, 0x3F ; 63 3be8a: d0 78 andi r29, 0x80 ; 128 3be8c: 5d 27 eor r21, r29 3be8e: 0f 94 85 de call 0x3bd0a ; 0x3bd0a <__addsf3x> 3be92: df 91 pop r29 3be94: 0d 94 97 d8 jmp 0x3b12e ; 0x3b12e <__fp_round> 0003be98 : 3be98: 0f 94 df e0 call 0x3c1be ; 0x3c1be <__fp_trunc> 3be9c: 90 f0 brcs .+36 ; 0x3bec2 3be9e: 9f 37 cpi r25, 0x7F ; 127 3bea0: 48 f4 brcc .+18 ; 0x3beb4 3bea2: 91 11 cpse r25, r1 3bea4: 16 f4 brtc .+4 ; 0x3beaa 3bea6: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 3beaa: 60 e0 ldi r22, 0x00 ; 0 3beac: 70 e0 ldi r23, 0x00 ; 0 3beae: 80 e8 ldi r24, 0x80 ; 128 3beb0: 9f e3 ldi r25, 0x3F ; 63 3beb2: 08 95 ret 3beb4: 26 f0 brts .+8 ; 0x3bebe 3beb6: 1b 16 cp r1, r27 3beb8: 61 1d adc r22, r1 3beba: 71 1d adc r23, r1 3bebc: 81 1d adc r24, r1 3bebe: 0d 94 50 e0 jmp 0x3c0a0 ; 0x3c0a0 <__fp_mintl> 3bec2: 0d 94 6b e0 jmp 0x3c0d6 ; 0x3c0d6 <__fp_mpack> 0003bec6 <__cmpsf2>: 3bec6: 0f 94 2c e0 call 0x3c058 ; 0x3c058 <__fp_cmp> 3beca: 08 f4 brcc .+2 ; 0x3bece <__cmpsf2+0x8> 3becc: 81 e0 ldi r24, 0x01 ; 1 3bece: 08 95 ret 0003bed0 : 3bed0: 0f 94 a2 e0 call 0x3c144 ; 0x3c144 <__fp_rempio2> 3bed4: e3 95 inc r30 3bed6: 0d 94 cb e0 jmp 0x3c196 ; 0x3c196 <__fp_sinus> 0003beda <__divsf3>: 3beda: 0f 94 81 df call 0x3bf02 ; 0x3bf02 <__divsf3x> 3bede: 0d 94 97 d8 jmp 0x3b12e ; 0x3b12e <__fp_round> 3bee2: 0f 94 90 d8 call 0x3b120 ; 0x3b120 <__fp_pscB> 3bee6: 58 f0 brcs .+22 ; 0x3befe <__divsf3+0x24> 3bee8: 0f 94 89 d8 call 0x3b112 ; 0x3b112 <__fp_pscA> 3beec: 40 f0 brcs .+16 ; 0x3befe <__divsf3+0x24> 3beee: 29 f4 brne .+10 ; 0x3befa <__divsf3+0x20> 3bef0: 5f 3f cpi r21, 0xFF ; 255 3bef2: 29 f0 breq .+10 ; 0x3befe <__divsf3+0x24> 3bef4: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 3bef8: 51 11 cpse r21, r1 3befa: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 3befe: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 0003bf02 <__divsf3x>: 3bf02: 0f 94 a8 d8 call 0x3b150 ; 0x3b150 <__fp_split3> 3bf06: 68 f3 brcs .-38 ; 0x3bee2 <__divsf3+0x8> 0003bf08 <__divsf3_pse>: 3bf08: 99 23 and r25, r25 3bf0a: b1 f3 breq .-20 ; 0x3bef8 <__divsf3+0x1e> 3bf0c: 55 23 and r21, r21 3bf0e: 91 f3 breq .-28 ; 0x3bef4 <__divsf3+0x1a> 3bf10: 95 1b sub r25, r21 3bf12: 55 0b sbc r21, r21 3bf14: bb 27 eor r27, r27 3bf16: aa 27 eor r26, r26 3bf18: 62 17 cp r22, r18 3bf1a: 73 07 cpc r23, r19 3bf1c: 84 07 cpc r24, r20 3bf1e: 38 f0 brcs .+14 ; 0x3bf2e <__divsf3_pse+0x26> 3bf20: 9f 5f subi r25, 0xFF ; 255 3bf22: 5f 4f sbci r21, 0xFF ; 255 3bf24: 22 0f add r18, r18 3bf26: 33 1f adc r19, r19 3bf28: 44 1f adc r20, r20 3bf2a: aa 1f adc r26, r26 3bf2c: a9 f3 breq .-22 ; 0x3bf18 <__divsf3_pse+0x10> 3bf2e: 35 d0 rcall .+106 ; 0x3bf9a <__divsf3_pse+0x92> 3bf30: 0e 2e mov r0, r30 3bf32: 3a f0 brmi .+14 ; 0x3bf42 <__divsf3_pse+0x3a> 3bf34: e0 e8 ldi r30, 0x80 ; 128 3bf36: 32 d0 rcall .+100 ; 0x3bf9c <__divsf3_pse+0x94> 3bf38: 91 50 subi r25, 0x01 ; 1 3bf3a: 50 40 sbci r21, 0x00 ; 0 3bf3c: e6 95 lsr r30 3bf3e: 00 1c adc r0, r0 3bf40: ca f7 brpl .-14 ; 0x3bf34 <__divsf3_pse+0x2c> 3bf42: 2b d0 rcall .+86 ; 0x3bf9a <__divsf3_pse+0x92> 3bf44: fe 2f mov r31, r30 3bf46: 29 d0 rcall .+82 ; 0x3bf9a <__divsf3_pse+0x92> 3bf48: 66 0f add r22, r22 3bf4a: 77 1f adc r23, r23 3bf4c: 88 1f adc r24, r24 3bf4e: bb 1f adc r27, r27 3bf50: 26 17 cp r18, r22 3bf52: 37 07 cpc r19, r23 3bf54: 48 07 cpc r20, r24 3bf56: ab 07 cpc r26, r27 3bf58: b0 e8 ldi r27, 0x80 ; 128 3bf5a: 09 f0 breq .+2 ; 0x3bf5e <__divsf3_pse+0x56> 3bf5c: bb 0b sbc r27, r27 3bf5e: 80 2d mov r24, r0 3bf60: bf 01 movw r22, r30 3bf62: ff 27 eor r31, r31 3bf64: 93 58 subi r25, 0x83 ; 131 3bf66: 5f 4f sbci r21, 0xFF ; 255 3bf68: 3a f0 brmi .+14 ; 0x3bf78 <__divsf3_pse+0x70> 3bf6a: 9e 3f cpi r25, 0xFE ; 254 3bf6c: 51 05 cpc r21, r1 3bf6e: 78 f0 brcs .+30 ; 0x3bf8e <__divsf3_pse+0x86> 3bf70: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 3bf74: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 3bf78: 5f 3f cpi r21, 0xFF ; 255 3bf7a: e4 f3 brlt .-8 ; 0x3bf74 <__divsf3_pse+0x6c> 3bf7c: 98 3e cpi r25, 0xE8 ; 232 3bf7e: d4 f3 brlt .-12 ; 0x3bf74 <__divsf3_pse+0x6c> 3bf80: 86 95 lsr r24 3bf82: 77 95 ror r23 3bf84: 67 95 ror r22 3bf86: b7 95 ror r27 3bf88: f7 95 ror r31 3bf8a: 9f 5f subi r25, 0xFF ; 255 3bf8c: c9 f7 brne .-14 ; 0x3bf80 <__divsf3_pse+0x78> 3bf8e: 88 0f add r24, r24 3bf90: 91 1d adc r25, r1 3bf92: 96 95 lsr r25 3bf94: 87 95 ror r24 3bf96: 97 f9 bld r25, 7 3bf98: 08 95 ret 3bf9a: e1 e0 ldi r30, 0x01 ; 1 3bf9c: 66 0f add r22, r22 3bf9e: 77 1f adc r23, r23 3bfa0: 88 1f adc r24, r24 3bfa2: bb 1f adc r27, r27 3bfa4: 62 17 cp r22, r18 3bfa6: 73 07 cpc r23, r19 3bfa8: 84 07 cpc r24, r20 3bfaa: ba 07 cpc r27, r26 3bfac: 20 f0 brcs .+8 ; 0x3bfb6 <__divsf3_pse+0xae> 3bfae: 62 1b sub r22, r18 3bfb0: 73 0b sbc r23, r19 3bfb2: 84 0b sbc r24, r20 3bfb4: ba 0b sbc r27, r26 3bfb6: ee 1f adc r30, r30 3bfb8: 88 f7 brcc .-30 ; 0x3bf9c <__divsf3_pse+0x94> 3bfba: e0 95 com r30 3bfbc: 08 95 ret 0003bfbe <__fixsfsi>: 3bfbe: 0f 94 e6 df call 0x3bfcc ; 0x3bfcc <__fixunssfsi> 3bfc2: 68 94 set 3bfc4: b1 11 cpse r27, r1 3bfc6: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 3bfca: 08 95 ret 0003bfcc <__fixunssfsi>: 3bfcc: 0f 94 b0 d8 call 0x3b160 ; 0x3b160 <__fp_splitA> 3bfd0: 88 f0 brcs .+34 ; 0x3bff4 <__fixunssfsi+0x28> 3bfd2: 9f 57 subi r25, 0x7F ; 127 3bfd4: 98 f0 brcs .+38 ; 0x3bffc <__fixunssfsi+0x30> 3bfd6: b9 2f mov r27, r25 3bfd8: 99 27 eor r25, r25 3bfda: b7 51 subi r27, 0x17 ; 23 3bfdc: b0 f0 brcs .+44 ; 0x3c00a <__fixunssfsi+0x3e> 3bfde: e1 f0 breq .+56 ; 0x3c018 <__fixunssfsi+0x4c> 3bfe0: 66 0f add r22, r22 3bfe2: 77 1f adc r23, r23 3bfe4: 88 1f adc r24, r24 3bfe6: 99 1f adc r25, r25 3bfe8: 1a f0 brmi .+6 ; 0x3bff0 <__fixunssfsi+0x24> 3bfea: ba 95 dec r27 3bfec: c9 f7 brne .-14 ; 0x3bfe0 <__fixunssfsi+0x14> 3bfee: 14 c0 rjmp .+40 ; 0x3c018 <__fixunssfsi+0x4c> 3bff0: b1 30 cpi r27, 0x01 ; 1 3bff2: 91 f0 breq .+36 ; 0x3c018 <__fixunssfsi+0x4c> 3bff4: 0f 94 ca d8 call 0x3b194 ; 0x3b194 <__fp_zero> 3bff8: b1 e0 ldi r27, 0x01 ; 1 3bffa: 08 95 ret 3bffc: 0d 94 ca d8 jmp 0x3b194 ; 0x3b194 <__fp_zero> 3c000: 67 2f mov r22, r23 3c002: 78 2f mov r23, r24 3c004: 88 27 eor r24, r24 3c006: b8 5f subi r27, 0xF8 ; 248 3c008: 39 f0 breq .+14 ; 0x3c018 <__fixunssfsi+0x4c> 3c00a: b9 3f cpi r27, 0xF9 ; 249 3c00c: cc f3 brlt .-14 ; 0x3c000 <__fixunssfsi+0x34> 3c00e: 86 95 lsr r24 3c010: 77 95 ror r23 3c012: 67 95 ror r22 3c014: b3 95 inc r27 3c016: d9 f7 brne .-10 ; 0x3c00e <__fixunssfsi+0x42> 3c018: 3e f4 brtc .+14 ; 0x3c028 <__fixunssfsi+0x5c> 3c01a: 90 95 com r25 3c01c: 80 95 com r24 3c01e: 70 95 com r23 3c020: 61 95 neg r22 3c022: 7f 4f sbci r23, 0xFF ; 255 3c024: 8f 4f sbci r24, 0xFF ; 255 3c026: 9f 4f sbci r25, 0xFF ; 255 3c028: 08 95 ret 0003c02a : 3c02a: 0f 94 df e0 call 0x3c1be ; 0x3c1be <__fp_trunc> 3c02e: 90 f0 brcs .+36 ; 0x3c054 3c030: 9f 37 cpi r25, 0x7F ; 127 3c032: 48 f4 brcc .+18 ; 0x3c046 3c034: 91 11 cpse r25, r1 3c036: 16 f0 brts .+4 ; 0x3c03c 3c038: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 3c03c: 60 e0 ldi r22, 0x00 ; 0 3c03e: 70 e0 ldi r23, 0x00 ; 0 3c040: 80 e8 ldi r24, 0x80 ; 128 3c042: 9f eb ldi r25, 0xBF ; 191 3c044: 08 95 ret 3c046: 26 f4 brtc .+8 ; 0x3c050 3c048: 1b 16 cp r1, r27 3c04a: 61 1d adc r22, r1 3c04c: 71 1d adc r23, r1 3c04e: 81 1d adc r24, r1 3c050: 0d 94 50 e0 jmp 0x3c0a0 ; 0x3c0a0 <__fp_mintl> 3c054: 0d 94 6b e0 jmp 0x3c0d6 ; 0x3c0d6 <__fp_mpack> 0003c058 <__fp_cmp>: 3c058: 99 0f add r25, r25 3c05a: 00 08 sbc r0, r0 3c05c: 55 0f add r21, r21 3c05e: aa 0b sbc r26, r26 3c060: e0 e8 ldi r30, 0x80 ; 128 3c062: fe ef ldi r31, 0xFE ; 254 3c064: 16 16 cp r1, r22 3c066: 17 06 cpc r1, r23 3c068: e8 07 cpc r30, r24 3c06a: f9 07 cpc r31, r25 3c06c: c0 f0 brcs .+48 ; 0x3c09e <__fp_cmp+0x46> 3c06e: 12 16 cp r1, r18 3c070: 13 06 cpc r1, r19 3c072: e4 07 cpc r30, r20 3c074: f5 07 cpc r31, r21 3c076: 98 f0 brcs .+38 ; 0x3c09e <__fp_cmp+0x46> 3c078: 62 1b sub r22, r18 3c07a: 73 0b sbc r23, r19 3c07c: 84 0b sbc r24, r20 3c07e: 95 0b sbc r25, r21 3c080: 39 f4 brne .+14 ; 0x3c090 <__fp_cmp+0x38> 3c082: 0a 26 eor r0, r26 3c084: 61 f0 breq .+24 ; 0x3c09e <__fp_cmp+0x46> 3c086: 23 2b or r18, r19 3c088: 24 2b or r18, r20 3c08a: 25 2b or r18, r21 3c08c: 21 f4 brne .+8 ; 0x3c096 <__fp_cmp+0x3e> 3c08e: 08 95 ret 3c090: 0a 26 eor r0, r26 3c092: 09 f4 brne .+2 ; 0x3c096 <__fp_cmp+0x3e> 3c094: a1 40 sbci r26, 0x01 ; 1 3c096: a6 95 lsr r26 3c098: 8f ef ldi r24, 0xFF ; 255 3c09a: 81 1d adc r24, r1 3c09c: 81 1d adc r24, r1 3c09e: 08 95 ret 0003c0a0 <__fp_mintl>: 3c0a0: 88 23 and r24, r24 3c0a2: 71 f4 brne .+28 ; 0x3c0c0 <__fp_mintl+0x20> 3c0a4: 77 23 and r23, r23 3c0a6: 21 f0 breq .+8 ; 0x3c0b0 <__fp_mintl+0x10> 3c0a8: 98 50 subi r25, 0x08 ; 8 3c0aa: 87 2b or r24, r23 3c0ac: 76 2f mov r23, r22 3c0ae: 07 c0 rjmp .+14 ; 0x3c0be <__fp_mintl+0x1e> 3c0b0: 66 23 and r22, r22 3c0b2: 11 f4 brne .+4 ; 0x3c0b8 <__fp_mintl+0x18> 3c0b4: 99 27 eor r25, r25 3c0b6: 0d c0 rjmp .+26 ; 0x3c0d2 <__fp_mintl+0x32> 3c0b8: 90 51 subi r25, 0x10 ; 16 3c0ba: 86 2b or r24, r22 3c0bc: 70 e0 ldi r23, 0x00 ; 0 3c0be: 60 e0 ldi r22, 0x00 ; 0 3c0c0: 2a f0 brmi .+10 ; 0x3c0cc <__fp_mintl+0x2c> 3c0c2: 9a 95 dec r25 3c0c4: 66 0f add r22, r22 3c0c6: 77 1f adc r23, r23 3c0c8: 88 1f adc r24, r24 3c0ca: da f7 brpl .-10 ; 0x3c0c2 <__fp_mintl+0x22> 3c0cc: 88 0f add r24, r24 3c0ce: 96 95 lsr r25 3c0d0: 87 95 ror r24 3c0d2: 97 f9 bld r25, 7 3c0d4: 08 95 ret 0003c0d6 <__fp_mpack>: 3c0d6: 9f 3f cpi r25, 0xFF ; 255 3c0d8: 31 f0 breq .+12 ; 0x3c0e6 <__fp_mpack_finite+0xc> 0003c0da <__fp_mpack_finite>: 3c0da: 91 50 subi r25, 0x01 ; 1 3c0dc: 20 f4 brcc .+8 ; 0x3c0e6 <__fp_mpack_finite+0xc> 3c0de: 87 95 ror r24 3c0e0: 77 95 ror r23 3c0e2: 67 95 ror r22 3c0e4: b7 95 ror r27 3c0e6: 88 0f add r24, r24 3c0e8: 91 1d adc r25, r1 3c0ea: 96 95 lsr r25 3c0ec: 87 95 ror r24 3c0ee: 97 f9 bld r25, 7 3c0f0: 08 95 ret 0003c0f2 <__fp_powser>: 3c0f2: df 93 push r29 3c0f4: cf 93 push r28 3c0f6: 1f 93 push r17 3c0f8: 0f 93 push r16 3c0fa: ff 92 push r15 3c0fc: ef 92 push r14 3c0fe: df 92 push r13 3c100: 7b 01 movw r14, r22 3c102: 8c 01 movw r16, r24 3c104: 68 94 set 3c106: 06 c0 rjmp .+12 ; 0x3c114 <__fp_powser+0x22> 3c108: da 2e mov r13, r26 3c10a: ef 01 movw r28, r30 3c10c: 0f 94 26 d8 call 0x3b04c ; 0x3b04c <__mulsf3x> 3c110: fe 01 movw r30, r28 3c112: e8 94 clt 3c114: a5 91 lpm r26, Z+ 3c116: 25 91 lpm r18, Z+ 3c118: 35 91 lpm r19, Z+ 3c11a: 45 91 lpm r20, Z+ 3c11c: 55 91 lpm r21, Z+ 3c11e: a6 f3 brts .-24 ; 0x3c108 <__fp_powser+0x16> 3c120: ef 01 movw r28, r30 3c122: 0f 94 85 de call 0x3bd0a ; 0x3bd0a <__addsf3x> 3c126: fe 01 movw r30, r28 3c128: 97 01 movw r18, r14 3c12a: a8 01 movw r20, r16 3c12c: da 94 dec r13 3c12e: 69 f7 brne .-38 ; 0x3c10a <__fp_powser+0x18> 3c130: df 90 pop r13 3c132: ef 90 pop r14 3c134: ff 90 pop r15 3c136: 0f 91 pop r16 3c138: 1f 91 pop r17 3c13a: cf 91 pop r28 3c13c: df 91 pop r29 3c13e: 08 95 ret 3c140: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 0003c144 <__fp_rempio2>: 3c144: 0f 94 b0 d8 call 0x3b160 ; 0x3b160 <__fp_splitA> 3c148: d8 f3 brcs .-10 ; 0x3c140 <__fp_powser+0x4e> 3c14a: e8 94 clt 3c14c: e0 e0 ldi r30, 0x00 ; 0 3c14e: bb 27 eor r27, r27 3c150: 9f 57 subi r25, 0x7F ; 127 3c152: f0 f0 brcs .+60 ; 0x3c190 <__fp_rempio2+0x4c> 3c154: 2a ed ldi r18, 0xDA ; 218 3c156: 3f e0 ldi r19, 0x0F ; 15 3c158: 49 ec ldi r20, 0xC9 ; 201 3c15a: 06 c0 rjmp .+12 ; 0x3c168 <__fp_rempio2+0x24> 3c15c: ee 0f add r30, r30 3c15e: bb 0f add r27, r27 3c160: 66 1f adc r22, r22 3c162: 77 1f adc r23, r23 3c164: 88 1f adc r24, r24 3c166: 28 f0 brcs .+10 ; 0x3c172 <__fp_rempio2+0x2e> 3c168: b2 3a cpi r27, 0xA2 ; 162 3c16a: 62 07 cpc r22, r18 3c16c: 73 07 cpc r23, r19 3c16e: 84 07 cpc r24, r20 3c170: 28 f0 brcs .+10 ; 0x3c17c <__fp_rempio2+0x38> 3c172: b2 5a subi r27, 0xA2 ; 162 3c174: 62 0b sbc r22, r18 3c176: 73 0b sbc r23, r19 3c178: 84 0b sbc r24, r20 3c17a: e3 95 inc r30 3c17c: 9a 95 dec r25 3c17e: 72 f7 brpl .-36 ; 0x3c15c <__fp_rempio2+0x18> 3c180: 80 38 cpi r24, 0x80 ; 128 3c182: 30 f4 brcc .+12 ; 0x3c190 <__fp_rempio2+0x4c> 3c184: 9a 95 dec r25 3c186: bb 0f add r27, r27 3c188: 66 1f adc r22, r22 3c18a: 77 1f adc r23, r23 3c18c: 88 1f adc r24, r24 3c18e: d2 f7 brpl .-12 ; 0x3c184 <__fp_rempio2+0x40> 3c190: 90 48 sbci r25, 0x80 ; 128 3c192: 0d 94 6d e0 jmp 0x3c0da ; 0x3c0da <__fp_mpack_finite> 0003c196 <__fp_sinus>: 3c196: ef 93 push r30 3c198: e0 ff sbrs r30, 0 3c19a: 07 c0 rjmp .+14 ; 0x3c1aa <__fp_sinus+0x14> 3c19c: a2 ea ldi r26, 0xA2 ; 162 3c19e: 2a ed ldi r18, 0xDA ; 218 3c1a0: 3f e0 ldi r19, 0x0F ; 15 3c1a2: 49 ec ldi r20, 0xC9 ; 201 3c1a4: 5f eb ldi r21, 0xBF ; 191 3c1a6: 0f 94 85 de call 0x3bd0a ; 0x3bd0a <__addsf3x> 3c1aa: 0f 94 97 d8 call 0x3b12e ; 0x3b12e <__fp_round> 3c1ae: 0f 90 pop r0 3c1b0: 03 94 inc r0 3c1b2: 01 fc sbrc r0, 1 3c1b4: 90 58 subi r25, 0x80 ; 128 3c1b6: ef e4 ldi r30, 0x4F ; 79 3c1b8: f2 e7 ldi r31, 0x72 ; 114 3c1ba: 0d 94 c2 e2 jmp 0x3c584 ; 0x3c584 <__fp_powsodd> 0003c1be <__fp_trunc>: 3c1be: 0f 94 b0 d8 call 0x3b160 ; 0x3b160 <__fp_splitA> 3c1c2: a0 f0 brcs .+40 ; 0x3c1ec <__fp_trunc+0x2e> 3c1c4: be e7 ldi r27, 0x7E ; 126 3c1c6: b9 17 cp r27, r25 3c1c8: 88 f4 brcc .+34 ; 0x3c1ec <__fp_trunc+0x2e> 3c1ca: bb 27 eor r27, r27 3c1cc: 9f 38 cpi r25, 0x8F ; 143 3c1ce: 60 f4 brcc .+24 ; 0x3c1e8 <__fp_trunc+0x2a> 3c1d0: 16 16 cp r1, r22 3c1d2: b1 1d adc r27, r1 3c1d4: 67 2f mov r22, r23 3c1d6: 78 2f mov r23, r24 3c1d8: 88 27 eor r24, r24 3c1da: 98 5f subi r25, 0xF8 ; 248 3c1dc: f7 cf rjmp .-18 ; 0x3c1cc <__fp_trunc+0xe> 3c1de: 86 95 lsr r24 3c1e0: 77 95 ror r23 3c1e2: 67 95 ror r22 3c1e4: b1 1d adc r27, r1 3c1e6: 93 95 inc r25 3c1e8: 96 39 cpi r25, 0x96 ; 150 3c1ea: c8 f3 brcs .-14 ; 0x3c1de <__fp_trunc+0x20> 3c1ec: 08 95 ret 0003c1ee <__gesf2>: 3c1ee: 0f 94 2c e0 call 0x3c058 ; 0x3c058 <__fp_cmp> 3c1f2: 08 f4 brcc .+2 ; 0x3c1f6 <__gesf2+0x8> 3c1f4: 8f ef ldi r24, 0xFF ; 255 3c1f6: 08 95 ret 3c1f8: 0f 94 89 d8 call 0x3b112 ; 0x3b112 <__fp_pscA> 3c1fc: 29 f0 breq .+10 ; 0x3c208 <__gesf2+0x1a> 3c1fe: 0f 94 90 d8 call 0x3b120 ; 0x3b120 <__fp_pscB> 3c202: 11 f0 breq .+4 ; 0x3c208 <__gesf2+0x1a> 3c204: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 3c208: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 3c20c: b9 01 movw r22, r18 3c20e: ca 01 movw r24, r20 3c210: 0d 94 6b e0 jmp 0x3c0d6 ; 0x3c0d6 <__fp_mpack> 0003c214 : 3c214: 9f 77 andi r25, 0x7F ; 127 3c216: 5f 77 andi r21, 0x7F ; 127 3c218: 0f 94 a8 d8 call 0x3b150 ; 0x3b150 <__fp_split3> 3c21c: 68 f3 brcs .-38 ; 0x3c1f8 <__gesf2+0xa> 3c21e: 99 23 and r25, r25 3c220: a9 f3 breq .-22 ; 0x3c20c <__gesf2+0x1e> 3c222: 55 23 and r21, r21 3c224: a9 f3 breq .-22 ; 0x3c210 <__gesf2+0x22> 3c226: ff 27 eor r31, r31 3c228: 95 17 cp r25, r21 3c22a: 58 f4 brcc .+22 ; 0x3c242 3c22c: e5 2f mov r30, r21 3c22e: e9 1b sub r30, r25 3c230: ed 30 cpi r30, 0x0D ; 13 3c232: 60 f7 brcc .-40 ; 0x3c20c <__gesf2+0x1e> 3c234: 5e 3b cpi r21, 0xBE ; 190 3c236: 10 f0 brcs .+4 ; 0x3c23c 3c238: f1 e4 ldi r31, 0x41 ; 65 3c23a: 1c c0 rjmp .+56 ; 0x3c274 3c23c: 90 34 cpi r25, 0x40 ; 64 3c23e: e0 f4 brcc .+56 ; 0x3c278 3c240: 0a c0 rjmp .+20 ; 0x3c256 3c242: e9 2f mov r30, r25 3c244: e5 1b sub r30, r21 3c246: ed 30 cpi r30, 0x0D ; 13 3c248: 18 f7 brcc .-58 ; 0x3c210 <__gesf2+0x22> 3c24a: 9e 3b cpi r25, 0xBE ; 190 3c24c: 10 f0 brcs .+4 ; 0x3c252 3c24e: f1 e4 ldi r31, 0x41 ; 65 3c250: 11 c0 rjmp .+34 ; 0x3c274 3c252: 50 34 cpi r21, 0x40 ; 64 3c254: 88 f4 brcc .+34 ; 0x3c278 3c256: f9 ea ldi r31, 0xA9 ; 169 3c258: 88 23 and r24, r24 3c25a: 2a f0 brmi .+10 ; 0x3c266 3c25c: 9a 95 dec r25 3c25e: 66 0f add r22, r22 3c260: 77 1f adc r23, r23 3c262: 88 1f adc r24, r24 3c264: da f7 brpl .-10 ; 0x3c25c 3c266: 44 23 and r20, r20 3c268: 2a f0 brmi .+10 ; 0x3c274 3c26a: 5a 95 dec r21 3c26c: 22 0f add r18, r18 3c26e: 33 1f adc r19, r19 3c270: 44 1f adc r20, r20 3c272: da f7 brpl .-10 ; 0x3c26a 3c274: 9f 1b sub r25, r31 3c276: 5f 1b sub r21, r31 3c278: ff 93 push r31 3c27a: 1f 93 push r17 3c27c: 0f 93 push r16 3c27e: ff 92 push r15 3c280: ef 92 push r14 3c282: 79 01 movw r14, r18 3c284: 8a 01 movw r16, r20 3c286: bb 27 eor r27, r27 3c288: ab 2f mov r26, r27 3c28a: 9b 01 movw r18, r22 3c28c: ac 01 movw r20, r24 3c28e: 0f 94 29 d8 call 0x3b052 ; 0x3b052 <__mulsf3_pse> 3c292: 97 01 movw r18, r14 3c294: a8 01 movw r20, r16 3c296: bf 93 push r27 3c298: 7b 01 movw r14, r22 3c29a: 8c 01 movw r16, r24 3c29c: aa 27 eor r26, r26 3c29e: ba 2f mov r27, r26 3c2a0: b9 01 movw r22, r18 3c2a2: ca 01 movw r24, r20 3c2a4: 0f 94 29 d8 call 0x3b052 ; 0x3b052 <__mulsf3_pse> 3c2a8: af 91 pop r26 3c2aa: 97 01 movw r18, r14 3c2ac: a8 01 movw r20, r16 3c2ae: ef 90 pop r14 3c2b0: ff 90 pop r15 3c2b2: 0f 91 pop r16 3c2b4: 1f 91 pop r17 3c2b6: 0f 94 85 de call 0x3bd0a ; 0x3bd0a <__addsf3x> 3c2ba: 0f 94 97 d8 call 0x3b12e ; 0x3b12e <__fp_round> 3c2be: 0f 94 3c e2 call 0x3c478 ; 0x3c478 3c2c2: 4f 91 pop r20 3c2c4: 40 ff sbrs r20, 0 3c2c6: 08 95 ret 3c2c8: 55 27 eor r21, r21 3c2ca: 47 fd sbrc r20, 7 3c2cc: 50 95 com r21 3c2ce: 0d 94 75 e1 jmp 0x3c2ea ; 0x3c2ea 0003c2d2 : 3c2d2: 9b 01 movw r18, r22 3c2d4: ac 01 movw r20, r24 3c2d6: 60 e0 ldi r22, 0x00 ; 0 3c2d8: 70 e0 ldi r23, 0x00 ; 0 3c2da: 80 e8 ldi r24, 0x80 ; 128 3c2dc: 9f e3 ldi r25, 0x3F ; 63 3c2de: 0d 94 6d df jmp 0x3beda ; 0x3beda <__divsf3> 3c2e2: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 3c2e6: 0d 94 6b e0 jmp 0x3c0d6 ; 0x3c0d6 <__fp_mpack> 0003c2ea : 3c2ea: 0f 94 b0 d8 call 0x3b160 ; 0x3b160 <__fp_splitA> 3c2ee: d8 f3 brcs .-10 ; 0x3c2e6 3c2f0: 99 23 and r25, r25 3c2f2: c9 f3 breq .-14 ; 0x3c2e6 3c2f4: 94 0f add r25, r20 3c2f6: 51 1d adc r21, r1 3c2f8: a3 f3 brvs .-24 ; 0x3c2e2 3c2fa: 91 50 subi r25, 0x01 ; 1 3c2fc: 50 40 sbci r21, 0x00 ; 0 3c2fe: 94 f0 brlt .+36 ; 0x3c324 3c300: 59 f0 breq .+22 ; 0x3c318 3c302: 88 23 and r24, r24 3c304: 32 f0 brmi .+12 ; 0x3c312 3c306: 66 0f add r22, r22 3c308: 77 1f adc r23, r23 3c30a: 88 1f adc r24, r24 3c30c: 91 50 subi r25, 0x01 ; 1 3c30e: 50 40 sbci r21, 0x00 ; 0 3c310: c1 f7 brne .-16 ; 0x3c302 3c312: 9e 3f cpi r25, 0xFE ; 254 3c314: 51 05 cpc r21, r1 3c316: 2c f7 brge .-54 ; 0x3c2e2 3c318: 88 0f add r24, r24 3c31a: 91 1d adc r25, r1 3c31c: 96 95 lsr r25 3c31e: 87 95 ror r24 3c320: 97 f9 bld r25, 7 3c322: 08 95 ret 3c324: 5f 3f cpi r21, 0xFF ; 255 3c326: ac f0 brlt .+42 ; 0x3c352 3c328: 98 3e cpi r25, 0xE8 ; 232 3c32a: 9c f0 brlt .+38 ; 0x3c352 3c32c: bb 27 eor r27, r27 3c32e: 86 95 lsr r24 3c330: 77 95 ror r23 3c332: 67 95 ror r22 3c334: b7 95 ror r27 3c336: 08 f4 brcc .+2 ; 0x3c33a 3c338: b1 60 ori r27, 0x01 ; 1 3c33a: 93 95 inc r25 3c33c: c1 f7 brne .-16 ; 0x3c32e 3c33e: bb 0f add r27, r27 3c340: 58 f7 brcc .-42 ; 0x3c318 3c342: 11 f4 brne .+4 ; 0x3c348 3c344: 60 ff sbrs r22, 0 3c346: e8 cf rjmp .-48 ; 0x3c318 3c348: 6f 5f subi r22, 0xFF ; 255 3c34a: 7f 4f sbci r23, 0xFF ; 255 3c34c: 8f 4f sbci r24, 0xFF ; 255 3c34e: 9f 4f sbci r25, 0xFF ; 255 3c350: e3 cf rjmp .-58 ; 0x3c318 3c352: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 0003c356 : 3c356: 0f 94 b0 d8 call 0x3b160 ; 0x3b160 <__fp_splitA> 3c35a: 58 f1 brcs .+86 ; 0x3c3b2 3c35c: 9e 57 subi r25, 0x7E ; 126 3c35e: 60 f1 brcs .+88 ; 0x3c3b8 3c360: 98 51 subi r25, 0x18 ; 24 3c362: a0 f0 brcs .+40 ; 0x3c38c 3c364: e9 f0 breq .+58 ; 0x3c3a0 3c366: 98 30 cpi r25, 0x08 ; 8 3c368: 20 f5 brcc .+72 ; 0x3c3b2 3c36a: 09 2e mov r0, r25 3c36c: 99 27 eor r25, r25 3c36e: 66 0f add r22, r22 3c370: 77 1f adc r23, r23 3c372: 88 1f adc r24, r24 3c374: 99 1f adc r25, r25 3c376: 0a 94 dec r0 3c378: d1 f7 brne .-12 ; 0x3c36e 3c37a: 12 c0 rjmp .+36 ; 0x3c3a0 3c37c: 06 2e mov r0, r22 3c37e: 67 2f mov r22, r23 3c380: 78 2f mov r23, r24 3c382: 88 27 eor r24, r24 3c384: 98 5f subi r25, 0xF8 ; 248 3c386: 11 f4 brne .+4 ; 0x3c38c 3c388: 00 0c add r0, r0 3c38a: 07 c0 rjmp .+14 ; 0x3c39a 3c38c: 99 3f cpi r25, 0xF9 ; 249 3c38e: b4 f3 brlt .-20 ; 0x3c37c 3c390: 86 95 lsr r24 3c392: 77 95 ror r23 3c394: 67 95 ror r22 3c396: 93 95 inc r25 3c398: d9 f7 brne .-10 ; 0x3c390 3c39a: 61 1d adc r22, r1 3c39c: 71 1d adc r23, r1 3c39e: 81 1d adc r24, r1 3c3a0: 3e f4 brtc .+14 ; 0x3c3b0 3c3a2: 90 95 com r25 3c3a4: 80 95 com r24 3c3a6: 70 95 com r23 3c3a8: 61 95 neg r22 3c3aa: 7f 4f sbci r23, 0xFF ; 255 3c3ac: 8f 4f sbci r24, 0xFF ; 255 3c3ae: 9f 4f sbci r25, 0xFF ; 255 3c3b0: 08 95 ret 3c3b2: 68 94 set 3c3b4: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_szero> 3c3b8: 0d 94 ca d8 jmp 0x3b194 ; 0x3b194 <__fp_zero> 0003c3bc : 3c3bc: fa 01 movw r30, r20 3c3be: ee 0f add r30, r30 3c3c0: ff 1f adc r31, r31 3c3c2: 30 96 adiw r30, 0x00 ; 0 3c3c4: 21 05 cpc r18, r1 3c3c6: 31 05 cpc r19, r1 3c3c8: a1 f1 breq .+104 ; 0x3c432 3c3ca: 61 15 cp r22, r1 3c3cc: 71 05 cpc r23, r1 3c3ce: 61 f4 brne .+24 ; 0x3c3e8 3c3d0: 80 38 cpi r24, 0x80 ; 128 3c3d2: bf e3 ldi r27, 0x3F ; 63 3c3d4: 9b 07 cpc r25, r27 3c3d6: 49 f1 breq .+82 ; 0x3c42a 3c3d8: 68 94 set 3c3da: 90 38 cpi r25, 0x80 ; 128 3c3dc: 81 05 cpc r24, r1 3c3de: 61 f0 breq .+24 ; 0x3c3f8 3c3e0: 80 38 cpi r24, 0x80 ; 128 3c3e2: bf ef ldi r27, 0xFF ; 255 3c3e4: 9b 07 cpc r25, r27 3c3e6: 41 f0 breq .+16 ; 0x3c3f8 3c3e8: 99 23 and r25, r25 3c3ea: 4a f5 brpl .+82 ; 0x3c43e 3c3ec: ff 3f cpi r31, 0xFF ; 255 3c3ee: e1 05 cpc r30, r1 3c3f0: 31 05 cpc r19, r1 3c3f2: 21 05 cpc r18, r1 3c3f4: 19 f1 breq .+70 ; 0x3c43c 3c3f6: e8 94 clt 3c3f8: 08 94 sec 3c3fa: e7 95 ror r30 3c3fc: d9 01 movw r26, r18 3c3fe: aa 23 and r26, r26 3c400: 29 f4 brne .+10 ; 0x3c40c 3c402: ab 2f mov r26, r27 3c404: be 2f mov r27, r30 3c406: f8 5f subi r31, 0xF8 ; 248 3c408: d0 f3 brcs .-12 ; 0x3c3fe 3c40a: 10 c0 rjmp .+32 ; 0x3c42c 3c40c: ff 5f subi r31, 0xFF ; 255 3c40e: 70 f4 brcc .+28 ; 0x3c42c 3c410: a6 95 lsr r26 3c412: e0 f7 brcc .-8 ; 0x3c40c 3c414: f7 39 cpi r31, 0x97 ; 151 3c416: 50 f0 brcs .+20 ; 0x3c42c 3c418: 19 f0 breq .+6 ; 0x3c420 3c41a: ff 3a cpi r31, 0xAF ; 175 3c41c: 38 f4 brcc .+14 ; 0x3c42c 3c41e: 9f 77 andi r25, 0x7F ; 127 3c420: 9f 93 push r25 3c422: 0d d0 rcall .+26 ; 0x3c43e 3c424: 0f 90 pop r0 3c426: 07 fc sbrc r0, 7 3c428: 90 58 subi r25, 0x80 ; 128 3c42a: 08 95 ret 3c42c: 46 f0 brts .+16 ; 0x3c43e 3c42e: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 3c432: 60 e0 ldi r22, 0x00 ; 0 3c434: 70 e0 ldi r23, 0x00 ; 0 3c436: 80 e8 ldi r24, 0x80 ; 128 3c438: 9f e3 ldi r25, 0x3F ; 63 3c43a: 08 95 ret 3c43c: 4f e7 ldi r20, 0x7F ; 127 3c43e: 9f 77 andi r25, 0x7F ; 127 3c440: 5f 93 push r21 3c442: 4f 93 push r20 3c444: 3f 93 push r19 3c446: 2f 93 push r18 3c448: 0f 94 de e2 call 0x3c5bc ; 0x3c5bc 3c44c: 2f 91 pop r18 3c44e: 3f 91 pop r19 3c450: 4f 91 pop r20 3c452: 5f 91 pop r21 3c454: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3c458: 0d 94 89 e2 jmp 0x3c512 ; 0x3c512 0003c45c : 3c45c: 9f 93 push r25 3c45e: 0f 94 a2 e0 call 0x3c144 ; 0x3c144 <__fp_rempio2> 3c462: 0f 90 pop r0 3c464: 07 fc sbrc r0, 7 3c466: ee 5f subi r30, 0xFE ; 254 3c468: 0d 94 cb e0 jmp 0x3c196 ; 0x3c196 <__fp_sinus> 3c46c: 19 f4 brne .+6 ; 0x3c474 3c46e: 16 f4 brtc .+4 ; 0x3c474 3c470: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 3c474: 0d 94 6b e0 jmp 0x3c0d6 ; 0x3c0d6 <__fp_mpack> 0003c478 : 3c478: 0f 94 b0 d8 call 0x3b160 ; 0x3b160 <__fp_splitA> 3c47c: b8 f3 brcs .-18 ; 0x3c46c 3c47e: 99 23 and r25, r25 3c480: c9 f3 breq .-14 ; 0x3c474 3c482: b6 f3 brts .-20 ; 0x3c470 3c484: 9f 57 subi r25, 0x7F ; 127 3c486: 55 0b sbc r21, r21 3c488: 87 ff sbrs r24, 7 3c48a: 0f 94 bb e2 call 0x3c576 ; 0x3c576 <__fp_norm2> 3c48e: 00 24 eor r0, r0 3c490: a0 e6 ldi r26, 0x60 ; 96 3c492: 40 ea ldi r20, 0xA0 ; 160 3c494: 90 01 movw r18, r0 3c496: 80 58 subi r24, 0x80 ; 128 3c498: 56 95 lsr r21 3c49a: 97 95 ror r25 3c49c: 28 f4 brcc .+10 ; 0x3c4a8 3c49e: 80 5c subi r24, 0xC0 ; 192 3c4a0: 66 0f add r22, r22 3c4a2: 77 1f adc r23, r23 3c4a4: 88 1f adc r24, r24 3c4a6: 20 f0 brcs .+8 ; 0x3c4b0 3c4a8: 26 17 cp r18, r22 3c4aa: 37 07 cpc r19, r23 3c4ac: 48 07 cpc r20, r24 3c4ae: 30 f4 brcc .+12 ; 0x3c4bc 3c4b0: 62 1b sub r22, r18 3c4b2: 73 0b sbc r23, r19 3c4b4: 84 0b sbc r24, r20 3c4b6: 20 29 or r18, r0 3c4b8: 31 29 or r19, r1 3c4ba: 4a 2b or r20, r26 3c4bc: a6 95 lsr r26 3c4be: 17 94 ror r1 3c4c0: 07 94 ror r0 3c4c2: 20 25 eor r18, r0 3c4c4: 31 25 eor r19, r1 3c4c6: 4a 27 eor r20, r26 3c4c8: 58 f7 brcc .-42 ; 0x3c4a0 3c4ca: 66 0f add r22, r22 3c4cc: 77 1f adc r23, r23 3c4ce: 88 1f adc r24, r24 3c4d0: 20 f0 brcs .+8 ; 0x3c4da 3c4d2: 26 17 cp r18, r22 3c4d4: 37 07 cpc r19, r23 3c4d6: 48 07 cpc r20, r24 3c4d8: 30 f4 brcc .+12 ; 0x3c4e6 3c4da: 62 0b sbc r22, r18 3c4dc: 73 0b sbc r23, r19 3c4de: 84 0b sbc r24, r20 3c4e0: 20 0d add r18, r0 3c4e2: 31 1d adc r19, r1 3c4e4: 41 1d adc r20, r1 3c4e6: a0 95 com r26 3c4e8: 81 f7 brne .-32 ; 0x3c4ca 3c4ea: b9 01 movw r22, r18 3c4ec: 84 2f mov r24, r20 3c4ee: 91 58 subi r25, 0x81 ; 129 3c4f0: 88 0f add r24, r24 3c4f2: 96 95 lsr r25 3c4f4: 87 95 ror r24 3c4f6: 08 95 ret 0003c4f8 <__unordsf2>: 3c4f8: 0f 94 2c e0 call 0x3c058 ; 0x3c058 <__fp_cmp> 3c4fc: 88 0b sbc r24, r24 3c4fe: 99 0b sbc r25, r25 3c500: 08 95 ret 3c502: 29 f4 brne .+10 ; 0x3c50e <__unordsf2+0x16> 3c504: 16 f0 brts .+4 ; 0x3c50a <__unordsf2+0x12> 3c506: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 3c50a: 0d 94 ca d8 jmp 0x3b194 ; 0x3b194 <__fp_zero> 3c50e: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 0003c512 : 3c512: 0f 94 b0 d8 call 0x3b160 ; 0x3b160 <__fp_splitA> 3c516: a8 f3 brcs .-22 ; 0x3c502 <__unordsf2+0xa> 3c518: 96 38 cpi r25, 0x86 ; 134 3c51a: a0 f7 brcc .-24 ; 0x3c504 <__unordsf2+0xc> 3c51c: 07 f8 bld r0, 7 3c51e: 0f 92 push r0 3c520: e8 94 clt 3c522: 2b e3 ldi r18, 0x3B ; 59 3c524: 3a ea ldi r19, 0xAA ; 170 3c526: 48 eb ldi r20, 0xB8 ; 184 3c528: 5f e7 ldi r21, 0x7F ; 127 3c52a: 0f 94 29 d8 call 0x3b052 ; 0x3b052 <__mulsf3_pse> 3c52e: 0f 92 push r0 3c530: 0f 92 push r0 3c532: 0f 92 push r0 3c534: 4d b7 in r20, 0x3d ; 61 3c536: 5e b7 in r21, 0x3e ; 62 3c538: 0f 92 push r0 3c53a: 0f 94 26 e3 call 0x3c64c ; 0x3c64c 3c53e: ed e6 ldi r30, 0x6D ; 109 3c540: f2 e7 ldi r31, 0x72 ; 114 3c542: 0f 94 79 e0 call 0x3c0f2 ; 0x3c0f2 <__fp_powser> 3c546: 4f 91 pop r20 3c548: 5f 91 pop r21 3c54a: ef 91 pop r30 3c54c: ff 91 pop r31 3c54e: e5 95 asr r30 3c550: ee 1f adc r30, r30 3c552: ff 1f adc r31, r31 3c554: 49 f0 breq .+18 ; 0x3c568 3c556: fe 57 subi r31, 0x7E ; 126 3c558: e0 68 ori r30, 0x80 ; 128 3c55a: 44 27 eor r20, r20 3c55c: ee 0f add r30, r30 3c55e: 44 1f adc r20, r20 3c560: fa 95 dec r31 3c562: e1 f7 brne .-8 ; 0x3c55c 3c564: 41 95 neg r20 3c566: 55 0b sbc r21, r21 3c568: 0f 94 75 e1 call 0x3c2ea ; 0x3c2ea 3c56c: 0f 90 pop r0 3c56e: 07 fe sbrs r0, 7 3c570: 0d 94 69 e1 jmp 0x3c2d2 ; 0x3c2d2 3c574: 08 95 ret 0003c576 <__fp_norm2>: 3c576: 91 50 subi r25, 0x01 ; 1 3c578: 50 40 sbci r21, 0x00 ; 0 3c57a: 66 0f add r22, r22 3c57c: 77 1f adc r23, r23 3c57e: 88 1f adc r24, r24 3c580: d2 f7 brpl .-12 ; 0x3c576 <__fp_norm2> 3c582: 08 95 ret 0003c584 <__fp_powsodd>: 3c584: 9f 93 push r25 3c586: 8f 93 push r24 3c588: 7f 93 push r23 3c58a: 6f 93 push r22 3c58c: ff 93 push r31 3c58e: ef 93 push r30 3c590: 9b 01 movw r18, r22 3c592: ac 01 movw r20, r24 3c594: 0f 94 13 d8 call 0x3b026 ; 0x3b026 <__mulsf3> 3c598: ef 91 pop r30 3c59a: ff 91 pop r31 3c59c: 0f 94 79 e0 call 0x3c0f2 ; 0x3c0f2 <__fp_powser> 3c5a0: 2f 91 pop r18 3c5a2: 3f 91 pop r19 3c5a4: 4f 91 pop r20 3c5a6: 5f 91 pop r21 3c5a8: 0d 94 13 d8 jmp 0x3b026 ; 0x3b026 <__mulsf3> 3c5ac: 16 f0 brts .+4 ; 0x3c5b2 <__fp_powsodd+0x2e> 3c5ae: 0d 94 6b e0 jmp 0x3c0d6 ; 0x3c0d6 <__fp_mpack> 3c5b2: 0d 94 86 d8 jmp 0x3b10c ; 0x3b10c <__fp_nan> 3c5b6: 68 94 set 3c5b8: 0d 94 80 d8 jmp 0x3b100 ; 0x3b100 <__fp_inf> 0003c5bc : 3c5bc: 0f 94 b0 d8 call 0x3b160 ; 0x3b160 <__fp_splitA> 3c5c0: a8 f3 brcs .-22 ; 0x3c5ac <__fp_powsodd+0x28> 3c5c2: 99 23 and r25, r25 3c5c4: c1 f3 breq .-16 ; 0x3c5b6 <__fp_powsodd+0x32> 3c5c6: ae f3 brts .-22 ; 0x3c5b2 <__fp_powsodd+0x2e> 3c5c8: df 93 push r29 3c5ca: cf 93 push r28 3c5cc: 1f 93 push r17 3c5ce: 0f 93 push r16 3c5d0: ff 92 push r15 3c5d2: c9 2f mov r28, r25 3c5d4: dd 27 eor r29, r29 3c5d6: 88 23 and r24, r24 3c5d8: 2a f0 brmi .+10 ; 0x3c5e4 3c5da: 21 97 sbiw r28, 0x01 ; 1 3c5dc: 66 0f add r22, r22 3c5de: 77 1f adc r23, r23 3c5e0: 88 1f adc r24, r24 3c5e2: da f7 brpl .-10 ; 0x3c5da 3c5e4: 20 e0 ldi r18, 0x00 ; 0 3c5e6: 30 e0 ldi r19, 0x00 ; 0 3c5e8: 40 e8 ldi r20, 0x80 ; 128 3c5ea: 5f eb ldi r21, 0xBF ; 191 3c5ec: 9f e3 ldi r25, 0x3F ; 63 3c5ee: 88 39 cpi r24, 0x98 ; 152 3c5f0: 20 f0 brcs .+8 ; 0x3c5fa 3c5f2: 80 3e cpi r24, 0xE0 ; 224 3c5f4: 38 f0 brcs .+14 ; 0x3c604 3c5f6: 21 96 adiw r28, 0x01 ; 1 3c5f8: 8f 77 andi r24, 0x7F ; 127 3c5fa: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3c5fe: e5 e9 ldi r30, 0x95 ; 149 3c600: f2 e7 ldi r31, 0x72 ; 114 3c602: 04 c0 rjmp .+8 ; 0x3c60c 3c604: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__addsf3> 3c608: e2 ec ldi r30, 0xC2 ; 194 3c60a: f2 e7 ldi r31, 0x72 ; 114 3c60c: 0f 94 79 e0 call 0x3c0f2 ; 0x3c0f2 <__fp_powser> 3c610: 8b 01 movw r16, r22 3c612: be 01 movw r22, r28 3c614: ec 01 movw r28, r24 3c616: fb 2e mov r15, r27 3c618: 6f 57 subi r22, 0x7F ; 127 3c61a: 71 09 sbc r23, r1 3c61c: 75 95 asr r23 3c61e: 77 1f adc r23, r23 3c620: 88 0b sbc r24, r24 3c622: 99 0b sbc r25, r25 3c624: 0f 94 d4 d7 call 0x3afa8 ; 0x3afa8 <__floatsisf> 3c628: 28 e1 ldi r18, 0x18 ; 24 3c62a: 32 e7 ldi r19, 0x72 ; 114 3c62c: 41 e3 ldi r20, 0x31 ; 49 3c62e: 5f e3 ldi r21, 0x3F ; 63 3c630: 0f 94 26 d8 call 0x3b04c ; 0x3b04c <__mulsf3x> 3c634: af 2d mov r26, r15 3c636: 98 01 movw r18, r16 3c638: ae 01 movw r20, r28 3c63a: ff 90 pop r15 3c63c: 0f 91 pop r16 3c63e: 1f 91 pop r17 3c640: cf 91 pop r28 3c642: df 91 pop r29 3c644: 0f 94 85 de call 0x3bd0a ; 0x3bd0a <__addsf3x> 3c648: 0d 94 97 d8 jmp 0x3b12e ; 0x3b12e <__fp_round> 0003c64c : 3c64c: fa 01 movw r30, r20 3c64e: dc 01 movw r26, r24 3c650: aa 0f add r26, r26 3c652: bb 1f adc r27, r27 3c654: 9b 01 movw r18, r22 3c656: ac 01 movw r20, r24 3c658: bf 57 subi r27, 0x7F ; 127 3c65a: 28 f4 brcc .+10 ; 0x3c666 3c65c: 22 27 eor r18, r18 3c65e: 33 27 eor r19, r19 3c660: 44 27 eor r20, r20 3c662: 50 78 andi r21, 0x80 ; 128 3c664: 20 c0 rjmp .+64 ; 0x3c6a6 3c666: b7 51 subi r27, 0x17 ; 23 3c668: 90 f4 brcc .+36 ; 0x3c68e 3c66a: ab 2f mov r26, r27 3c66c: 00 24 eor r0, r0 3c66e: 46 95 lsr r20 3c670: 37 95 ror r19 3c672: 27 95 ror r18 3c674: 01 1c adc r0, r1 3c676: a3 95 inc r26 3c678: d2 f3 brmi .-12 ; 0x3c66e 3c67a: 00 20 and r0, r0 3c67c: 71 f0 breq .+28 ; 0x3c69a 3c67e: 22 0f add r18, r18 3c680: 33 1f adc r19, r19 3c682: 44 1f adc r20, r20 3c684: b3 95 inc r27 3c686: da f3 brmi .-10 ; 0x3c67e 3c688: 0e d0 rcall .+28 ; 0x3c6a6 3c68a: 0d 94 6d de jmp 0x3bcda ; 0x3bcda <__subsf3> 3c68e: 61 30 cpi r22, 0x01 ; 1 3c690: 71 05 cpc r23, r1 3c692: a0 e8 ldi r26, 0x80 ; 128 3c694: 8a 07 cpc r24, r26 3c696: b9 46 sbci r27, 0x69 ; 105 3c698: 30 f4 brcc .+12 ; 0x3c6a6 3c69a: 9b 01 movw r18, r22 3c69c: ac 01 movw r20, r24 3c69e: 66 27 eor r22, r22 3c6a0: 77 27 eor r23, r23 3c6a2: 88 27 eor r24, r24 3c6a4: 90 78 andi r25, 0x80 ; 128 3c6a6: 30 96 adiw r30, 0x00 ; 0 3c6a8: 21 f0 breq .+8 ; 0x3c6b2 3c6aa: 20 83 st Z, r18 3c6ac: 31 83 std Z+1, r19 ; 0x01 3c6ae: 42 83 std Z+2, r20 ; 0x02 3c6b0: 53 83 std Z+3, r21 ; 0x03 3c6b2: 08 95 ret 0003c6b4 : 3c6b4: 91 11 cpse r25, r1 3c6b6: 08 95 ret 3c6b8: 81 54 subi r24, 0x41 ; 65 3c6ba: 8a 51 subi r24, 0x1A ; 26 3c6bc: 08 f4 brcc .+2 ; 0x3c6c0 3c6be: 80 5e subi r24, 0xE0 ; 224 3c6c0: 85 5a subi r24, 0xA5 ; 165 3c6c2: 08 95 ret 0003c6c4 : 3c6c4: fb 01 movw r30, r22 3c6c6: dc 01 movw r26, r24 3c6c8: 04 c0 rjmp .+8 ; 0x3c6d2 3c6ca: 8d 91 ld r24, X+ 3c6cc: 01 90 ld r0, Z+ 3c6ce: 80 19 sub r24, r0 3c6d0: 21 f4 brne .+8 ; 0x3c6da 3c6d2: 41 50 subi r20, 0x01 ; 1 3c6d4: 50 40 sbci r21, 0x00 ; 0 3c6d6: c8 f7 brcc .-14 ; 0x3c6ca 3c6d8: 88 1b sub r24, r24 3c6da: 99 0b sbc r25, r25 3c6dc: 08 95 ret 0003c6de : 3c6de: fb 01 movw r30, r22 3c6e0: dc 01 movw r26, r24 3c6e2: 02 c0 rjmp .+4 ; 0x3c6e8 3c6e4: 01 90 ld r0, Z+ 3c6e6: 0d 92 st X+, r0 3c6e8: 41 50 subi r20, 0x01 ; 1 3c6ea: 50 40 sbci r21, 0x00 ; 0 3c6ec: d8 f7 brcc .-10 ; 0x3c6e4 3c6ee: 08 95 ret 0003c6f0 : 3c6f0: dc 01 movw r26, r24 3c6f2: 01 c0 rjmp .+2 ; 0x3c6f6 3c6f4: 6d 93 st X+, r22 3c6f6: 41 50 subi r20, 0x01 ; 1 3c6f8: 50 40 sbci r21, 0x00 ; 0 3c6fa: e0 f7 brcc .-8 ; 0x3c6f4 3c6fc: 08 95 ret 0003c6fe : 3c6fe: fb 01 movw r30, r22 3c700: dc 01 movw r26, r24 3c702: 8d 91 ld r24, X+ 3c704: 81 34 cpi r24, 0x41 ; 65 3c706: 1c f0 brlt .+6 ; 0x3c70e 3c708: 8b 35 cpi r24, 0x5B ; 91 3c70a: 0c f4 brge .+2 ; 0x3c70e 3c70c: 80 5e subi r24, 0xE0 ; 224 3c70e: 61 91 ld r22, Z+ 3c710: 61 34 cpi r22, 0x41 ; 65 3c712: 1c f0 brlt .+6 ; 0x3c71a 3c714: 6b 35 cpi r22, 0x5B ; 91 3c716: 0c f4 brge .+2 ; 0x3c71a 3c718: 60 5e subi r22, 0xE0 ; 224 3c71a: 86 1b sub r24, r22 3c71c: 61 11 cpse r22, r1 3c71e: 89 f3 breq .-30 ; 0x3c702 3c720: 99 0b sbc r25, r25 3c722: 08 95 ret 0003c724 : 3c724: fb 01 movw r30, r22 3c726: dc 01 movw r26, r24 3c728: 0d 90 ld r0, X+ 3c72a: 00 20 and r0, r0 3c72c: e9 f7 brne .-6 ; 0x3c728 3c72e: 11 97 sbiw r26, 0x01 ; 1 3c730: 01 90 ld r0, Z+ 3c732: 0d 92 st X+, r0 3c734: 00 20 and r0, r0 3c736: e1 f7 brne .-8 ; 0x3c730 3c738: 08 95 ret 0003c73a : 3c73a: fc 01 movw r30, r24 3c73c: 81 91 ld r24, Z+ 3c73e: 86 17 cp r24, r22 3c740: 21 f0 breq .+8 ; 0x3c74a 3c742: 88 23 and r24, r24 3c744: d9 f7 brne .-10 ; 0x3c73c 3c746: 99 27 eor r25, r25 3c748: 08 95 ret 3c74a: 31 97 sbiw r30, 0x01 ; 1 3c74c: cf 01 movw r24, r30 3c74e: 08 95 ret 0003c750 : 3c750: fb 01 movw r30, r22 3c752: dc 01 movw r26, r24 3c754: 8d 91 ld r24, X+ 3c756: 01 90 ld r0, Z+ 3c758: 80 19 sub r24, r0 3c75a: 01 10 cpse r0, r1 3c75c: d9 f3 breq .-10 ; 0x3c754 3c75e: 99 0b sbc r25, r25 3c760: 08 95 ret 0003c762 : 3c762: fb 01 movw r30, r22 3c764: dc 01 movw r26, r24 3c766: 01 90 ld r0, Z+ 3c768: 0d 92 st X+, r0 3c76a: 00 20 and r0, r0 3c76c: e1 f7 brne .-8 ; 0x3c766 3c76e: 08 95 ret 0003c770 : 3c770: fb 01 movw r30, r22 3c772: dc 01 movw r26, r24 3c774: 41 50 subi r20, 0x01 ; 1 3c776: 50 40 sbci r21, 0x00 ; 0 3c778: 30 f0 brcs .+12 ; 0x3c786 3c77a: 8d 91 ld r24, X+ 3c77c: 01 90 ld r0, Z+ 3c77e: 80 19 sub r24, r0 3c780: 19 f4 brne .+6 ; 0x3c788 3c782: 00 20 and r0, r0 3c784: b9 f7 brne .-18 ; 0x3c774 3c786: 88 1b sub r24, r24 3c788: 99 0b sbc r25, r25 3c78a: 08 95 ret 0003c78c : 3c78c: fb 01 movw r30, r22 3c78e: dc 01 movw r26, r24 3c790: 41 50 subi r20, 0x01 ; 1 3c792: 50 40 sbci r21, 0x00 ; 0 3c794: 48 f0 brcs .+18 ; 0x3c7a8 3c796: 01 90 ld r0, Z+ 3c798: 0d 92 st X+, r0 3c79a: 00 20 and r0, r0 3c79c: c9 f7 brne .-14 ; 0x3c790 3c79e: 01 c0 rjmp .+2 ; 0x3c7a2 3c7a0: 1d 92 st X+, r1 3c7a2: 41 50 subi r20, 0x01 ; 1 3c7a4: 50 40 sbci r21, 0x00 ; 0 3c7a6: e0 f7 brcc .-8 ; 0x3c7a0 3c7a8: 08 95 ret 0003c7aa : 3c7aa: 0f 93 push r16 3c7ac: 1f 93 push r17 3c7ae: cf 93 push r28 3c7b0: df 93 push r29 3c7b2: e0 91 12 18 lds r30, 0x1812 ; 0x801812 <__iob+0x2> 3c7b6: f0 91 13 18 lds r31, 0x1813 ; 0x801813 <__iob+0x3> 3c7ba: 23 81 ldd r18, Z+3 ; 0x03 3c7bc: ec 01 movw r28, r24 3c7be: 10 e0 ldi r17, 0x00 ; 0 3c7c0: 00 e0 ldi r16, 0x00 ; 0 3c7c2: 21 fd sbrc r18, 1 3c7c4: 08 c0 rjmp .+16 ; 0x3c7d6 3c7c6: 0f ef ldi r16, 0xFF ; 255 3c7c8: 1f ef ldi r17, 0xFF ; 255 3c7ca: 14 c0 rjmp .+40 ; 0x3c7f4 3c7cc: 19 95 eicall 3c7ce: 89 2b or r24, r25 3c7d0: 11 f0 breq .+4 ; 0x3c7d6 3c7d2: 0f ef ldi r16, 0xFF ; 255 3c7d4: 1f ef ldi r17, 0xFF ; 255 3c7d6: 89 91 ld r24, Y+ 3c7d8: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 3c7dc: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 3c7e0: db 01 movw r26, r22 3c7e2: 18 96 adiw r26, 0x08 ; 8 3c7e4: ed 91 ld r30, X+ 3c7e6: fc 91 ld r31, X 3c7e8: 81 11 cpse r24, r1 3c7ea: f0 cf rjmp .-32 ; 0x3c7cc 3c7ec: 8a e0 ldi r24, 0x0A ; 10 3c7ee: 19 95 eicall 3c7f0: 89 2b or r24, r25 3c7f2: 49 f7 brne .-46 ; 0x3c7c6 3c7f4: c8 01 movw r24, r16 3c7f6: df 91 pop r29 3c7f8: cf 91 pop r28 3c7fa: 1f 91 pop r17 3c7fc: 0f 91 pop r16 3c7fe: 08 95 ret 0003c800 <__do_global_dtors>: 3c800: 17 e5 ldi r17, 0x57 ; 87 3c802: cc e6 ldi r28, 0x6C ; 108 3c804: d7 e5 ldi r29, 0x57 ; 87 3c806: 00 e0 ldi r16, 0x00 ; 0 3c808: 06 c0 rjmp .+12 ; 0x3c816 <__do_global_dtors+0x16> 3c80a: 80 2f mov r24, r16 3c80c: fe 01 movw r30, r28 3c80e: 0f 94 56 de call 0x3bcac ; 0x3bcac <__tablejump2__> 3c812: 21 96 adiw r28, 0x01 ; 1 3c814: 01 1d adc r16, r1 3c816: cd 36 cpi r28, 0x6D ; 109 3c818: d1 07 cpc r29, r17 3c81a: 80 e0 ldi r24, 0x00 ; 0 3c81c: 08 07 cpc r16, r24 3c81e: a9 f7 brne .-22 ; 0x3c80a <__do_global_dtors+0xa> 3c820: f8 94 cli 0003c822 <__stop_program>: 3c822: ff cf rjmp .-2 ; 0x3c822 <__stop_program>